Merge remote-tracking branch 'origin/stable-2.0'
[bpt/guile.git] / test-suite / vm / t-macros2.scm
CommitLineData
2335fb97
LC
1;; Are macros well-expanded at compilation-time?
2
3(defmacro minus-binary (a b)
4 `(- ,a ,b))
5
6(define-macro (plus . args)
7 `(let ((res (+ ,@args)))
8 ;;(format #t "plus -> ~a~%" res)
9 res))
10
11\f
12(plus (let* ((x (minus-binary 12 7)) ;; 5
13 (y (minus-binary x 1))) ;; 4
14 (plus x y 5)) ;; 14
15 12 ;; 26
16 (expt 2 3)) ;; => 34
17