[racket] filtering syntax

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Jan 17 10:14:48 EST 2012

On Tue, Jan 17, 2012 at 4:06 AM, Marijn <hkBst at gentoo.org> wrote:
> On 16-01-12 15:28, Sam Tobin-Hochstadt wrote:
>> On Mon, Jan 16, 2012 at 7:57 AM, Marijn <hkBst at gentoo.org> wrote:
>>>
>>> ((_ ((id rule) ...)) (with-syntax (((dep ...) (free-vars (expand
>>> #'(rule ...)))))
>>
>> You need to use `local-expand', not `expand', here.  Probably like
>> this:
>>
>> (local-expand #'(rule ...) 'expression '())
>>
>
> If I use that instead I still get the same error. Perhaps it needs to
> be something like:
>
>  (local-expand #'(rule ...) 'expression '(id ...))
>
> but '(id ...) is not in the right form...

Ah, I see the problem.  You're trying to expand expressions with
unbound variables, and they give an expansion error as they should.
You might be able to use the stop list to make this work, but the
right solution is to bind the variables.
-- 
sam th
samth at ccs.neu.edu



Posted on the users mailing list.