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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 86E5C7EEBF for ; Mon, 3 Aug 2015 17:10:15 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of octa@polychoron.fr) identity=pra; client-ip=217.70.183.194; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="octa@polychoron.fr"; x-sender="octa@polychoron.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of octa@polychoron.fr) identity=mailfrom; client-ip=217.70.183.194; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="octa@polychoron.fr"; x-sender="octa@polychoron.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@relay2-d.mail.gandi.net) identity=helo; client-ip=217.70.183.194; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="octa@polychoron.fr"; x-sender="postmaster@relay2-d.mail.gandi.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AMAQCTgb9VnMK3RtlbGQEBAYNSaQEFgx2mEgaDH5IEgkODNgKBKkwBAQEBAQESAQEBAQEGDQkJIS6EJAEBAQMjFTYKARALGAICBQQSCwICCQMCAQIBMxIGDQYCAQEOiAcDEgQJtGKQKQOFHwEBAQcBAQEBHoEihH2FMIRVMweCaYFDBYVmDI8HgT+DPIkYRoZMIoxpg2IChCVtgUiBBAEBAQ X-IPAS-Result: A0AMAQCTgb9VnMK3RtlbGQEBAYNSaQEFgx2mEgaDH5IEgkODNgKBKkwBAQEBAQESAQEBAQEGDQkJIS6EJAEBAQMjFTYKARALGAICBQQSCwICCQMCAQIBMxIGDQYCAQEOiAcDEgQJtGKQKQOFHwEBAQcBAQEBHoEihH2FMIRVMweCaYFDBYVmDI8HgT+DPIkYRoZMIoxpg2IChCVtgUiBBAEBAQ X-IronPort-AV: E=Sophos;i="5.15,602,1432591200"; d="scan'208";a="172534685" Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 03 Aug 2015 17:10:14 +0200 Received: from mfilter30-d.gandi.net (mfilter30-d.gandi.net [217.70.178.161]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id A2CEBC5A56; Mon, 3 Aug 2015 17:10:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter30-d.gandi.net Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter30-d.gandi.net (mfilter30-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 9yHNIPfup1SJ; Mon, 3 Aug 2015 17:10:13 +0200 (CEST) X-Originating-IP: 146.232.92.127 Received: from [146.232.92.127] (unknown [146.232.92.127]) (Authenticated sender: octa@polychoron.fr) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 06134C5A46; Mon, 3 Aug 2015 17:10:11 +0200 (CEST) To: Gabriel Scherer References: <55BF6F1C.3050705@bioquant.uni-heidelberg.de> <55BF75F6.1040006@bioquant.uni-heidelberg.de> <8E1A640CE3374EB492981ADB0A2DA5C6@erratique.ch> Cc: Nils Becker , Caml-list From: octachron Message-ID: <55BF8451.3060408@polychoron.fr> Date: Mon, 3 Aug 2015 17:10:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] destructive local opens Splitting 44 between alphanumeric and other identifiers is a nice=20 default but it sounds a little arbitrary. Maybe it would make sense to=20 combine this splitting with your [@shadow] annotation idea (cf.=20 https://github.com/ocaml/ocaml/pull/218#issuecomment-123998749) ? Like this, library writers could annotate identifiers that are intended=20 to shadow predefined identifiers without any limitations, and cautious=20 users could activate 53 to protect themselves from unexpected=20 identifiers shadowing? Regards, octachron. On 08/03/15 16:37, Gabriel Scherer wrote : > We could split 44 in two warnings, one (52 ?) for alphanumeric > identifiers and the other (53 ?) for symbol identifiers (infix and > prefix operations, but also now the indexed read and write syntax), > and enable 52 by default. The more paranoid people may then enable 53 > explicitly (and those that enable 44 explicitly today would retain the > current behavior). > > > On Mon, Aug 3, 2015 at 4:24 PM, Daniel B=C3=BCnzli > wrote: >> Le lundi, 3 ao=C3=BBt 2015 =C3=A0 15:08, Nils Becker a =C3=A9crit : >>> It's possible that people actually want M.() to mean let open! more >>> often than let open. For me I think that's the case. >> If you are in the vector case, I don't think that's the case. With Gg [1= ] I often had the following kind of subtly wrong code (can't remember the e= xact details but something similar): >> >> let ox =3D V2.((dot v ox) * ox) in >> V2.(3 * ox + oy) >> >> The reality is that M.() is inherently dangerous, especially from an API= evolution perspective where new identifiers with matching type may get int= roduced later leading to silent semantic changes in your code. So we should= not encourage people to use M.!() as it's going to make the problem even m= ore acute. Besides we should have that 44 warning by default so that we see= the problems, but for now it's impossible to live with 44 and a Gg like li= brary. >> >> Best, >> >> Daniel >> >> [1] http://erratique.ch/software/gg >> >> >> >> -- >> 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