From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 788F9BB9A for ; Wed, 9 Nov 2005 00:40:11 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA8NeABt011272 for ; Wed, 9 Nov 2005 00:40:11 +0100 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 AAA21570 for ; Wed, 9 Nov 2005 00:40:09 +0100 (MET) Received: from mail26.sea5.speakeasy.net (mail26.sea5.speakeasy.net [69.17.117.28]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jA8Ne7RI000322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 9 Nov 2005 00:40:08 +0100 Received: (qmail 14784 invoked from network); 8 Nov 2005 23:40:04 -0000 Received: from shell3.sea5.speakeasy.net ([69.17.116.4]) (envelope-sender ) by mail26.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 8 Nov 2005 23:40:04 -0000 Date: Tue, 8 Nov 2005 15:40:04 -0800 (PST) From: brogoff To: Brian Hurt Cc: caml-list Subject: Re: Ant: [Caml-list] The "Objective" part of Objective Caml In-Reply-To: Message-ID: References: <20051107214110.46596.qmail@web26805.mail.ukl.yahoo.com> <87acggxguw.fsf@mid.deneb.enyo.de> <1131414473.23991.37.camel@rosella> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 4371375A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43713757.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 inherently:01 runtime:01 ocaml:01 recursion:01 okasaki's:01 -rectypes:01 compiler:01 workarounds:01 recursion:01 haskell:01 ocaml:01 2005,:98 wrote:01 polymorphic:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tue, 8 Nov 2005, Brian Hurt wrote: > > As far as static vs dynamic, dynamic type systems are inherently more > > capable. There is no "slack" in a dynamically typed language. But the > > possibility of a runtime exception is of course there. > > But if we restrict ourselves to the domain of correct programs, now I'm > not so sure. Well, maybe, in the extreme fringes, there are correct > programs which are being disallowed by the Ocaml type systems. The canonical examples are those that involve polymorphic recursion (lots of examples in Okasaki's Purely Functional data Structures book) and those that involve flipping on the -rectypes compiler switch. Yes, there are workarounds, but for the polymorphic recursion case, Haskell is nicer. Yes, I realize I am nitpicking. I've only > been programming in Ocaml a couple of years now- I may just have not run > across them yet. But everything I've wanted to do in Ocaml I've been able > to do, working with the type system and not against it. > > > The flip side of this is that OCaml is like Perl, with lots of ways to do > > things, and many overlapping features. The fact that OCaml has classes and > > modules is good, and that's how I think OO languages should be, but I would > > expect that protection and hiding be done only by modules and not objects. > > To my knowledge, they are. How do you declare a private or protected > method for a class variable *without* using modules to do so? There are private methods in OCaml classes. I can imagine in other OO languages that there would be none, and the privateness would be controlled by the module system. It's only in 3.09 that we have private rows, which are a step in the right direction. -- Brian