Subject: Re: looking for a language with any of the following 4 charachteristics (all 4 would be nice). From: Erik Naggum <erik@naggum.net> Date: Sat, 16 Feb 2002 22:04:04 GMT Newsgroups: comp.lang.lisp Message-ID: <3222885847439883@naggum.net> * Erann Gat | First, the special variable is a red herring. What you say is equally | true whether or not *alist* is special. Huh? I gave a couple examples that should be enlightening. I am sorry that I do not have space to include the entire universe in every example to make sure that is also true but not mentioned because it is probably not useful in the process of _understanding_ the example. If you have to get everything "just so", please let me know, and I will try to label my examples "not suitable for Erann Gat", instead of trying to cope with your "special needs" for you. | Second, you can do exactly the same thing with a list of hash tables. Really? gethash works on a list of hash tables? Are you same guy who whined that you could not defer the choice of association type in the standard language? Suddenly you are allowed to rewrite the whole language in order to argue that you can do with gethash what you can do with assoc, even though it is not actually supported in the language. You have gone from knowledgable in Common Lisp to a foll and a troll. | In fact, an alist is just a special case of this. You can think of a | cons cell as a brain-damaged hash table with a capacity of one entry and | the identity as the hash function. Yeah, that is a certainly brain-damaged way to look at it. > Alists are also just as efficient from key to value as from value to key. | If you really need a bidirectional mapping you can get one easily with a | pair of hash tables. And the runtime efficiency will be O(1) instead of | O(N). Great, so now I have two different hashtables that need to be syncronized with some extraneous code and one accessor for both instead of one data structure and two accessor functions. Or perhaps you have forgotten about rassoc now that you have turned to C++ to get your performance fix? I have, after spending about 3 months with relational databases and SQL, started to miss support for independent indexing (via hashtables, say) and relational algebra. I would like to have been able to do these things in-memory without the need for a fully-fledged database engine, and not have to change the language I used when I wanted such an engine. Thinking and designing at such a high level, I could not care less how things are implemented below the levels I am interested in. /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.