diff options
| author | Chouser <chouser@n01se.net> | 2014-01-29 20:05:05 -0500 |
|---|---|---|
| committer | Chouser <chouser@n01se.net> | 2015-01-30 12:54:43 -0500 |
| commit | fb21afa71b4f73fa9c05c47e6b1c0f45d2144069 (patch) | |
| tree | 81ac4a0d48ef7cca6c89224b3c7c4acfe38a582c /ocaml/types.ml | |
| parent | efb850b5d5f8072c95fd0dc67383ffa308504f7b (diff) | |
| download | mal-fb21afa71b4f73fa9c05c47e6b1c0f45d2144069.tar.gz mal-fb21afa71b4f73fa9c05c47e6b1c0f45d2144069.zip | |
OCaml: Add Step 8
Diffstat (limited to 'ocaml/types.ml')
| -rw-r--r-- | ocaml/types.ml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ocaml/types.ml b/ocaml/types.ml index 287cc88..1cec691 100644 --- a/ocaml/types.ml +++ b/ocaml/types.ml @@ -1,6 +1,7 @@ module rec Types : sig type 'a with_meta = { value : 'a; meta : t } + and fn_rec = { f : (t list -> t); is_macro : bool } and t = | List of t list with_meta | Vector of t list with_meta @@ -11,7 +12,7 @@ module rec Types | Nil | Bool of bool | String of string - | Fn of (t list -> t) + | Fn of fn_rec end = Types and MalValue @@ -38,6 +39,7 @@ let list x = Types.List { Types.value = x; meta = Types.Nil } let map x = Types.Map { Types.value = x; meta = Types.Nil } let vector x = Types.Vector { Types.value = x; meta = Types.Nil } let symbol x = Types.Symbol { Types.value = x; meta = Types.Nil } +let fn f = Types.Fn { Types.f = f; Types.is_macro = false } let rec list_into_map target source = match source with |
