Session: ---
~/dynamic$ cat t2.scm (define-macro (assert-equal lhs rhs) (let ((g-lhs (gensym)) (g-rhs (gensym)) (e-lhs (gensym)) (e-rhs (gensym))) `(let ((,g-lhs ,lhs) (,g-rhs ,rhs) (,e-lhs ',lhs) (,e-rhs ',rhs)) (if (not (equal? ,g-lhs ,g-rhs)) (pp `(,,e-lhs = ,,g-lhs <> ,,g-rhs = ,,e-rhs))))))
(pp (lambda () (assert-equal (+ 1 2) (- 3 4))) (current-output-port))
~/dynamic$ gsi t2.scm (lambda () (let ((#:g0 (+ 1 2)) (#:g1 (- 3 4)) (#:g2 '(+ 1 2)) (#:g3 '(- 3 4))) (if (not (equal? #:g0 #:g1)) (pp `(,#:g2 ,@`(,'= ,@`(,#:g0 ,@`(,'<> ,@`(,#:g1 ,@`(,'= ,@`(,#:g3 ,@'()))))))))))) ~/dynamic$
Question: ---
Why do I have:
(pp `(,#:g2 ,@`(,'= ,@`(,#:g0 ,@`(,'<> ,@`(,#:g1 ,@`(,'= ,@`(,#:g3 ,@'())))))))))))
?
It seems prettier as:
`(,#:g2 '= ,#:g0 '<> ...)
the ,@` seems extraneous