[phobos] Time to get ready for the next release
Robert Jacques
sandford at jhu.edu
Mon Apr 25 12:29:07 PDT 2011
On Mon, 25 Apr 2011 09:58:47 -0400, Steve Schveighoffer
<schveiguy at yahoo.com> wrote:
> ----- Original Message -----
>> From: Robert Jacques <sandford at jhu.edu>
>> To: Discuss the phobos library for D <phobos at puremagic.com>
>> Cc:
>> Sent: Sunday, April 24, 2011 12:03 PM
>> Subject: Re: [phobos] Time to get ready for the next release
>>
>> On Sun, 24 Apr 2011 07:33:30 -0400, Jacob Carlborg <doob at me.com> wrote:
>
>>> If writeln = "foo"; doesn't compile but printf =
>> "foo"; does then I would consider it not fixed. The way I would want
>> @property to behave is disallow bar = "foo"; for functions not marked
>> with @property. But still allow functions not marked with @property to
>> be
>> callable without parentheses.
>>
>> Also, this and another post have given me an idea: what if
>> non- at property methods
>> could be assigned to if and only if a valid 'getter' also existed. This
>> would still 'fix' writeln = "foo" but be a less restrictive
>> than an outright ban.
>
> It was an idea that Andrei brought up (before @property syntax was
> introduced), but I don't think it can be properly enforced:
>
> int select(int timeout = 0); // both "getter" and "setter"
>
> -Steve
Hmm... good point. Counter-point, select's functions signature is still a
'setter' signature. A 'select' / 'select()' method doesn't exist, it's
simply syntactic sugar for select(0). Since a lookup of select by DMD
involves the actual function overloads and not their sugary-transforms, it
should still detect that select has no zero-arg overload and therefore
error on 'select = 5'.
More information about the phobos
mailing list