A compile-time Ook! interpreter with Rust macro.
Based on The Ook! Example of The Little Book of Rust Macros.
Here is the a + b example of this interpreter.
Numbers are represented with the number of @
's.
Ook!(((@ @) (@ @ @));
Ook. Ook!
Ook. Ook? Ook. Ook!
Ook! Ook?
Ook! Ook! Ook? Ook. Ook. Ook. Ook. Ook?
Ook? Ook!
Ook? Ook.
Ook! Ook.
);
Build with cargo
cargo build --example a_plus_b
You will get the output below:
( @ @ @ @ @ )