Generality creep

Luís Marques luis at luismarques.eu
Fri Mar 29 14:56:03 UTC 2019


On Friday, 29 March 2019 at 13:05:31 UTC, Andrei Alexandrescu 
wrote:
> Yah, I actually had even code for an idea - after each module 
> is loaded, the following code is automatically injected at the 
> end of it:
>
> mixin(__onImportedModule(__MODULE__));
>
> This is evaluated in the context of the importer (not 
> imported), an essential detail. By default of course the 
> function returns the empty string.
>
> This allows user code to add things like serialization, 
> factories and other introspection-based utilities automatically 
> upon import.

Jean-Louis argued for that overall feature at last year's DConf, 
and I also agree. Such a feature would be useful for a lot of 
things, although it's one of those "with great power comes great 
responsibility" kind of features.


More information about the Digitalmars-d mailing list