tapl: add lam-testing example

This commit is contained in:
Stephen Chang 2015-05-19 18:58:05 -04:00
parent f317282609
commit 338452aadd
2 changed files with 22 additions and 1 deletions

22
tapl/lam-testing.rkt Normal file
View File

@ -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+)]))

View File

@ -1 +0,0 @@
#lang s-exp "stlc.rkt"