From c59597d97e65a6fc08d9c5b898360255b34eb73b Mon Sep 17 00:00:00 2001 From: DrMaxNix Date: Sat, 3 Sep 2022 18:39:59 +0200 Subject: [PATCH] :memo: clarify compare statements --- doc/concept.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/doc/concept.sh b/doc/concept.sh index 6866b4c..ef231be 100644 --- a/doc/concept.sh +++ b/doc/concept.sh @@ -99,17 +99,23 @@ floor $1 # only execute next line if cond is true if|ifl cond -# cond: -x -!x -x == y -x != y -x === y -x !== y -x < y -x <= y -x > y -x >= y +# value to bool +$1 # same as `$1 == true` +!$1 # same as `$1 != true` + +# loosely typed compare +$1 == $2 +$1 != $2 + +# strongly typed compare +$1 === $2 +$1 !== $2 + +# numerical / alphabetical compare +$1 < $2 +$1 <= $2 +$1 > $2 +$1 >= $2