summaryrefslogtreecommitdiff
path: root/VM.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2019-11-18 18:33:06 +0100
committertomsmeding <tom.smeding@gmail.com>2019-11-18 18:33:06 +0100
commit095970d60c7912d330c7c33501a1634c533eced1 (patch)
treec6276b25bbe564175346f1be7f8eb4fbbbe31bf4 /VM.hs
parent6ff145b50b2b56d610a16cc047c311d3f3552bf4 (diff)
Refactor analyseValue, fix Let
Diffstat (limited to 'VM.hs')
-rw-r--r--VM.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/VM.hs b/VM.hs
index a272829..1250c1e 100644
--- a/VM.hs
+++ b/VM.hs
@@ -111,6 +111,7 @@ vmRunBuiltin state "print" as = putStrLn (intercalate ", " (map printshow as)) >
vmRunBuiltin state "=" [a, b] = return (if equalOp a b then RVNum 1 else RVNum 0, state)
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 "+" [RVString a, RVString b] = return (RVString (a ++ b), state)
vmRunBuiltin state "-" [RVNum a, RVNum b] = return (RVNum (a - b), state)
vmRunBuiltin state "null?" [v] = return (RVNum (case v of { RVList [] -> 1; _ -> 0 }), state)
vmRunBuiltin state "car" [RVList l] = case l of