User Defined Attributes

bearophile bearophileHUGS at lycos.com
Tue Nov 6 08:47:49 PST 2012


Walter Bright:

> It would be a significant extension, and so I'd like to see a 
> compelling use case first.

Right. Combined with the trait to read function arguments, it's 
useful to add semantics to function arguments. This is good.


> User defined attributes cannot invent new semantics for the 
> language.

Right, that's my point :-)


> And besides, 'ref' already does what you suggest.

Nope. I have discussed the topic here:
http://forum.dlang.org/thread/znbtczbgipqqzllafmzk@forum.dlang.org

"ref" is useful to denote Case2 of that post of mine. But the 
@copy annotation I was talking here is the very uncommon (but 
unfortunately often used by mistake, and common source of bugs) 
Case3.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list