openmethods 1.3.0

Jean-Louis Leroy jl at leroy.nyc
Mon Apr 20 13:25:14 UTC 2020


On Monday, 20 April 2020 at 08:17:24 UTC, Robert M. Münch wrote:

> I just read your blog post [1] and wonder if it's still 
> up-to-date or maybe an update would make sense?

The blog post is still current. I remember that, in 2017, some 
were annoyed by the need to call a setup function 
(updateMethods). As for support for attributes, it is nice to 
have, but it is hardly the focus of the module. I don't think the 
improvements deserve a new blog entry.

However, in the process of implementing support for attributes 
and storage classes, the internals became very ugly. Also I had a 
to address the same problems in a new library. Eventually I found 
a way of factoring the mixin generation code in a package that I 
am going to spin off, probably as part of bolts. But I need 
permission from my employer to do that. I hope to get it soon.

> This stuff sounds like a very fundamental concept/pattern and 
> IMO would be a good member of Phobos.

Andrei is not convinced ;-) Well at least not as part of the 
language, but probably not as part of Phobos either.

That is not a problem. If I was granted two wishes, they would 
be: 1/ reallocate 'ClassInfo.deallocator' to me ;-) and 2/ add a 
more general feature to the language, similar to Perl's 'import' 
function: if a module defines a 'string imported(alias Module)' 
or a 'mixin template imported(alias Module)', call it in the 
context of the importing module. That would allow me to get rid 
of the 'mixin(registerMethods)' after the 'import openmethods'.



More information about the Digitalmars-d-announce mailing list