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 9D00A7ED7A for ; Fri, 21 Sep 2012 18:44:10 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of pierreetienne.meunier@gmail.com) identity=pra; client-ip=74.125.82.52; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierreetienne.meunier@gmail.com"; x-sender="pierreetienne.meunier@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of pierreetienne.meunier@gmail.com designates 74.125.82.52 as permitted sender) identity=mailfrom; client-ip=74.125.82.52; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierreetienne.meunier@gmail.com"; x-sender="pierreetienne.meunier@gmail.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@mail-wg0-f52.google.com) identity=helo; client-ip=74.125.82.52; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="pierreetienne.meunier@gmail.com"; x-sender="postmaster@mail-wg0-f52.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcCAO+YXFBKfVI0jWdsb2JhbABFrCiRZggjAQEBAQkJCwkSBiOCIAEBAQMBEgIsARsSDAMBCwYFCw0NISECEQEFAQoSGRIQh1ABAwkGBAeaUAkDjCWCdYUWChknAwpZiHQBBQyKLmKDBoJAYAOUD4FVgRWKA4MrP4QJ X-IronPort-AV: E=Sophos;i="4.80,463,1344204000"; d="scan'208";a="156550627" Received: from mail-wg0-f52.google.com ([74.125.82.52]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Sep 2012 18:43:50 +0200 Received: by wgbfg15 with SMTP id fg15so2698865wgb.9 for ; Fri, 21 Sep 2012 09:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=8+79DskWDSFBpXrOiWz5N7P0LsTJMoOJbSHqg63IPIo=; b=kdpL53rd9yWq25cm3rXVpkAKbRWLL1ISzxXoNUBb14lKMS4ybl6RdVfU3a+BKDLuD9 9Cq5zBjkUJLgGJj7L4/L8a8RUIMWwsDIuKHxCFhNUmZV2sSFsTdM41mhGcRdfU8bKWl8 zhAH77bPiTY4ICBZTvlxZLBeyMsuwct40KEzJe9iwVjGHrv/O6idGH5uzYwPxuiBn/No ypD+3lN/Rc0uQ+2ATP3R33WmHjdaaEHfFnAavqhD+8O2q+ufl6phUGyoFthL5kA1C0cN xl06NzJg3263xk1rrS6V7ceG3lcOyH6Zc/KhgCq6c7/i6vomP4k7SIXYN2iW695eoDDc T/Sg== Received: by 10.180.86.2 with SMTP id l2mr5559903wiz.12.1348245830363; Fri, 21 Sep 2012 09:43:50 -0700 (PDT) Received: from d187.lama.univ-savoie.fr (d187.lama.univ-savoie.fr. [193.48.123.187]) by mx.google.com with ESMTPS id t7sm17538554wix.6.2012.09.21.09.43.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 09:43:49 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1084) From: Pierre-Etienne Meunier In-Reply-To: Date: Fri, 21 Sep 2012 18:43:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4C5580B1-5737-40ED-B7B4-83ACFFAD491B@gmail.com> References: <3371F9A1-1248-42DC-9761-8A7797A1C1D1@gmail.com> To: caml-list@inria.fr X-Mailer: Apple Mail (2.1084) Subject: Re: [Caml-list] Partial module include No, sorry, what I wanted to override was a module: module A=3Dstruct let a=3D0 module B=3Dstruct let b=3D1 end end module B=3Dstruct include A module B=3Dstruct let b=3D2 end end Em 21/09/2012, =E0s 18:41, David House escreveu: > Sure. That exact code will work just fine. >=20 > It's a special case of "shadowing", where bindings override any > previous ones, for the duration of their scope. E.g.: >=20 > let x =3D 5 in > let x =3D 4 in > (* here x is 4 *) >=20 > also: >=20 > let x =3D 5 in > let () =3D > let x =3D 4 in > printf "%d " x > in > printf "%d\n" x >=20 > 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. >=20 > On Fri, Sep 21, 2012 at 5:37 PM, Pierre-Etienne Meunier > wrote: >> Hi, >>=20 >> Is it possible in ocaml to redefine a part of an included module, like i= n the following code ? >>=20 >> module A=3Dstruct >> let a=3D0 >> let b=3D1 >> end >>=20 >> module B=3Dstruct >> include A >> let b=3D2 >> end >>=20 >>=20 >> 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 >>=20