Monday, June 7, 2010

Unhygenic macros in PLT Scheme

You need language "pretty big" for this to work. The following is a demonstration of "anaphoric if"

(defmacro aif (a b c)
`(let ((it ,a))
(if it ,b ,c)))

(aif #f 2 3) ; returns 3
You may need to
(require mzlib/defmacro)

No comments: