summaryrefslogtreecommitdiffstats
path: root/tests/011/macros-4.tl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/011/macros-4.tl')
-rw-r--r--tests/011/macros-4.tl11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/011/macros-4.tl b/tests/011/macros-4.tl
new file mode 100644
index 00000000..440dcd9e
--- /dev/null
+++ b/tests/011/macros-4.tl
@@ -0,0 +1,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)