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 JAA18607; Thu, 19 Jul 2001 09:05:32 +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 JAA18603 for ; Thu, 19 Jul 2001 09:05:31 +0200 (MET DST) Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f6J75UT24439 for ; Thu, 19 Jul 2001 09:05:31 +0200 (MET DST) Received: (from uucp@localhost) by relay.rinet.ru (8.11.4/8.11.4) with UUCP id f6J75LF12309 for caml-list@inria.fr; Thu, 19 Jul 2001 11:05:21 +0400 (MSD) X-Envelope-To: caml-list@inria.fr Received: from dialin1.stormoff (DIMA) [192.168.0.129] by stormoff with esmtp (Exim 2.05 #1 (Debian)) id 15N7pS-0006TJ-00; Thu, 19 Jul 2001 11:02:34 +0400 X-Comment-To: "Alexander V. Voinov" To: caml-list@inria.fr Subject: Re: [Caml-list] default values for record field definitions References: <3B565E7B.35BB6073@quasar.ipa.nw.ru> From: Dmitry Bely Date: 19 Jul 2001 11:02:31 +0400 In-Reply-To: <3B565E7B.35BB6073@quasar.ipa.nw.ru> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Alexander V. Voinov" writes: > It may well be that I'm not in the first hundred of those who proposed > this, if so - sorry :-). > > Why not to introduce a syntax for default values of record fields: > > type rec1 = { attr1: type1 = val1; attr2: type2; attr3: type3 = val3 } > > It this case constructions of the form > > let x = { attr2 = val2 } are possible, with other fields filled by val1, > val3. > > Can it be done via camlp4? Why don't you like type rec1 = { attr1: type1; attr2: type2; attr3: type } let default_rec1 = { attr1 = init_val1; attr2 = init_val2; attr = init_val3 } ... let x = { default_rec1 with attr2 = val2 } ? Hope to hear from you soon, Dmitry ------------------- 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