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

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Nov 15 07:34:26 EST 2005

Then you need to push those if-eqs into the patterns (or fenders) of 
the syntax definitions. -- Matthias


On Nov 15, 2005, at 2:26 AM, Hans Oesterholt wrote:

> 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.