|
From: | David De La Harpe Golden |
Subject: | Re: hash-table-{to, from}-alist |
Date: | Wed, 26 Nov 2008 02:16:13 +0000 |
User-agent: | Mozilla-Thunderbird 2.0.0.17 (X11/20081018) |
Stefan Monnier wrote:
#s<hash-table size 65 test 'eql weak 'key rehash-size 20.0 rehash-threshold 0.001 data (1 2 5 env )>Looks OK, except I don't think it's a good idea to include ' in front of key and eql. I know it's what we do right now, but in order to read it back in, it's going to be more trouble. Also I'd generally prefer using ":weakness" rather than "weak", so it's as close as possible to the key args passed to make-hash-table.
The #s kind of bothers me. In common lisp, #s(a ...) is readable - as an instance of struct a [*]. Hence the "s". Now, hashtables may well use a struct for their metadata as an implementation detail, but the #s<...> does look to me like an odd mix of commmon lisp #s(...) struct-instance-literal syntax and #<...> printable-but-unreadable-object syntax.
I realise that for emacs lisp compatibility with common lisp is a nongoal and compatibility with xemacs lisp is of some interest, so it's not a huge argument against #s<...>, I'm just saying I'm finding it a bit confusing coming from CL (mind you, CL anyway lacks any print/read
roundtripping hashtable syntax) [*] CL-USER> (defstruct a b c) A CL-USER> (make-a :b 1 :c 2) #S(A :B 1 :C 2) CL-USER> #s(a :b 2 :c 3) #S(A :B 2 :C 3) CL-USER>
[Prev in Thread] | Current Thread | [Next in Thread] |