Simplify expansion of pdefine: and define:

original commit: 6c716759d7e172bf1a092e584c56a56da778a0a8
This commit is contained in:
Asumu Takikawa 2012-12-13 14:54:20 -05:00
parent e1799227f0
commit a13b354d96

View File

@ -340,8 +340,9 @@ This file defines two sorts of primitives. All of them are provided into any mod
[(pdefine: (tvars:id ...) (nm:id . formals:annotated-formals) : ret-ty . body)
(with-syntax ([type (syntax/loc #'ret-ty (All (tvars ...) (formals.arg-ty ... -> ret-ty)))])
(syntax/loc stx
(define: nm : type
(plambda: (tvars ...) formals . body))))]))
(begin
(: nm : type)
(define (nm . formals.ann-formals) . body))))]))
(define-syntax (ann stx)
(syntax-parse stx #:literals (:)
@ -372,8 +373,9 @@ This file defines two sorts of primitives. All of them are provided into any mod
[(define: (tvars:id ...) (nm:id . formals:annotated-formals) : ret-ty body ...)
(with-syntax ([type (syntax/loc #'ret-ty (All (tvars ...) (formals.arg-ty ... -> ret-ty)))])
(syntax/loc stx
(define: nm : type
(plambda: (tvars ...) formals body ...))))]))
(begin
(: nm : type)
(define (nm . formals.ann-formals) body ...))))]))
(define-syntax (lambda: stx)
(syntax-parse stx