From ... From: Erik Naggum Subject: Re: Readable hash tables Date: 2000/06/14 Message-ID: <3169980799367283@naggum.no>#1/1 X-Deja-AN: 634439002 References: <3169906921883001@naggum.no> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 960992041 1066 195.0.192.66 (14 Jun 2000 14:14:01 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6 Mime-Version: 1.0 NNTP-Posting-Date: 14 Jun 2000 14:14:01 GMT Newsgroups: comp.lang.lisp * Ivar Rummelhoff | I'm so sorry. | | (let ((dispatch | (let ((tab (copy-pprint-dispatch nil))) | (set-pprint-dispatch 'hash-table #'hash-print 0 tab) | tab))) | (defun mi-write (obj &rest args) | (let ((*print-pprint-dispatch* dispatch)) | (setf (getf args :pretty) t) | (apply #'write obj args)))) | | should replace the erroneous function by the same name in my previous | posting. Although not strictly erroneous, you don't really know whether the argument list is modifiable and safe to modify. I highly recommend (apply #'write obj :pretty t args) as only the first occurrence of a keyword argument is used and any redundancy is just ignored. | Alas, this the new version insists on printing pretty... Well, you _could_ empty the pprint-dispatch if *print-pretty* is nil upon entry to the function. An empty *pprint-dispatch* is returned from excl::make-pprint-dispatch without arguments in Allegro CL. #:Erik -- If this is not what you expected, please alter your expectations.