On 5/4/01 11:47 PM, Edward Peschko wrote:
> Horrors is right. The default perl5 behaviour is *useful*. I use the
> %b=(%a,%c)
> metaphor all of the time.
I believe you can get the Perl 5 functionality by throwing a few *
characters in there somewhere...
> Why not just keep it simple?
Based on Apoc. 2, I'm not sure the Perl 6 isn't just as simple. It's just
different.
> And perl5-ish. Two contexts, scalar and list,
> hashes NOT a context of its own. If
>
> %a = @b;
>
> does
>
> %c = map{ ($_ => undef ) } @a;
>
> then it both confuses things and gets rid of lots of regular expression
> tricks,
> example:
>
> %environment = (`env` =~ m"(.*?)=(.*)\n"sg);
I may be misunderstanding pairlist vs. list context here, but I'd imagine
you could keep that type of functionality in Perl 6 with an explicit
keyword. Perhaps:
%environment = list (`env` =~ m"(.*?)=(.*)\n"sg); # Guessing
It seems to me that pairlist context will have enough benefits to outweigh
the extra care that must be taken to do Perl 5-ish stuff like the above.
-John