Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Andreas Rossberg <rossberg@mpi-sws.org>
To: Gerd Stolpmann <info@gerd-stolpmann.de>
Cc: Jeff Meister <nanaki@gmail.com>,
	david.baelde@ens-lyon.org, Chris Yocum <cyocum@gmail.com>,
	caml-list List <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocaml and the Fragile Base Class Problem
Date: Sun, 28 Aug 2011 12:50:55 +0200	[thread overview]
Message-ID: <2490BD8A-2ECF-4917-A829-A86B511D53BB@mpi-sws.org> (raw)
In-Reply-To: <1314526296.3496.199.camel@thinkpad>

On Aug 28, 2011, at 12.11 h, Gerd Stolpmann wrote:
> Am Sonntag, den 28.08.2011, 11:31 +0200 schrieb Andreas Rossberg:
>> On Aug 28, 2011, at 01.08 h, Gerd Stolpmann wrote:
>>>
>>> Let me point out one final thing. Information hiding is simply not a
>>> core concept of OO - which is in the first place a specific way of
>>> structuring the program (e.g. group data and algorithms together),
>>> with
>>> an integrated method of adapting object types (subtyping), and  
>>> giving
>>> control of parts of your algorithm to the user of your class.
>>
>> Not sure why you would say that. I'd argue that information hiding
>> ("encapsulation") definitively is very central to OO -- an object
>> collects a set of methods that operate on some hidden shared state
>> (not necessarily mutable). And Ocaml fully supports that.
>
> Who says that the state is or can be hidden? This is certainly a later
> addition to OO, when people found out that they can view a class as an
> abstract data type (with the known limitations). Take off your "typed
> glasses". OO is mainly a way of organizing the execution flow, and  
> there
> are lots of OO languages lacking typing and access control.

Again, I don't follow. Alan Kay claims that he invented the term, and  
his vision of OO was basically that of black boxes communicating  
through messages. AFAICS, that's also the common picture in OOAD  
literature. Whether one buys into that is a different story.

Also, none of that has anything to do with types. Objects-as-records- 
of-closures are a sufficient and pretty natural implementation of this  
concept.

> And even in
> OCaml you'd not use objects if your primary interest is  
> encapsulation -
> objects are not good at this. (That's all what I'm saying!)

I agree. Modules are superior for most day-to-day things. But then  
again, a first-class module is pretty much an object with type  
members, and sometimes one wants first-class modules. ;)

/Andreas


  reply	other threads:[~2011-08-28 10:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 10:53 Chris Yocum
2011-08-27 11:24 ` Jacques Garrigue
2011-08-27 15:06 ` Gerd Stolpmann
2011-08-27 16:59   ` David Baelde
2011-08-27 19:37     ` Gerd Stolpmann
2011-08-27 20:21       ` Jeff Meister
2011-08-27 23:08         ` Gerd Stolpmann
2011-08-28  9:31           ` Andreas Rossberg
2011-08-28 10:04             ` Guillaume Yziquel
2011-08-28 10:11             ` Gerd Stolpmann
2011-08-28 10:50               ` Andreas Rossberg [this message]
2011-08-29  3:35           ` Jacques Garrigue
2011-08-29 11:19             ` Chris Yocum
2011-08-29 11:47               ` Guillaume Yziquel
2011-08-29 12:03                 ` Chris Yocum
2011-08-31 21:33             ` Alain Frisch
2011-08-31 23:39               ` Jacques Garrigue
2011-08-28 17:58       ` Julien Signoles

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=2490BD8A-2ECF-4917-A829-A86B511D53BB@mpi-sws.org \
    --to=rossberg@mpi-sws.org \
    --cc=caml-list@inria.fr \
    --cc=cyocum@gmail.com \
    --cc=david.baelde@ens-lyon.org \
    --cc=info@gerd-stolpmann.de \
    --cc=nanaki@gmail.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