Hi there,

I need a counterpart for the C #define statement, meaning a way to textually replace every instance of id at preprocessor time with its defined value, as in

#define ONE 1

unsigned int addone(unsigned int theArg)
{
    return (theArg + ONE);
}

I understand that Scheme's macro system is infinitely more powerful than C's, so obvious solutions like

(let-syntax [(ONE 1)]
   ((lambda (x) (+ ONE x))
    2))

won't work... so how do I do it? As a related question, what is the counterpart of C's enum as in

enum
{
    ZERO=0,
    ONE,
    TWO,
    THREE,
    <etc>
};

?

Thanks especially for your patience with my recurring stupid beginner's questions!


____________________
 Racket Users list:
 http://lists.racket-lang.org/users

Reply via email to