Use strip-context instead of replace-context in reader. Now functions in bracket-lang.rkt can be used in Bracket files

This commit is contained in:
Jens Axel Søgaard 2012-07-04 19:45:50 +02:00
parent 553318ffd0
commit b99935f357
3 changed files with 8 additions and 8 deletions

View File

@ -7,11 +7,10 @@
(submod "bracket.rkt" bracket)
"unparse.rkt")
(provide (for-syntax #%module-begin)
#%module-begin)
(provide (all-from-out racket)
unparse)
(provide (all-defined-out)
(for-syntax #%module-begin)
#%module-begin)
(define-syntax (DeclareVars stx)
(syntax-case stx ()
@ -19,3 +18,5 @@
#'(begin
(define sym 'sym) ...
(set! sym 'sym) ...)]))
(provide (all-defined-out))

View File

@ -24,7 +24,7 @@ NestList(f,expr,n):=if(n=0, List(expr), Cons(expr, NestList(f,f(expr),n-1)));
% Use it!
NestList(next,x0,7);
% NestList also works symbolically.
%DeclareVars(g,x);
%NestList(g,x,5);
DeclareVars(g,x);
NestList(g,x,5);
% We can get the first approximations as symbolical expressions. Not pretty.
%NestList(next,x,2);
NestList(next,x,2);

View File

@ -50,8 +50,7 @@
(build-path base "../bracket.rkt"))))]
[module-name (generate-temporary "main")])
(syntax-property
(replace-context #'here
;strip-context
(strip-context ; reason: see read docs on read-syntax
#'(module module-name bracket/bracket-lang
(require (submod (file bracket.rkt) bracket)
(submod (file bracket.rkt) symbolic-application))