guile-user
[Top][All Lists]
Advanced

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

Re: Please explain different macros


From: Marius Vollmer
Subject: Re: Please explain different macros
Date: 21 Apr 2001 14:54:56 +0200
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Neil Jerram <address@hidden> writes:

> >>>>> "Marius" == Marius Vollmer <address@hidden> writes:
> 
>     Marius> [... explanation of macros ...]
> 
> I hope you don't mind if I snarf all of these explanations for the
> reference manual?

No, of course not.  But let me add that I think that `acros' and
`macros' are obscure stuff and shouldn't be advertised too much.  For
`mmacros', the interface should be `defmacro' or `define-macro', but
we should in any case work on making `define-syntax' more attractive.
(People say `define-syntax' is slow.)

>     Marius> No, no, no.  defmacro and define-macro are both mmacro,
> 
> So, just to complete the puzzle, then, what's the difference between
> defmacro and define-macro?

`define-macro' is just

    (defmacro define-macro (name-and-args . body)
      `(defmacro ,(car name-and-args) ,(cdr name-and-args) ,@body))

that is, this

    (defmacro NAME (ARGS...) BODY...)

is the same as this

    (define-macro (NAME ARGS...) BODY...)

The difference is analogous to the difference between `defun' and
`define'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]