/[cmucl]/src/code/backq.lisp
ViewVC logotype

Diff of /src/code/backq.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14.22.2 by rtoy, Tue Feb 9 03:43:35 2010 UTC revision 1.17 by rtoy, Tue Apr 20 17:57:43 2010 UTC
# Line 45  Line 45 
45  ;;;<hair> involves starting over again pretending you had read ".,a)" instead  ;;;<hair> involves starting over again pretending you had read ".,a)" instead
46  ;;; of ",@a)"  ;;; of ",@a)"
47    
48  (defvar *backquote-count* 0  _N"How deep we are into backquotes")  (defvar *backquote-count* 0  "How deep we are into backquotes")
49  (defvar *bq-comma-flag* '(|,|))  (defvar *bq-comma-flag* '(|,|))
50  (defvar *bq-at-flag* '(|,@|))  (defvar *bq-at-flag* '(|,@|))
51  (defvar *bq-dot-flag* '(|,.|))  (defvar *bq-dot-flag* '(|,.|))
# Line 61  Line 61 
61      (multiple-value-bind (flag thing)      (multiple-value-bind (flag thing)
62                           (backquotify stream (read stream t nil t))                           (backquotify stream (read stream t nil t))
63        (if (eq flag *bq-at-flag*)        (if (eq flag *bq-at-flag*)
64            (%reader-error stream _",@ after backquote in ~S" thing))            (%reader-error stream (intl:gettext ",@ after backquote in ~S") thing))
65        (if (eq flag *bq-dot-flag*)        (if (eq flag *bq-dot-flag*)
66            (%reader-error stream _",. after backquote in ~S" thing))            (%reader-error stream (intl:gettext ",. after backquote in ~S") thing))
67        (values (backquotify-1 flag thing) 'list))))        (values (backquotify-1 flag thing) 'list))))
68    
69  (defun comma-macro (stream ignore)  (defun comma-macro (stream ignore)
# Line 71  Line 71 
71    (unless (> *backquote-count* 0)    (unless (> *backquote-count* 0)
72      (when *read-suppress*      (when *read-suppress*
73        (return-from comma-macro nil))        (return-from comma-macro nil))
74      (%reader-error stream _"Comma not inside a backquote."))      (%reader-error stream (intl:gettext "Comma not inside a backquote.")))
75    (let ((c (read-char stream))    (let ((c (read-char stream))
76          (*backquote-count* (1- *backquote-count*)))          (*backquote-count* (1- *backquote-count*)))
77      (values      (values
# Line 112  Line 112 
112               (multiple-value-bind (dflag d) (backquotify stream (cdr code))               (multiple-value-bind (dflag d) (backquotify stream (cdr code))
113                 (if (eq dflag *bq-at-flag*)                 (if (eq dflag *bq-at-flag*)
114                     ;; get the errors later.                     ;; get the errors later.
115                     (%reader-error stream _",@ after dot in ~S" code))                     (%reader-error stream (intl:gettext ",@ after dot in ~S") code))
116                 (if (eq dflag *bq-dot-flag*)                 (if (eq dflag *bq-dot-flag*)
117                     (%reader-error stream _",. after dot in ~S" code))                     (%reader-error stream (intl:gettext ",. after dot in ~S") code))
118                 (cond                 (cond
119                  ((eq aflag *bq-at-flag*)                  ((eq aflag *bq-at-flag*)
120                   (if (null dflag)                   (if (null dflag)
# Line 238  Line 238 
238      ))      ))
239    
240  (defun backq-unparse (form &optional splicing)  (defun backq-unparse (form &optional splicing)
241    _N"Given a lisp form containing the magic functions BACKQ-LIST, BACKQ-LIST*,    "Given a lisp form containing the magic functions BACKQ-LIST, BACKQ-LIST*,
242    BACKQ-APPEND, etc. produced by the backquote reader macro, will return a    BACKQ-APPEND, etc. produced by the backquote reader macro, will return a
243    corresponding backquote input form.  In this form, `,' `,@' and `,.' are    corresponding backquote input form.  In this form, `,' `,@' and `,.' are
244    represented by lists whose cars are BACKQ-COMMA, BACKQ-COMMA-AT, and    represented by lists whose cars are BACKQ-COMMA, BACKQ-COMMA-AT, and
# Line 250  Line 250 
250     ((atom form)     ((atom form)
251      (backq-unparse-expr form splicing))      (backq-unparse-expr form splicing))
252     ((not (null (cdr (last form))))     ((not (null (cdr (last form))))
253      _"### illegal dotted backquote form ###")      (intl:gettext "### illegal dotted backquote form ###"))
254     (t     (t
255      (case (car form)      (case (car form)
256        (backq-list        (backq-list

Legend:
Removed from v.1.14.22.2  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.5