fix let/ec: and let/cc:

svn: r18000

original commit: bf77c690f4d1a97fb530ea23602bf590f32f2479
This commit is contained in:
Sam Tobin-Hochstadt 2010-02-05 23:00:07 +00:00
parent f3030b5775
commit 40b9514197
3 changed files with 10 additions and 3 deletions

View File

@ -14,6 +14,13 @@
#:with ty (syntax-property #'name 'type-label)
#:with ann-name #'name))
(define-splicing-syntax-class (param-annotated-name trans)
#:attributes (name ty ann-name)
#:description "type-annotated identifier"
#:literals (:)
(pattern [~seq name:id : ty]
#:with ann-name (syntax-property #'name 'type-label (trans #'ty))))
(define-syntax-class annotated-binding
#:attributes (name ty ann-name binding rhs)
(pattern (~and whole [:annotated-name rhs:expr])

View File

@ -340,6 +340,6 @@ This file defines two sorts of primitives. All of them are provided into any mod
(let ()
(define ((mk l/c) stx)
(syntax-parse stx
[(_ k:annotated-name . body)
(quasisyntax/loc stx (#,l/c k.name . body))]))
[(_ (~var k (param-annotated-name (lambda (s) #`(#,s -> (U))))) . body)
(quasisyntax/loc stx (#,l/c k.ann-name . body))]))
(values (mk #'let/cc) (mk #'let/ec))))

View File

@ -132,7 +132,7 @@ result of @scheme[_loop] (and thus the result of the entire
@deftogether[[
@defform[(let/cc: v : t . body)]
@defform[(let/ec: v : t . body)]]]{Type-annotated versions of
@scheme[let/cc] and @scheme[let/ec].}
@scheme[let/cc] and @scheme[let/ec]. @scheme[t] is the type that will be provided to the continuation @scheme[v].}
@subsection{Anonymous Functions}