Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Ocaml interface to ctype.h functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sylvain Kerjean <skerjean@i...>
Subject: Re: [Caml-list] Ocaml interface to ctype.h functions
Xavier Leroy wrote:
> 
> It's mostly a matter of knowing what we want these classification
> functions to do.  Meanwhile, it might be easier to define your own
> isalpha, etc, predicates; at least you get to choose the encoding!
> Besides, it's really easy using pattern-matching, e.g. for ASCII:
> 
> let isalpha = function 'A'..'Z'|'a'..'z' -> true | _ -> false
>

I did it at the compiler level, shortcutting (is it english ??) the call
to  the C isalpha function
in the lexer and coded my own in order to support accented letters in my
compiler (it worked bad on BeOS). But i realize i coudln't share my
programs anymore with an unmodified compiler :/

So I think it is a good idea to have standard characters let's say
simple ascii and let users
re-implement an isalpha() predicate at the user level ...
And if there are some good unicode coders here, i am greatfully
interested !


-- 
Sylvain Kerjean
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 75 99, Fax: +33 (0) 2 99 84 71 71
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr