diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-11-18 18:33:06 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-11-18 18:33:06 +0100 |
commit | 095970d60c7912d330c7c33501a1634c533eced1 (patch) | |
tree | c6276b25bbe564175346f1be7f8eb4fbbbe31bf4 /VM.hs | |
parent | 6ff145b50b2b56d610a16cc047c311d3f3552bf4 (diff) |
Refactor analyseValue, fix Let
Diffstat (limited to 'VM.hs')
-rw-r--r-- | VM.hs | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 |