Re: Concatenation of objects...

Harley Gorrell <[email protected]>
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
On Tue, 30 Sep 2003, Fabrizio Morbini wrote:
> The problem is: convert a list into a symbol that is in 1:1 corrispondence
> with the list. (because the list will be the key of an hash table, but a
> list cannot be a key of an hash table so I need to convert it into a
> symbol).

   Ok... I think I see what you are trying to do.  However,
you should know that lists CAN be used as keys to a hash
table, but just not by default.  You need to tell the hash
table to use a different equality function.

   Try this:

(setf *ht1* (make-hash-table :test 'equal))
(setf (gethash '(1) *ht1*) 'one)
(gethash '(1) *ht1*)

PS: If you will be putting lots of entries in, use ":size" to
    provide a hint as to the final size.

harley.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.