You had the right idea, if you're using `syntax-rules`, but there were a few small problems:

---- BEGIN ----
#lang racket

(define-syntax mysyn
  (syntax-rules ()
    ((_ NAME ELEMENTn ...)
     (define (NAME)
       (display ELEMENTn) ...))))

(mysyn fun 1 2 3)

(fun)
---- END ----

But, if you expect to be doing more macro work in the future, you probably want to learn `syntax-case` instead of `syntax-rules`. (Because `syntax-rules` is an old legacy form that has some major restrictions that get too cumbersome for many nontrivial purposes. `syntax-case`, on the other hand, is much more powerful, and `syntax-case` also provides a smooth path to the crazy-awesome `syntax-rules`, once one is ready to not be too intimidated by `syntax-rules` documentation.)

Neil V.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to