DIP23 draft: Fixing properties redux

Timon Gehr timon.gehr at gmx.ch
Mon Feb 4 07:42:01 PST 2013


On 02/04/2013 04:08 PM, kenji hara wrote:
> 2013/2/4 Timon Gehr <timon.gehr at gmx.ch <mailto:timon.gehr at gmx.ch>>
>
>     On 02/04/2013 03:38 PM, kenji hara wrote:
>
>         I think this is necessary feature for the D's function and property
>         semantics.
>
>
>     Why?
>
>
> Because, "property" is one of D-specific feature.
>
> In D, "property" is directly translated to function call. So, we should
> get balance between two requirements:
> 1. property should be treated as its returned type.
> 2. property should be distinguished from raw field. (For example,
> serialization library should recognize it)
>

This is what __traits are for.

> Address expression is _only_one_ built-in feature to make a callable
> object from function symbol.

Property symbols are not to be treated like function symbols 
syntactically. That is the point. Otherwise we may as well get rid of 
properties.

> So this "special feature" is enough reasonable to me.
>
> ...

"special features" are usually not reasonable.


More information about the Digitalmars-d mailing list