summaryrefslogtreecommitdiffstats
path: root/tests/011/macros-2.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-28 01:37:43 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-28 01:37:43 -0800
commit1dcc39dbd54082af1e4c1cc9a2ca5ef30f2c4536 (patch)
tree0827dc0b135161cc1f4a633d7c2142210e77c624 /tests/011/macros-2.txr
parenta9e06b4e815240f7f954d237f8625c30338be55f (diff)
downloadtxr-1dcc39dbd54082af1e4c1cc9a2ca5ef30f2c4536.tar.gz
txr-1dcc39dbd54082af1e4c1cc9a2ca5ef30f2c4536.tar.bz2
txr-1dcc39dbd54082af1e4c1cc9a2ca5ef30f2c4536.zip
About time for some new regression tests.
* tests/011/macros-1.expected: New file. * tests/011/macros-1.txr: New file. * tests/011/macros-2.expected: New file. * tests/011/macros-2.txr: New file. * tests/011/special-1.expected: New file. * tests/011/special-1.txr: New file.
Diffstat (limited to 'tests/011/macros-2.txr')
-rw-r--r--tests/011/macros-2.txr27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/011/macros-2.txr b/tests/011/macros-2.txr
new file mode 100644
index 00000000..0d63a13b
--- /dev/null
+++ b/tests/011/macros-2.txr
@@ -0,0 +1,27 @@
+@(do
+ (defmacro while ((condition : result) . body)
+ (let ((cblk (gensym "cnt-blk-"))
+ (bblk (gensym "brk-blk-")))
+ '(macrolet ((break (value) '(return-from ,',bblk ,value)))
+ (symacrolet ((break (return-from ,bblk))
+ (continue (return-from ,cblk)))
+ (block ,bblk
+ (for () (,condition ,result) ()
+ (block ,cblk ,*body)))))))
+
+ (let ((i 0))
+ (while ((< i 100))
+ (if (< (inc i) 20)
+ continue)
+ (if (> i 30)
+ break)
+ (prinl i)))
+
+ (prinl
+ (sys:expand
+ '(while ((< i 100))
+ (if (< (inc i) 20)
+ continue)
+ (if (> i 30)
+ break)
+ (prinl i)))))