aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-03-02 13:41:27 -0600
committerJoel Martin <github@martintribe.org>2015-03-02 13:41:27 -0600
commit85f95f369cae5a75a6b44b97ea83b686995fb5e8 (patch)
tree0f80ad04f650098deab89010e3fc683f7085a74c
parent478fd9ce409a62ccb130c46008303da4dd44eed6 (diff)
downloadmal-85f95f369cae5a75a6b44b97ea83b686995fb5e8.tar.gz
mal-85f95f369cae5a75a6b44b97ea83b686995fb5e8.zip
ocaml: fix empty? on vectors.
-rw-r--r--ocaml/core.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/ocaml/core.ml b/ocaml/core.ml
index 20f68b6..12bf3c3 100644
--- a/ocaml/core.ml
+++ b/ocaml/core.ml
@@ -64,7 +64,10 @@ let init env = begin
Env.set env (Types.symbol "vector?")
(Types.fn (function [T.Vector _] -> T.Bool true | _ -> T.Bool false));
Env.set env (Types.symbol "empty?")
- (Types.fn (function [T.List {T.value = []}] -> T.Bool true | _ -> T.Bool false));
+ (Types.fn (function
+ | [T.List {T.value = []}] -> T.Bool true
+ | [T.Vector {T.value = []}] -> T.Bool true
+ | _ -> T.Bool false));
Env.set env (Types.symbol "count")
(Types.fn (function
| [T.List {T.value = xs}]