diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-15 22:27:02 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-15 22:27:02 +0300 |
commit | 0328272d2a52264f36770d524aaa11b425e34370 (patch) | |
tree | c40006c6d17d441db0feae56070396c028d56462 /TUTORIAL.md | |
parent | 1a38462fbefd58cc7aff98f28520152e37c5ae55 (diff) | |
download | myslip-0328272d2a52264f36770d524aaa11b425e34370.tar.gz myslip-0328272d2a52264f36770d524aaa11b425e34370.zip |
doc: added help message and a reference to it in README.md
Diffstat (limited to 'TUTORIAL.md')
-rw-r--r-- | TUTORIAL.md | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/TUTORIAL.md b/TUTORIAL.md index d7bf266..4cf8948 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -44,6 +44,15 @@ Decimals are truncated in division: 2 : Int ``` +Increment and decrement operators are supplied by the +standard library: +```console +> (-- 1) +0 : Int +> (++ 1) +2 : Int +``` + Booleans -------- @@ -65,6 +74,15 @@ false : Bool false : Bool ``` +If-expressions are provided by the standard library in the +form `(if [condition] [iftrue] [iffalse])`: +```console +> (if true 1 0) +1 : Int +> (if false 1 0) +0 : Int +``` + Integer comparisons ------------------- @@ -99,7 +117,8 @@ x saved ``` The REPL interprets this as `((let x 1) x)`, which you could also type but would make a more cumbersome REPLing -experience. +experience (and would make loading definitions from files +nigh impossible). Shadowing works as expected: ```console |