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 4E2E07EEFA for ; Thu, 12 Nov 2015 19:39:34 +0100 (CET) IronPort-PHdr: 9a23:6211QBRMTvPusbHlY5JePZmS9Npsv+yvbD5Q0YIujvd0So/mwa64YxaN2/xhgRfzUJnB7Loc0qyN4/2mBT1LuM/Y+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8CVP1QD3WPkKZpJbzyI7izp/vEMhoVjLqtjgjDomVBvP9ps+GVzOFiIlAz97MrjtLRq8iBXpu5zv5UYCfayLOwESul0BTInPmQCzlntpx3CBV+D730dX2FQmAdFBRrB7Tn3RI34rirjq+c70ynMbuPsSrVhZzW44KZvRVfQkioZMCUl9ymDlM1qg6NfrVS5vRFhxJXIZ6mQaOo4ebnSK4BJDVFdV9pcAnQSSri3aJECWrIM Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=virgile.prevosto@gmail.com; spf=Pass smtp.mailfrom=virgile.prevosto@gmail.com; spf=None smtp.helo=postmaster@mail-ig0-f177.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of virgile.prevosto@gmail.com) identity=pra; client-ip=209.85.213.177; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="virgile.prevosto@gmail.com"; x-sender="virgile.prevosto@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of virgile.prevosto@gmail.com designates 209.85.213.177 as permitted sender) identity=mailfrom; client-ip=209.85.213.177; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="virgile.prevosto@gmail.com"; x-sender="virgile.prevosto@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f177.google.com) identity=helo; client-ip=209.85.213.177; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="virgile.prevosto@gmail.com"; x-sender="postmaster@mail-ig0-f177.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CxAAAW3ERWm7HVVdFehH0GxjyBOQc8EAEBAQEBAQEBEAEBAQEBBgsLCSEugi2CCAEBBBIRHQE4AQMMAQUFCw8CJgICIhIBBQEcBhMih3cDEqVLgTE+MYtIhGOGbicNhGABJgEFDnODQ4IQg3iBBoRZgxyBRAWWSI0ngVuSFoRigiUSJIEXOGWBSoIBPTSFPQEBAQ X-IPAS-Result: A0CxAAAW3ERWm7HVVdFehH0GxjyBOQc8EAEBAQEBAQEBEAEBAQEBBgsLCSEugi2CCAEBBBIRHQE4AQMMAQUFCw8CJgICIhIBBQEcBhMih3cDEqVLgTE+MYtIhGOGbicNhGABJgEFDnODQ4IQg3iBBoRZgxyBRAWWSI0ngVuSFoRigiUSJIEXOGWBSoIBPTSFPQEBAQ X-IronPort-AV: E=Sophos;i="5.20,283,1444687200"; d="scan'208";a="187272755" Received: from mail-ig0-f177.google.com ([209.85.213.177]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 12 Nov 2015 19:39:33 +0100 Received: by igbhv6 with SMTP id hv6so46766553igb.0 for ; Thu, 12 Nov 2015 10:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=5kTWI/a/9bcpGcuDm9OkWfldHbvSRiZBiCuJPh3GwGQ=; b=K3yTigsvRFFYUkPtM8tV7eoQDwElUhKuflqb6BGXngKZlwwR+D1n0r+dpchp2+vb23 qya5dz3M3z4wpYQBioy24FQSg0or7//wHhdY1cDtNfVAFqS1YhEZtHaOWxB12rP8+vx8 ph7tRfvLgsYMNkI/Ypg8+11m5PvLJZqrWTzxRUci3g3zkGGjYOC+BJl4JzzkCiUFEehG 3C8YeJgqUMpM/rjVG8xMiagA24jMHXeKoHf55ADocnOwS06IHmAZLNN53KdkAoLOKg/P yTHICh7pZIG31SvcqDRFGYoAy2z7bOazF4TBoPbR07BsyYl/sQIsXc/6tFX1xBq5w1Pj xOzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=m4x.org; s=gapps; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=5kTWI/a/9bcpGcuDm9OkWfldHbvSRiZBiCuJPh3GwGQ=; b=Z16NCNVMkFzx24jvk4EJ1dALvCOweyzmAEcO0zwvqQeRq93kKtPQkoptzLHqqfTdzp kLKVXr5hXoeUrj0cQIz/U+uSU5tMtVjhZQOiWDF10OwjAMUwQV8l185cjH1nPFR8kBhP 32458PsyRJQOviYbYMu9pZMMjZ3ZScmDDZjWo= MIME-Version: 1.0 X-Received: by 10.50.67.179 with SMTP id o19mr20131957igt.65.1447353572290; Thu, 12 Nov 2015 10:39:32 -0800 (PST) Sender: virgile.prevosto@gmail.com Received: by 10.64.9.79 with HTTP; Thu, 12 Nov 2015 10:39:32 -0800 (PST) In-Reply-To: <1FC1AC75A2AB4C22B73E890AAF747F6D@erratique.ch> 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> Date: Thu, 12 Nov 2015 19:39:32 +0100 X-Google-Sender-Auth: Gr0Ka06c2xxtKUk8iH4o2pisp_0 Message-ID: From: Virgile Prevosto To: =?UTF-8?Q?Daniel_B=C3=BCnzli?= Cc: Leo White , OCAML Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Suppress warning from within Ocaml source file 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 tha= t I don't want my program not to compile if I add or remove fields. In the = current system I can do this with any update I want to make to a record exc= ept if for some strange reason that update happen to touch all the current = fields of the record. >> >> I don't particularly wish to argue for or against using this warning, bu= t 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. > 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: 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 } 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. Best regards, --=20 E tutto per oggi, a la prossima volta Virgile