On Fri, May 04, 2001 at 11:23:12PM -0400, John Siracusa wrote:
> On 5/4/01 11:09 PM, Nathan Wiger wrote:
> > The real trick is what to do with these:
>
> Note: stabbing wildly here... :)
>
> > %a = (%b, %c);
>
> %a = (stringify(\%b) => \%c); # Perl 5-ish
> %a = (%b.str => %c); # Perl 6 equiv.
>
> > %d = (@e, @f);
>
> %d = (stringify(\@e) => \@f); # Perl 5-ish
> %d = (@e.str => @f); # Perl 6 equiv.
>
> > Or, horrors:
Horrors is right. The default perl5 behaviour is *useful*. I use the %b=(%a,%c)
metaphor all of the time.
Why not just keep it simple? 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);
Ed