[Top][All Lists]

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

[Chicken-users] simple macroexpand query

From: Greg Buchholz
Subject: [Chicken-users] simple macroexpand query
Date: Thu, 12 May 2005 10:37:27 -0700
User-agent: Mutt/

    I'm trying tying to get "macroexpand" to do something useful, but I
seem to be failing, and...

...doesn't answer my question.  I'd like to see what my macros get
expanded to, but none of the following uses appears to do the

;define a very simple macro...
(define-macro (test n)
    `(if (= 0 ,n) 'zero 'not))

;test it out...
(display (test 0)) ;(if (= 0 0) 'zero 'not)
(display (test 1)) ;(if (= 0 1) 'zero 'not)

;try and see what our macro looks like, but the following don't work...
(display (macroexpand '(test 2)))   (newline)
(display (macroexpand  (test 3)))   (newline)
(display (macroexpand-1 '(test 4))) (newline)
(display (macroexpand-1  (test 5))) (newline)
(display (macroexpand  'test)) (newline)
(display (macroexpand   test)) (newline)


Greg Buchholz

reply via email to

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