You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 5, 2020. It is now read-only.
Daniel Wirtz edited this page Jan 14, 2014
·
33 revisions
Welcome to the MetaScript wiki! For now, the wiki contains a few non-trivial insights on writing meta.
Short statements
//? if (NODE)buffer.writeInt8(offset,value);//? elseview.setInt8(value,offset);
This will actually work without using curly braces because each source line is wrapped by a dedicated write(...) call, resulting in the following meta program:
When inspecting the generated meta program, you will notice that the variable __ is used quite frequently. It stores the indentation level of the last meta block processed. For example ...
//? if (NODE)//? include("node-stuff.js");//? else//? include("browser-stuff.js");
... will indent the contents of the included filesby four spaces (just like before //?), while ...
/*? if (NODE) include("node-stuff.js");else include("browser-stuff.js"); */
will not, just like before /*?. When creating custom utility functions, it's of course safe to use this variable on your own.