From 0328272d2a52264f36770d524aaa11b425e34370 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Fri, 15 Aug 2025 22:27:02 +0300 Subject: doc: added help message and a reference to it in README.md --- TUTORIAL.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'TUTORIAL.md') 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 -- cgit v1.2.3