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: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: another approach to sprintf (Re: ocaml 2.02 bug: curried printf)
> I don't know very much about *printf in ocaml, but how about Olivier
> Danvy's approach to sprintf (
> It seems safer and faster than ordinary "interpretive" approach.  I'd
> like to hear what do you (I mean, readers of this mailing list) think
> about it.

It's a cute trick.  One drawback is that the format is not a character
string, but needs to be expressed using special functions and infix
operators.  On the other hand, it doesn't need the special
typechecking rules for format strings that we have in OCaml.

With this special typechecking rules, I don't think Danvy's "partially
evaluated" printf is any safer than OCaml's "interpreted" printf.

Also, it doesn't solve (nor makes any worse) the issues with partial
application of printf and friends that we discussed before.

- Xavier Leroy