Avoid saying temper in temper-built c++#454
Conversation
Signed-off-by: Tom <tom@temper.systems>
Signed-off-by: Tom <tom@temper.systems>
| * | ||
| * All module-level variable initializations and init blocks are deferred to an explicit | ||
| * `temper_init_<module>()` function, called from `main()`, to avoid the Static | ||
| * `global_init_<module>()` function, called from `main()`, to avoid the Static |
There was a problem hiding this comment.
We also still need subnamespaces for submodules of libraries. Currently, they all go in the same namespace. I checked by looking at the output of object-literals funtest, but the convention above already shows the expectation of a shared namespace.
Once we split namespaces, maybe this would be just global_init or module_init in each module's own namespace.
|
|
||
| // Compute the C++ namespace for the std library's Test type | ||
| val testNs = "temper::${safeCppNamespace(cppNames.library("std").text)}" | ||
| val testNs = safeCppNamespace(cppNames.library("std").text) |
There was a problem hiding this comment.
I also looked at the output here, and the namespace we make for std is temper_std. So this was saying temper::temper_std and now just says temper_std. Perhaps we could say just temper::std in the future, but this PR is just a first pass on these things.
| | void greet(std::string name) { | ||
| | temper::core::Console::log(console_0, "Hi:"); | ||
| | temper::core::Console::log(console_0, name); | ||
| |namespace my_test_library { |
There was a problem hiding this comment.
This is now a namespace I'd be happy with users of my temper-built library using.
| | x = 42; | ||
| |namespace my_test_library { | ||
| | int32_t x; | ||
| | void global_init_something() { |
There was a problem hiding this comment.
Because the backend test places this under a submodule called something. In the future, it would be nice to see my_test_library::something::global_init() or some such.
|
Agree with the goal. We shouldn't be "Sent from my iPhone"-ing translations of code that isn't related to the Temper project itself. The implementation looks fine to me but @ShawSumma would know better. |
temper::namespacing around user librariesglobal_init_...instead oftemper_init_...to init user libraries