Here is a superficial fly-by of the forms used to define macros in
some Lisp systems I know of.
I'm trying to decide on a syntax for my Skimp's unhygienic macro system.
Ignoring the standardised hygienic macros of R6RS Scheme and R5RS Scheme for now (one step at a time), and also putting aside local macros definitions (let-syntax etc), I have tracked down the following plain old global unhygienic macro syntaxes.
| MacLisp | (defmacro name (arguments...) body...) |
arguments can include &optional, &rest, &aux which behave as they do in the lambda-list of defun; also &whole is for capturing the entire macro form as a list. |
| Emacs Lisp | (defmacro name (arguments...) body...) |
arguments can include &optional and &rest. |
| Common Lisp | (defmacro name (arguments...) body...) |
arguments can include &optional, &rest, &aux, &key, &environment, &whole and &kitchen-sink, and nested lists can be used to destructure nested argument lists; this seems to be the defmacro de luxe. |
| Guile Scheme | (defmacro name (arguments... [. rest]) body...) |
This this style echos traditional Lisps, though without the magic keywords. |
(define-macro (name arguments... [. rest]) body...) |
This alternative style is more schemely and mirrors the function definition syntax. | |
| Chicken Scheme | (define-macro (name arguments... [. rest]) body...) |
Same as Guile's define-macro. |
(define-macro name (lambda (arguments... [. rest]) body...)) |
This style is provide 'for compatibility purposes only'. | |
(define-macro new-name existing-name) |
Aliases an existing macro. | |
| Gambit-C Scheme | (define-macro (name arguments... [. rest]) body...) |
Same as other define-macros, with a funky #!optional marker for arguments. |
| Bigloo Scheme | (define-macro (name arguments... [. rest]) body...) |
Ok this is starting to look like the established convention. |
| MzScheme | (defmacro name (arguments... [. rest]) body...) |
Another traditional style defmacro, available through the module (require mzlib/defmacro) |
(define-macro (name arguments... [. rest]) body...) |
Another define-macro, available through the module (require mzlib/defmacro) |
I could keep looking but I think it's pretty clear that define-macro is the style I should go for...