Path: utzoo!attcan!uunet!mcvax!ukc!etive!aipna!jeff From: jeff@aipna.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp Subject: Re: Common Lisp Problems with Hash-table in Macros Message-ID: <393@aipna.ed.ac.uk> Date: 12 Dec 88 14:46:52 GMT References: <698@crin.crin.fr> Reply-To: jeff@uk.ac.ed.aipna.UUCP (Jeff Dalton) Organization: Dept. of AI, Edinburgh, UK Lines: 27 In article <698@crin.crin.fr> stephan@crin.crin.fr (Stephan BRUNESSAUX) writes: >Is there anybody out there who can explain me what is wrong with this >example which correctly runs in both interpreted and compiled mode on >Symbolics 3620 (Genera 7.2) and correctly ONLY in interpreted mode on >TI Explorer II and on VAX running KCL (June 3, 1987) but not in compiled >mode !?... > >(defmacro test (a b) > (let ((table (make-hash-table :size 1))) > (setf (gethash a table) b) > `(defun aux () > (maphash #'(lambda (key val) > (format t "key: ~a - val: ~a~%" key val)) > ',table)))) The problem is that you're trying to compile some code that contains aquoted hash table. So, the compiler has to put a representation of that hash table into the ".o" file. In KCL, the hash table just gets PRINTed and so looks like this: # When LOAD tries to read this, it calls READ which sees the # and calls the reader for the # dispatching character macro. It then sees the < and signals an error. I don't know what happens on the Explorer.