Last active
October 31, 2016 18:25
-
-
Save mndrix/00a9c50ecd7fe70acb4c912fc085570b to your computer and use it in GitHub Desktop.
Hello Amalog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use("amalog.org/std/io", Io); # See Note_use | |
main(W) { | |
Io.printf(W, "Hello, world!\n"); | |
} | |
### Note_use: | |
`use/2` is a macro that expands into | |
at(now) { | |
Core.load("amalog.org/std/io", Io); | |
Core.make_global(Io); # only callable at compile time | |
} | |
where `at/1` schedules execution at the runtime stage indicated. | |
`now` is "as soon as possible during compilation". | |
`use/2` has to be a macro because `Core.make_global/1` has | |
to operate on the variable itself not an alias. | |
`load/2` parses a directory of Amalog files into a database. | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment