From 4e4d5373328276ea6d49a60242555d5db03158ff Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 10 Oct 2021 14:48:30 +0200 Subject: Add numerical comparison primitive procedures --- examples/booleans.bdl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'examples/booleans.bdl') diff --git a/examples/booleans.bdl b/examples/booleans.bdl index 24d57a0..8828ac2 100644 --- a/examples/booleans.bdl +++ b/examples/booleans.bdl @@ -75,3 +75,17 @@ (cond ((and true true true) (+ 1 2 3)) ((or true true false) 2) (else 3)) + +;; Numeric comparisons. +(print "(< 1 2 3) -> ") (< 1 2 3) +(print "(< 3 2 1) -> ") (< 3 2 1) +(print "(> 1 2 3) -> ") (> 1 2 3) +(print "(> 3 2 1) -> ") (> 3 2 1) +(print "(= 1 2 3) -> ") (= 1 2 3) +(print "(= 3 2 1) -> ") (= 3 2 1) +(print "(= 3 3 3) -> ") (= 3 3 3) +(print "(= (+ 1 2) 3 (- 6 3)) -> ") (= (+ 1 2) 3 (- 6 3)) +(print "(< 1 1 3) -> ") (< 1 1 3) +(print "(<= 1 1 3) -> ") (<= 1 1 3) +(print "(> 3 3 1) -> ") (> 3 3 1) +(print "(>= 3 3 1) -> ") (>= 3 3 1) -- cgit v1.2.1