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 SAA21776; Fri, 23 Apr 2004 18:26:59 +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 SAA22251 for ; Fri, 23 Apr 2004 18:26:58 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3NGQvYM002324 for ; Fri, 23 Apr 2004 18:26:57 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1BH3Vx-0005yv-00 for ; Fri, 23 Apr 2004 17:26:57 +0100 Date: Fri, 23 Apr 2004 17:26:57 +0100 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Suggestion: Pervasives.identity Message-ID: <20040423162657.GA22912@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 pervasives:01 2004:99 stupid:01 crm:99 consultancy:99 ltd:98 int:01 int:01 labels:01 labels:01 thread:02 string:03 string:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Apr 23, 2004 at 10:48:56AM -0500, Brian Hurt wrote: > Possibly stupid question: what use would this function be? I've had to define an identity function from time to time. Most recently I wanted to define a function for printing labels on charts: let plot ?(labels = identity) data = (* ... *) Called as: plot ~labels:string_of_int data if the label was an int instead of the default string. There was a thread on this on ocaml-beginners I think. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment http://www.winwinsales.co.uk/ - CRM improvement consultancy ------------------- 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