From 01799a12da456293e82f39cc46a6dc2808971a6b Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Tue, 21 Mar 2017 17:55:45 -0400 Subject: [PATCH] add with-ctx shorthand --- macrotypes/typecheck.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macrotypes/typecheck.rkt b/macrotypes/typecheck.rkt index 0485c82..4ec3da2 100644 --- 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)]