diff options
author | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2019-11-14 18:01:38 +0100 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2019-11-14 18:13:47 +0100 |
commit | 6ff145b50b2b56d610a16cc047c311d3f3552bf4 (patch) | |
tree | 584aae71a51d46f6fc4fcb9b17e38f3ffbd46459 /VM.hs | |
parent | aa160950ef426bc959ddce12bd45d2af0cf8dc72 (diff) |
'null?' builtin
Diffstat (limited to 'VM.hs')
-rw-r--r-- | VM.hs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -112,7 +112,7 @@ vmRunBuiltin state "=" [a, b] = return (if equalOp a b then RVNum 1 else RVNum 0 vmRunBuiltin state "<=" [RVNum a, RVNum b] = return (RVNum (fromEnum (a <= b)), state) vmRunBuiltin state "+" [RVNum a, RVNum b] = return (RVNum (a + b), state) vmRunBuiltin state "-" [RVNum a, RVNum b] = return (RVNum (a - b), state) --- TODO: null? +vmRunBuiltin state "null?" [v] = return (RVNum (case v of { RVList [] -> 1; _ -> 0 }), state) vmRunBuiltin state "car" [RVList l] = case l of a : _ -> return (a, state) _ -> throw "Empty list in 'car'" |