Most Perl 6 will look like Perl 5

Paul Makepeace paulm at paulm.com
Tue Jan 29 07:43:53 GMT 2008


On 1/25/08, Adriano Ferreira <a.r.ferreira at gmail.com> wrote:
> On Jan 25, 2008 10:07 AM, Mark Overmeer <mark at overmeer.net> wrote:
> > * Abigail (abigail at abigail.be) [080125 11:09]:
> > > Even something simple as C<< $hash {key} >> requires THREE changes, it
> > > will now become C<< %hash{'key'} >>.
> >
> > Actually, you have three more alternatives:  (See S02)
> >   %hash<key>
> >   %hash.<key>
> >   %hash .<key>
>
> A slight correction: the latter should be
>
>      %hash\ .<key>
>
> using an "unspace" (as presented at Synopsis 02 and illustrated in
> many places at Synopsis 03 - http://feather.perl6.nl/syn/S02.html and
> http://feather.perl6.nl/syn/S03.html).
>
> This odd construction has to do with the requisite of not allowing
> spaces before the dot, so that
>
>     .<key>   may stand for an invocation of .<> in the current topic
> (for example, $_)
>     $_.<key>
>
> (To be honest, I am not 100% sure of this, but my reading of the
> synopsis suggest this behavior. This is certainly true for things like
> "%hash.meth" vs. "%hash .meth")

When I learnt python, Template Toolkit, Java, (and and..) it took me
about one second to understand that to deference a hash I could use,

  hash.key

;-)

Jus' sayin', yo,
Paul


More information about the london.pm mailing list