From 786436b314f39a115381da9791fe86a7559fc16b Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Thu, 10 Nov 2011 20:49:57 -0700 Subject: [PATCH] [honu] add some simple macro examples --- collects/tests/honu/macros.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/collects/tests/honu/macros.rkt b/collects/tests/honu/macros.rkt index 44bd25ffab..f2c0ebb522 100644 --- a/collects/tests/honu/macros.rkt +++ b/collects/tests/honu/macros.rkt @@ -6,3 +6,14 @@ testx 5 * 2 for z = 1 to testx 5 * 2 do printf("z is ~a\n", z) + +macro testfor () {x:expression} { + syntax(for z = 1 to x_result do + printf("z is ~a\n" z)) +} + +macro testfor2 () {x:expression}{ + syntax(testfor x_result * 2) +} + +testfor2 1 + 2