[gambit-list] rewriting a macro

lowly coder lowlycoder at huoyanjinjing.com
Sat Feb 7 05:03:49 EST 2009


in the following code:

(define-macro (assert-equal lhs
rhs)
  (let ((g-lhs
(gensym))
        (g-rhs
(gensym)))
    `(let ((,g-lhs ,lhs) (,g-rhs
,rhs))
       (if (not (equal? ,g-lhs
,g-rhs))
           (raise (list ',lhs '= ,g-lhs '<> ,g-rhs '= ',rhs))))))

used like this:

(assert-equal (+ 1 2) (- 3 4))

is there anyway to rewirte that last line:

(raise (list ...)) somehow in the format of:

(raise '(....))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090207/e8108cff/attachment.htm>


More information about the Gambit-list mailing list