From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA17557; Tue, 5 Jun 2001 19:01:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA17511 for caml-list@pauillac.inria.fr; Tue, 5 Jun 2001 19:01:03 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA17047 for ; Tue, 5 Jun 2001 18:44:10 +0200 (MET DST) Received: from feu.irisa.fr (feu.irisa.fr [131.254.60.80]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f55Gi9r10912 for ; Tue, 5 Jun 2001 18:44:09 +0200 (MET DST) Received: from irisa.fr (sigzag.irisa.fr [131.254.12.93]) by feu.irisa.fr (8.9.3/8.9.3) with ESMTP id SAA12601 for ; Tue, 5 Jun 2001 18:44:09 +0200 (MET DST) Message-ID: <3B1D0C59.B7A518FC@irisa.fr> Date: Tue, 05 Jun 2001 18:44:09 +0200 From: Sylvain Kerjean Organization: IRISA, Campus de Beaulieu, 35042 Rennes Cedex, FRANCE X-Mailer: Mozilla 4.77 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: fr-FR, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Ocaml interface to ctype.h functions References: <20010601232433.A22189@speakeasy.org> <20010605182909.A16268@pauillac.inria.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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