Stephen J. Turnbull wrote:
Mike Kupfer writes:
> Well, we could have a discussion about when internal information
> should be displayed,
We could, but I'd be strongly in favor of the status quo: objects with
an unreadable print representationshould have a representation that
displays any information that developers find useful.
By "developers", do you mean XEmacs implementors, or do you mean people
trying to write Lisp applications?
> Yeah, I thought it a little odd when I first noticed that. But
I
> convinced myself that for a literal constant, the current number of
> items is the same as the expected long-run number. ;-)
Not if you interrupt the process immediately after initialization, and
it decides to dump an empty table to reread later.
Sorry, I'm not following you here.
> The thing is, for make-hash-table and the readable
representation, the
> number refers to objects, not buckets.
Sure. All representations refer to objects. The unreadable
representation also contains the number of buckets.
Which is presented in a way that makes it look like it's the expected
long-term number of objects.
This is not documented anywhere that I have seen. If I'm a Lisp newbie
and I'm futzing around in *scratch*, trying to understand something
about hash tables, and the interpreter tells me that my experimental
hash table is
#<hash-table :size 2/29 0x719>
then it seems reasonable to conclude that the 29 refers to objects. It
uses the same "size" keyword that is documented for #'make-hash-table,
and the 2 is clearly the number of actual objects in the table.
So if the 2/29 is for consumption by Lisp application writers, it's
misleading and confusing. It may not be part of the formal API, but it
still contributes to an ecosystem that's more difficult to work in, and
more intimidating to non-experts, than it needs to be.
Could the 2/29 be broken up, e.g.,
:size 2 :buckets 29
?
mike
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta