[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash-table-{to, from}-alist

From: Stephen J. Turnbull
Subject: Re: hash-table-{to, from}-alist
Date: Tue, 25 Nov 2008 10:50:53 +0900

Ted Zlatanov writes:

 > The equality test is necessary if it was given originally (meaning,
 > if it's not 'eql).  I don't think we should ever omit it, even if
 > it's the default value, for readability.

I disagree.  But it's not incompatible as long as you don't make the
:test option to make-hash-table obligatory. ;-)

 > Would this work?
 > #s(hash-table size 2 test equal data (k1 v1) (k2 v2))

Not quite.  The data field in XEmacs is a plist, and the construct
above signals an error.

#s(hash-table size 2 test equal data (k1 v1 k2 v2))

 > Finally, the size is just a hint with make-hash-table; should the (read)
 > allow wrong sizes or throw an error?

XEmacs allows wrong sizes.  I think this makes sense, but it probably
isn't deliberate (the structure-reading mechanism validates field
values one at a time; I don't see a provision for cross-field
consistency checks).

#s(hash-table size 10 data (y y-value x x-value))
#<hash-table size 2/29 data (y y-value x x-value) 0x587cb2e2>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]