* Abigail <abig...@abigail.nl> [2005-10-14 10:10]:
> Someone pointed out that I was incorrect. It turns out to be
> _worse_:
> 
>       my %hash;                        # Empty hash.
>       if %hash{1} {print "Found it"}   # No output.
>       if %hash {1} {print "Found it"}  # Syntax error.
>       if %hash {1}
>       {print "Found it"}               # Prints 'Found it'.

That’s really just obfuscation based on expectations from Perl5.
Once you know that there must be no whitespace between the hash
name and the key lookup operator in Perl6, the parsing is
completely straightforward.

Of course, you are free to dislike that syntax rule.

Can you throw in whitespace in those examples if you use the new
%hash«key» syntax instead?

(And if not, would it at least be possible to parse the examples
umambiguously if it *were* allowed? If the answer to that
question is yes, then I would lobby for dropping the {} hash
lookup operator altogether and permitting whitespace with the «»
operator.)

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to