Generic code: @autoconst, @autopure, @autonothrow

Simen kjaeraas simen.kjaras at gmail.com
Sun Aug 29 11:24:55 PDT 2010


dsimcha <dsimcha at yahoo.com> wrote:

[Interesting stuff]

This problem is much bigger that @auto<foo>. When we get a new @ribute
that affects code in a similar way, are we to add @autofnord @autogrok
@autogazillions to the language as well? If anything, this system should
be made extensible. I suggest the syntax

     @auto[ <value> ]

where <value> is a comma-separated list of @ributes.

This also leads to another (somewhat unrelated, I admit) idea of mine.
Occasionally, you want attributes to be determined by template
parameters. For this, I suggest the following:

     @attribute( condition )[ <value> ]

Where <condition> follows the system of template constraints. <value> is
as above, a comma-separated list of @ributes. If <condition> evaluates
to true, the @ributes in <value> are applied to whatever follows.

-- 
Simen


More information about the Digitalmars-d mailing list