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] Printf question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Printf question
On Sat, Sep 27, 2003 at 02:11:14AM +0200, Olivier Andrieu wrote:
> You could use the %a format. See the Prinf module documentation : 
>    * `a': user-defined printer. Takes two arguments and apply the first
>      one to `outchan' (the current output channel) and to the second
>      argument. The first argument must therefore have type `out_channel
>      -> 'b -> unit' and the second `'b'.  The output produced by the
>      function is therefore inserted in the output of `fprintf' at the
>      current point.
> (that's for fprintf, for sprintf the printer would be of type 
>  `unit -> 'b -> string')

I guess the problem with this is that I lose any type safety,
which is the whole point of doing things this way.


Richard Jones.
Merjis Ltd. - all your business data are belong to you.
C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes,
trees, string funcs, pool allocator:

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