From 40b9514197f8da64918f6960f74eb105cbca27fc Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 5 Feb 2010 23:00:07 +0000 Subject: [PATCH] fix let/ec: and let/cc: svn: r18000 original commit: bf77c690f4d1a97fb530ea23602bf590f32f2479 --- collects/typed-scheme/private/annotate-classes.ss | 7 +++++++ collects/typed-scheme/private/prims.ss | 4 ++-- collects/typed-scheme/ts-reference.scrbl | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/collects/typed-scheme/private/annotate-classes.ss b/collects/typed-scheme/private/annotate-classes.ss index 09b369d6..0264868d 100644 --- a/collects/typed-scheme/private/annotate-classes.ss +++ b/collects/typed-scheme/private/annotate-classes.ss @@ -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]) diff --git a/collects/typed-scheme/private/prims.ss b/collects/typed-scheme/private/prims.ss index 6d91e099..81f9e014 100644 --- a/collects/typed-scheme/private/prims.ss +++ b/collects/typed-scheme/private/prims.ss @@ -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)))) diff --git a/collects/typed-scheme/ts-reference.scrbl b/collects/typed-scheme/ts-reference.scrbl index 3e7731dc..9ad4989c 100644 --- a/collects/typed-scheme/ts-reference.scrbl +++ b/collects/typed-scheme/ts-reference.scrbl @@ -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}