On 12 February 2013 16:15, Akop Pogosian <apogos...@gmail.com> 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

Reply via email to