std.mixins

Philippe Sigaud philippe.sigaud at gmail.com
Tue Aug 31 15:14:32 PDT 2010


On Tue, Aug 31, 2010 at 23:49, dsimcha <dsimcha at yahoo.com> wrote:

>
>
> Isn't this a core language feature that's in the spec but is only currently
> implemented for arrays?  I thought eventually uniform function call syntax
> was
> coming for classes and structs, too.
>

Yes I heard that too. But it will be at least a year coming, so I decided to
roll my own :-)
I admit its utility is less that what I thought at first.
Now, I'm salivating over a recent proposal by Andrei to do lowering,
allowing a void delegate() as the ast arg of a function to be written
outside it. Which just shows I'm a fashion victim.

Ah, I have a mixin called Disable!(function names) that generates the
@disabled versions of a class supertype. Could that be useful?

I also have a template that gets the list of all members of an aggregate
type (classes, structs and, well, modules, in a way), even the constructors,
even the overloaded members, separated by type, and list them with their
names and associated type. It even gets the types aliases and unittests,
though I don't know what to do with the latter. That was part of a project
to duplicate a type: generate a new type with this extracted info. I had
vague projects to transform the methods into their const equivalent for
example or to render the fields immutable, but didn't get that far. Would
that be interesting to someone?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100901/86e648b1/attachment.html>


More information about the Digitalmars-d mailing list