chiark / gitweb /
Fix constant-resetting.
[lisp] / infix.lisp
index 64a0a308d257c0cac310562bb6f81545c597a56f..a77f51ea2c4fc56a6aa6b7e7add96d5efe92dda4 100644 (file)
@@ -94,8 +94,12 @@ (defvar *paren-depth* 0
 ;;;--------------------------------------------------------------------------
 ;;; The tokenizer.
 
-(defconstant eof (cons :eof nil)
-  "A magical object which `get-token' returns at end-of-file.")
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (let ((value (cons :eof nil)))
+    (unless (and (boundp 'eof)
+                (equal (symbol-value 'eof) value))
+      (defconstant eof (cons :eof nil)
+       "A magical object which `get-token' returns at end-of-file."))))
 
 (defun default-get-token ()
   "Read a token from *stream* and store it in *token*."