Chances of D getting proper runtime reflection?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Aug 22 23:52:21 PDT 2011
On 8/22/11 11:30 PM, Jacob Carlborg wrote:
> On 2011-08-22 22:26, Andrei Alexandrescu wrote:
>>
>> Yes. Better yet:
>>
>> class Derived : Base
>> {
>> ...
>> }
>>
>> mixin(serializable!Derived());
>>
>> i.e. so you can add serialization to classes you can't edit.
>
> Yeah, of course. So "The line of code needs to be declarative,
> not imperative" was just a fancy way of saying that you want to move the
> class registration to global scope :)
>
>>> The only way I can think of how this could work is to store a global
>>> list of the serializable classes. Any other suggestion how this would
>>> work? Note that all this wouldn't be necessary if my original post was
>>> implemented.
>>
>> A global structure sounds the way to go.
>>
>>
>> Andrei
>
> Ok, then I just change "register" to a static method.
A static method of whom?
Andrei
More information about the Digitalmars-d
mailing list