DIP23 draft: Fixing properties redux

kenji hara k.hara.pg at gmail.com
Mon Feb 4 07:57:03 PST 2013


I have thought in long term that, in D, "proerty" is just a syntactic
rerwiting rule of  function call. It is much reasonable abstraction to me.

So, using __trait is overkill.

Kenji Hara
2013/02/05 0:45 "Timon Gehr" <timon.gehr at gmx.ch>:

> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130205/33dc3ff2/attachment.html>


More information about the Digitalmars-d mailing list