From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 3961D7EEBF for ; Wed, 19 Aug 2015 17:52:52 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=pra; client-ip=69.165.131.134; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=mailfrom; client-ip=69.165.131.134; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@april.topoi.pooq.com) identity=helo; client-ip=69.165.131.134; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="postmaster@april.topoi.pooq.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CXCwAQpdRV/4aDpUVdhDMBxWoCgg8BAQEBAQGBC4QkAQEEOk8LGAklDwUYiHLRJgELIItThREXgwGBFAWVJIxqA0+ZYiaEGSKCfwEBAQ X-IPAS-Result: A0CXCwAQpdRV/4aDpUVdhDMBxWoCgg8BAQEBAQGBC4QkAQEEOk8LGAklDwUYiHLRJgELIItThREXgwGBFAWVJIxqA0+ZYiaEGSKCfwEBAQ X-IronPort-AV: E=Sophos;i="5.15,710,1432591200"; d="scan'208";a="174168928" Received: from topoi.pooq.com (HELO april.topoi.pooq.com) ([69.165.131.134]) by mail2-smtp-roc.national.inria.fr with ESMTP; 19 Aug 2015 17:52:50 +0200 Received: by april.topoi.pooq.com (Postfix, from userid 1001) id B647F1A0272; Wed, 19 Aug 2015 11:52:49 -0400 (EDT) Date: Wed, 19 Aug 2015 11:52:49 -0400 From: Hendrik Boom To: caml-list@inria.fr Message-ID: <20150819155249.GB31044@topoi.pooq.com> References: <20150804092633.GC5689@frosties> <5C2023F4AF0549F58F3E4C9A6F8ABE84@erratique.ch> <20150814105551.GD31364@frosties> <55CDD0F2.1090200@zoho.com> <20150818111134.GA11154@frosties> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] destructive local opens On Tue, Aug 18, 2015 at 04:26:00PM -0600, Anthony Tavener wrote: > (TL;DR: I commonly want to specify paths -uniquely- for identifiers in local > scopes (function, module) which have no means to do this.) > > As I run into this yet again, moments ago... > > I do often want the ability to be clear that something is not to be shadowed > by the opened scope... to specify it's from the local (usually function) > scope. > Part of the reason is for code clarity, but also to safeguard against > possible > later changes in the *opened* module (introducing the same identifier). > > let init flags = > M.(init (flag1 + flag2 + flags)) (* flags is intended to be 'local', > but it could be shadowed by a value in M *) The way to make this explicit is to write let init flags = (M.init (M.flag1 + M.flag2 + flags) (* flags is 'local', and is not shadowed by a value in M *) THe code is one characte longer, and even the comment becomes smaller! -- hendrik