Passed through to PARSE-LAMBDA-LIST-LIKE, used by %SPLIT-ARGLIST in PCL.
Prior to this GENERIC-FUNCTION-PRETTY-ARGLIST on functions with both
&OPTIONAL and &KEY arguments caused a style-warning -- and inquiring about
the lambda-list isn't the right time for that.
* bug fix: FORMAT now handles floating point rounding correct, eg.
(format nil "~,1F" 0.01) => "0.0" instead of "0.01" as previously.
(lp#308961)
+ * bug fix: style warning during lambda-list introspection of generic
+ functions with both optional and key argments.
changes in sbcl-1.0.49 relative to sbcl-1.0.48:
* minor incompatible change: WITH-LOCKED-HASH-TABLE no longer disables
(values list list boolean t boolean list boolean
boolean list boolean t t boolean))
parse-lambda-list-like-thing))
-(declaim (ftype (sfunction (list)
+(declaim (ftype (sfunction (list &key (:silent boolean))
(values list list boolean t boolean list boolean
boolean list boolean t t))
parse-lambda-list))
;;; can barf on things which're illegal as arguments in lambda lists
;;; even if they could conceivably be legal in not-quite-a-lambda-list
;;; weirdosities
-(defun parse-lambda-list (lambda-list)
+(defun parse-lambda-list (lambda-list &key silent)
;; Classify parameters without checking their validity individually.
(multiple-value-bind (required optional restp rest keyp keys allowp auxp aux
morep more-context more-count)
- (parse-lambda-list-like-thing lambda-list)
+ (parse-lambda-list-like-thing lambda-list :silent silent)
;; Check validity of parameters.
(flet ((need-symbol (x why)
;; PARSE-LAMBDA-LIST to something handier.
(multiple-value-bind (required optional restp rest keyp keys allowp
auxp aux morep more-context more-count)
- (parse-lambda-list lambda-list)
+ (parse-lambda-list lambda-list :silent t)
(declare (ignore restp keyp auxp aux morep))
(declare (ignore more-context more-count))
(values required optional rest keys allowp)))
(check-type req integer))))
(assert (= warnings 1))))
+(defgeneric generic-function-pretty-arglist-optional-and-key (req &optional opt &key key)
+ (:method (req &optional opt &key key)
+ (list req opt key)))
+(with-test (:name :generic-function-pretty-arglist-optional-and-key)
+ (handler-bind ((warning #'error))
+ ;; Used to signal a style-warning
+ (assert (equal '(req &optional opt &key key)
+ (sb-pcl::generic-function-pretty-arglist
+ #'generic-function-pretty-arglist-optional-and-key)))))
;;;; success