(format-error-offset condition)))
\f
(def!struct format-directive
- (string (required-argument) :type simple-string)
- (start (required-argument) :type (and unsigned-byte fixnum))
- (end (required-argument) :type (and unsigned-byte fixnum))
- (character (required-argument) :type base-char)
+ (string (missing-arg) :type simple-string)
+ (start (missing-arg) :type (and unsigned-byte fixnum))
+ (end (missing-arg) :type (and unsigned-byte fixnum))
+ (character (missing-arg) :type base-char)
(colonp nil :type (member t nil))
(atsignp nil :type (member t nil))
(params nil :type list))
(error
'format-error
:complaint
- "too many parameters, expected no more than ~D"
+ "too many parameters, expected no more than ~W"
:arguments (list ,(length specs))
:offset (caar ,params)))
,,@body)))
:complaint "no previous argument"))
(caar *simple-args*))
(t
+ (/show0 "THROWing NEED-ORIG-ARGS from tilde-P")
(throw 'need-orig-args nil)))))
(if atsignp
`(write-string (if (eql ,arg 1) "y" "ies") stream)
"both colon and atsign modifiers used simultaneously")
(expand-bind-defaults ((posn 0)) params
(unless *orig-args-available*
+ (/show0 "THROWing NEED-ORIG-ARGS from tilde-@*")
(throw 'need-orig-args nil))
`(if (<= 0 ,posn (length orig-args))
(setf args (nthcdr ,posn orig-args))
(error 'format-error
- :complaint "Index ~D out of bounds. Should have been ~
- between 0 and ~D."
+ :complaint "Index ~W out of bounds. Should have been ~
+ between 0 and ~W."
:arguments (list ,posn (length orig-args))
:offset ,(1- end)))))
(if colonp
(expand-bind-defaults ((n 1)) params
(unless *orig-args-available*
+ (/show0 "THROWing NEED-ORIG-ARGS from tilde-:*")
(throw 'need-orig-args nil))
`(do ((cur-posn 0 (1+ cur-posn))
(arg-ptr orig-args (cdr arg-ptr)))
(setf args (nthcdr new-posn orig-args))
(error 'format-error
:complaint
- "Index ~D is out of bounds; should have been ~
- between 0 and ~D."
+ "Index ~W is out of bounds; should have been ~
+ between 0 and ~W."
:arguments
(list new-posn (length orig-args))
:offset ,(1- end)))))))
(expand-bind-defaults () params
`(handler-bind
((format-error
- #'(lambda (condition)
- (error 'format-error
- :complaint
- "~A~%while processing indirect format string:"
- :arguments (list condition)
- :print-banner nil
- :control-string ,string
- :offset ,(1- end)))))
+ (lambda (condition)
+ (error 'format-error
+ :complaint
+ "~A~%while processing indirect format string:"
+ :arguments (list condition)
+ :print-banner nil
+ :control-string ,string
+ :offset ,(1- end)))))
,(if atsignp
(if *orig-args-available*
`(setf args (%format stream ,(expand-next-arg) orig-args args))
(if *orig-args-available*
`((handler-bind
((format-error
- #'(lambda (condition)
- (error 'format-error
- :complaint
- "~A~%while processing indirect format string:"
- :arguments (list condition)
- :print-banner nil
- :control-string ,string
- :offset ,(1- end)))))
+ (lambda (condition)
+ (error 'format-error
+ :complaint
+ "~A~%while processing indirect format string:"
+ :arguments (list condition)
+ :print-banner nil
+ :control-string ,string
+ :offset ,(1- end)))))
(setf args
(%format stream inside-string orig-args args))))
(throw 'need-orig-args nil))
(line-len '(or (sb!impl::line-length stream) 72)))
(format-directive-params first-semi)
`(setf extra-space ,extra line-len ,line-len))))
- ,@(mapcar #'(lambda (segment)
- `(push (with-output-to-string (stream)
- ,@(expand-directive-list segment))
- segments))
+ ,@(mapcar (lambda (segment)
+ `(push (with-output-to-string (stream)
+ ,@(expand-directive-list segment))
+ segments))
segments))
(format-justification stream
,@(if newline-segment-p
;;;; format directive and support function for user-defined method
(def-format-directive #\/ (string start end colonp atsignp params)
- (let ((symbol (extract-user-function-name string start end)))
+ (let ((symbol (extract-user-fun-name string start end)))
(collect ((param-names) (bindings))
(dolist (param-and-offset params)
(let ((param (cdr param-and-offset)))
(,symbol stream ,(expand-next-arg) ,colonp ,atsignp
,@(param-names))))))
-(defun extract-user-function-name (string start end)
+(defun extract-user-fun-name (string start end)
(let ((slash (position #\/ string :start start :end (1- end)
:from-end t)))
(unless slash