diff options
| author | Joel Martin <github@martintribe.org> | 2015-03-02 13:41:27 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-03-02 13:41:27 -0600 |
| commit | 85f95f369cae5a75a6b44b97ea83b686995fb5e8 (patch) | |
| tree | 0f80ad04f650098deab89010e3fc683f7085a74c | |
| parent | 478fd9ce409a62ccb130c46008303da4dd44eed6 (diff) | |
| download | mal-85f95f369cae5a75a6b44b97ea83b686995fb5e8.tar.gz mal-85f95f369cae5a75a6b44b97ea83b686995fb5e8.zip | |
ocaml: fix empty? on vectors.
| -rw-r--r-- | ocaml/core.ml | 5 |
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}] |
