if (int x=..) but no while(int x=..) ?

Kyle Furlong kylefurlong at gmail.com
Tue May 2 02:30:03 PDT 2006


Lionello Lunesu wrote:
> Lionello Lunesu wrote:
>> I like the fact that we can do
>>
>> # if (int recvd = ts.receive(buffer)) {...}
>>
>> but is there any reason why this shouldn't apply to "while" also?
>>
>> # while (int recvd = ts.receive(buffer)) {...}
>>
>> main.d(26): found 'recvd' when expecting '.' following 'int'
>> main.d(26): found '=' when expecting identifier following 'int.'
>> main.d(26): found 'ts' when expecting ')'
>> main.d(26): found ')' when expecting ';' following 'statement' 
> 
> *BUMP*
> 
> What's the status on this issue? Is there any reason why the syntax of 
> "while" is different from the syntax of "if" ?
> 
> According to tests done by Kelly Wilson it's trivial to support.
> 
> Sorry for the bump, but this seems like a forgotten issue.
> 
> L.

This needs implementing.



More information about the Digitalmars-d mailing list