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 IAA18334; Thu, 19 Jul 2001 08:43:26 +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 IAA18330 for ; Thu, 19 Jul 2001 08:43:25 +0200 (MET DST) Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id f6J6hOT24175 for ; Thu, 19 Jul 2001 08:43:25 +0200 (MET DST) Received: (qmail 22212 invoked from network); 19 Jul 2001 06:43:23 -0000 Received: from unknown (HELO itz.dsl.speakeasy.net) ([216.254.11.87]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 Jul 2001 06:43:23 -0000 Received: from itz by itz.dsl.speakeasy.net with local (Exim 3.22 #1 (Debian)) id 15N7Ws-0002oG-00 for ; Wed, 18 Jul 2001 23:43:22 -0700 To: caml-list@inria.fr (OCAML) Subject: Re: [Caml-list] default values for record field definitions References: <3B565E7B.35BB6073@quasar.ipa.nw.ru> From: Ian Zimmerman Date: 18 Jul 2001 23:43:22 -0700 In-Reply-To: "Alexander V. Voinov"'s message of "Wed, 18 Jul 2001 21:13:47 -0700" Message-ID: <86u209l8qd.fsf@itz.dsl.speakeasy.net> User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Alexander> Why not to introduce a syntax for default values of record Alexander> fields: Alexander> type rec1 = { attr1: type1 = val1; attr2: type2; attr3: Alexander> type3 = val3 } Alexander> It this case constructions of the form Alexander> let x = { attr2 = val2 } are possible, with other fields Alexander> filled by val1, val3. type rec1 = { attr1: type1; attr2: type2; attr3: type3 }; let rec1_default = { attr1 = val1; attr2 = val2; attr3 = val3 } in let x = { rec1_default with attr2 = val2' } and ... BTW, I couldn't find this in the manual! -- Ian Zimmerman, Oakland, California, U.S.A. EngSoc adopts market economy: cheap is wasteful, efficient is expensive. GPG pub key: 433BA087 9C0F 194F 203A 63F7 B1B8 6E5A 8CA3 27DB 433B A087 ------------------- 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