;;;--------------------------------------------------------------------------
;;; 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*."
(pushval `(loop ,@(strip-progn (parse-infix 0)))))
(defopfunc bind operand
- (labels ((loop ()
+ (labels ((loopy ()
(let ((ids (parse-ident-list))
(valform (progn (delim '=) (parse-infix 0)))
(body (if (delim '|,| nil)
- (loop)
+ (loopy)
(progn
(delim 'in)
(strip-progn (parse-infix 0))))))
`(let ((,(car ids) ,valform)) ,@body)
`(multiple-value-bind ,ids ,valform ,@body))))))
(get-token)
- (pushval (car (loop)))))
+ (pushval (car (loopy)))))
;;;--------------------------------------------------------------------------
;;; Parsing function bodies and lambda lists.