[Israel.pm] Python talk

Omer Zak omerz at actcom.co.il
Tue Dec 7 09:06:08 PST 2004


The gist of discussion is that Python is, after all, better than Perl x.y
(for x.y<6.0) when one wishes to use complicated data structures as keys
of associative arrays.

So this is not just the way my own neurons are wired together.

Makes me feel like the boy. who threw a stench bomb into the room and ran
away for cover as agitation ensued.

Besides complicated data structures, there are also other benchmarks for
comparing Python to Perl, but I'll defer to the Python talk for the
discussion about them.

I don't know how I'd feel about programming in Perl vs. Python if it were
not for the question of representing complicated data structures.

On Tue, 7 Dec 2004, Gaal Yahas wrote:

>
> Mikhael wrote:
>
> > And if the keys are constant arrays and not variable arrays, then you
> > don't even need to join the array elements to construct the key (but
> > you should be aware that Perl converts arrayref to string here):
> >
> >  $time = [ 100, 200 ];
> >  $CAA->{$time} = { label => 'somewhere', population => 12, time => $time };
>
> I forgot to mention that this approach, apart from potentially being
> dangerous due to the ref-reuse prolem, has the obvious limitation that
> applicatively equivalent keys will not match elements. I *must* have
> $time to restore the value. I will be disappointed if I do
>
>   $time2 = [ 100, 200 ];
> 	return $CAA->{$time2}; #undef
>
> What I typically want for object keys is that they associate to the same
> elementif they pass (in Javaesque parlance) an isEqual test.
                                             --- Omer
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html




More information about the Perl mailing list