From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id C10957EE09 for ; Fri, 26 Oct 2012 15:55:46 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of matthieu.dubuget@gmail.com) identity=pra; client-ip=209.85.214.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="matthieu.dubuget@gmail.com"; x-sender="matthieu.dubuget@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of matthieu.dubuget@gmail.com designates 209.85.214.54 as permitted sender) identity=mailfrom; client-ip=209.85.214.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="matthieu.dubuget@gmail.com"; x-sender="matthieu.dubuget@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f54.google.com) identity=helo; client-ip=209.85.214.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="matthieu.dubuget@gmail.com"; x-sender="postmaster@mail-bk0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AscCACGVilDRVdY2k2dsb2JhbABEi3e2PwgjAQEBAQkJCwkUBCOCHwEBBBICExkBGxwCAwwGBQQBBhYWDwkDAgECARERAQUBHBMIAh6HUQEDDwSdeGIJA4wwgnaEeQoZJw1ZiHUBBQyLZYNKgyQDlXOFZoh3P4QT X-IronPort-AV: E=Sophos;i="4.80,654,1344204000"; d="scan'208,217";a="179082057" Received: from mail-bk0-f54.google.com ([209.85.214.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 26 Oct 2012 15:55:46 +0200 Received: by mail-bk0-f54.google.com with SMTP id jf20so1765324bkc.27 for ; Fri, 26 Oct 2012 06:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=Qez5PsZ1fdcuOELQtLFRvY8rxZhbbWo9XMT4Tx3eM6Y=; b=kvzmTQ/Z5uh9WJmbHUtdjYoEH7z5ov0HcVDbJGhHMbs5e47HwjQW6l9Q8+CMMNX6y1 WppQQzF6c+lJ3Y42D73VlrSy1d/o2TTDRHD/ujM71ogocIx82kX5R4WUwLJMMTaV3QkN Uy6qFLoxIy3GQM5VHPo3NPdQbvGhaS+BKqPAT1KB06gjmeNNhVMWtIRHScCISIv2cgHi X2W4+wAooSsBs+XuZSJXJVuCcj7noPVFGmQnV29nKt6RHL2wWPocJtAhE+kt6kc4XACO 1KwuuIrsINYYPD/Bh3p99rCIauatWFjAPTacDIE3o6aS0csrljVAFR7PiYAXnLAMxcTw +m3A== Received: by 10.204.12.205 with SMTP id y13mr7384215bky.46.1351259745967; Fri, 26 Oct 2012 06:55:45 -0700 (PDT) Received: from [192.168.1.78] (79.234.15.109.rev.sfr.net. [109.15.234.79]) by mx.google.com with ESMTPS id v14sm1055426bkv.10.2012.10.26.06.55.44 (version=SSLv3 cipher=OTHER); Fri, 26 Oct 2012 06:55:45 -0700 (PDT) Message-ID: <508A965F.3000205@gmail.com> Date: Fri, 26 Oct 2012 15:55:43 +0200 From: Matthieu Dubuget User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.9) Gecko/20121014 Icedove/10.0.9 MIME-Version: 1.0 To: caml-list@inria.fr References: <20121026112602.GA2781@romildo.no-ip.org> In-Reply-To: <20121026112602.GA2781@romildo.no-ip.org> Content-Type: multipart/alternative; boundary="------------060409070409080702080501" Subject: Re: [Caml-list] Importing specific names This is a multi-part message in MIME format. --------------060409070409080702080501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Le 26/10/2012 13:26, José Romildo Malaquias a écrit : > Hello. > > It seems that the expression ocaml "open module-path" exposes all names > exported by module-path. > > Is there any way of exposing only a restrict set of names from a > module-path, instead of all names? > > Romildo > Is this what you are looking for? # module type RS = sig val length : string -> int end;; module type RS = sig val length : string -> int end # module ReducedString:RS = String;; module ReducedString : RS # ReducedString.length "coco";; - : int = 4 # ReducedString.uppercase "coco";; Error: Unbound value ReducedString.uppercase Salutations Matthieu --------------060409070409080702080501 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Le 26/10/2012 13:26, José Romildo Malaquias a écrit :
> Hello.
>
> It seems that the expression ocaml "open module-path" exposes all names
> exported by module-path.
>
> Is there any way of exposing only a restrict set of names from a
> module-path, instead of all names?
>
> Romildo
>


Is this what you are looking for?

# module type RS = sig
   val length : string -> int
  end;;
module type RS = sig val length : string -> int end
# module ReducedString:RS = String;;
module ReducedString : RS
# ReducedString.length "coco";;
- : int = 4
# ReducedString.uppercase "coco";;
Error: Unbound value ReducedString.uppercase

Salutations

Matthieu

--------------060409070409080702080501--