Custom attributes (again)

Timon Gehr timon.gehr at gmx.ch
Fri Apr 6 04:09:31 PDT 2012


On 04/06/2012 12:53 PM, Walter Bright wrote:
> On 4/6/2012 3:27 AM, Ary Manzana wrote:
>>> @safe, @nothrow, etc., require a lot of semantic support in the
>>> compiler. They cannot pretend to be user defined attributes.
>>
>> Yes they can. That's how it is done in C# and Java. In fact, IUnknown is
>> pretending to be an interface and has semantic support in the compiler.
>
> All the semantics of @safe are in the compiler. None of it can be user
> defined. There's just no point to trying to make it user defined. It's
> like trying to make int user defined.
>
> IUnknown's semantics are nearly all user-defined.
>

The proposal is not to make the semantics of @safe user defined. I think 
he proposes to make 'safe' a symbol that is looked up like an user 
defined symbol.

Some languages do the same for the built-in integer type.


More information about the Digitalmars-d mailing list