The #say directive - jpbubble/NIL-isn-t-Lua GitHub Wiki
The #say directive will allow the NIL translator to generate visual output while it's translating to Lua.
This feature was most of all used by me in order to debug NIL while it was used on its first projects, since it was my belief that the only way to put NIL seriously to the test, was by actually using it in a serious project. Of course, I could never expect it working OK from the start,and this went even more for its underlying APIs. The #say directive at least helps me to get a more proper view on things.
Now it should be said that #say needs a little help. There is no way NIL can know how your engine prefers its output. It is merely a scripting language after all. So without this help nothing will come out. You need to add a function with one string parameter as output to the NIL.SayFuncs array.
When just using NIL on a console application, this will do!
table.insert(NIL.SayFuncs,print)
Or else this:
NIL.SayFuncs[#NIL.SayFuncs+1]=print
#say Hello
If you translate that "Hello" will appear on console now during the translation phase. So that is even before Lua touches the generated code.
One notice:
#say Hello World
Will only output "Hello", if you want that to be done properly use this:
#say "Hello World"
Now if you have a use for #say use it.... If you don't then skip it ;)