[Perl] Report on the last meeting
gabor at tracert.com
Sat Sep 21 13:20:12 PDT 2002
Shlomo Yona wrote:
> Since Gabor is by now on his way to the YAPC::Europe::2002, and won't have time to
> review the last meeting, I think I will.
Indeed I was already at YAPC::Europe when you sent this. Thanks very
much for the report ! I think it is time that other people also get
active in the organization and the 'management' of our group hence I am
very happy that you took this step !
> Array::Unique, so it appeares, was born by mistake, and serves mostly as a lesson:
> Gabor wanted a data structure which holds elements with order and can be accessed with indices,
> yet do not keep more than one copy of each element. Sure you can hack this with a combination
> of a LIST and a HASH but Gabor wanted to increase his code readability by hiding the implementation
> and giving an interface which behaves like an ARRAY. Gabor showed us his implementation which was
> unfortunately not so efficient, computational-complexity speaking, and show ways to improve it.
> The great lesson, was that after various attempts of optimization, Gabor realized he needed no more
> than a simple HASH to begin with - so when you want unique elements, use a hash.
Well, not exactly. What my conclusion is that while I do need the array
interface, I don't need to keep the order of the values so I can
implement the backend with a simple hash. (but I do want to hide the
fact that this is a hash). Also I concluded that time did not matter in
my case (though it is important in the general case).
Actually on YAPC, where I gave more or less the same presentation
someone mentioned a Set::* module that would do the same. I'll have to
find that to see it it is good for my purposes.
BTW reagarding the issue we talked about in Haifa that we don't really
know how long does it take to insert one element into a hash Larry Wall
said something like that it is 'O(1) for some very large value of 1' :-)
> I hope the rest of the participants will add onto this summary their own impressions.
More information about the Perl