X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=demos%2Fadvanced-hello-world.c;h=124788a5f180d5cb9a86f637898fe31d91a900a3;hb=49df11dfb79a408ff31ebadd42c16cd5d71d6a7f;hp=0c166659e4eefe610f379ae802ef95b5d622be32;hpb=21720b7b452dd15e967b7cc860c620f2175d0d2b;p=svn%2FCll1h%2F.git diff --git a/demos/advanced-hello-world.c b/demos/advanced-hello-world.c index 0c16665..124788a 100644 --- a/demos/advanced-hello-world.c +++ b/demos/advanced-hello-world.c @@ -2,8 +2,34 @@ program { - echo("Hello ",NULL," ","world"," ! "); - print("Hello", "world",NULL,"!"); - - print(MAYBE ? "Hello" : "Hi", WHOKNOWS ? "world" : "friend", MAYBE ? "!" : "?"); + print("* echo()"); + echo("Hello"," ","world"," !\n"); + print("* print()"); + print("Hello","world","!"); + print("* NIL"); + print("We can print", NULL, "safely."); + NIL="(hic sunt crocodiles)"; + print("We can print", NULL, "safely."); + + { + str p = "print", a = NULL; + print("* coalesce():"); + print("We can", coalesce(p, "everything"), "almost", coalesce(a, "anything"), "safely."); + } + + echo("Surprisingly ->",NIL," (you can't see this)"); + print("<- nothing special here."); + print("* OFS"); + OFS=""; + EOL=""; + print("We","Can","Print","Without","Spaces","BetweenArgs."); + OFS=":"; + print("We","can","customize","print."); + OFS="..."; + EOL="<--\n"; + print(""); + print("* MAYBE ?"); + repeat(4) print((MAYBE ? "Hello" : "Hi"), (MAYBE ? "world" : "friend"), (MAYBE ? "!" : "?")); + print("* WHOKNOWS ?"); + repeat(4) print((WHOKNOWS ? "Hello" : "Hi"), (WHOKNOWS ? "world" : "friend"), (WHOKNOWS ? "!" : "?")); }