Skip to content
Snippets Groups Projects
Commit 96f876e8 authored by toy's avatar toy
Browse files

Fix for (pprint '`(lambda ,x)) bug wherein the backquote

implementation details leaks out.

From SBCL.
parent 5c4707fd
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/backq.lisp,v 1.11 2002/10/14 21:37:57 toy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/backq.lisp,v 1.12 2004/01/16 03:13:09 toy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -48,7 +48,10 @@ ...@@ -48,7 +48,10 @@
(defvar *bq-at-flag* '(|,@|)) (defvar *bq-at-flag* '(|,@|))
(defvar *bq-dot-flag* '(|,.|)) (defvar *bq-dot-flag* '(|,.|))
(defvar *bq-vector-flag* '(|bqv|)) (defvar *bq-vector-flag* '(|bqv|))
(defvar *bq-tokens*
'(backq-comma backq-comma-at backq-comma-dot backq-list
backq-list* backq-append backq-nconc backq-cons backq-vector))
;; This is the actual character macro. ;; This is the actual character macro.
(defun backquote-macro (stream ignore) (defun backquote-macro (stream ignore)
(declare (ignore ignore)) (declare (ignore ignore))
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pprint.lisp,v 1.33 2003/01/06 22:27:16 toy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pprint.lisp,v 1.34 2004/01/16 03:13:10 toy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -1177,6 +1177,16 @@ ...@@ -1177,6 +1177,16 @@
(defun pprint-lambda-list (stream lambda-list &rest noise) (defun pprint-lambda-list (stream lambda-list &rest noise)
(declare (ignore noise)) (declare (ignore noise))
(when (and (consp lambda-list)
(member (car lambda-list) lisp::*bq-tokens*))
;; if this thing looks like a backquoty thing, then we don't want
;; to destructure it, we want to output it straight away. [ this
;; is the exception to the normal processing: if we did this
;; generally we would find lambda lists such as (FUNCTION FOO)
;; being printed as #'FOO ] -- CSR, 2003-12-07
(output-object lambda-list stream)
(return-from pprint-lambda-list nil))
(pprint-logical-block (stream lambda-list :prefix "(" :suffix ")") (pprint-logical-block (stream lambda-list :prefix "(" :suffix ")")
(let ((state :required) (let ((state :required)
(first t)) (first t))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment