[racket] define-syntax-rule/id

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Apr 19 08:00:48 EDT 2011

On Mon, Apr 18, 2011 at 2:42 PM, Jon Rafkind <rafkind at cs.utah.edu> wrote:
>             (with-syntax ([id (datum->syntax (car (syntax->list #'(arg ...)))
>                                              (string->symbol
>                                                (let ([arg (syntax-e #'arg)] ...)
>                                                  id-rename))
>                                              (car (syntax->list #'(arg ...))))])

This can all be replaced by:

(with-syntax ([id (format-id stx (let ([arg (syntax-e #'arg)] ..) id-rename))])
  (begin body ...))


-- 
sam th
samth at ccs.neu.edu



Posted on the users mailing list.