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 PAA30036; Fri, 10 Jan 2003 15:34:43 +0100 (MET) 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 PAA03649 for ; Fri, 10 Jan 2003 15:34:42 +0100 (MET) Received: from grace.speakeasy.org (grace.speakeasy.org [216.254.0.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h0AEYf520636 for ; Fri, 10 Jan 2003 15:34:41 +0100 (MET) Received: (qmail 26973 invoked by uid 36130); 10 Jan 2003 14:34:40 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Jan 2003 14:34:40 -0000 Date: Fri, 10 Jan 2003 06:34:40 -0800 (PST) From: brogoff@speakeasy.net To: Xavier Leroy cc: "A. Ozmen" , "caml-list@inria.fr" Subject: Re: [Caml-list] record declaration, SML In-Reply-To: <20030110102111.A21055@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 10 Jan 2003, Xavier Leroy wrote: > > There are a few other conveniences in SML record handling too, like the ... > > notation, that don't exist in OCaml. > > You mean, in pattern-matching over records? Caml offers the same > functionality without the ... notation, e.g. > > type r = { x: int; y: int } > > match r with { x = 1 } -> ... > > Because records are declared in advance, there is no requirement that > all record labels be mentioned in a pattern matching. Right, but if I'm not mistaken, SML forces you to use the ... in record pattern matching when you want to ignore some labels in the match. As you suggest, this is a lot more important in SML, but even in OCaml it would be a bit better IMO to explicitly distinguish between ignoring some labels and forgetting some, so that slovenly programmers (like yours truly) could depend on the type checker to slap them when they miss fields. Unfortunately, OCaml behaves as though every record pattern match had an implicit ..., so I don't see a good way out even if the developers agreed that this was worth fixing. File that one under "petty complaints", or, if you're feeling generous in this new year, under the non-petty "Oh how I wish we had more polymorphism in records!" complaint :-) -- Brian ------------------- 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