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
[Caml-list] Passing printf format strings to functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <ocaml-erikd@m...>
Subject: Re: [Caml-list] Passing printf format strings to functions
On Wed, 15 Sep 2004 10:12:28 +0200
Jean-Christophe Filliatre <> wrote:

Thanks Jean-Christophe for a very thorough and well explained

> Indeed, there is  no static way to check that  the resulting format is
> indeed of  type (string->string->'a,'b,'c) format. 

Ahh, now I understand. 

With the knowledge you provided and some hacking I did after
I sent the original email, I was able to use a constant format
string like:

    Printf.printf  "    %-*s    %s\n" format_width (fst a) (snd a) ;;

and acheive the result I desired.

  Erik de Castro Lopo (Yes it's valid)
"The earth is degenerating these days. Bribery and corruption abound.
Children no longer mind parents ...and it is evident that the end of
the world is approaching fast." -- Assyrian Tablet Engraved in 2800 B.C.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: