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:
parent
553318ffd0
commit
b99935f357
|
@ -7,11 +7,10 @@
|
||||||
(submod "bracket.rkt" bracket)
|
(submod "bracket.rkt" bracket)
|
||||||
"unparse.rkt")
|
"unparse.rkt")
|
||||||
|
|
||||||
|
(provide (for-syntax #%module-begin)
|
||||||
|
#%module-begin)
|
||||||
(provide (all-from-out racket)
|
(provide (all-from-out racket)
|
||||||
unparse)
|
unparse)
|
||||||
(provide (all-defined-out)
|
|
||||||
(for-syntax #%module-begin)
|
|
||||||
#%module-begin)
|
|
||||||
|
|
||||||
(define-syntax (DeclareVars stx)
|
(define-syntax (DeclareVars stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
|
@ -19,3 +18,5 @@
|
||||||
#'(begin
|
#'(begin
|
||||||
(define sym 'sym) ...
|
(define sym 'sym) ...
|
||||||
(set! sym 'sym) ...)]))
|
(set! sym 'sym) ...)]))
|
||||||
|
|
||||||
|
(provide (all-defined-out))
|
|
@ -24,7 +24,7 @@ NestList(f,expr,n):=if(n=0, List(expr), Cons(expr, NestList(f,f(expr),n-1)));
|
||||||
% Use it!
|
% Use it!
|
||||||
NestList(next,x0,7);
|
NestList(next,x0,7);
|
||||||
% NestList also works symbolically.
|
% NestList also works symbolically.
|
||||||
%DeclareVars(g,x);
|
DeclareVars(g,x);
|
||||||
%NestList(g,x,5);
|
NestList(g,x,5);
|
||||||
% We can get the first approximations as symbolical expressions. Not pretty.
|
% We can get the first approximations as symbolical expressions. Not pretty.
|
||||||
%NestList(next,x,2);
|
NestList(next,x,2);
|
||||||
|
|
|
@ -50,8 +50,7 @@
|
||||||
(build-path base "../bracket.rkt"))))]
|
(build-path base "../bracket.rkt"))))]
|
||||||
[module-name (generate-temporary "main")])
|
[module-name (generate-temporary "main")])
|
||||||
(syntax-property
|
(syntax-property
|
||||||
(replace-context #'here
|
(strip-context ; reason: see read docs on read-syntax
|
||||||
;strip-context
|
|
||||||
#'(module module-name bracket/bracket-lang
|
#'(module module-name bracket/bracket-lang
|
||||||
(require (submod (file bracket.rkt) bracket)
|
(require (submod (file bracket.rkt) bracket)
|
||||||
(submod (file bracket.rkt) symbolic-application))
|
(submod (file bracket.rkt) symbolic-application))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user