I found a solution:

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

Are there more elegant solutions? ;)

On 6/13/07, Daniel Sadilek <[EMAIL PROTECTED]> wrote:
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



_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to