chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Macro that changes the structure


From: Daniel Sadilek
Subject: [Chicken-users] Macro that changes the structure
Date: Wed, 13 Jun 2007 14:28:55 +0200

Hello all,

I'm stuck with the following problem. I want a macro that called this way:

(testsyntax
((a 1 2)
 (b 3 4)))

Returns this:

(((a 1) (a 2))
((b 3) (b 4)))

My bet was:

(define-syntax testsyntax
 (syntax-rules ()
   ((_ ((char digit ...)
        ...))
    '(((char digit) ...)
      ...)))))

But this macro returns:

(((a 1) (b 2))
((a 3) (b 4)))

Notice the difference in the characters. The ellipsis just doesn't do
what I want ;)

Can be accomplished what I want with define-syntax? Or do I have to
use defmacro?

Best regards
Daniel Sadilek




reply via email to

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