diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-07-11 22:50:55 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-07-11 22:50:55 -0700 |
commit | a5e757e1abefad8de527f3e7a6e8602cce62d468 (patch) | |
tree | 8dc604c2b57c4e00cf48156ab41c0075f6a247cc /mu.arc | |
parent | d17e8291efb5fb7c6f793ef925c6c262ce855581 (diff) | |
download | mu-a5e757e1abefad8de527f3e7a6e8602cce62d468.tar.gz |
21 - new boolean type
Diffstat (limited to 'mu.arc')
-rw-r--r-- | mu.arc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mu.arc b/mu.arc index d0f83099..d556e30a 100644 --- a/mu.arc +++ b/mu.arc @@ -4,7 +4,8 @@ (= types* (obj integer (obj size 1) location (obj size 1) - address (obj size 1))) + address (obj size 1) + boolean (obj size 1))) (= memory* (table)) (= function* (table))) (clear) @@ -58,6 +59,18 @@ (trunc:/ (memory* arg.0.1) (memory* arg.1.1)) (memory* oarg.1.1) (mod (memory* arg.0.1) (memory* arg.1.1))) + and + (= (memory* oarg.0.1) + (and (memory* arg.0.1) (memory* arg.1.1))) + or + (= (memory* oarg.0.1) + (and (memory* arg.0.1) (memory* arg.1.1))) + not + (= (memory* oarg.0.1) + (not (memory* arg.0.1))) + eq + (= (memory* oarg.0.1) + (iso (memory* arg.0.1) (memory* arg.1.1))) arg (let idx (if arg arg.0 @@ -72,8 +85,8 @@ (do (= pc (+ pc arg.0.1)) ; relies on continue still incrementing (bug) ;? (prn "jumping to " pc) (continue)) - jifz - (when (is 0 (memory* arg.0.1)) + jif + (when (is t (memory* arg.0.1)) ;? (prn "jumping to " arg.1.1) (= pc (+ pc arg.1.1)) ; relies on continue still incrementing (bug) (continue)) |