X-Git-Url: http://git.harvie.cz/?p=svn%2FCll1h%2F.git;a=blobdiff_plain;f=demos%2Ffor_range.c;fp=demos%2Ffor_range.c;h=0000000000000000000000000000000000000000;hp=c96f24cb53b05768f55c127d1f1010f6246d05c5;hb=e63f1bc2438012b5f2f6592a474892501149af18;hpb=6a60bc82e8b8e6cccd0d4c2214a1f291662215f0 diff --git a/demos/for_range.c b/demos/for_range.c deleted file mode 100644 index c96f24c..0000000 --- a/demos/for_range.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "cll1.h" - -program -{ - int i,j=1; - - echo("Just plain vanilla auto-increment:\tfor_range(i,1,5)"); - for_range(i,1,5) - { - printf(" [%d]",i); - } - print(""); - - echo("Single-evaluation of macro argument:\tj=1; for_range(i,0,j++)"); - for_range(i,0,j++) - { - printf(" [%d]",i); - } - print(""); - - echo("Just plain vanilla auto-decrement:\tfor_range(i,1,0)"); - for_range(i,1,0) - { - printf(" [%d]",i); - } - print(""); - - echo("Single iteration is possible too:\tfor_range(i,1,1)"); - for_range(i,1,1) - { - printf(" [%d]",i); - } - print(""); - - echo("Yet another example of macro safety:\tj=2; for_range(i,5,--j)"); - for_range(i,5,--j) - { - printf(" [%d]",i); - } - print(""); - - echo("Nesting of this macro seems to be safe:\tfor_range(i,1,3) for_range(j,3,1)"); - for_range(i,1,3) - { - for_range(j,3,1) - { - printf(" [%d,%d]",i,j); - } - } - print(""); -}