summaryrefslogtreecommitdiffstats
path: root/tests/011/macros-4.tl
blob: 440dcd9e88e5455a7d02a52b87a607d062e84663 (plain)
1
2
3
4
5
6
7
8
9
10
11
(load "../common")

(defmacro xsqrt (:match :form f)
  (((* @exp @exp)) exp)
  (@else f))

(defmacro xexpt (:match :form f)
   ((@exp 2) ^(* ,exp ,exp))
   (@else f))

(test (expand '(xsqrt (xexpt x 2))) x)