On Wed, Dec 04, 2013 at 02:52:10PM +0100, Panicz Maciej Godek wrote:
> This looks like a job for a macro!
> 
> (define-macro (define-test-function)
>   `(define (test-function)
>      ,(load "external.scm")
>      x))
> 
> (define-test-function)
> 
> (test-function)
> ; ==> 3

No  - this doesn't solve the OP's question.
Even with your macro, x is still defined in 
the toplevel. Try this:

(display (test-function)) 
(display x)  ; visible from the toplevel
(set! x 42)
(display (test-function)) ; Outsch!

Cheers, Ralf Mattes



Reply via email to