From a606f6614bc2e8f2b0cf55d593d2d83337495c74 Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Tue, 20 Mar 2012 11:31:50 -0600 Subject: [PATCH] [honu] add two more tests --- collects/tests/honu/math.honu | 16 ++++++++++++++++ collects/tests/honu/where.honu | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 collects/tests/honu/math.honu create mode 100644 collects/tests/honu/where.honu diff --git a/collects/tests/honu/math.honu b/collects/tests/honu/math.honu new file mode 100644 index 0000000000..4c4456ca2f --- /dev/null +++ b/collects/tests/honu/math.honu @@ -0,0 +1,16 @@ +#lang honu + +macro add_all(){ + number:expression ... +} { + syntax( + $ number + $ ... 0 + ) + /* + syntax( + $ printf("~a\n", number) $ ... + ) + */ +} + +add_all 1 2 3 * 4; diff --git a/collects/tests/honu/where.honu b/collects/tests/honu/where.honu new file mode 100644 index 0000000000..dfbefbd590 --- /dev/null +++ b/collects/tests/honu/where.honu @@ -0,0 +1,14 @@ +#lang honu + +var where = 0 + +macro varwhere(where =){ unparsed where bind:identifier = any:expression } +{ syntax({var bind = any + unparsed}) } + +varwhere { printf("x is ~a\n", x) + { + var x = 5; + x * 2 + } + } where x = 2 + 1