summaryrefslogtreecommitdiff
path: root/VM.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2019-11-21 23:23:23 +0100
committerTom Smeding <tom.smeding@gmail.com>2019-11-21 23:23:23 +0100
commit206689c943ba93ad48ce2b41166ca1902ed920a9 (patch)
tree6158a8e74c4b822a87bb104df2946238db039ffb /VM.hs
parent8114c68b9f42a9273109ad95cf1a76544ceb52a1 (diff)
cons, cond, exit
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 b66cfc5..64674fb 100644
--- a/VM.hs
+++ b/VM.hs
@@ -127,6 +127,7 @@ vmRunBuiltin state "cdr" [RVList l] = case l of
_ : a -> return (RVList a, state)
_ -> throw "Empty list in 'cdr'"
vmRunBuiltin state "list" values = return (RVList values, state)
+vmRunBuiltin state "cons" [val, RVList l] = return (RVList (val : l), state)
vmRunBuiltin state "sys-open-file" [RVNum modenum, RVString path] = do
let mode = [ReadMode, WriteMode] !! modenum
fid = sUniq state