From ddf0daee0538f6436bd5fd4d34c42563e5f2fc09 Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Mon, 25 Feb 1991 23:52:27 +0000 Subject: [PATCH] /usr2/ch/lisp/format.lisp, 13-Mar-90 19:02:12, Edit by Christopher Hoover. Fixed a bug in format regarding ~@*. The count default needed to be zero not one. --- code/format.lisp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/code/format.lisp b/code/format.lisp index e06ed7d67..3d599d3d4 100644 --- a/code/format.lisp +++ b/code/format.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/format.lisp,v 1.7 1991/02/08 13:32:58 ram Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/format.lisp,v 1.8 1991/02/25 23:52:27 ram Exp $") ;;; ;;; ********************************************************************** ;;; @@ -849,22 +849,24 @@ ;;; Skip arguments (relative goto) ~* (defun format-skip-arguments (colon atsign parms) - (with-format-parameters parms ((count 1)) - (cond (atsign + (cond (atsign + (with-format-parameters parms ((count 0)) (when (or (minusp count) (> count (length *format-original-arguments*))) (format-error "Illegal to go to non-existant argument")) (setq *format-arguments* - (nthcdr count *format-original-arguments*))) - (colon + (nthcdr count *format-original-arguments*)))) + (colon + (with-format-parameters parms ((count 1)) (let ((cdrs (- (length (the list *format-original-arguments*)) (length (the list *format-arguments*)) count))) (if (minusp cdrs) (format-error "Skip to nonexistant argument") (setq *format-arguments* - (nthcdr cdrs *format-original-arguments*))))) - (t + (nthcdr cdrs *format-original-arguments*)))))) + (t + (with-format-parameters parms ((count 1)) (if (> count (length *format-arguments*)) (format-error "Skip to nonexistant argument") (setq *format-arguments* (nthcdr count *format-arguments*))))))) @@ -917,12 +919,12 @@ (defun format-princ (colon atsign parms) (let ((arg (pop-format-arg))) (if (null parms) - (if (or arg (not colon)) (princ arg) (write-string "()")) + (if arg (princ arg) (write-string (if colon "()" "NIL"))) (with-format-parameters parms ((mincol 0) (colinc 1) (minpad 0) (padchar #\space)) - (format-write-field (if (or arg (not colon)) + (format-write-field (if arg (princ-to-string arg) - "()") + (if colon "()" "NIL")) mincol colinc minpad padchar atsign))))) @@ -932,12 +934,12 @@ (defun format-prin1 (colon atsign parms) (let ((arg (pop-format-arg))) (if (null parms) - (if (or arg (not colon)) (prin1 arg) (write-string "()")) + (if arg (prin1 arg) (write-string (if colon "()" "NIL"))) (with-format-parameters parms ((mincol 0) (colinc 1) (minpad 0) (padchar #\space)) - (format-write-field (if (or arg (not colon)) + (format-write-field (if arg (prin1-to-string arg) - "()") + (if colon "()" "NIL")) mincol colinc minpad padchar atsign))))) -- GitLab