[OT] Programming language WATs

Timon Gehr timon.gehr at gmx.ch
Sun Jan 22 16:36:26 PST 2012


On 01/23/2012 01:27 AM, Jonathan M Davis wrote:
> On Sunday, January 22, 2012 13:26:57 bcs wrote:
>> http://www.d-programming-language.org/statement.html#ForStatement
>>
>> Everything from after the '(' up to and including the first ';' is
>> defined by use of an NoScopeNonEmptyStatement or ';' (the first happens
>> to include variable decelerations, expression statements and
>> if/for/switch/etc.).
>
> Yeah. I thought that that was extremely cool when I figured that out. I'm not
> sure that there's any real use for it being so flexible, and in most cases,
> doing the sort of thing that you just did shouldn't be done, but it does allow
> you to do some cool stuff with the first portion of the for loop.
>
> - Jonathan M Davis

All cool stuff that can be done elsewhere in a function body can also be 
done with the first portion of the for loop. ;)


More information about the Digitalmars-d mailing list