multiple-evalution-of-args-safe versions of repeat() { } and for_range() { } macros
[svn/Cll1h/.git] / demos / repeat.c
index 70a5abec589542579a09ed499b210ff15ea3e6a8..b6229e928c4ad2981c4b53fa3f68604311825b39 100644 (file)
@@ -2,9 +2,19 @@
 
 program
 {
- repeat(2)
+ int i=2;
+ repeat(1)
  {
-  print("Tohle cele delam 2x:");
-  repeat(3) print("Tohle delam 3x...");
+  print("This is demonstration, that nesting of C<<1 repeat(N) { ... } flow-control macro is completely safe:");
+  repeat(i++)
+  {
+   echo("Outer loop is supposed to be done twice: ");
+   repeat(i)
+   {
+    printf("[doing this %d times] ",i);
+   } 
+   print("... finished.");
+  }
  }
 }
This page took 0.125369 seconds and 4 git commands to generate.