491b74ddde05917cc6ed7b776aa41ba72f094eb7
[svn/Cll1h/.git] / demos / repeat.c
1 #include "cll1.h"
2
3 program
4 {
5 int i=2;
6
7 repeat(1)
8 {
9 print("This is demonstration, that nesting of C<<1 repeat(N) { ... } flow-control macro is completely safe:");
10 repeat(i++)
11 {
12 echo("This loop is supposed to be repeated twice: ");
13 repeat(i)
14 {
15 printf("[doing this %d times] ",i);
16 }
17 repeat(0)
18 {
19 printf("[doing this 0 times] ",i);
20 }
21 repeat(-1)
22 {
23 printf("[doing this -1 times] ",i);
24 }
25 repeat(1)
26 {
27 printf("[doing this 1 times] ",i);
28 }
29 print("... finished.");
30 }
31 }
32 repeat(--i)
33 {
34 print("This loop is not nested and it is supposed to be repeated again just twice.");
35 }
36 }
This page took 0.268333 seconds and 3 git commands to generate.