On Thursday 16 June 2016 14:44:19 Richard W.M. Jones wrote:
---
mllib/common_utils.ml | 29 +++++++++++++++++++++++++++++
mllib/common_utils.mli | 8 ++++++++
2 files changed, 37 insertions(+)
The patch makes sense to me, I'd like to use these in the customize
code. Just one note below.
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 64bf3d3..34e1285 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -49,6 +49,35 @@ module String = struct
and len = length str in
len >= sufflen && sub str (len - sufflen) sufflen = suffix
+ (* Note OCaml stdlib has an "is_space" function. *)
+ let isspace c =
+ c = ' '
+ (* || c = '\f' *) || c = '\n' || c = '\r' || c =
'\t' (* || c = '\v' *)
Since it's new code for Common_utils, why not just use the standard
is_space here, and in case provide an own function only where needed?
This way we can easily drop these implementations when bumping the
required OCaml version to 4.00.
Thanks,
--
Pino Toscano