| Printing | categories I/O, Modules and System Interface WCL syntax |
Reading |
XL CLAIRE comes with a new printing facility called WCL syntax standing for Web CLaire syntax due to its design originally meant for web oriented applications with generation of dynamic content. WCL syntax draws its inspiration from HTML and the ability to embed CLAIRE code in such language. It comes as a printing alternative to printf and also perform inline substitution. For instance, here is a simple WCL fragment and its printf equivalent :
| ?>Hello world<? <=> printf("Hello world") |
| ?>toto<? princ("titi") ?>tata<? ?>toto<? , princ("titi"), ?>tata<? ?>toto<? princ("titi"), ?>tata<? ?>toto<? , princ("titi") ?>tata<? princ("tototititata") |
| ?>toto<?princ "titi" <=> princ("tototiti") |
| ?>toto<?= <exp> <=> princ("toto"), echo(<exp>) ?>toto<?== <exp> <=> princ("toto"), self_html(<exp>) ?>toto<?oid <exp> <=> princ("toto"), princ(Core/Oid(<exp>)) |
| <wcl fragment> = < ?> <text> <? < <= | == | oid | property> <exp> >opt > |
| ?><table><? for y in (1 .. 10) ( ?><tr><? for x in (1 .. 10) ( ?><td><?= x ?>,<?= y)) ?></table><? |