Killing the comma operator

Mathias Lang via Digitalmars-d digitalmars-d at puremagic.com
Wed May 11 17:35:43 PDT 2016


2016-05-12 0:32 GMT+02:00 deadalnix via Digitalmars-d <
digitalmars-d at puremagic.com>:

> On Wednesday, 11 May 2016 at 18:36:11 UTC, H. S. Teoh wrote:
>
>> On Wed, May 11, 2016 at 05:55:27PM +0000, deadalnix via Digitalmars-d
>> wrote:
>>
>>> On Wednesday, 11 May 2016 at 16:44:43 UTC, H. S. Teoh wrote:
>>> >That's what I've been saying, it should be treated as a >special case
>>> in the syntax of for-loops, but not as an >operator in general.
>>> >
>>>
>>> Please no special cases.
>>>
>>
>> You misunderstand, what I mean is that the comma should be *part of*
>> for-loop syntax, instead of being part of expression syntax. I.e., for-loop
>> grammar should read something like this:
>>
>> for-loop:
>>         "for" "(" loop-init ";" loop-condition ";" loop-increment ")"
>> block
>>
>> loop-init:
>>         comma-separated-exprs
>>
>> loop-condition:
>>         comma-separated-exprs
>>
>> loop-increment:
>>         comma-separated-exprs
>>
>> comma-separated-exprs:
>>         expression
>>         expression "," comma-separated-exprs
>>
>> And the grammar for expression should have zero references to comma
>> operators.
>>
>>
>> T
>>
>
> loopinit is a statement, but I see the idea. Works for me.
>
>
That is my intent too. However the discussions on the P.R. seem to converge
in another direction.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160512/9a451800/attachment.html>


More information about the Digitalmars-d mailing list