custom attribute proposal (yeah, another one)

Manu turkeyman at gmail.com
Fri Apr 6 08:28:39 PDT 2012


On 6 April 2012 18:17, Adam D. Ruppe <destructionator at gmail.com> wrote:

> On Friday, 6 April 2012 at 15:07:04 UTC, Manu wrote:
>
>> But maybe the function approach has an
>> effect on the simplicity of the expression for a simple attribute, like a
>> single bool?
>>
>
> Meh, it is pretty similar:
>
> struct Serializable { bool yes; }
> bool Serializable(bool yes) { return yes; }
>

Indeed. And with that in mind...


On 6 April 2012 17:56, Piotr Szturmaj <bncrbme at jadamspam.pl> wrote:

> @Uuid("...")
> interface MyIntf { }
>
> without explicitly declaring Uuid as attribute. However, I don't see any
> usage for primitive types:
>
> @5
> @"s"
> @false
>
> I think that allowing values of structs, classes and _eventually_ enums
> should be enough.
>

I totally agree, although I don't know what enum's offer that can't be
equally wrapped in a struct/class? They can probably be skipped as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120406/d5a3564e/attachment.html>


More information about the Digitalmars-d mailing list