(defvar *bq-at-flag* '(|,@|))
(defvar *bq-dot-flag* '(|,.|))
(defvar *bq-vector-flag* '(|bqv|))
+(defvar *bq-error* "Comma not inside a backquote.")
(/show0 "backq.lisp 50")
(multiple-value-bind (flag thing)
(backquotify stream (read stream t nil t))
(when (eq flag *bq-at-flag*)
- (%reader-error stream ",@ after backquote in ~S" thing))
+ (simple-reader-error stream ",@ after backquote in ~S" thing))
(when (eq flag *bq-dot-flag*)
- (%reader-error stream ",. after backquote in ~S" thing))
+ (simple-reader-error stream ",. after backquote in ~S" thing))
(backquotify-1 flag thing))))
(/show0 "backq.lisp 64")
(unless (> *backquote-count* 0)
(when *read-suppress*
(return-from comma-macro nil))
- (%reader-error stream "comma not inside a backquote"))
+ (simple-reader-error stream *bq-error*))
(let ((c (read-char stream))
(*backquote-count* (1- *backquote-count*)))
(cond ((char= c #\@)
(multiple-value-bind (dflag d) (backquotify stream (cdr code))
(when (eq dflag *bq-at-flag*)
;; Get the errors later.
- (%reader-error stream ",@ after dot in ~S" code))
+ (simple-reader-error stream ",@ after dot in ~S" code))
(when (eq dflag *bq-dot-flag*)
- (%reader-error stream ",. after dot in ~S" code))
+ (simple-reader-error stream ",. after dot in ~S" code))
(cond
((eq aflag *bq-at-flag*)
(if (null dflag)
;;; them, the backquoted material will be recognizable to the
;;; pretty-printer.
(macrolet ((def (b-name name)
- (let ((args (gensym "ARGS")))
;; FIXME: This function should be INLINE so that the lists
;; aren't consed twice, but I ran into an optimizer bug the
;; first time I tried to make this work for BACKQ-LIST. See
;; whether there's still an optimizer bug, and fix it if so, and
;; then make these INLINE.
- `(defun ,b-name (&rest ,args)
- (declare (dynamic-extent ,args))
- (apply #',name ,args)))))
+ `(defun ,b-name (&rest rest)
+ (declare (truly-dynamic-extent rest))
+ (apply #',name rest))))
(def backq-list list)
(def backq-list* list*)
(def backq-append append)
;;; Since our backquote is installed on the host lisp, and since
;;; developers make mistakes with backquotes and commas too, let's
;;; ensure that we can report errors rather than get an undefined
-;;; function condition on %READER-ERROR.
+;;; function condition on SIMPLE-READER-ERROR.
#+sb-xc-host ; proper definition happens for the target
-(defun %reader-error (stream format-string &rest format-args)
+(defun simple-reader-error (stream format-string &rest format-args)
(bug "READER-ERROR on stream ~S: ~?" stream format-string format-args))
(/show0 "done with backq.lisp")