chicken-users
[Top][All Lists]
Advanced

[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/1.4.2.1i

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

    http://www.call-with-current-continuation.org/manual/Macros.html#Macros

...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
trick...

;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)
(newline)
(display (test 1)) ;(if (= 0 1) 'zero 'not)
(newline)

;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)


Thanks,

Greg Buchholz




reply via email to

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