User Defined Attributes

Leandro Lucarella luca at llucax.com.ar
Wed Nov 7 03:05:23 PST 2012


Walter Bright, el  6 de November a las 20:19 me escribiste:
> On 11/6/2012 7:52 PM, bearophile wrote:
> >Walter Bright:
> >
> >>But I'm not sure at this point if that is the right thing to do.
> >
> >Why?
> 
> D was fortunate in having 10 years of experience with C++'s
> exception system to learn from. We don't have that with UDAs.

What? UDAs has been for quite a long time out in the wild, just not in C++.

> >[If you decide to restrict UDAs, then later it will be easy to extend them, it
> >will not break code. While doing the opposite break code. It's you the one that
> >has taught me to design things this way :-) ]
> 
> It's a good point, but I have no experience with UDAs.

OK, that's another thing. And maybe a reason for listening to people having
more experience with UDAs than you.

For me the analogy with Exceptions is pretty good. The issues an conveniences
of throwing anything or annotating a symbol with anything instead of just
type are pretty much the same. I only see functions making sense to be accepted
as annotations too (that's what Python do with annotations, @annotation symbol
is the same as symbol = annotation(symbol), but is quite a different language).

-- 


More information about the Digitalmars-d-announce mailing list