search for: case_ascii

Displaying 2 results from an estimated 2 matches for "case_ascii".

2015 Oct 06
0
[PATCH 3/5] mllib: Add (Char|String).(lower|upper)case_ascii functions.
...files changed, 24 insertions(+), 4 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index f375317..97363df 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -22,10 +22,23 @@ open Common_gettext.Gettext module Char = struct include Char + + let lowercase_ascii c = + if (c >= 'A' && c <= 'Z') + then unsafe_chr (code c + 32) + else c + + let uppercase_ascii c = + if (c >= 'a' && c <= 'z') + then unsafe_chr (code c - 32) + else c end module String = struct...
2015 Oct 07
1
Re: [PATCH 3/5] mllib: Add (Char|String).(lower|upper)case_ascii functions.
...gt; diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml > index f375317..97363df 100644 > --- a/mllib/common_utils.ml > +++ b/mllib/common_utils.ml > @@ -22,10 +22,23 @@ open Common_gettext.Gettext > > module Char = struct > include Char > + > + let lowercase_ascii c = > + if (c >= 'A' && c <= 'Z') > + then unsafe_chr (code c + 32) > + else c > + > + let uppercase_ascii c = > + if (c >= 'a' && c <= 'z') > + then unsafe_chr (code c - 32) > + els...