From 5ea796cbcd4f7c9576cf5a23d621dd15c0617e9a Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sun, 15 May 2016 09:56:30 -0700 Subject: [PATCH] one more --- .../br/syntax-scopes-test-2.rkt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 beautiful-racket-lib/br/syntax-scopes-test-2.rkt diff --git a/beautiful-racket-lib/br/syntax-scopes-test-2.rkt b/beautiful-racket-lib/br/syntax-scopes-test-2.rkt new file mode 100644 index 0000000..82d68d5 --- /dev/null +++ b/beautiful-racket-lib/br/syntax-scopes-test-2.rkt @@ -0,0 +1,21 @@ +#lang br +(require (for-syntax br/syntax)) + +(begin-for-syntax + (define-scope blue)) + +(define #'(define-blue _id _expr) + (with-syntax ([_id (blue-binding-form #'_id)]) + #'(define _id _expr))) + +(define #'(blue _id) + (with-syntax ([_id (blue #'_id)]) + #'_id)) + +(define-syntax x:blue (make-rename-transformer (with-syntax ([x (blue #'x)]) + #'x))) + +(define-blue x (+ 42 42)) +(define y 50) + +(+ (blue x) y) \ No newline at end of file