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 JAA04866; Mon, 7 Oct 2002 09:06:27 +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 JAA04533 for ; Mon, 7 Oct 2002 09:06:26 +0200 (MET DST) 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 g9776I512622; Mon, 7 Oct 2002 09:06:18 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA04709; Mon, 7 Oct 2002 09:06:18 +0200 (MET DST) From: Pierre Weis Message-Id: <200210070706.JAA04709@pauillac.inria.fr> Subject: Re: [Caml-list] syntaxes In-Reply-To: from "Kontra, Gergely" at "Oct 4, 102 12:58:00 pm" To: kgergely@mlabdial.hit.bme.hu (Kontra, Gergely) Date: Mon, 7 Oct 2002 09:06:18 +0200 (MET DST) Cc: daniel.de_rauglaudre@inria.fr, caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > >> Sometimes SML solution is shorter. > >For example? > > pattern matching in function head... > > Gergo > +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+ > | Email: kgergely@mcl.hu, kgergely@turul.eet.bme.hu | > | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 | > +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+ This has been reported many times as such, but: 1) Semantically, this is not as clear as Caml's ``function'' construct. 2) You have to carefully count characters before stating that pattern matching in function head is shorter! Very often, functions using pattern matching have many cases, and repeating the function name for each clause is a burden and a lot more typing. 3) We already had this feature in Caml in the past. When we suppressed it, nobody complained at the time: I suspect that serious Caml's users (those that write in the mailing lists to complain and ask for new features) never used ``pattern matching in function head''. In my mind ``pattern matching in function head'' is a typical ``programming in the small'' feature: it is useful for beginners and/or small functions with only 2 or 3 cases but useless for huge pattern matchings. Once more Caml has a tendency to favour programming in the large. Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- 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