[Top][All Lists]

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

Re: macros, procedure->macro

From: Neil Jerram
Subject: Re: macros, procedure->macro
Date: 14 Jul 2002 16:23:10 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Dirk" == Dirk Herrmann <address@hidden> writes:

    Dirk> On 13 Jul 2002, Neil Jerram wrote:
    >> Thanks, that's helpful.  So we won't support references to a macro
    >> that is defined in a following top-level form, as in:
    >> (define-macro (foo x) `(list ,(bar x) ,x))
    >> (define-macro (bar x) `(* ,x ,x))
    >> or is there a cunning plan that still allows us to support this?

    Dirk> I don't see why recursive macros shouldn't be possible.

Well, because when the first `define-macro' form is read
(universally), macroexpanded (universally) and evaluated (with the
quasiquoted part protected from evaluation by an implicit lambda),
`bar' is not yet defined.

    Dirk> This, however, depends on the implementation of the macro
    Dirk> system used.

Yes (in practice), but it should depend first on our specification of
how it will work.  AFAICT, if the specification is that macroexpansion
is `universal' in the way that `read' is, the above example will _not_

    Dirk> However, there are things that won't work any more:
    Dirk>   (define (foo) (bar))
    Dirk>   (define-macro (bar) #f)
    Dirk>   (foo)

For the purposes of current discussion, I don't see the difference
between this example and my one above.  (Note that my `(bar x)' above
is unquoted, so equivalent to your `(bar)'.)  What do you intend to be
the key difference?  (Perhaps you meant `(define foo (bar))'?)


reply via email to

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