caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Bruce Hoult <bruce@hoult.org>
To: Miles Egan <miles@caddr.com>, Dave Berry <Dave@kal.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] a reckless proposal
Date: Tue, 31 Jul 2001 00:21:08 +1200	[thread overview]
Message-ID: <a0510100db78b001e923e@[192.168.0.2]> (raw)
In-Reply-To: <20010726083524.B65526@caddr.com>

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


  reply	other threads:[~2001-07-30 12:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-25  9:30 Dave Berry
2001-07-26 15:35 ` Miles Egan
2001-07-30 12:21   ` Bruce Hoult [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-24 18:08 Miles Egan
2001-07-24 19:44 ` Brian Rogoff
2001-07-24 21:02   ` Miles Egan
2001-07-25 15:15     ` Brian Rogoff
2001-07-26 15:27       ` Miles Egan
2001-07-26 15:47         ` Brian Rogoff
2001-07-26 16:01           ` Miles Egan
2001-07-26 21:19   ` John Max Skaller
2001-07-24 20:26 ` Sven
2001-07-24 20:51   ` Miles Egan
2001-07-25  8:30 ` FabienFleutot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='a0510100db78b001e923e@[192.168.0.2]' \
    --to=bruce@hoult.org \
    --cc=Dave@kal.com \
    --cc=caml-list@inria.fr \
    --cc=miles@caddr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).