From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA30925; Mon, 19 May 2003 12:03:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA00893 for ; Mon, 19 May 2003 12:03:39 +0200 (MET DST) Received: from avalon.ens-lsh.fr (mailhost.ens-lsh.fr [193.51.131.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4JA3aH22217 for ; Mon, 19 May 2003 12:03:38 +0200 (MET DST) Received: from avalon.ens-lsh.fr (localhost [127.0.0.1]) by avalon.ens-lsh.fr (8.12.8/8.12.8) with ESMTP id h4JB2mnI003470 for ; Mon, 19 May 2003 12:02:48 +0100 (WEST) Received: from ens-notes1.ens-lsh.fr (ens-notes1.ens-lsh.fr [10.2.1.44]) by avalon.ens-lsh.fr (8.12.8/8.12.8) with ESMTP id h4JB2mV9003467 for ; Mon, 19 May 2003 12:02:48 +0100 (WEST) Received: from mostha ([10.3.20.3]) by ens-notes1.ens-lsh.fr (Lotus Domino Release 5.0.10) with SMTP id 2003051912033531:16246 ; Mon, 19 May 2003 12:03:35 +0200 Date: Mon, 19 May 2003 12:00:56 +0200 From: Damien To: caml-list@inria.fr Subject: [Caml-list] kprintf question (was printf question) Message-Id: <20030519120056.5544c687.Damien.Pous@ens-lyon.fr> Organization: mosthagloups X-Mailer: Sylpheed version 0.8.11claws141 (GTK+ 1.2.10; i386-debian-linux-gnu) Mime-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on ens-notes1/ENS-LSH(Release 5.0.10 |March 22, 2002) at 19/05/2003 12:03:35, Serialize by Router on ens-notes1/ENS-LSH(Release 5.0.10 |March 22, 2002) at 19/05/2003 12:03:35, Serialize complete at 19/05/2003 12:03:35 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Spam: no; 0.00; damien:01 ens-lyon:01 kprintf:01 printf:01 prerr:01 endline:01 debugging:01 inserting:01 dummy:01 polymorphic:01 continuation:02 unit:03 string:03 obj:03 ugly:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk hi, I've got three questions about Printf.kprintf : * why has it type (string -> string) -> ('a, unit, string) format -> 'a and not (string -> 'b) -> ('a, unit, 'b) format -> 'a this would allow to make _exactly_ what we want within the continuation. * why is it _pseudo_ polymorphic ? # Printf.kprintf (fun s -> prerr_endline s; "");; - : ('_a, unit, string) format -> '_a = * couldn't Printf export a dummy function zprintf: ('a, 'b, unit) format -> 'a that does nothing ! this would allow a more efficient debugging function in the code I've just posted (printf question), without inserting ugly Obj.magics. thanks, damien -- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners