This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: pretty-printing?
- From: Per Bothner <per at bothner dot com>
- To: David St-Hilaire <sthilaid at iro dot umontreal dot ca>
- Cc: kawa at sources dot redhat dot com
- Date: Sun, 30 Sep 2007 17:34:08 -0700
- Subject: Re: pretty-printing?
- References: <47003AD9.1070703@iro.umontreal.ca>
David St-Hilaire wrote:
I'm completely new to kawa and I have a few questions.
Welcome!
> I wrote a simple macro which is:
(define-macro (pp arg)
`(begin (display ,arg) (newline)))
This is a FAQ (though alas Kawa doesn't have an FAQ list).
Answer: Don't use define-macro or defmacro.
Instead use define-syntax:
(define-syntax pp
(syntax-rules ()
((pp arg) (begin (display arg) (newline)))))
--
--Per Bothner
per@bothner.com http://per.bothner.com/