On Friday, 9 December 2022 at 22:20:28 UTC, Walter Bright wrote:
>Currently, the ModuleInfo struct generated for each module also includes a pointer to the ClassInfo for every class in that module.
The only reference to this data is in the functions Object.localClasses() and Object.find(). The idea is to be able to instantiate a class via a text string rather than a link to the name.
This adds a lot of extra size.
-
Does anybody use Object.localClasses() or Object.find() ?
-
Does anybody need them?
-
Could it be changed to only include the classes marked
export
? -
Could we just remove it entirely?
This would affect Object.factory, yes? I've used that previously in commercial software.
Can partially work around it with std.traits.moduleName
and __traits(allMembers, somemodule)
, but what other options are there for finding classes outside of the current module other than those explicitly referenced in the calling module?