Growing a Language (applicable to @attribute design)

Timon Gehr timon.gehr at gmx.ch
Wed Nov 14 03:18:34 PST 2012


On 11/14/2012 01:53 AM, Walter Bright wrote:
> On 11/13/2012 12:56 PM, Walter Bright wrote:
>> An insightful talk by Guy Steele on what makes a language successful.
>>
>> http://www.youtube.com/watch?v=_ahvzDzKdB0
>
> Guy says something interesting in there that's applicable to one of our
> current discussions.
>
> Particularly, should we allow:
>
>     @identifier
>
> as a user-defined attribute, in potential conflict with future reserved
> attribute words, or not?
>
> Guy makes the argument that users need to be able to extend the
> vocabulary of a language and have those new words look like built-in
> ones. We have that today, of course, with the ability of defining new
> types. There is no special syntax that says "this is a user-defined
> type, not a keyword."
>

Well,

template Foo(alias a){ }
struct S{}

alias S X;     // ok
alias int Y;   // ok
mixin Foo!S;   // ok
mixin Foo!int; // not ok

Please fix that. (Everything should be ok.)

> I think this is a compelling argument, and tips the scales in its favor.
> Probably we've been excessively worried about the problems of adding a
> new builtin attribute type.



More information about the Digitalmars-d mailing list