commit 01799a12da456293e82f39cc46a6dc2808971a6b
parent 3d9ef8424cbb2d30eeb726893cb6211be3c04f4b
Author: Stephen Chang <stchang@ccs.neu.edu>
Date: Tue, 21 Mar 2017 17:55:45 -0400
add with-ctx shorthand
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/macrotypes/typecheck.rkt b/macrotypes/typecheck.rkt
@@ -757,6 +757,11 @@
(define current-tag (make-parameter (type-key1))))
;; type assignment utilities --------------------------------------------------
+(define-simple-macro (with-ctx ([x x- ty] ...) e ...)
+ (let-syntax
+ ([x (make-variable-like-transformer (assign-type #'x- #'ty))] ...)
+ e ...))
+
(define-syntax (let*-syntax stx)
(syntax-parse stx
[(_ () . body) #'(let-syntax () . body)]