[Ocaml-i18n] Re: [Ocaml-lib-devel] Some (simple) functions I'd like to see in ExtLib ...

Richard Jones rich at annexia.org
Thu May 27 07:59:44 PDT 2004


On Thu, May 27, 2004 at 03:53:41PM +0100, Richard Jones wrote:
> > > ** ExtChar (or perhaps better in UChar):
> > >
> > > is_space, is_alnum, is_digit, is_xdigit, etc.  It's inexplicable why
> > > these were left out of the standard OCaml library.
> > 
> > you're welcome to send a full featured ExtChar module.
> 
> OK, will look at this.  Do you think it should be ExtChar or UChar
> though?  Since so much of the code I now write uses UTF-8 exclusively
> I'm loathe to contribute any more 8-bit-char-specific code to the
> world ...

Actually I can answer my own question here.  We could define the
ExtChar.is_* functions to only work correctly on 7-bit ASCII.  They
would return false on any character codes >= 128.  This way they
should do the Right Thing when presented with UTF-8 strings too.

(CC-ing this to ocaml-i18n so that people who know what they're
talking about can comment).

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
MOD_CAML lets you run type-safe Objective CAML programs inside the Apache
webserver. http://www.merjis.com/developers/mod_caml/



More information about the Ocaml-i18n mailing list