guile-user
[Top][All Lists]
Advanced

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

Re: macros, procedure->macro


From: Clinton Ebadi
Subject: Re: macros, procedure->macro
Date: Fri, 12 Jul 2002 22:36:56 -0400
User-agent: KMail/1.4.2

On Friday 12 July 2002 20:09, 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?

Just use r5rs macros:
(use-modules (ice-9 syncase))
(define-syntax foo (syntax-rules () ((foo x) (list (bar x) x))))
(define-syntax bar (syntax-rules () ((bar x) (* x x))))

guile> (foo 5)
(25 5)

-- 
http://unknownlamer.org
Facts do not cease to exist because they are ignored.
                -- Aldous Huxley
Flag Burner.



reply via email to

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