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 PAA10560; Tue, 15 Jan 2002 15:54:47 +0100 (MET) 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 PAA10784 for ; Tue, 15 Jan 2002 15:54:47 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0FEsib17653; Tue, 15 Jan 2002 15:54:44 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA10146; Tue, 15 Jan 2002 15:54:43 +0100 (MET) Date: Tue, 15 Jan 2002 15:54:43 +0100 From: Xavier Leroy To: Brian Rogoff Cc: caml-list@inria.fr Subject: Re: [Caml-list] Caml historical question Message-ID: <20020115155443.A10666@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from bpr@bpr.best.vwh.net on Thu, Jan 10, 2002 at 04:40:20PM +0000 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > OK Caml history buffs, I have a question which arose during my > proofreading of a chapter of the forthcoming bestseller "Developing > Applications with Objective Caml" (Stephen King, watch out!). > > In the current translation, it is mentioned that "fun" is a legacy of > older versions of Caml and it is insinuated that the "fun" form is somehow > deprecated in favor of fun. What's the straight dope? I wouldn't say that either "fun" or "function" is deprecated in favor of the other. Basically, we have "fun" for multiple-arguments, one-case definitions: fun pat1 ... patN -> expr and "function" for single-argument, multiple-case definitions: function pat1 -> expr1 | ... | patN -> exprN Both seem equally useful, although there is admittedly some overlap between the two forms. What is deprecated in OCaml, but was supported in Caml Light and Caml V3.1, is multiple-case "fun": fun pat11 ... patN1 -> expr1 | ... | pat1M ... patNM -> exprM Although this form subsumes the previous two, the extra generality was rarely useful, and complex patterns have to be parenthesized so that the parser can figure them out. - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr