Interesting user mistake

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 4 08:10:18 PDT 2015


On 9/4/15 9:38 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net> wrote:
> On Friday, 4 September 2015 at 12:02:26 UTC, Steven Schveighoffer wrote:
>> On 9/3/15 5:59 PM, Brian Schott wrote:
>>> On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer
>>> wrote:
>>>> What about all other operations that may be typos from op= where op is
>>>> also a unary operator? e.g. =-
>>>
>>> We'd have to special-case '*':
>>>
>>> a=*b;
>>>
>>
>> You could say the same thing for =-:
>>
>> a=-b;
>>
>> seems reasonable for someone who doesn't like whitespace. I think
>> Andrei's rule was the token sequence must have whitespace after the
>> operator in order to be rejected. So the above would be fine.
>
>      Vector!double p;
>      p.x=+ 0.27;
>      p.y=-11.91;
>      p.z=- 8.24;
>

p.x= + 0.27;
p.y= -11.91;
p.z= - 8.24;

This really isn't a difficult thing to fix, nor do I likely see this 
being a common issue.

-Steve


More information about the Digitalmars-d mailing list