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 UAA28978; Wed, 10 Sep 2003 20:54:52 +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 UAA28501 for ; Wed, 10 Sep 2003 20:54:51 +0200 (MET DST) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h8AIrKT17687 for ; Wed, 10 Sep 2003 20:54:50 +0200 (MET DST) Received: from 12-203-149-172.client.attbi.com ([12.203.149.172]) by ux9.sp.cs.cmu.edu id aa21093; 10 Sep 2003 14:52 EDT Received: from ecc by stratocaster.home with local (Exim 3.36 #1 (Debian)) id 19xA5H-0006m4-00 for ; Wed, 10 Sep 2003 14:52:55 -0400 Date: Wed, 10 Sep 2003 14:52:55 -0400 To: caml-list@inria.fr Subject: [Caml-list] suggestion for record pattern matching and construction Message-ID: <20030910185255.GF25815@ecooper.com> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i From: "Eric C. Cooper" X-Loop: caml-list@inria.fr X-Spam: no; 0.00; nontrivial:01 orthogonal:01 bindings:01 labels:01 simpler:01 syntax:02 contexts:03 omitting:05 suggestion:06 guess:06 pattern:06 pattern:06 cooper:06 cooper:06 notation:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I find that I am often writing code like { field1 = field1; field2 = field2; field3 = field3 } when matching and constructing records. I guess it's because thinking up good names for the record fields is nontrivial and having similar but different names for the bindings just bothers me. How about allowing syntax like that used for labels: { ~field1; ~field2; ~field3 } would expand into the above, in both pattern matching and construction contexts. This is orthogonal to (and I think much simpler than) omitting some fields via "..." notation. -- Eric C. Cooper e c c @ c m u . e d u ------------------- 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