From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 78AF97ED7A for ; Fri, 21 Sep 2012 18:41:18 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.115; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of dhouse@janestreet.com designates 38.105.200.115 as permitted sender) identity=mailfrom; client-ip=38.105.200.115; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@nyc-dmz-mxout2.janestreet.com) identity=helo; client-ip=38.105.200.115; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="postmaster@nyc-dmz-mxout2.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4BAMqXXFAmachzl2dsb2JhbABFrCiRZisBAQEBAQgWBzuCIAEBAQQSAiwBASwLAQ8LCw0NISEBEgEFAQoSBhMSEIdRAw8DAQeaUAkDimiEMgEFhVsDColNBoo6YoYmlBKBVYEVigODKxYphAiCFg X-IronPort-AV: E=Sophos;i="4.80,463,1344204000"; d="scan'208";a="156550426" Received: from mx2.janestreet.com (HELO nyc-dmz-mxout2.janestreet.com) ([38.105.200.115]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Sep 2012 18:41:17 +0200 Received: from nyc-qsv-mail1.delacy.com ([172.25.22.57]) by nyc-dmz-mxout2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TF6Hy-0007lG-WB for caml-list@inria.fr; Fri, 21 Sep 2012 12:41:15 -0400 Received: from nyc-dmz-mxgoog1.delacy.com ([172.25.224.109] helo=mxgoog1.janestreet.com) by nyc-qsv-mail1.delacy.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TF6Hy-0000FR-Up for caml-list@inria.fr; Fri, 21 Sep 2012 12:41:14 -0400 Received: from mail-qc0-f182.google.com ([209.85.216.182]) by mxgoog1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TF6Hy-00022T-T2 for caml-list@inria.fr; Fri, 21 Sep 2012 12:41:14 -0400 Received: by qcsg15 with SMTP id g15so4141207qcs.27 for ; Fri, 21 Sep 2012 09:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xIV3VbsxEYFRwmIdEk7WaYF7SSbDWxQZB9seJIWifV0=; b=eF40O/qXGzkd/2SJakUxblhZL+/1zDi6Ym70ZqfaJ0kjeG4NOilPbTzqptL9yFSU3t Y/zY4x6vxFRfIsj7vEhDsLmc9Cz2H+FKhPfEg5N7iUExusjsc/95bSgIUdFT4PCPtsy6 JrDWVoWnIHsZ3iTUoiD2vRDpYpIoVfF8ICqN4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=xIV3VbsxEYFRwmIdEk7WaYF7SSbDWxQZB9seJIWifV0=; b=hen0HC510e9HoHmEzixDY/hkv9puAItPTUBDUHjR1sReouINNaI3ri/8O8urO4FAfR C7Shh62EmJibrWdjd4wEfVlH84C6i5ixsccIsyMzONuX/HZIVW6xZ5EeqgycbXLvb6FY 45zGgEwoInNmBaIN7nspp2Q+lJ2SqUJbbAgK9QvtysOsCoVR8jlN5ik37BdVyKWjaNJ1 T2gWEdLl+A1qPGDV0+DWBVb9N+snCG5GAKF6C/Dun8XyIacV5xKazdWKhOgr5e+VlCQ5 wNO4mb7ajJlJAoH596HdLDVoFrSyirhFKYpfn9dPdiF0OlY2bDQp2+Qp8dqTnsF/3MgW tZbA== MIME-Version: 1.0 Received: by 10.224.174.75 with SMTP id s11mr13323375qaz.88.1348245674600; Fri, 21 Sep 2012 09:41:14 -0700 (PDT) Received: by 10.49.6.7 with HTTP; Fri, 21 Sep 2012 09:41:14 -0700 (PDT) X-Originating-IP: [80.169.196.210] In-Reply-To: <3371F9A1-1248-42DC-9761-8A7797A1C1D1@gmail.com> References: <3371F9A1-1248-42DC-9761-8A7797A1C1D1@gmail.com> Date: Fri, 21 Sep 2012 17:41:14 +0100 Message-ID: From: David House To: Pierre-Etienne Meunier Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlTc212AWCCTC4kI6EkXevr/A6QOr2Ef6MDcBJcNIKMttkPAwGLRBiwUNvNETvMapcXjvVa Subject: Re: [Caml-list] Partial module include Sure. That exact code will work just fine. It's a special case of "shadowing", where bindings override any previous ones, for the duration of their scope. E.g.: let x = 5 in let x = 4 in (* here x is 4 *) also: let x = 5 in let () = let x = 4 in printf "%d " x in printf "%d\n" x Prints "4 5", because the inner binding only has effect during the time that it is in scope, and afterwards the original binding is "uncovered" again. On Fri, Sep 21, 2012 at 5:37 PM, Pierre-Etienne Meunier wrote: > Hi, > > Is it possible in ocaml to redefine a part of an included module, like in the following code ? > > module A=struct > let a=0 > let b=1 > end > > module B=struct > include A > let b=2 > end > > > Thanks > Pierre > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >