This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pretty-printing?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]