Version française
Home     About     Download     Resources     Contact us    
Browse thread
probleme de parsing ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Max Skaller <maxs@i...>
Subject: Re: probleme de parsing ?
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

Furthermore, the float value is wrong: it should be "5.0",
a value which would be parsed as a float by the compiler.
[Both parser functions above should fault, IMHO: the string
should contain exactly the number, no leading spaces]
-- 
John (Max) Skaller at OTT [Open Telecommications Ltd]
mailto:maxs@in.ot.com.au      -- at work
mailto:skaller@maxtal.com.au  -- at home