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 KAA16426; Fri, 11 May 2001 10:00:09 +0200 (MET DST) 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 KAA16422 for ; Fri, 11 May 2001 10:00:08 +0200 (MET DST) Received: from uni-sb.de (uni-sb.de [134.96.252.33]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4B807f22142 for ; Fri, 11 May 2001 10:00:07 +0200 (MET DST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.11.3/2001032800) with ESMTP id f4B800O13372 for ; Fri, 11 May 2001 10:00:00 +0200 (CEST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.11.3/2001043000) with ESMTP id f4B806B03173 for ; Fri, 11 May 2001 10:00:06 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.11.3/2001041100) with ESMTP id f4B805907010 for ; Fri, 11 May 2001 10:00:05 +0200 (CEST) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (zoidberg.ps.uni-sb.de [134.96.186.121]) by ps.uni-sb.de (8.11.0/8.11.0) with ESMTP id f4B805K21011; Fri, 11 May 2001 10:00:05 +0200 Message-ID: <3AFB9C04.AD291AC6@ps.uni-sb.de> Date: Fri, 11 May 2001 10:00:04 +0200 From: Andreas Rossberg Organization: =?iso-8859-1?Q?Universit=E4t?= des Saarlandes X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-14 i686) X-Accept-Language: de, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Record pattern matching References: <0C682B70CE37BC4EADED9D375809768A02DB1FEF@red-msg-04.redmond.corp.microsoft.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > You'd rather be forced to code something like: > > > > function { a=a; b=_ } -> a;; > > > > where all the fields have to be named, but some of them can > > be specified as ignored? No, but as Don suggested having alternative syntax would be preferable. SML for example distinguishes the patterns {a = p} and {a = p, ...} > I guess the point is that I don't use record pattern matching much, and > where I do I don't want partial matches. Or at least I have a cases > where enforcing full matching would catch more bugs. This has been my experience as well when modifying record types. > > There is a sense in which > > > > record.a > > > > is just a shorthand for > > > > match record with { a=value } -> value > > > > which means that you might argue that the notation > > > > record.a > > > > should be completed by naming every field too :-) In SML the record selection function #a in fact is sugar for fn {a=x, ...} => x Best regards, - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de "Computer games don't affect kids. If Pac Man affected us as kids, we would all be running around in darkened rooms, munching pills, and listening to repetitive music." ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr