caml-list - the Caml user's mailing list
 help / color / Atom feed
From: Vadim <vadim@radovel.ru>
To: Thierry Martinez <thierry.martinez@inria.fr>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] How to shadow nested submodules?
Date: Fri, 11 Oct 2019 19:09:12 +0300
Message-ID: <541351570810152@iva3-67f911cb3a01.qloud-c.yandex.net> (raw)
In-Reply-To: <1296445821.9982847.1570808406866.JavaMail.zimbra@inria.fr>

Wow! Thank you very much! I don't know why I could not find it.<br /><br />18:40, 11 октября 2019 г., Thierry Martinez &lt;thierry.martinez@inria.fr&gt;:<br /><blockquote class="b4fd5cf2ec92bc68cb898700bb81355fwmi-quote"><p>Hello, Vadim!<br /><br />Vadim:<br /></p><blockquote class="b4fd5cf2ec92bc68cb898700bb81355fwmi-quote"> Hello! I'm trying to figure out how shadow/override nested modules in<br /> OCaml.<br /></blockquote><p><br />A generic solution for old OCaml versions (&lt;4.08) has been explained by<br />Gabriel Scherer in the following blog post:<br /><a href="http://gallium.inria.fr/blog/overriding-submodules/">http://gallium.inria.fr/blog/overriding-submodules/</a><br /><br />The idea is to use destructive substitution while including the original<br />Ipaddr:<br /><a href="http://caml.inria.fr/pub/docs/manual-ocaml-4.01/extn.html#sec234">http://caml.inria.fr/pub/docs/manual-ocaml-4.01/extn.html#sec234</a><br /><br />module Ipaddr = struct<br />  include (Ipaddr : module type of Ipaddr with module Prefix := Ipaddr.Prefix)<br />  ...<br />end<br /><br />But I guess that the code you posted should work just fine with OCaml &gt;=4.08<br />thanks to the following change:<br /><a href="https://github.com/ocaml/ocaml/pull/1892">https://github.com/ocaml/ocaml/pull/1892</a><br /><br />Best regards.<br /></p><span class="c18e9d485856a85513717a5a5b59d3fewmi-sign">-- <br />Thierry Martinez.</span></blockquote>

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 15:24 Vadim
2019-10-11 15:40 ` Thierry Martinez
2019-10-11 16:09   ` Vadim [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=541351570810152@iva3-67f911cb3a01.qloud-c.yandex.net \
    --to=vadim@radovel.ru \
    --cc=caml-list@inria.fr \
    --cc=thierry.martinez@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable:
	git clone --mirror http://inbox.vuxu.org/caml-list
	git clone --mirror https://inbox.ocaml.org/caml-list

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.caml-list


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git