[plt-scheme] Problem with a macro inside a module

From: Jean-Guillaume Pyraksos (jeapy at free.fr)
Date: Thu Jul 3 11:06:00 EDT 2003

; In a file foo.ss i have the following module:

(module foo mzscheme
   (provide double!)

   (define-syntax double!
     (syntax-rules ()
       ((double! x) (set! x (* x 2)))))

   (printf "Module foo loaded !~n"))

; If in the same file i have also:

(require foo)
(define x 1)
(double! x)
x

; then when evaluating the file it works ok, giving 2.

; Now, if i save only the module foo in the file and if i type in 
another toplevel window:

(require (file "~/Documents/Scheme/foo.ss"))
(define x 1)
(double! x)
x

; then it says "identifier double! is not defined". why is the world so 
complicated ?
; thanks for your help.



Posted on the users mailing list.