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
ocaml 2.02 bug: curried printf
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-03-12 (17:13)
From: William Chesters <williamc@d...>
Subject: Re: ocaml 2.02 bug: curried printf
Xavier Leroy writes:
 > The behavior of the *printf functions when partially applied
 > has always been a bit strange even before 2.02: [...]

Ooooh yes, I never noticed that ...

 > The alternative is to keep a buffer-based sprintf that is efficient
 > and consistent with printf ("consistent" in the sense of "as weird as"),
 > but is not really usable in partial application contexts.
 > Any opinions?

The change in behaviour was a nuisance to me (and I now have a module
called Printf201!).  In spite of that I'd be happy to stick with the
new semantics if it's more efficient.  I say that becase I believe the
reason I used constructs like

       concat " " ( (sprintf "...") xs)

, for generating C code and string representations of complex objects,
was precisely because of the lack of extensible string buffers.  With
Buffer available I would be more likely to use a `for' loop with
`bprintf' (or indeed `Format.bprintf').