ModuleInfo, Object.localClasses(), and Object.find() - any users?
Puneet Goel
puneet at coverify.com
Sun Feb 12 14:44:11 UTC 2023
On Tuesday, 17 January 2023 at 08:43:50 UTC, psyscout wrote:
> 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.
>
> I was planning to use "localClasses" to build a factory aware
> of classes to instantiate. The approach with mixin template
> doesn't look that handy, it is easy to forget it.
>
I have trodden the path of mixin templates. I believe the only
way to register classes for a factory mechanism is to involve
"static this" constructors.
For any non-trivial code it gets me to unresolvable circular
dependencies in the modules. I request the developers not to rush
with deprecating Object.factory until a mechanism is developed to
creak circular dependencies with modules. I see some discussion
on the following thread which may be related to what I am trying
to say.
https://forum.dlang.org/post/mailman.1221.1513724189.9493.digitalmars-d@puremagic.com
More information about the Digitalmars-d
mailing list