[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems with with-syntax
Robert Bruce Findler writes:
> You can define helper functions inside the define-syntax:
>
> (define-syntax (m stx)
> (define (helper x) ...)
> (syntax-case stx ()
> [(... y ...) (helper (syntax y))]))
>
> and the define-syntaxes form helps if you want to define multiple
> macros that share helper functions.
Yeah, I figured out that that would work (although I had forgotten
about define-syntaxes-- shouldn't that be define-syntaces? no, I guess
that rule is only for -ex). But I defined the syntax helper function
at the top level so I could test it interactively, by building up
syntax objects and then running them through the helper function to
make sure it was doing the right thing. Sure, once I got it working I
should have moved it into the body of the define-syntax, but I found
it surprising that it made a difference.
--dougo@ccs.neu.edu