This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Scheme style auto-resizing hashtable (fwd)


On Thu, 5 Nov 1998, Jay Glascoe wrote:

>     (foo-bar->list (list->foo-bar list)) == list
>     and
>     (list->foo-bar (foo-bar->list foo-bar)) == foo-bar

oops, out-smarted myself there.

(list->dictionary (dictionary->list dictionary)) == dictionary 

is true in general only if "dictionary" was constructed by
"make-dictionary" or "list->dictionary", (btw, doing a "list->dictionaryq" 
on an alist with, e.g. constant strings for keys is a very bad idea). 

and

(dictionary->list (list->dictionary list)) != list

if "list" is an association list, then the Left-Hand-Side is a
randomly ordered version of "list" with unique association keys.
OTOH, if "list" isn't an alist then the LHS is a randomly ordered,
unique'ified list of lists of "list"'s elements.  cool.

to avoid such complications, I think it best to assert that "list" is in
fact an association list.

> 	Jay Glascoe
> 	jglascoe@jay.giss.nasa.gov
> 
>