Subject: Re: Scheme macros
From: (Rob Warnock)
Date: 21 Jun 2001 02:25:08 GMT
Newsgroups: comp.lang.scheme
Message-ID: <9grlu4$i83to$>
glauber <> wrote:
| Is there a tutorial for Scheme macros anywhere? I know enough Common
| Lisp to write "safe" macros there, thanks to Paul Graham, but the
| section on "syntax" of R5RS COMPLETELY baffled me.
| I'm using mzscheme.

This isn't exactly what you were asking, but...

MzScheme provides CL-style "defmacro" in the "" library.
Or if you don't need/want all of that particular library:

	(define-macro defmacro
	  (lambda (name args . body)
	    `(define-macro ,name (lambda ,args ,@body))))

Just remember to use "." instead of "&rest".  ;-}  ;-}

[Confession: I never use R5RS macros myself, just "defmacro".]


Rob Warnock, 31-2-510		<>
SGI Network Engineering		<> [until 8/15]
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA

[Note: and aren't for humans ]