From 7be78efb6c56c04b8a96b3f4f7f6cf810da04dbf Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Tue, 5 Aug 2025 12:18:11 +0300 Subject: Fixed type of Not, added documentation to the tour for booleans --- TUTORIAL.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'TUTORIAL.md') diff --git a/TUTORIAL.md b/TUTORIAL.md index 7389d55..9494859 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -34,6 +34,46 @@ Decimals are truncated in division: ``` +**Booleans** + +Myslip supports booleans and `and`, `or`, `xor` and `not` +for their comparisons. +```console +> true +true : Bool +> false +false : Bool +> (and true true) +true : Bool +> (or true false) +true : Bool +> (xor true true) +false : Bool +> (not true) +false : Bool +``` + + +**Integer comparisons** + +To generate booleans from integers, some basic and quite +self-explanatory operators are supplied. +```console +> (> 2 1) +true : Bool +> (< 1 2) +true : Bool +> (>= 1 1) +true : Bool +> (<= 1 1) +true : Bool +> (= 1 1) +true : Bool +> (!= 1 1) +false : Bool +``` + + **Lists** Lists in myslip correspond to what is known as tuples in many -- cgit v1.2.3