Commit 7a42065f authored by Attila Lendvai's avatar Attila Lendvai

Fix issue #2: parse-ordinary-lambda-list &key and &optional normalization.

Based on Kyle Littler's patch.
parent e88c1833
...@@ -184,8 +184,10 @@ Signals a PROGRAM-ERROR is the lambda-list is malformed." ...@@ -184,8 +184,10 @@ Signals a PROGRAM-ERROR is the lambda-list is malformed."
(check-variable name "optional parameter") (check-variable name "optional parameter")
(cond ((cdr tail) (cond ((cdr tail)
(check-spec tail "optional-supplied-p parameter")) (check-spec tail "optional-supplied-p parameter"))
((and normalize-optional tail)
(setf elt (append elt '(nil))))
(normalize-optional (normalize-optional
(setf elt (append elt '(nil))))))) (setf elt (append elt '(nil nil)))))))
(t (t
(check-variable elt "optional parameter") (check-variable elt "optional parameter")
(when normalize-optional (when normalize-optional
...@@ -209,10 +211,12 @@ Signals a PROGRAM-ERROR is the lambda-list is malformed." ...@@ -209,10 +211,12 @@ Signals a PROGRAM-ERROR is the lambda-list is malformed."
(check-variable var-or-kv "keyword parameter") (check-variable var-or-kv "keyword parameter")
(when normalize-keyword (when normalize-keyword
(setf var-or-kv (list (make-keyword var-or-kv) var-or-kv))))) (setf var-or-kv (list (make-keyword var-or-kv) var-or-kv)))))
(if (cdr tail) (cond ((cdr tail)
(check-spec tail "keyword-supplied-p parameter") (check-spec tail "keyword-supplied-p parameter"))
(when normalize-keyword ((and normalize-keyword tail)
(setf tail (append tail '(nil))))) (setf tail (append tail '(nil))))
(normalize-keyword
(setf tail '(nil nil))))
(setf elt (cons var-or-kv tail)))) (setf elt (cons var-or-kv tail))))
(t (t
(check-variable elt "keyword parameter") (check-variable elt "keyword parameter")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment