re-fix error when keywords missing in app; fix defn to allow non-keyword args withotu default after keyword args

svn: r8140
This commit is contained in:
Matthew Flatt 2007-12-27 16:49:27 +00:00
parent bd260e132e
commit d2aa4f610b
2 changed files with 8 additions and 4 deletions

View File

@ -338,7 +338,11 @@
#'rest)]
[rest-empty (if (null? (syntax-e #'rest))
'()
'(null))])
'(null))]
[fail-rest (if (null? (syntax-e #'rest))
'(null)
#'rest)])
(let ([with-core
(lambda (result)
;; body of procedure, where all keyword and optional
@ -402,7 +406,7 @@
;; struct-type entry point for no keywords when a keyword is required
(syntax/loc stx
(fail-opt-cases (missing-kw) (opt-id ...) (self plain-id ...)
() (rest-id . rest)
() (rest-id . fail-rest)
())))])
(cond
[(null? kws)

View File

@ -89,13 +89,13 @@
(identifier? #'id))
(begin
(check-kw #'kw)
(cons #'id (loop #'more #t)))]
(cons #'id (loop #'more need-def?)))]
[(kw [id def-expr] . more)
(and (keyword? (syntax-e #'kw))
(identifier? #'id))
(begin
(check-kw #'kw)
(cons #'id (loop #'more #t)))]
(cons #'id (loop #'more need-def?)))]
[(kw . more)
(keyword? (syntax-e #'kw))
(raise-syntax-error #f