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 237AC7EEFA for ; Thu, 12 Nov 2015 20:22:00 +0100 (CET) IronPort-PHdr: 9a23:HyMTHB+AAbaDZ/9uRHKM819IXTAuvvDOBiVQ1KB92uocTK2v8tzYMVDF4r011RmSDdidt6MP0rCO+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStOU05X8jrrqs7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjN92Mq+ixjZQgqL6zMkSGgIlQFUBECR8hDgUZb1v23irOdj3zKGOuXzEaByXi6tufRFUhjt3QgKLTJxy33QjtR1haRd6EagoRJ464HZeo3QL+Z5ervYdNUcA2ZMCJUCHxddC5+xOtNcR9EKOvxV+syk/wMD Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=info@gerd-stolpmann.de; spf=None smtp.mailfrom=info@gerd-stolpmann.de; spf=None smtp.helo=postmaster@mout.kundenserver.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.130; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.130; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=212.227.126.130; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DWAAAz5kRWlIJ+49Regw9/b7Z4iToXBoVzAoE+PBABAQEBAQEBARABAQEBBwsLCR8wgi2CCAEBAwEjMiQQC0ICAlcGEwmIHQkDCbNDkGUBAQEBAQUBAQEBFgmFWYRzgQaEZoJVDC4TgTEFh0SPBIECAo1+hz6KWIRig3I4glKBXnEBhTwBAQE X-IPAS-Result: A0DWAAAz5kRWlIJ+49Regw9/b7Z4iToXBoVzAoE+PBABAQEBAQEBARABAQEBBwsLCR8wgi2CCAEBAwEjMiQQC0ICAlcGEwmIHQkDCbNDkGUBAQEBAQUBAQEBFgmFWYRzgQaEZoJVDC4TgTEFh0SPBIECAo1+hz6KWIRig3I4glKBXnEBhTwBAQE X-IronPort-AV: E=Sophos;i="5.20,283,1444687200"; d="asc'?scan'208";a="153636352" Received: from mout.kundenserver.de ([212.227.126.130]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2015 20:21:59 +0100 Received: from office1.lan.sumadev.de ([84.59.136.115]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MMrpj-1a3Ipa008l-008cau; Thu, 12 Nov 2015 20:21:53 +0100 Received: from [IPv6:fd54:fbcf:6598:7e::1004] (unknown [IPv6:fd54:fbcf:6598:7e::1004]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 2DA91DC05D; Thu, 12 Nov 2015 20:21:52 +0100 (CET) Message-ID: <1447356106.28343.15.camel@zotac> From: Gerd Stolpmann To: Virgile Prevosto Cc: Daniel =?ISO-8859-1?Q?B=FCnzli?= , Leo White , OCAML Date: Thu, 12 Nov 2015 20:21:46 +0100 In-Reply-To: References: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3F4C5@IRSMSX102.ger.corp.intel.com> <5644845B.6000801@freenet.de> <9463C955F1814F02BE3D330F5C3E4E17@erratique.ch> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3F675@IRSMSX102.ger.corp.intel.com> <1457A4B3A2894AC0858EE7C5FCBA3D7F@erratique.ch> <1447346244.4108313.438013625.74F09F5B@webmail.messagingengine.com> <1FC1AC75A2AB4C22B73E890AAF747F6D@erratique.ch> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-tOHniZ8Ea+wqJMEanDZ5" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Provags-ID: V03:K0:N8kT19IJJ+k3QLUVEMyvIqADbNUsgebwOkK1jEOBJE82Q/E4XUO 7uFG6J9YTEUz8dO1rX9VhArgFz4kkaFKRxqxVRHWZlgxtlqvCf0fTEs4huQmoAErL7subf8 +ab+HV7Shi/zwFfQ6jl6XCFwpYUnFm39h1sWhjKQIQWy4I5O42huCu0FTCkT8YWxD/7/Lxy cSNe3o8s7lk7DvVwsHLpQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:HXqmD1Fg+No=:+V7WiHwpyy5cxsB4sSpEAH LTJ13fCy+QjMd+uVX6gAmCaz6es0YBkNVziX4jMLbDSEx5/FYyHPHCEi/CYKvJ6c4IfystPGp QMEj6danbfKxdG1xhj04k4Bj/DcBV7G9sZopLpPeka2QSrbRQ2sltFGOFEgYNqwUcSbNNLHud eIi/RoOdC31XcKH5PEuOlKav0YYEhrgEgIQLGlV0ND82//LmbuZFLYajiBZ3bl6jiIVB5FG46 e1FPoxw0IvbkpKQmDdtvHxbza0b5NeWG/Z97zEV5CclgqVgn4E2QeQBRCjl72/vD2BZhD1rDB 3KMdBNOGfBLS/8DOhjOtsRGlpTYD2m3xk/X7BAJHoLCgg/y8OJFI8pmb1qty7fruvJSA6k80M eXUAfxsYXZllH18L7O+i7EcmqknX19h0grYaDY94haVFfgRf6YE00Bc892rYuM09l+5R36u4G QL3wn+9wJE2qm/4rJwn4niZ4yBZIeh/jfcl+ECzONGkLqrTZZnuE0xYAGY1Fh4LtSNvh68Ewu gHjK1v1bOC1q9htQ0ulfhlyf3vQ70HfHTrWPKpKl6Lku389gKG+RA0ScGYLXOGO8ZHKwVsgdB +XhqUPREQ98kaMV/KTO0w/k3A4XDjuF5lx6UWg1cYqWP5N6M7nOXQ665yZe5aKKXGNt7oRpha QE9kqOn3wqxIXjQd978JxTfw5GKFNXEKd4BfroYYXmP9yyEZBy8jL6lF9AUAlcQ8qMO0= Subject: Re: [Caml-list] Suppress warning from within Ocaml source file --=-tOHniZ8Ea+wqJMEanDZ5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Donnerstag, den 12.11.2015, 19:39 +0100 schrieb Virgile Prevosto: > 2015-11-12 18:26 GMT+01:00 Daniel B=C3=BCnzli : > > Le jeudi, 12 novembre 2015 =C3=A0 16:37, Leo White a =C3=A9crit : > >> > This misses the point. By using `with` I can instruct the compiler t= hat I don't want my program not to compile if I add or remove fields. In th= e current system I can do this with any update I want to make to a record e= xcept if for some strange reason that update happen to touch all the curren= t fields of the record. > >> > >> I don't particularly wish to argue for or against using this warning, = but I think it is worth noting > >> that this is not really any different from: > > > > [=E2=80=A6] > > > > It's quite different: you have dead code in your example. > > >=20 > But in the record case, the expr in { expr with ... } will indeed be > evaluated (thus is not dead), but its result will never be used, which > is barely better. In the (admittedly contrived) example below, > investigating the cause of the warning would save you from a runtime > exception: >=20 > type foo =3D { a : int; } > let rec x =3D lazy { a =3D (Lazy.force x).a } > let y =3D { (Lazy.force x) with a =3D 42 } >=20 > Now that I think of it, it is more like warning 26, with the exception > that in the present case, the expression is usually a variable and > thus already evaluated. Maybe print the warning only in the non-variable case? And rephrase the warning to "the expression before 'with' is not evaluated"? Gerd >=20 > Best regards, > --=20 > E tutto per oggi, a la prossima volta > Virgile >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-tOHniZ8Ea+wqJMEanDZ5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJWRObKAAoJEAaM4b9ZLB5TQAcH/j88yVu3peLFgRDleLxoQYiE WF17Sazx0V8ZBSmLloP+PVRCUySZaJbVMHFZqdsSmS5zAN4qVpX0HcokwE15eyDm Rx9OweKlY9wSuYnYZVx24utOQqIc/jRzN+CRIRCcK5lG1jdIs25/r3dbTWbETbXN Fc+XtQlwFlZQF5Ag4y8dxkR9F/y0XaK3OG6wO9RJ27NfzIg1imQm387nGpk/IJsT L7OkOb3CM0wEZY6ZanydZPWQGeDjOaOy+gsgWBqSY3UUcWAEqLyqF93uSzGjo537 sKyXWDcNBq432AYxklLkWxpSxH7Dip0u+yCqQ3Z5bv3lYT1v3zLu9YasOrSlW7k= =+qYS -----END PGP SIGNATURE----- --=-tOHniZ8Ea+wqJMEanDZ5--