> First is the choice of arrays verses hashes as the choice for set storage.
> Arrays are obviously easier to construct, but hashes are both faster
> implementations, and easier to determine membership.
Well in fact I'm interested by such functions in order to manipulate
lists
of scalars (1, 'to
> The point is that a hash of booleans (not a list of hashes) is a more direct
> way to implement a set. A set is unordered, and does not have duplicates.
> This is also true of hash keys. Furthermore, the nature of a hash makes it
> faster and easier to check for the existance of a key, which
>
> Arrays are ordered.
> Hashes are not.
> Neither are sets.
>
> Arrays can have repetitions.
> Hashes can not.
> Neither can sets.
>
> etc.
>
> --tom
Yes, this is true, but the natural syntax, for me, to manipulate sets,
is the one of arrays.
It is not natural to w
Eric Roode wrote:
> Adjust your thinking a bit, not the language. Try:
>%my_fruit_set = (orange => 1, lemon => 1);
>or
>@my_fruit_set{qw/orange lemon/} = ();
Yes, probably, this could be easiest... :)
But, maybe because I'm a mulish person, I still thinking that if we
actually use such
John Porter wrote:
>
> Buddha Buck wrote:
> >
> > In a hash implementation, your hash keys -are- your set elements!
> >
> > my %set;
> >
> > # add elements to %set
> > $set{'elem1','elem2'} = 1;
> >
> > # Compute union
> > $union{keys %set1, keys %set2} = 1;
>
> Oh, yeah, using native hashes for
Tom Christiansen wrote:
> Until you start thinking of terms of hashes, you aren't thinking
> in Perl. It serves no good to delay this epiphany. Also, remember
> that being a "novice" is a temporary and curable condition. Perl
> is designed to for long-term ease of use, not short-term learn-fre
> At what point do you feel a new operator is not justified? Why do
> we need grep/map, just use for? Why have <=>, cmp, just use ?:
>
> So what if the man wants
>
> @foo = @bar union @baz;
> @foo = @bar intersetcion @baz;
>
> This is a lot more of a direct map than the twiddli
Tom Christiansen wrote:
>
> >I don't want a set representation. I want set operations. And somehow
> >for this having to add a use statment and who knows what overhead for
> >what seems to be a simple operation is a pain.
>
> The overhead is not that it should be a module, but rather,
> the sill
[EMAIL PROTECTED] wrote:
>
> Could we please take discussion of 179 to -data? I think that's where
> it should be.
>
> K.
Personnally, I don't see any objection to this.
If everybody is ok, why not ?
How should I process ? Submit again the proposal with a modified
mailing-list email ?
Gael,
Jeremy Howard wrote:
>
> > [EMAIL PROTECTED] wrote:
> > >
> > > Could we please take discussion of 179 to -data? I think that's where
> > > it should be.
> > >
> > > K.
> >
> > Personnally, I don't see any objection to this.
> > If everybody is ok, why not ?
> >
> > How should I process ? Submit
10 matches
Mail list logo