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 PAA08256; Fri, 23 Apr 2004 15:26:37 +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 PAA08234 for ; Fri, 23 Apr 2004 15:26:36 +0200 (MET DST) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3NDQZjq006538 for ; Fri, 23 Apr 2004 15:26:35 +0200 X-Sasl-enc: cAyQZ5QsuPc19jeaN+L2Sw 1082726793 Received: from [192.168.1.100] (unknown [218.81.124.114]) by mail.messagingengine.com (Postfix) with ESMTP id D0079A91A83 for ; Fri, 23 Apr 2004 09:26:32 -0400 (EDT) Date: Fri, 23 Apr 2004 21:26:20 +0800 (HKT) From: Martin Jambon X-X-Sender: martin@localhost To: caml-list@inria.fr Subject: Re: [Caml-list] Suggestion: Pervasives.identity In-Reply-To: <20040423145614.C3686@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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; caml-list:01 pervasives:01 mli:01 int:01 int:01 jambon:02 jambon:02 external:03 wrote:03 let:04 let:04 compiled:05 efficient:05 define:05 suggestion:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 23 Apr 2004, Xavier Leroy wrote: > Even if you define > external identity: 'a -> 'a = "%identity" > references to "identity" will be compiled like "fun x -> x". > It's only direct applications of "identity", e.g. "identity 3", that > would be more efficient than with the definition > let identity x = x > But I hope your programs don't contain calls like "identity x"... My problem was: (* something.mli *) type key (* something.ml *) type key = int let key_of_int = identity (** what should I write here? **) (* other.ml *) let key = Something.key_of_int 1 Sure, there are more important problems in the world... Martin ------------------- 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