commit 338452aadd68f7593fce6d6d4e1467ef7450dcf6 parent f3172826096a906524dbe8f292a5210ad6d0bb62 Author: Stephen Chang <stchang@ccs.neu.edu> Date: Tue, 19 May 2015 18:58:05 -0400 tapl: add lam-testing example Diffstat:
| A | tapl/lam-testing.rkt | | | 23 | +++++++++++++++++++++++ |
| D | tapl/stlc-tests.rkt | | | 2 | -- |
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/tapl/lam-testing.rkt b/tapl/lam-testing.rkt @@ -0,0 +1,22 @@ +#lang racket +(require (for-syntax syntax/parse)) +(require (for-meta 2 racket/base)) +(provide #%module-begin #%top-interaction #%app #%datum) +(provide (rename-out [lam/tc λ])) + +(define-syntax (lam/tc stx) + (syntax-parse stx + [(_ (x y) e) + #:with + (lam xs (lr bs1 vs1 (lr2 bs2 vs2 e+))) + (local-expand + #'(λ (x y) + (let-syntax +; ([x (λ (sx) (syntax-parse sx [z:id (syntax-property #'y 'type 100)]))]) + ([x (make-rename-transformer (syntax-property #'x 'type 100))]) + e)) + 'expression + null) + #:when (printf "~a\n" #'e+) + #:when (printf "~a\n" (syntax-property #'e+ 'type)) + #'(λ xs e+)])) +\ No newline at end of file diff --git a/tapl/stlc-tests.rkt b/tapl/stlc-tests.rkt @@ -1 +0,0 @@ -#lang s-exp "stlc.rkt" -\ No newline at end of file