summaryrefslogtreecommitdiff
path: root/VM.hs
diff options
context:
space:
mode:
Diffstat (limited to 'VM.hs')
-rw-r--r--VM.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/VM.hs b/VM.hs
index 883066f..138bf26 100644
--- a/VM.hs
+++ b/VM.hs
@@ -160,6 +160,11 @@ vmRunBuiltin state "chr" [RVNum num] = return (RVString [chr num], state)
vmRunBuiltin state "concat" values
| Just strings <- sequence (map fromRVString values) = return (RVString (concat strings), state)
| otherwise = throw "Non-string arguments to 'concat'"
+vmRunBuiltin state "type-list?" [value] = return (RVNum (case value of { RVList _ -> 1; _ -> 0 }), state)
+vmRunBuiltin state "type-number?" [value] = return (RVNum (case value of { RVNum _ -> 1; _ -> 0 }), state)
+vmRunBuiltin state "type-string?" [value] = return (RVNum (case value of { RVString _ -> 1; _ -> 0 }), state)
+vmRunBuiltin state "type-quoted?" [value] = return (RVNum (case value of { RVQuoted _ -> 1; _ -> 0 }), state)
+vmRunBuiltin state "type-symbol?" [value] = return (RVNum (case value of { RVName _ -> 1; _ -> 0 }), state)
vmRunBuiltin _ name args = error (name ++ " " ++ show args)
equalOp :: RunValue -> RunValue -> Bool