DIP23 draft: Fixing properties redux

Timon Gehr timon.gehr at gmx.ch
Sun Feb 3 04:59:23 PST 2013


On 02/03/2013 09:16 AM, Andrei Alexandrescu wrote:
> Walter and I have had a discussion on how to finalize properties.
>
> http://wiki.dlang.org/DIP23
> ...

Looks good. Two things:

What about eg:

@property T front(T)(T[] arr){ return arr[0]; }

And:

"Avoid embarrassing situations such as expressions with unexpressible 
types or no-op address-of operator (as is the case with C functions)."

The DIP does not fix the first issue.

pragma(msg, typeof(*(int x)=>x)); // pure nothrow @safe int(int x)



More information about the Digitalmars-d mailing list