[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with with-syntax



Quoting Doug Orleans:
> Would it be reasonable to ask for a "define-for-syntax" form?  Or
> maybe call it "define-syntax-helper"?  I know I should be using
> modules, but so far my program is fairly simple, with just top-level
> definitions.

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.

Robby