diff options
author | Adrian Kummerlaender | 2017-04-17 20:35:55 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2017-04-17 20:35:55 +0200 |
commit | c484b2fe3bbfffaa0509f919972dd25a35e82ad7 (patch) | |
tree | 2c984119681ada013041f017707a4ee423e72b6b | |
parent | 6e115f5229dc2323804b8250138339a7f62bd852 (diff) | |
download | slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.tar slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.tar.gz slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.tar.bz2 slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.tar.lz slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.tar.xz slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.tar.zst slang-c484b2fe3bbfffaa0509f919972dd25a35e82ad7.zip |
Add word documentation to README.md
-rw-r--r-- | README.md | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -11,4 +11,29 @@ § loop i withinBounds if i print i incr loop then else ; loop -The above _slang_ code to be entered in the repl prints the numbers from 1 to 9. The repl may be compiled and executed using `dub run` in the project directory. +The above _slang_ code to be entered in the repl prints the numbers from 1 to 9. The repl may be compiled and executed using `dub run` in the project directory. Check the `example` directory for further further demonstrations. + +## Words + +Currently implemented primitives: + +| Word | Description | +| --- | --- | +| `§` | Custom word definition | +| `$`, `@` | Single token variable binding, resolution | +| `if`, `then`, `else` | Conditional primitives | +| `+`, `*`, `/`, `%` | Common artithmetics | +| `.` | Non destructive printing of top-of-stack | +| `pop` | Remove uppermost stack element | +| `dup` | Duplicate top-of-stack | +| `swp` | Swap the first two stack elements | +| `over` | Place a copy of the second stack element on top-of-stack | +| `rot` | Rotate the top three stack elements | +| `true` | Write true boolean value to top-of-stack | +| `false` | Write false boolean value to top-of-stack | +| `!` | Negate boolean value | +| `<` | Compare size of two integers | +| `=` | Compare equality of two stack values | +| `&` | Boolean and | +| `or` | Boolean or | +| `#` | Debug word printing the whole stack to _stdout_ | |