From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7SAp8bq024348 for ; Sun, 28 Aug 2011 12:51:08 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgABAEEcWk6LEwExe2dsb2JhbABCqAsBARYmBSCBQAEBAQECATgCBgEBNwEECwsOCi5XBogFAqkaAY0SBYVsYKQp X-IronPort-AV: E=Sophos;i="4.68,292,1312149600"; d="scan'208";a="106860043" Received: from infao0809.mpi-sb.mpg.de (HELO hera.mpi-sb.mpg.de) ([139.19.1.49]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 28 Aug 2011 12:51:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=From:To:In-Reply-To:Subject: References:Message-Id:Content-Type:Content-Transfer-Encoding: Mime-Version:Date:Cc; bh=6DjsaGMaYwMmWIadx3bogianZFRDe/0sTpOACJi H3BY=; b=ZNUHuKbts8nXx8KFijET+bDzWIOkR7V9jVHvt+fd06GlEVTEQM1lcSJ eizMxc7DkspnadqwxEKrT37d6izDweA/GVw2hkmzsx8OBQ2MKXhYfCEetRYGpfRK 4ZAD9hs2cHXlSmtQOHG18rb8LNfHBkmbRcQO9rA1o/ti8osnMOVc= Received: from zak.mpi-klsb.mpg.de ([139.19.1.27]:48864) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1Qxcx7-00052L-Mx; Sun, 28 Aug 2011 12:50:59 +0200 Received: from mnch-4d0474cc.pool.mediaways.net ([77.4.116.204]:57410 helo=[192.168.178.31]) by zak.mpi-klsb.mpg.de (envelope-from ) with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) id 1Qxcx6-00022d-R1; Sun, 28 Aug 2011 12:50:57 +0200 From: Andreas Rossberg To: Gerd Stolpmann In-Reply-To: <1314526296.3496.199.camel@thinkpad> References: <4E58CCC3.4040901@gmail.com> <1314457588.3496.86.camel@thinkpad> <1314473840.3496.132.camel@thinkpad> <1314486489.3496.179.camel@thinkpad> <00776888-5A29-4575-BAAC-A27B3F2A8FE3@mpi-sws.org> <1314526296.3496.199.camel@thinkpad> Message-Id: <2490BD8A-2ECF-4917-A829-A86B511D53BB@mpi-sws.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 28 Aug 2011 12:50:55 +0200 Cc: Jeff Meister , david.baelde@ens-lyon.org, Chris Yocum , caml-list List X-Mailer: Apple Mail (2.936) Subject: Re: [Caml-list] Ocaml and the Fragile Base Class Problem 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