[plt-scheme] syntax form works in top-level env, but not when imported from module.

From: Hans Oesterholt (hdnews at gawab.com)
Date: Tue Nov 15 02:26:37 EST 2005

You're right of course.
But look:

(define-syntax pexpr-all-op
 (syntax-rules ()
   ((_ op)
    (if (eq? 'op 'all)
    (lambda () 'op)
    (lambda () op)))))

When I use:

(psearch (all ('a-class)))

pexpr-all-op will be expanded:

(pexpr-all-op all)
:
(if (eq? 'all 'all) (lambda () 'all) (lambda () all))
-->
(lambda () 'all)

When I use:

(psearch (my-variable-holding-the-wanted-operation ('a-class)))
:
(if (eq? 'my-variable-holding-the-wanted-operation 'all) (lambda () 
'my-variable-holding-the-wanted-operation) (lambda () 
my-variable-holding-the-wanted-operation))
-->
(lambda () my-variable-holding-the-wanted-operation)



Matthias Felleisen schreef:

>
> On Nov 14, 2005, at 3:50 PM, Hans Oesterholt wrote:
>
>> As you can see. "all" and "like" are free variables.
>
>
> I just see them as symbols, like this: 'all and 'like. -- Matthias
>



Posted on the users mailing list.