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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id D27A57EE09 for ; Fri, 26 Oct 2012 13:30:38 +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: AkEBAB50ilAmachzl2dsb2JhbABEsCWSCisBAQEBAQgWBzuCHgEBAQQSAiwBASwMDwsLDQ0hIQESAQUBChIZEhCFboFiAw8DAQedW2AJA4pxhDMBBYU6AwqJTgaLAWeDSoMklCSBVYEXihaDLxYphBKBYzU X-IronPort-AV: E=Sophos;i="4.80,654,1344204000"; d="scan'208";a="160497541" 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; 26 Oct 2012 13:30:29 +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 1TRi7P-0007kY-8a for caml-list@inria.fr; Fri, 26 Oct 2012 07:30:27 -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 1TRi7P-00009M-7D for caml-list@inria.fr; Fri, 26 Oct 2012 07:30:27 -0400 Received: from mail-wg0-f70.google.com ([74.125.82.70]) by mxgoog1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TRi7P-0002Qe-3C for caml-list@inria.fr; Fri, 26 Oct 2012 07:30:27 -0400 Received: by mail-wg0-f70.google.com with SMTP id dt14so2148372wgb.9 for ; Fri, 26 Oct 2012 04:30:26 -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:content-type:content-transfer-encoding; bh=NSvNk+jShAX+0KK2adtebCzGB97FB9GTYHY5wKWhUpY=; b=ULSrECUT6PcLLmL4B+8kOKVklTsm26nRwQA+sWnSLbK1+buP+0Xka8gEXWYENDt6Dc 28x96DxsLcEWWCD94PtbeYPmDYuYWovpp6LldzDoZQVqLLSbB4jnKh3lczQcw9vgT8EM ule7ENljY6D6hAaNr8tOgEYGq4TDWIkUOIjqY= 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:content-type:content-transfer-encoding :x-gm-message-state; bh=NSvNk+jShAX+0KK2adtebCzGB97FB9GTYHY5wKWhUpY=; b=Q2QShjrabuPmocQ9TBAPEi6+e+NQcfS0f1OKIo6J2yUOKIdAi+fGtn1T4rD4+/rsrO 2SQC/nW9YhtGfzBz1KFuVljrqJgZ0LwMOGlqlkzKW5ALCKJynBljQzPWw2ur435Wn6c7 m7Yjmn96sUUmk/RJLEnw2BSy3FSqLQbki2TwIJoLdNWjuB/L2e7xDBZ/6yGZ4nEWr6Hp Vb7rT/99GAX1jUbOX157jppfH3gGjIkPu7UAbjfDqiNWrRW8fIc3br6lce1A55txaJAX O3ENgO3JwLkGrn44E9iYcQ7wg9pCAtLqP/wg/2UBwTXWYu0TdKHUPeIj2eqXgOlN5MA5 eF5g== Received: by 10.216.136.157 with SMTP id w29mr13262002wei.148.1351251026566; Fri, 26 Oct 2012 04:30:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.136.157 with SMTP id w29mr13261998wei.148.1351251026393; Fri, 26 Oct 2012 04:30:26 -0700 (PDT) Received: by 10.180.106.228 with HTTP; Fri, 26 Oct 2012 04:30:26 -0700 (PDT) X-Originating-IP: [80.169.196.210] In-Reply-To: References: <20121026112602.GA2781@romildo.no-ip.org> Date: Fri, 26 Oct 2012 12:30:26 +0100 Message-ID: From: David House To: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmFECST4z8oyab/j8/G6/b+OzwUNYiIW9jf7heLrwDH5dLLyIfw+pIXu92Ssb9SjD6KSsc2Rmf/STIy02bBjChOBP/upI6xrcGnloUhIQqfPhwNfS9d7AIpgmDZP5VAPp4mtnPipxKCcc7+inKtIiF24fSzKg== Subject: Re: [Caml-list] Importing specific names I should add: although this is possible, I generally find it easier to read code that has been written with as few opens as possible. If you find you are using things from Module a lot, you might consider creating a module alias: module Mod =3D Very_long_module_name You can then say Mod.foo, Mod.bar etc. This makes it obvious where foo and bar come from, but you don't have to sacrifice readability by typing such a long module name every time. (Of course, there is an art to picking module abbreviations as well; I find it best to pick a short abbreviation which holds at least some meaning, rather than just "let module M =3D ...". E.g.: module Str =3D My_super_duper_string_module Rather than: module S =3D My_super_duper_string_module ) Yet another option is to do a local module alias ("let module Mod =3D ... in"), or a local open ("let open ... in"), in the function(s) where you need access to things from Module. This keeps things as localised as possible, which again increases readability. (You only have to remember the meaning of a module alias for a very short time, rather than for the scope of the whole module.) On Fri, Oct 26, 2012 at 12:26 PM, David House wrote: > If you want to list the things you want, rather than listing the > things you don't want, what's wrong with the following? > > let x =3D Module.x > let y =3D Module.y > ... > > You could abbreviate that somewhat: > > include (struct > open Module > let x =3D x > let y =3D y > ... > end) > > On Fri, Oct 26, 2012 at 12:26 PM, Jos=E9 Romildo Malaquias > wrote: >> 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 >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs