Most Perl 6 will look like Perl 5

Adriano Ferreira a.r.ferreira at gmail.com
Fri Jan 25 15:19:48 GMT 2008


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")

>
> You may prefer the latter, because it permits blanks.  The first
> requires only two changes from the original syntax for the
> average programmer (everyone except you).
> --
>
>                MarkOv
>
> ------------------------------------------------------------------------
>        Mark Overmeer MSc                                MARKOV Solutions
>        Mark at Overmeer.net                          solutions at overmeer.net
> http://Mark.Overmeer.net                   http://solutions.overmeer.net
>
>


More information about the london.pm mailing list