Category:AntLang: Difference between revisions

Content added Content deleted
Line 42: Line 42:


OpenCally adds interfaces to all its target languages (currently [[JavaScript]]):
OpenCally adds interfaces to all its target languages (currently [[JavaScript]]):
<source>
/ load the standard library
/ load the standard library
:"?/lib/stdlib.a"
:"?/lib/stdlib.a"

/ make a JavaScript function available to AntLang (prefix: v_)
/ make a JavaScript function available to AntLang (prefix: v_)
js)v_console_log = console.log;
js)v_console_log = console.log;

/ call that function from within AntLang
/ call that function from within AntLang
console_log each <"APL"; "Haskell"; "Erlang">
console_log each <"APL"; "Haskell"; "Erlang">
</source>


To execute the code above on a machine with OpenCally installed, run:
To execute the code above on a machine with OpenCally installed, run:
$ run-antlang file.ant
<source lang="sh">
$ run-antlang file.ant
</source>


It is also hosted on GitHub.
It is also hosted on GitHub.