diff options
| author | Thomas Bauereiss | 2017-11-08 16:27:49 +0000 |
|---|---|---|
| committer | Thomas Bauereiss | 2017-11-08 16:27:49 +0000 |
| commit | 16272e084d118c1b72d7921455d023aaafbf3dd5 (patch) | |
| tree | c982bbc3748a56e230880e54e57380bbdb2a049a /src/util.ml | |
| parent | 275ded17e9d0824a932fe23607fe4f7d7b1da62f (diff) | |
Allow functions to be selectively declared external only for some backends
For example,
val test = { ocaml: "test_ocaml" } : unit -> unit
will only be external for OCaml. For other backends, it will have to be
defined.
Diffstat (limited to 'src/util.ml')
| -rw-r--r-- | src/util.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.ml b/src/util.ml index 335fd36f..59ba7026 100644 --- a/src/util.ml +++ b/src/util.ml @@ -216,6 +216,11 @@ let rec option_binop f x y = match x, y with | Some x, Some y -> Some (f x y) | _ -> None +let rec option_these = function + | Some x :: xs -> x :: option_these xs + | None :: xs -> option_these xs + | [] -> [] + let changed2 f g x h y = match (g x, h y) with | (None,None) -> None |
