Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ('a, output_chan, unit) format, etc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] ('a, output_chan, unit) format, etc

>I'm trying to write my own printf.  Can someone give me a pointer to where the (evidently built-in) format type is explained?  Thanks.

It's not really a type, it's just mocked up that way by the compiler so that the type inference works out for the parms.  It's a total hack (a clever one, but a hack nonetheless).  You use Obj.magic to cast it back to the string, and then use Obj.magic to return a bunch of functions that eat the parms.  Check out printf.ml.

Chris


-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr