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 FAA27585; Sun, 18 May 2003 05:23:30 +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 FAA27333 for ; Sun, 18 May 2003 05:23:29 +0200 (MET DST) Received: from null.cs.brown.edu (null.cs.brown.edu [128.148.38.190]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4I3NSH06647 for ; Sun, 18 May 2003 05:23:28 +0200 (MET DST) Received: from miette (miette [128.148.38.66]) by null.cs.brown.edu (Postfix) with ESMTP id 105353F66; Sat, 17 May 2003 23:23:28 -0400 (EDT) Received: from er by miette with local (Exim 3.36 #1 (Debian)) id 19HElk-0008VS-00; Sat, 17 May 2003 23:23:28 -0400 Date: Sat, 17 May 2003 23:23:28 -0400 From: Manos Renieris To: Brian Hurt Cc: Ocaml Mailing List Subject: Re: [Caml-list] Printf question Message-ID: <20030518032327.GA32539@cs.brown.edu> Reply-To: Manos Renieris Mail-Followup-To: Brian Hurt , Ocaml Mailing List References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Spam: no; 0.00; renieris:01 caml-list:01 printf:01 foo:01 debug:01 wrote:03 let:04 define:05 cvs:05 strings:06 i'd:06 brian:06 basically:06 defined:07 wrapper:08 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, May 17, 2003 at 08:34:27PM -0500, Brian Hurt wrote: > > I want to define a wrapper function for printf, basically for debug. I'd > I tried: > let debug s = Printf.printf ("FOO: " ^ s ^ "\n") > and: > let debug s = let t = "FOO: " ^ s ^ "\n" in Printf.printf s > and neither works. You need to concatenate formats, not strings. In the CVS version, (^^) is defined, and does exactly that. -- Manos ------------------- 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