[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
visible hash tables
- To: common-lisp@SAIL.STANFORD.EDU
- Subject: visible hash tables
- From: Richard Mlynarik <MLY@AI.AI.MIT.EDU>
- Date: Fri, 13 May 88 09:14 EDT
- In-reply-to: <12397896527.20.TOURETZKY@C.CS.CMU.EDU>
I have always thought that an extension to the #S macro
is the correct way to do this sort of thing.
Might I instead suggest
#S(hash-table :test #'eq :initial-contents #)
Such an extension would also allow one to present *PRINT-ESCAPE*
pathnames along the lines of
#S(byte-specifier 69 259)
and so forth.
In CLOSsage, I guess the way to do this would be have the reader call
a generic function whose methods are defined on either a class instance
or, somewhat less flexibly, `on' the prototype instance of a class.
((class (eql (find-class 'pathname)))
(apply (lambda (name)
(apply (secret-internal-constructor class) initargs))
I believe that this sort of approach was implemented in NIL
at some stage. RMS' lisp machine code had a similar feature.
[Then again, one could always print
"#.(let ((table (make-hash-table :test #'eql)))
(dolist (x '((key1 . val1) ...))
(setf (gethash table (car x)) (cdr x)))))"