> 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.
I agree. But what to do with:
(%a, %b) = (%c, %d);
Surely that shouldn't act too differently from:
%a = (%c, %d);
It seems either the list should be flattened or not.
Maybe we need a new flattening operator. I don't think the proposed := by
itself would do everything we need to do. Maybe we need a way to say
"flatten these together". I'm going to throw out a new ":" op here:
%a = (%b, %c); # same as %a = %b
%a = (%b : %c); # flattened like Perl 5
(%a, %b) = (%c, %d); # kept separate
(%a, %b) = (%c : %d); # %a slurps all of flattened %c and %d,
# %b gets nothin'
This allows you added functionality to flatten stuff as you see fit:
(%a, %b) = (%c : %d, @e : @f);
(@a, @b) = ($c : $d : $e : $f, @g : $f);
Hmmm... I kinda like that... Am I missing anything?
-Nate