[plt-scheme] syntax form works in top-level env, but not when imported from module.
Matthias Felleisen schreef:
> Then you need to push those if-eqs into the patterns (or fenders) of
> the syntax definitions. -- Matthias
I'm confused, i.e., I don't understand the meaning of what you're writing.
Could you provide an example please?
Thank you in advance,
Hans
>
>
> 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
>>>
>>
>