Some discussion on the list - the tail end of this thread:
http://groups.google.com/group/boolang/browse_frm/thread/ac20f7172255287e/99ea344d11fe6bc6#99ea344d11fe6bc6
- brings up something in general that I think a lot of people might like:
while true: print 'var'; print 'hello'
or, as mentioned in the thread,
if false: print 'empty codeblock'
Sometimes its not really necessary to consume that much space if there's only going to be one or two elements within the block. Othertimes its just easier to expand a statement like that into a fully block-based statement with a little hassle.
Note: this is not a proposal to remove the "print 'foo' if bar" syntax; this is just a more general way of allowing compacted block-based statements/expressions/technical jargon.
protected
{ b.LexicalInfo = ToLexicalInfo(begin); }compound_stmt[Block b]
{
StatementCollection statements = b.Statements;
}:
(COLON (EOS)* stmt[statements]) |
(
COLON begin:INDENT
block[statements]
end[b]
)
;
Some simple examples:
if true: print "ok"
if false: print "true"
else: print "false"
try: raise "uh oh"
except e: print "caught it"