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 WAA06355; Fri, 23 Apr 2004 22:20:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA06345 for ; Fri, 23 Apr 2004 22:20:17 +0200 (MET DST) Received: from hirsch.in-berlin.de (hirsch.in-berlin.de [192.109.42.6]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3NKKGjq021053 for ; Fri, 23 Apr 2004 22:20:17 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from hirsch.in-berlin.de (localhost [127.0.0.1]) by hirsch.in-berlin.de (8.12.11/8.12.11/Debian-3) with ESMTP id i3NKK1IW012403 for ; Fri, 23 Apr 2004 22:20:15 +0200 Received: from first.UUCP (uucp@localhost) by hirsch.in-berlin.de (8.12.11/8.12.11/Debian-3) with UUCP id i3NKF4wC012020 for inria.fr!caml-list; Fri, 23 Apr 2004 22:15:04 +0200 Received: by first.in-berlin.de via sendmail from stdin id (Debian Smail3.2.0.114) Fri, 23 Apr 2004 22:10:24 +0200 (CEST) From: oliver@first.in-berlin.de (Oliver Bandel) Date: Fri, 23 Apr 2004 22:10:24 +0200 To: caml-list@inria.fr Subject: [oliver: Re: [Caml-list] Suggestion: Pervasives.identity] Message-ID: <20040423201023.GG271@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; oliver:01 in-berlin:01 oliver:01 bandel:01 caml-list:01 pervasives:01 caml-list:01 pervasives:01 2004:99 black:98 readable:01 forwarded:97 forwarded:97 ciao:02 jambon:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk ----- Forwarded message from oliver ----- To: Martin Jambon Subject: Re: [Caml-list] Suggestion: Pervasives.identity On Fri, Apr 23, 2004 at 08:18:21PM +0800, Martin Jambon wrote: > Hello, > > Is there a good why there is no predefined identity function? > (fun x -> x) is sometimes less readable, and seems to be not > compiled (yet?) as this black magic: > external identity : 'a -> 'a : "%identity" > > In the same style, we already have Pervasives.ignore, so why not > Pervasives.identity? > When/where/why do you need such a function? And why don't you define it yourself? let id x = x THIS does not seem to compicated or unconvenient to do it by yourself. But why do you want to have such a function? I see no reason to have such a function. If you for example call a function and give it as one parameter a why should you instead give it an id ?! and why not give back then id ( id ) or id ( id ( id ) )???? What would that be good for? Why not saying x instead of (fun x -> x) ????? Do you like function calls so much, that you are doing as much as you can in your code? Ciao, Oliver ----- End forwarded message ----- ------------------- 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