English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2001-04-06 (07:15)
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.


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