<X-posting to perl6-language> [EMAIL PROTECTED] writes: > As for "cleanness", this is my interpretation of how perl6 is going > to work: > > %foo = (); > if %foo {"key"} {print "Hello 1"} > #### > %foo = (); > if %foo{"key"} {print "Hello 2"} > #### > %foo = (); > if %foo{"key"}{print "Hello 3"} > > Case 1 will print "Hello 1"; this is a block after the if statement.
No, it will be a syntax error. The first closing brace does not end the statement, probably something like "Block seen when keyword expected". > Case 2 will not print anything. The print is in the 'then' part > of the if. Correct. > Case 3 will be a syntax error - an if statement with a condition, > but not block. It won't be a syntax error *yet*. If there's a block immediately following then that will be treated as the 'then' block. If it's the end of file, or a nonblock, then it'll be a syntax error. > You call this **CLEAN**? Not even in Python can a space influence > control flow that significantly. (In fact, in Python, Java, C, Pascal, > awk, and perl5, whitespace between an aggregates names and its index is > optional. Not mandatory, not forbidden, no, optional). I confess that it's not my favourite feature. But I wouldn't go so far as to say it wasn't clean. 'Different', certainly. -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?