effect of a label on following block
elfy.nv at gmail.com
Mon Nov 15 07:07:29 PST 2010
Consider this code
v = 5; // ok, v is defined
As I understand from D's grammar this behaviour is not a bug as
Identifier : NoScopeStatement
and NoScopeStatement in turn takes BlockStatement without creating new
It looks very unnatural for me though. Especially when label goes before
v = 5;
it works as above, yet label after 'while'
v = 5; // error, v is undefined
has no such effect, even if ThenStatement is just another ScopeStatement.
I don't understand this difference. Any rationale behind this?
Using Opera's revolutionary email client: http://www.opera.com/mail/
More information about the Digitalmars-d-learn