[plt-scheme] Syntax and eval/load

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Tue Dec 5 18:15:56 EST 2006


Can anyone point me towards some tutorial introduction to the  
relationship between syntax and LOAD (or EVAL)?

I'm OK calling EVAL in the context of an environment extended with  
miscellaneous procedures, but syntax doesn't go by the same rules.

I can see why it's broadly reasonable that

     (define-syntax foo (syntax-rules ...))
     (load <something using FOO>)

doesn't work (and similar expressions using EVAL), though I'd be very  
hard pressed to deduce that from R5RS.

I can see that namespaces are involved (thinking specifically of  
mzscheme), but sections 14.1 and 7.9.1 of the language manual have a  
(require clue) in front of them, and my gung-ho experiments using

     (let ((ns (make-namespace)))
       (parameterize ((current-namespace ns))
         (define-syntax foo (syntax-rules ...))
         (load <something using FOO>)))

came to naught (not to my great surprise; if they had worked I'd have  
been even more confused).

So is there a syntax-for-the-hard-of-thinking intro anywhere, that  
could make these wonderfully transparent for me, or is it simply  
going to have to be head-first into chapter 8, and don't spare the  

Thanks for any pointers.  All the best,


Norman Gray  /  http://nxg.me.uk
eurovotech.org  /  University of Leicester, UK

Posted on the users mailing list.