DIP23 draft: Fixing properties redux

kenji hara k.hara.pg at gmail.com
Sun Feb 3 05:00:32 PST 2013


2013/2/3 Steven Schveighoffer <schveiguy at yahoo.com>

> On Sun, 03 Feb 2013 07:16:17 -0500, Steven Schveighoffer <
> schveiguy at yahoo.com> wrote:
>
>  On Sun, 03 Feb 2013 03:16:08 -0500, Andrei Alexandrescu <
>> SeeWebsiteForEmail at erdani.org**> wrote:
>>
>>  Walter and I have had a discussion on how to finalize properties.
>>>
>>> http://wiki.dlang.org/DIP23
>>>
>>
>> I agree with everything in this.  This looks exactly like what I wanted a
>> few days ago.  Thank you!
>>
>> One aspect not addressed is free-function properties:
>>
>
> I thought of one other problem with this proposal.  You can no longer get
> a delegate of a property.  Like it or not, there will be existing code that
> does get a delegate to properties (it is allowed now).
>
> I think we should provide a __traits accessor for this.  Otherwise, there
> is no way to port said code to the new style.
>

On the contrary with you, I was read that we no longer get an address of
ref returned value by address-op.

@property ref int foo();
static assert(is(typeof(&foo) == ref int function()));  // typeof does not
return int*

If I am correct, there is no need for special enhancement like __traits.

Kenji Hara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130203/a49503e5/attachment.html>


More information about the Digitalmars-d mailing list