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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 138137EF53 for ; Fri, 14 Aug 2015 12:56:14 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of goswin-v-b@web.de designates 212.227.15.4 as permitted sender) identity=mailfrom; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B8AQBWyM1VnAQP49RdhFjFfwKBSEwBAQEBAQESAQEBAQEGDQkJIS6EIwEBAQMBJwsBSwsLGAklDwUNGzSIGAEDCgzKCh8rDYVVAQsgi1OCT4JBF4MBgRQBBJUbin+BaohgDIoFhzaEJW+CTAEBAQ X-IPAS-Result: A0B8AQBWyM1VnAQP49RdhFjFfwKBSEwBAQEBAQESAQEBAQEGDQkJIS6EIwEBAQMBJwsBSwsLGAklDwUNGzSIGAEDCgzKCh8rDYVVAQsgi1OCT4JBF4MBgRQBBJUbin+BaohgDIoFhzaEJW+CTAEBAQ X-IronPort-AV: E=Sophos;i="5.15,677,1432591200"; d="scan'208";a="142775659" Received: from mout.web.de ([212.227.15.4]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Aug 2015 12:56:13 +0200 Received: from frosties.localnet ([95.208.221.151]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MD8Au-1Za9MF0Qii-00GWlS for ; Fri, 14 Aug 2015 12:56:12 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.84) (envelope-from ) id 1ZQCeN-0000Py-Sx for caml-list@inria.fr; Fri, 14 Aug 2015 12:55:51 +0200 Date: Fri, 14 Aug 2015 12:55:51 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20150814105551.GD31364@frosties> References: <55BF6F1C.3050705@bioquant.uni-heidelberg.de> <55BF75F6.1040006@bioquant.uni-heidelberg.de> <8E1A640CE3374EB492981ADB0A2DA5C6@erratique.ch> <20150804092633.GC5689@frosties> <5C2023F4AF0549F58F3E4C9A6F8ABE84@erratique.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:vG/opxn05nYqFhhKGl85sjgo27kuHVUWuiUrjljPFXHrHJOQDSB jp37J9GTlUqTOS2Nki6ISK2qaKS5f6ftX+c0EaQEbpYeC2r33PC+pdAbyjM3yLQlqcNH+cF ailOybXYohkRNJhCWJHfeh17vLkVY+fod8yHFwiagmLOTkb3uYu98tWSDIKfyxmZyEGv6tl or8bYumsxCcOgfPoIMMgQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:vBkLKHfveiI=:V7nagPhV2IxSlVDJXGoyMU SvL3fiULEgknHS9OTUl172/UkRFyBMpze2vb2xFTi33S6vIKbmU1Db5442J/vBbAocNufG6I/ OcjS2hpwYadwShpXEB5tbkv7G94N8n7UERNHmaTNJE0eiay3/4MRPTy/TSjEUgxN+ab7K+OAF 9VUj5NWXMpYkPTVWKSEoufRBWSPflq9g5Sw6JjoWcy71JWUtmPpO+LCkswJJ3DHlfozYyFh1Z UTBlpvjmFyP60A+EeTxLeE9lopBgcvIKmPKGAjJhq7RaVPzC2akcbO7s2tOogWyKNF60LUt/Q rcmuurEpqdPuk92+8sqsBew3oHSrlSWmVmpxMTmZnXLzD8FHaoRjWHWM98WXFUW+q9nAzClL6 YgMYzj7jLyYf20/9BIq1jjBkCVOJ7gd+jp6zWQpRRh9OOgI4p8LVcI91OaIRW5+GqATKHAmef jlIbu8VSTy/pq53/2Hb+h6tf7xre1QJMZYe2io5Cn9/ridUwO/YsONjd28VG6w56f0YPbqW/m gA2TDuupldHQgwceJX/5s6paJm4+N2XCuFHV2vZkRBl0R+ojClHGVzngdSMBsOFEgLdH6V6lB Oo+KqH+GnILdH9478z4a4owTgxuNteJgaXWOBnmziJ2GaQd0ZCac3scawkNKVJVqHLc3/bwtV S0cEUwR1yE9he6aLqGD6cxLcWFSaUYohqPO10y9E7QjLWtfdAm7PWoAUZpa2wxdUao+M3D7Y3 OUkHlBCQx2GRS8RW Subject: Re: [Caml-list] destructive local opens On Tue, Aug 04, 2015 at 09:14:49AM -0400, Ivan Gotovchits wrote: > I would prefer if the compiler warns us if in expression `M.(x)` the value > `x` is not in the scope of `M`. > > Clarification: usually when we say `M.(x + cross y)` we want to use only > values from module `M` > and problems arise when something is captured from outside the module. Such > kind of local opens > are usually use to open rich modules, that fully defines an algebra of a > type, i.e., a full suite of > common operations like, comparison operations, arithmetics, etc. So, using > local open is some kind > of local algebra switch operation. In other words switching to other domain > specific language. > > A good style would be to explicitly qualify every external value that is > used inside the local opened scope: > > M.(x * Vec.of_array [| 1; 2 |]) You can't qualifylocal values or values of the surrounding module so that is a no go. I also often use local open to access records, as in: let r = M.({ x = 1; y; z = depth; }) in So I can't agree that M.() should only access values from M. Far from it. > On Tue, Aug 4, 2015 at 8:26 AM, vrotaru.md@gmail.com > wrote: > > > After reading this thread, I'm starting to thinking about another option, > > namely: "local un-open", because I certainly dislike ambiguity. > > > > So, maybe, something like: > > > > Vec.( ^(3 * v) * vx + vy) > > > > where anything in ^(... ) is not subject local open. > > > > Regards > > > > > > În Mar, 4 aug. 2015 la 12:40, Daniel Bünzli > > a scris: > > > >> Le mardi, 4 août 2015 à 10:26, Goswin von Brederlow a écrit : > >> > > let ox = V2.((dot v ox) * ox) in > >> > > V2.(3 * ox + oy) > >> > > >> > What is wrong with that code? > >> > > >> > I'm assuming V2 has: > >> > > >> > val (+): t -> t -> t > >> > val (*): int -> t -> t > >> > val dot: t -> t -> int > >> > >> It also has > >> > >> val ox : t > >> > >> Daniel MfG Goswin