Re: Nice to have'it

2000-08-28 Thread John Porter
Damian Conway wrote: > I have a draft RFC that proposes that the LIST argument of a > grep be optional in a hash slice, and default to the key list > of the sliced hash. So: That's a waste of RFC paper, Damian. But let's generalize it a bit, and say that Perl6 should have a standard intrinsic

Re: Nice to have'it

2000-08-28 Thread Damian Conway
> Well, $hash{/re/} would only evaluate to a single scalar. > More likely, you'd want @hash{/re/}, which would be > equivalent to @hash{ grep { /re/ } keys %hash }. I have a draft RFC that proposes that the LIST argument of a grep be optional in a hash slice, and default to the key li

Re: Nice to have'it

2000-08-28 Thread John Porter
David Corbin wrote: > raptor wrote: > > > > $hash{/re/} i.e. this is the same like > > > > my @res; > > foreach my $k (keys %hash) > > { > > if ($k =~ /re/) {push $hash{$k},@res} > > }; > > > > OR > > keys %hash{/re/} > > values %hash{/re/} > > each %hash{/re/} > > Way cool. I'd love this

Re: Nice to have'it

2000-08-28 Thread David Corbin
raptor wrote: > > Hi, > > I have couple of ideas which may or may not worth it, so I didn't > wrote the RFC but will list them here in short. > Here are the nice to have'it. > > 1. There will be good to have some sort of "match and/or assign" operator > for structures i.e. HASHES. Can't still f

Re: Nice to have'it

2000-08-28 Thread Ed Mills
Hey Raptor et al: Wow you did some homework! Nice ideas, but the consensus seems to be "roll your own". I've noted that opertors working on arrays are generally discouraged in favor of scalar ops in these discussions, so for example your (min,max) (ceiling, floor) are coded thousands of times