Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-09 Thread TSa (Thomas Sandlaß)
On Tuesday, 9. November 2010 01:45:52 Mason Kramer wrote: > I have to disagree here. Arrays and Hashes may be about storage (I don't > think they are, though, since you can change the (storage) implemenation of > an Array or Hash via its metaclass and it can still remain an Array or > Hash). What

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-09 Thread Moritz Lenz
On 11/09/2010 09:26 PM, TSa (Thomas Sandlaß) wrote: > But doesn't > >my $x = (1,2,3); >my $y = map {$^x * $^x}, $x; > > result in $y containing the list (1,4,9)? Not at all. The $ sigil implies a scalar, so what you get is roughly my $y = (1, 2, 3).item * (1, 2, 3).item; so $y ends