| 1) As an exercise, I was trying to port Peter Seibel's unit testing stuff from Chapter 8 of Practical Common Lisp, and it made me realize I don't know how to write macros. I want a macro that turns this: (check
(is (+ 1 2) 3)
(is (+ 4 5) 9))
...into this: (do
(report-result (is (+ 1 2) 3) '(is (+ 1 2) 3))
(report-result (is (+ 4 5) 9) '(is (+ 4 5) 9)))
..using this macro: (mac check args
`(do
,(each arg (list ,@args)
`(report-result ,arg ',arg))))
Which, of course, doesn't work. Does anyone out there have the patience to explain why?2) I'm going to want to ask more of these types of questions, but is this the right forum? I don't want to spam the community. |