diff options
| author | Chouser <chouser@n01se.net> | 2015-01-23 20:05:03 -0500 |
|---|---|---|
| committer | Chouser <chouser@n01se.net> | 2015-01-30 12:54:42 -0500 |
| commit | de04357cd5f2954e2d682abb97ca2b3b90ea75d1 (patch) | |
| tree | f52fd11b6b3d21880409dc74b53c324d31fec7b5 /ocaml/types.ml | |
| parent | 9115534dc73fe18a12b3b2ecf436051b76bdd8a4 (diff) | |
| download | mal-de04357cd5f2954e2d682abb97ca2b3b90ea75d1.tar.gz mal-de04357cd5f2954e2d682abb97ca2b3b90ea75d1.zip | |
Ocaml: Add string functions
Diffstat (limited to 'ocaml/types.ml')
| -rw-r--r-- | ocaml/types.ml | 4 |
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 |
