From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, DNS_FROM_SECURITYSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 23AE7BBAF for ; Tue, 18 Nov 2008 18:52:17 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.33,626,1220220000"; d="scan'208";a="17336191" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail2-relais-roc.national.inria.fr with SMTP; 18 Nov 2008 18:52:16 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Tue, _d Nov 2008 18:51:21 +0100 From: "Nicolas Pouillard" Content-Type: text/plain; charset=UTF-8 Cc: Caml_mailing list Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included To: Jon Harrop References: <1227002178.6170.25.camel@Blefuscu> <20081118100625.GA25627@annexia.org> <200811181817.23216.jon@ffconsultancy.com> In-Reply-To: <200811181817.23216.jon@ffconsultancy.com> Date: Tue, 18 Nov 2008 18:51:21 +0100 Message-Id: <1227030578-sup-8064@ausone.local> User-Agent: Sup/git X-Spam: no; 0.00; ocaml:01 0100,:01 struct:01 sig:01 val:01 wrote:01 wrote:01 caml-list:01 int:01 underscore:02 underscore:02 external:03 external:03 module:03 module:03 Excerpts from Jon Harrop's message of Tue Nov 18 19:17:23 +0100 2008: > On Tuesday 18 November 2008 10:06:25 Richard Jones wrote: > > On Tue, Nov 18, 2008 at 10:56:18AM +0100, David Teller wrote: > > > open System.IO;; > > > open System.File;; > > > > Your biggest problem is using dot ('.') instead of underscore ('_'). > > Using a dot means that the System namespace cannot be extended by > > external packages. If you use an underscore then an external package > > can extend the namespace (eg. by providing System_Newpackage) > > I don't follow. Can you not use "include" to extend an existing module: > > # module Array = struct > include Array > let empty = [||] > end;; > module Array : > sig > external length : 'a array -> int = "%array_length" > ... > val empty : 'a array > end Yes but that's the same than saying you can change a value: let x = 42 let x = x + 1 So you make a new module but don't extend it. -- Nicolas Pouillard aka Ertai