User Defined Attributes

Jacob Carlborg doob at me.com
Tue Nov 6 10:03:14 PST 2012


On 2012-11-06 17:22, Walter Bright wrote:

> Consider that you can use a tuple generated elsewhere for a UDA:
>
> [tp] void foo();
>
> where tp is a tuple. You can even grab the attributes from another
> symbol, turn them into a tuple, and apply the tuple as an attribute to a
> new symbol. Tuples can, of course, be sliced and concatenated.
>
> In other words, by using tuples, you can "encapsulate" what the
> attributes expand to in the same way you can change target code by
> changing the definition of user defined types.

Then allow something like this:

@(tp)

Or

@foo(tp)

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list