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 OAA19690; Mon, 30 Jul 2001 14:21:31 +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 OAA19677 for ; Mon, 30 Jul 2001 14:21:30 +0200 (MET DST) Received: from www.image-acquire.com (valkyrie.image-acquire.com [207.71.8.230]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f6UCLSv19839 for ; Mon, 30 Jul 2001 14:21:29 +0200 (MET DST) Received: from [192.168.0.2] (p17-max1.wlg.ihug.co.nz [203.173.230.17]) by www.image-acquire.com (8.9.3/8.9.3) with ESMTP id HAA09454; Mon, 30 Jul 2001 07:21:14 -0500 Mime-Version: 1.0 X-Sender: bruce@www.hoult.org Message-Id: In-Reply-To: <20010726083524.B65526@caddr.com> References: <8E31D6933A2FE64F8AE3CC1381EEDCE70B2AEA@NT.kal.com> <20010726083524.B65526@caddr.com> Date: Tue, 31 Jul 2001 00:21:08 +1200 To: Miles Egan , Dave Berry From: Bruce Hoult Subject: Re: [Caml-list] a reckless proposal Cc: caml-list@inria.fr Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk At 8:35 AM -0700 26/7/01, Miles Egan wrote: >On Wed, Jul 25, 2001 at 10:30:09AM +0100, Dave Berry wrote: >> So perhaps Ocaml should adopt the approach used in Dylan and Moby, >> where field names in class definitions have module scope. Then >> records and objects would have similar scoping rules, instead of >> the current clash, and the distinction between modules and objects >> would be clearer. > >I suppose this is also similar to CLOS generics, right? I suppose >this would be more consistent but perhaps even more confusing to >people who've been writing ClassA.field and ClassB.field since the >first day of their first Java class. Sorry to reply to this a couple of days late, but I was preoccupied with a certain programing contest... Yes, the Dylan object system is extremely similar to CLOS. But the language provides just a little syntactic sugar so that instead of "field(object)" (or "(field object) in Lisp") you can also write "object.field". Also, instead of field-setter(newVal, object) you can write object.field := newVal. And a similar syntax correspondence for "a[i]" and "a[i] := b" which expand to calls to element() and element-setter(). A needless inconsistency compared to the simplicity and power of pure S-expressions, for sure, but one that as a Pascal and C/C++ and Java programmer I find very comfortable. -- Bruce ------------------- 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