[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: Wed, 26 Nov 2008 11:29:06 +0900

Ted Zlatanov writes:
 > On Tue, 25 Nov 2008 10:50:53 +0900 "Stephen J. Turnbull" <address@hidden> 
 > wrote: 
 > SJT> 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.
 > SJT> I disagree.  But it's not incompatible as long as you don't make the
 > SJT> :test option to make-hash-table obligatory. ;-)
 > OK, I'll make :test optional.  Is size mandatory?  I ask since you put
 > it in your example, but you could have done so to illustrate
 > parameters.

It's not mandatory in the read syntax, but an accurate estimate will
avoid some consing at read time.  As an implementation detail, the
write syntax does include it if non-zero.

--> #<hash-table size 0/29 0x5fa328ee>
(let ((print-readably t))
  (prin1 #s(hash-table)))
--> #<hash-table size 0/29 0x5fa4b2ef>
#s(hash-table size 2)
--> #<hash-table size 0/29 0x5fa56456>
(let ((print-readably t))
  (prin1 #s(hash-table size 2)))
--> #<hash-table size 0/29 0x5fa5a16d>

 > I'm OK with that format and it seems pretty good,

Good.  I would be very annoyed if we had to support an alternative

reply via email to

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