[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: define-macro syntax error
From: |
Daniel Hartwig |
Subject: |
Re: define-macro syntax error |
Date: |
Tue, 12 Feb 2013 16:20:18 +0800 |
On 12 February 2013 16:15, Akop Pogosian <address@hidden> wrote:
> I am having problems getting simple define-macro to work in Guile 2.
>
> For example, this:
>
> (define-macro when
> (lambda (test . branch)
> `(if ,test
> (begin ,@branch))))
> What's wrong here?
>
This is not the right syntax. From the manual:
> (define-macro (NAME ARGS ...) BODY ...)
so, in your case:
(define-macro (when test . branch)
`(if ,test
(begin ,@branch)))
Regards