[racket] beginner question about macros

From: Răzvan Rotaru (razvan.rotaru at gmail.com)
Date: Sun Dec 4 10:41:48 EST 2011

Hi,

I currently learning scheme macros, and trying to figure out how to do
two particulars things:

1/
(my-macro a 1 b 2 c 3)

should generate:

(let ((x foo))
    (a 1 x)
    (b 2 x)
    (c 3 x))


The order is important.

2/
I need to transform somehow the symbols:

(my-macro a 1 b 2 c 3)

should generate:

(let ((x foo))
    (new-a 1 x)
    (second-b 2 x)
    (another-c 3 x))

I'd like to ask for some hints about how to achieve these two goals.
I'm currently not able to decide whether to use syntax-rules or
syntax-case.

Thanks,
Razvan


Posted on the users mailing list.