aboutsummaryrefslogtreecommitdiff
path: root/ocaml/types.ml
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-01-23 20:05:03 -0500
committerChouser <chouser@n01se.net>2015-01-30 12:54:42 -0500
commitde04357cd5f2954e2d682abb97ca2b3b90ea75d1 (patch)
treef52fd11b6b3d21880409dc74b53c324d31fec7b5 /ocaml/types.ml
parent9115534dc73fe18a12b3b2ecf436051b76bdd8a4 (diff)
downloadmal-de04357cd5f2954e2d682abb97ca2b3b90ea75d1.tar.gz
mal-de04357cd5f2954e2d682abb97ca2b3b90ea75d1.zip
Ocaml: Add string functions
Diffstat (limited to 'ocaml/types.ml')
-rw-r--r--ocaml/types.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/ocaml/types.ml b/ocaml/types.ml
index 60d3725..badfee3 100644
--- a/ocaml/types.ml
+++ b/ocaml/types.ml
@@ -7,3 +7,7 @@ type mal_type =
| Bool of bool
| String of string
| Fn of (mal_type list -> mal_type)
+
+let to_bool x = match x with
+ | Nil | Bool false -> false
+ | _ -> true