From aef37edae4fdeea89960bdaff6abe7d474e91218 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Fri, 31 Jan 2014 12:30:10 -0500 Subject: [PATCH] Incorporate PR feedback --- .../typed-racket/base-env/prims.rkt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/prims.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/prims.rkt index c9bdc5bc18..c0ba61f476 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/prims.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/prims.rkt @@ -61,6 +61,7 @@ This file defines two sorts of primitives. All of them are provided into any mod (for-syntax racket/lazy-require syntax/parse + syntax/parse/experimental/template syntax/stx racket/list racket/syntax @@ -1178,16 +1179,11 @@ This file defines two sorts of primitives. All of them are provided into any mod #:literals (:) (pattern (mand:mand-formal ... opt:opt-formal ... . rest:rest-arg) #:attr kw-property - (> (length (append (filter values (attribute mand.kw)) - (filter values (attribute opt.kw)))) - 0) - #:attr req-len (length (attribute mand)) - #:attr opt-len (length (attribute opt)) + (ormap values (append (attribute mand.kw) (attribute opt.kw))) #:attr opt-property - (list (attribute req-len) (attribute opt-len)) - #:attr erased #`(#,@(apply append (stx-map syntax->list #'(mand.form ...))) - #,@(apply append (stx-map syntax->list #'(opt.form ...))) - . rest.form)))) + (list (length (attribute mand)) (length (attribute opt))) + #:attr erased + (template ((?@ . mand.form) ... (?@ . opt.form) ... . rest.form))))) ;; annotation to help tc-expr pick out keyword functions