Removed MalType::Bool

mplemented instead MalType::T as opposed to Maltype::Nil
This commit is contained in:
teo3300
2025-06-13 18:30:20 +09:00
parent e97a348e80
commit 9af7ada706
11 changed files with 50 additions and 43 deletions

View File

@ -1,8 +1,8 @@
(assert true)
(assert t)
(assert (ok? 1))
(assert-eq nil (ok? (1)))
(assert-eq true (ok? 1))
(assert (ok? (assert true)))
(assert-eq t (ok? 1))
(assert (ok? (assert t)))
(assert (not (ok? (assert nil))))
(assert (not (ok? (assert-fail '1))))
(assert-fail '(1))

View File

@ -8,13 +8,13 @@
; nil
(assert (= nil nil))
(assert (not (= nil true)))
(assert (not (= nil t)))
(assert (not (= nil 1)))
; bool
(assert (= true true))
(assert (not (= false true)))
(assert (not (= true 1)))
(assert (= t t))
(assert (not (= nil t)))
(assert (not (= t 1)))
; int
(assert (= 1 1))

View File

@ -9,7 +9,7 @@
expected
"got"
(n-fib n)))
(assert false))))) ; cause test panic
(assert nil))))) ; cause test panic
(assert-fib 0 0)
(assert-fib 1 1)

View File

@ -1,6 +1,6 @@
; def!
(assert (not (def! FALSE nil)))
(assert (def! TRUE true))
(assert (def! TRUE t))
(println :def)
(def! value-0 0)
@ -32,13 +32,13 @@
(assert-eq (do) nil)
; if
(assert (if true 1))
(assert (not (if false 1)))
(assert (not (if false nil)))
(assert (if false nil 1))
(assert (if true 1 nil))
(assert-fail '(if true))
(assert-fail '(if false))
(assert (if t 1))
(assert (not (if nil 1)))
(assert (not (if nil nil)))
(assert (if nil nil 1))
(assert (if t 1 nil))
(assert-fail '(if t))
(assert-fail '(if nil))
(assert-fail '(if))
; let*

View File

@ -1,12 +1,12 @@
; positive assert
(assert true)
(assert t)
(assert ())
(assert 1)
; not
(assert (not false))
(assert (not nil))
(assert (not (not true)))
(assert (not nil))
(assert (not (not t)))
; or
(assert (not (or nil nil)))