~ chicken-core (chicken-5) 197fb6f88746d780166ff37e37a6cda2d6456546
commit 197fb6f88746d780166ff37e37a6cda2d6456546 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: Tue May 17 14:07:33 2011 +0200 proper check in extended llist (thanks to sjamaan) diff --git a/expand.scm b/expand.scm index 150445df..fecf0c53 100644 --- a/expand.scm +++ b/expand.scm @@ -386,7 +386,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