On Sun, Oct 16, 2005 at 11:11:45PM +0200, A. Pagaltzis wrote:
> * 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.

And C. And Python. And Java. And Pascal. And about almost every language
on the sun that allows whitespace between an aggregate and its indexing
operator.

> 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.

"Once you know". That's the point. "Once you know" all the behaviour of
software, no software is hateful. It's just a matter of knowing it. Once.

I hate Perl6 not because I don't know the rules, I hate Perl6 because
it robs me of a coding style I've used for the past 20 years, in any language
I've used. Switching to Perl6 seems less logical than switching to Windows.

> 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?

Question marks? No idea to which syntax you are referring.

> (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.)

I've heard about the ??:: operator, replacing the ?: one. But ????, no idea.



Abigail

Attachment: pgpZ9nm2V5kl2.pgp
Description: PGP signature

Reply via email to