[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Keywords at top level
Date: Sun, 17 Dec 89 22:50:22 -0500
From: eliot@phoenix.Princeton.EDU (Eliot Handelman)
A program of mine is losing because of the way franz evaluates
keywords at top level. The relevent code is:
(set-macro-character #\$
#'(lambda (stream char)
(declare (ignore char))
(get (read stream t nil t) 'event)))
(setf (get :one 'event) <some structure>)
;;;And then, at top level, the following error is signalled:
<cl> $:one
Error: #<Event :ONE> -- invalid form for eval.
Ok, maybe I shouldn't have used keywords, but I did. Is there some way
to turn off franz's toplevel keyword evaluator? The implementation is
the one supplied with the NeXT.
This error has nothing to do with evaluation of keywords. Lisp's
(print (eval (read))) is trying to eval the #<Event :ONE) object
returned by the reader. Allegro conforms to CLtL in that arbitrary
arrays, structures, etc. are *not* self evaluating. The interpreter
signals an error when you try.
If you had put a quote before the form no error would have been
signalled, i.e.:
<cl> '$:one