ModuleInfo, Object.localClasses(), and Object.find() - any users?

Steven Schveighoffer schveiguy at gmail.com
Sat Dec 10 03:03:53 UTC 2022


On 12/9/22 5:20 PM, 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.
> 
> 1. Does anybody use Object.localClasses() or Object.find() ?
> 
> 2. Does anybody need them?
> 
> 3. Could it be changed to only include the classes marked `export` ?
> 
> 4. Could we just remove it entirely?

Please remove. You have to deprecate the functionality first (biggest 
problem is Object.factory). But it is broken anyway.

I have pointed this out for years. ModuleInfo *does* include this 
information. But it's not guaranteed to generate ModuleInfo just if a 
class is present. See for instance: 
https://issues.dlang.org/show_bug.cgi?id=16423

-Steve


More information about the Digitalmars-d mailing list