Re: Assigning duplicate values to several hash keys using junctions?

2009-06-08 Thread Larry Wall
On Mon, Jun 08, 2009 at 12:02:43PM +0100, Ville Koskinen wrote: : An alternative is always : : @hash{qw(foo bar)} = ('some value') x 2; : : which is probably : : %hash = ('some value') x 2; : : in Perl 6, but you always need to take care to write the correct integer : in the list replication.

Re: Assigning duplicate values to several hash keys using junctions?

2009-06-08 Thread Jon Lang
2009/6/8 Ville Koskinen : > Hello all, > > I was curious if this is possible in Perl 6: > > %hash{ 'foo' & 'bar' } = 'some value'; > # %hash{'foo'} eq 'some value' and %hash{'bar'} eq 'some value' By autothreading, this would be equivalent to: (%hash{'foo'} & %hash{'bar'}) = 'some value'; wh

Assigning duplicate values to several hash keys using junctions?

2009-06-08 Thread Ville Koskinen
Hello all, I was curious if this is possible in Perl 6: %hash{ 'foo' & 'bar' } = 'some value'; # %hash{'foo'} eq 'some value' and %hash{'bar'} eq 'some value' or perhaps %hash{ 'foo' | 'bar' } = 'some value'; In other words, is it possible to assign the same value to multiple hash keys simulta