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 SAA01012; Fri, 26 Apr 2002 18:11:31 +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 SAA00668 for ; Fri, 26 Apr 2002 18:11:30 +0200 (MET DST) Received: from gwsmtp.thomson-csf.com (gwsmtp.thomson-csf.com [195.101.39.226]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3QGBNf29029 for ; Fri, 26 Apr 2002 18:11:29 +0200 (MET DST) Received: from thomplex.thomson-csf.com (200.3.2.2) by gwsmtp.thomson-csf.com (NPlex 5.1.053) id 3CC6487B00054EB7 for caml-list@inria.fr; Fri, 26 Apr 2002 09:29:36 +0200 Received: from thomplex.thomson-csf.com (200.3.2.2) by thomplex.thomson-csf.com (NPlex 5.1.036) id 3CC6818000049D74 for caml-list@inria.fr; Fri, 26 Apr 2002 09:29:14 +0200 Received: from bgxplex3.bgx.airsys.thomson-csf.com (1.38.9.153) by bgxplex.bgx.airsys.thomson-csf.com (NPlex 5.1.053) id 3CAC2CE10003E97C for caml-list@inria.fr; Fri, 26 Apr 2002 09:26:53 +0200 Received: from bgxplex3.bgx.airsys.thomson-csf.com (1.38.9.153) by bgxplex3.bgx.airsys.thomson-csf.com (NPlex 5.1.053) id 3CC5815500006755 for caml-list@inria.fr; Fri, 26 Apr 2002 09:26:49 +0200 Received: from 187.150.3.12 by bgxplex3.bgx.airsys.thomson-csf.com (InterScan E-Mail VirusWall NT); Fri, 26 Apr 2002 09:25:51 +0200 Received: from af_mara by lully.bgx.airsys.thomson-csf.com with local (Exim 3.22 #1 (Red Hat Linux)) id 17106m-0000Yv-00 for ; Fri, 26 Apr 2002 09:25:32 +0200 Date: Fri, 26 Apr 2002 09:25:32 +0200 From: =?iso-8859-1?Q?J=E9r=F4me_Marant?= To: caml-list@inria.fr Subject: Re: [Caml-list] How to read three integers from a text-file... ? Message-ID: <20020426092532.A2133@fr.thalesgroup.com> Mail-Followup-To: caml-list@inria.fr References: <20020425111905.GA31096@kiefer.ai.univie.ac.at> <20020425133343.A31232@fr.thalesgroup.com> <4.3.2.7.2.20020425105510.02d0a600@mail.d6.com> <20020426083244K.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020426083244K.garrigue@kurims.kyoto-u.ac.jp>; from garrigue@kurims.kyoto-u.ac.jp on Fri, Apr 26, 2002 at 08:32:44AM +0900 Content-Transfer-Encoding: Quoted-Printable Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Apr 26, 2002 at 08:32:44AM +0900, Jacques Garrigue wrote: > From: Chris Hecker > >=20 > > > Well, this would make a static printf rather that the well known = printf > > > from C, since the format string may be known only at runtime in s= ome > > > cases. > >=20 > > As Markus says, the Printf.printf doesn't work in this case anyway ri= ght=20 > > now, since it happens completely at compile time, I believe. >=20 > Type-checking is completely at compile time, but you can define your > format independently if you want: >=20 > # let fmt : (_,_,_) format =3D "Hello %s, it's %d:%d.\n";; > val fmt : (string -> int -> int -> 'a, 'b, 'a) format =3D > # Printf.printf fmt "Chris" 9 30;; > Hello Chris, it's 9:30. Jacques, Would it be difficult to add arguments reordering to printf like: (we already talked about this in previous messages) =20 printf " %2$d %1$s " 1 "hello";; Which gives: hello 1 Thanks. --=20 J=E9r=F4me Marant ------------------- 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