Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
surprised by string_of_bool
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] surprised by string_of_bool
On Wednesday 28 May 2008 09:02:52 David Allsopp wrote:
> > The "correct" strategy seems to be used for string_of_float infinity:
> Well, it's just that string_of_bool can only return two possible values
> where string_of_float must perform an allocation each time.

The current implementation of string_of_float happens to allocate in this case 
but that is not necessary. It could just as well special case these special 
values and return static strings.

Dr Jon D Harrop, Flying Frog Consultancy Ltd.