~ chicken-core (chicken-5) 9d4af2a7375fae0aeb5bc3fe869cd180e433e867


commit 9d4af2a7375fae0aeb5bc3fe869cd180e433e867
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Tue May 17 14:07:33 2011 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Wed May 18 04:28:26 2011 -0400

    proper check in extended llist (thanks to sjamaan)

diff --git a/expand.scm b/expand.scm
index e4387532..12af83a2 100644
--- a/expand.scm
+++ b/expand.scm
@@ -416,7 +416,7 @@
 			       [(1) (loop 1 req (cons (list var #f) opt) '() r)]
 			       [(2) (err "invalid lambda list syntax after `#!rest' marker")]
 			       [else (loop 3 req opt (cons (list var) key) r)] ) ]
-			    [(and (list? var) (eq? 2 (length var)))
+			    [(and (list? var) (eq? 2 (length var)) (symbol? (car var)))
 			     (case mode
 			       [(0) (err "invalid required argument syntax")]
 			       [(1) (loop 1 req (cons var opt) '() r)]
diff --git a/tests/syntax-tests.scm b/tests/syntax-tests.scm
index 4307f008..ca80ec87 100644
--- a/tests/syntax-tests.scm
+++ b/tests/syntax-tests.scm
@@ -440,6 +440,10 @@
   (import scheme chicken)
   ((lambda (#!key string) (assert (not string))))) ; refered to R5RS `string'
 
+;;; Missing check for keyword and optional variable types in DSSSL llists
+
+(f (eval '(lambda (foo #!key (0 1)) x)))
+(f (eval '(lambda (foo #!optional (0 1)) x)))
 
 ;;; compiler didn't resolve expansion into local variable
 ;;; (reported by Alex Shinn, #15)
Trap