From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA09808 for caml-redistribution; Wed, 1 Mar 2000 20:02:14 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA18635 for ; Wed, 1 Mar 2000 19:16:17 +0100 (MET) Received: from ontil.ihep.su (ontil.ihep.su [194.190.161.63]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA02222 for ; Wed, 1 Mar 2000 19:16:14 +0100 (MET) Received: from localhost (vsl@localhost) by ontil.ihep.su (8.9.3/8.8.7) with ESMTP id VAA07082; Wed, 1 Mar 2000 21:07:39 +0300 Date: Wed, 1 Mar 2000 21:07:39 +0300 (MSK) From: Vitaly Lugovsky To: Jean-Yves Moyen cc: caml-list@inria.fr Subject: Re: probleme de parsing ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis On Tue, 29 Feb 2000, Jean-Yves Moyen wrote: > Bonjour, il y a apparamment un probleme de parsing des chaines dans la > fonction int_of_string : les espaces precedents (ou suivant) les nombres > ne sont pas eliminer. En revanche, il le sont dans la fonction > float_of_string : > > # int_of_string " 5";; > Uncaught exception: Failure("int_of_string") > #float_of_string " 5";; > - : float = 5 > > (avec Ocaml 2.04) > > Est-ce voulu ? Si oui, pourquoi avoir introduit cette difference ? Here is a kinda hack for it. Dunno, can it be a convential solution, we have not standard documents, etc... ocaml/byterun/ints.c: ----- 24a25,26 > #define _isdelimeter(c) ((c)==' ' || (c)=='\t' || (c)=='\n') > 29a32 > while(_isdelimeter(*p)) p++; ------ -- V.S.Lugovsky aka Mauhuur (http://ontil.ihep.su/~vsl) (UIN=45482254)