Browse thread
probleme de parsing ?
-
Jean-Yves Moyen
- Vitaly Lugovsky
- Sven LUTHER
- Max Skaller
- Xavier Leroy
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Vitaly Lugovsky <vsl@o...> |
| Subject: | Re: probleme de parsing ? |
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)