From 8cfb2879d9d5e9df9abb23bae8420f61005980e8 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 22 Nov 2019 22:37:27 +0100 Subject: Allow multiple arguments to 'error' in VM --- VM.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VM.hs b/VM.hs index b3df10a..5f7a818 100644 --- a/VM.hs +++ b/VM.hs @@ -175,7 +175,7 @@ vmRunBuiltin state "type-number?" [value] = return (RVNum (case value of { RVNum 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 _ "error" [RVString str] = throw ("error: " ++ str) +vmRunBuiltin _ "error" values = throw ("error: " ++ intercalate " " (map show values)) vmRunBuiltin _ name args = error (name ++ " " ++ show args) equalOp :: RunValue -> RunValue -> Either String Bool -- cgit v1.2.3-54-g00ecf