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 LAA05299; Mon, 16 Aug 2004 11:47:00 +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 LAA04727 for ; Mon, 16 Aug 2004 11:46:59 +0200 (MET DST) Received: from mta1.cl.cam.ac.uk (mta1.cl.cam.ac.uk [128.232.0.15]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i7G9kwRM000968 for ; Mon, 16 Aug 2004 11:46:58 +0200 Received: from zonule.cl.cam.ac.uk ([128.232.9.23] helo=cl.cam.ac.uk ident=[WhLpyOeGh1wolcWJRB1ysncYWDSsuMtm]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1Bwe4u-00088T-00; Mon, 16 Aug 2004 10:46:56 +0100 X-Mailer: exmh version 2.6.3-CL 04/04/2003 with nmh-1.0.4 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: cslists/caml To: =?iso-8859-1?Q?S=E9bastien?= Hinderer cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Continuations In-reply-to: Your message of "Fri, 13 Aug 2004 23:27:22 +0200." <20040813212722.GA1158@galois> Mime-Version: 1.0 Content-Type: text/plain Date: Mon, 16 Aug 2004 10:46:56 +0100 From: Keith Wansbrough Message-Id: X-Miltered: at concorde with ID 41208292.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 printf:01 printf:01 foo:01 pervasives:01 ocaml:01 module:03 string:03 string:03 arguments:03 parse:04 functions:05 strings:06 strings:06 magic:09 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Could someone explain me how the functions from the Printf module work, and > why continuations allow to consume the extra arguments given after the > format string ? OCaml contains special magic to parse the format strings - they aren't really strings. Try doing Printf.printf (if true then "%s,%s" else "%s.%s") "foo" "bar" and see what happens... (you have to use Pervasives.format_of_string to make it work). --KW 8-) ------------------- 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