This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: Association lists
- To: kawa at sourceware dot cygnus dot com
- Subject: Re: Association lists
- From: "Nic Ferrier" <nferrier at tapsellferrier dot co dot uk>
- Date: Thu, 22 Jun 2000 19:33:43 +0100
>>> "Brian D. Carlstrom" <bdc@zurich.ai.mit.edu> 22-Jun-00 7:13:12 PM
>>>
>Associative arrays are not hashtables, although they
>have a similar API, because their performance is not
>equivilent
I appreciate that.
But it's as near as dammit because an assoc-list is only an
assoc-list whilst it has associaton pairs on it. It wouldn't be a
problem (from the user's point of view) to optimize it into a
hashtable within the compiler or interpreter.
This, it seems to me, would be the Scheme way - expressive and
minimalist but with hidden, implementation driven, power (a la
loops).
>I think most Scheme implementations provide real hashs
>as a seperate non-standard extensions. I know scheme
>48 does, and my personal scheme in java just allows
>people to use Java Hashtables.
Which of course I can also do quite easily with Kawa.
But, like loops, Scheme cannot do hashes (not easily anyway) so I
would have thought the "schemey" thing to do is optimize assoc
lists?
>I don't think the compiler can lexically determine the
>usage of a hash to see that it is never used as a list.
Perhaps not...
but the list itself could do that (as specified in my original
mail).
In fact I am actively considering doing it (though perhaps for now
I'll just deal with a hash using Java calls).
Nic