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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id C0B08BB9A for ; Sat, 22 Oct 2005 05:35:26 +0200 (CEST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9M3ZQcJ014678 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sat, 22 Oct 2005 05:35:26 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay03.plus.net with esmtp (Exim) id 1ETAAG-0006D4-4y for caml-list@yquem.inria.fr; Sat, 22 Oct 2005 04:35:24 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Duplicate functionality? Date: Sat, 22 Oct 2005 04:31:17 +0100 User-Agent: KMail/1.7.2 References: <0IOQ006I7LO24OK2@vms044.mailsrvcs.net> In-Reply-To: <0IOQ006I7LO24OK2@vms044.mailsrvcs.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510220431.18749.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 4359B37E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 frog:98 wrote:01 modules:01 modules:01 caml:02 tend:02 checking:02 objective:02 objects:02 objects:02 dynamic:03 static:03 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 Saturday 22 October 2005 02:04, Stephen Brackin wrote: > My biggest initial question is why OCaml has both a modules system and > objects: Aren't they different ways of accomplishing the same things? Both modules and objects allow you to encapsulate related definitions, yes. However, modules are much more static by nature and objects are much more dynamic, i.e. you get stronger static checking using modules than you do using objects, giving more comprehensible error messages and more robust and faster code. Consequently, OCaml programmers tend to prefer modules over objects where possible. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists