220 39390 <pj98vf$n6o$1@blaine.gmane.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: David Brown <david@westcontrol.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Alternative proposal for mapping P0709
 Deterministic Exceptions into C
Date: Wed, 25 Jul 2018 09:33:07 +0200
Lines: 78
Approved: news@gmane.org
Message-ID: <pj98vf$n6o$1@blaine.gmane.org>
References: <6a65c934-5d2a-4e75-b88d-9eaaee338bd3@isocpp.org> <1c229827-6d5d-45bd-8766-c3af818b2b0b@isocpp.org> <5e1086ff-802e-4e45-bd6c-077a93287b08@isocpp.org> <CAANG=kWaY76_oC2xPbkj68sa0hMP0eKc7CDRbJt20oLJTbHu3g@mail.gmail.com> <pj6q6g$ep3$1@blaine.gmane.org> <6a349048-5ffe-4d46-9b6a-d3246e2d505b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1532503873 24996 195.159.176.226 (25 Jul 2018 07:31:13 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 25 Jul 2018 07:31:13 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDP6R2XHXIARBPOP4DNAKGQEYKDNB5I@isocpp.org Wed Jul 25 09:31:09 2018
Return-path: <std-proposals+bncBDP6R2XHXIARBPOP4DNAKGQEYKDNB5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lj1-f200.google.com ([209.85.208.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDP6R2XHXIARBPOP4DNAKGQEYKDNB5I@isocpp.org>)
	id 1fiEGJ-0006OJ-FX
	for gclcip-std-proposals@m.gmane.org; Wed, 25 Jul 2018 09:31:07 +0200
Original-Received: by mail-lj1-f200.google.com with SMTP id k22-v6sf1617141lji.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 25 Jul 2018 00:33:18 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1532503998; cv=pass;
        d=google.com; s=arc-20160816;
        b=kjNNFBkpubpY54aJ4GsfgOXA4IL8gA6dFs1JXpB/hlAcHBU7AOrJDPmJY0LtiEhF/e
         KVYN/GfwwTcn7kj1b3nSCLUpUX41L0VLHmfzroICpsh0FrGch6OfImOg6FVMYKpb2mQi
         1qlY5HJVt2AIe7BpRN/VoA/H2iYdW+T1s0wsB2nr47BmximyijtN/8FHoiiEW0DyvDr9
         P29JgOz6bMwo+ww29BMtkQghLukugcH6MoDVrF5/POs1uCuXeo3Myw+jN3pi4yH5uJiK
         fSfJylrattZBC2v6kgj+Blp7iVFrWMaOexXqdl1/ypWG19TN1JwlXPRD/bPtNtga3ZXs
         xAvg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:in-reply-to:user-agent
         :content-transfer-encoding:mime-version:references:message-id:lines
         :date:subject:from:to:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=xJx7Gidr7Wo2tbUHFvX9P2KblpbIUBMIQG617YrygWM=;
        b=SIPEsN0AjAgnEWQYfTKddZjqH26ZuDRj1/+J2Si+vi8H1mtzbFEXCd1M+wcRF928tD
         s+OEwkHepI0tRRuflJWKTlRtGqV71vUN8dWqLKT40DhJp+1OLX5LAWZwA4KxLzJTPgBv
         41kKm8fHOAbZXwU56HvvPo3Gky7kTDcL0JH3C6/K5S4vSYFTo4skawmSkMEmWHvwdOve
         eRmzb0jORtiLCtICv414VNs3GxAqsyMD2LEoXbHmYht2joX1BhlsKtUkmNr6CQf/SkIE
         mZeR3h8wL93F5cR2XHOHLymy9GRNEqJa7iXbwxdNhza5rm/xI2q7hwt5ZkaufnixX9to
     
ARC-Authentication-Results: i=2; mx.google.com;
       spf=neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=to:from:subject:date:lines:message-id:references:mime-version
         :content-transfer-encoding:user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=xJx7Gidr7Wo2tbUHFvX9P2KblpbIUBMIQG617YrygWM=;
        b=Oxo7QNhrCQYVfA8CNNK4t7d8N8lFKw/sHz3QbPOkn0S/XU2jsDYGhK2/OqZIkHGdaP
         VGRzM56edvcE8z2DjoWXlp78v3q5bjZA6mB5hszMVXJK3/RljGdUQxKrFXkMg3iL+Dt1
         PHLGb/j/q3iaULU3oiX6Icbq67d1aTdqi+rcQasPbZ1E/A9ySFXjs/9/D7EBd7iU7HjL
         w7sr/sR3c72Ck5GnrHhf8wNxVWa5gdrcbSzb/IoBK8AJWvxT1qR66RI73H9DRABVAPQZ
         Rv0nLrAyZcxeUlSdTHOxQ0bTkIMcBAy/dra3soltdTc2M1LufuGSTXaaXkESNWChX0mZ
         7vVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:content-transfer-encoding:user-agent:in-reply-to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=xJx7Gidr7Wo2tbUHFvX9P2KblpbIUBMIQG617YrygWM=;
        b=flLR3p13/qZyZiDIkRJCXDLc7nfZSLo1czUHYNdN7a0GIQaGjZyjwzCaEFFFj9D8OO
         qiqPWOhjqaJbsYFLo7CtW/3NO69Foghe+YfYgvubpW1AW7qUxhsr4xAEFwJhgMljoiHE
         y+mUkfm+ACao231OsYZ9aNASBZl59lcBcfz1nyrIdV2A7D4P46de6j6uz9sSoMICiAOS
         7jl8/cLLtH8IOdx9Q5Z15n2uKpuBHTuKS0o55mTG/JK03+4pf8iT3NWeix4ykpFrJg1/
         nNEldvn1noq8Eml3qOsO4zyZcq0RKWNVtN0JxlExOUdvYfTFAH5d6YnKBDuT+HKP 
X-Gm-Message-State: AOUpUlHA5L6qZfycWQduL0858+DocKMveFcEnvNaR26TkQt6zAEpdU/A
	a1/T/dgRAAJSnOHmYgR1fK4=
X-Google-Smtp-Source: AAOMgpcZlDzN7mHBWyn5/jdC8zK4OYWsK4dCoNQbKeC2K9oXSVowVHW1A0NPPQzGfWQxePJ494cjqQ==
X-Received: by 2002:a2e:9084:: with SMTP id l4-v6mr1107506ljg.24.1532503998752;
        Wed, 25 Jul 2018 00:33:18 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a2e:8246:: with SMTP id j6-v6ls1487146ljh.10.gmail; Wed, 25
 Jul 2018 00:33:17 -0700 (PDT)
X-Received: by 2002:a2e:6c07:: with SMTP id h7-v6mr14059081ljc.81.1532503997373;
        Wed, 25 Jul 2018 00:33:17 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1532503997; cv=none;
        d=google.com; s=arc-20160816;
        b=U1Q0xJ+UzP0VaYHAZUIe7NifRM9augxhmRB3d3ML2Opbx2WriLUcpY38DTT6z4+mGU
         k2b/vPBUU7KaT3wrwcLN48jMXTmlHt1vAr65rueqWoSXCGNLvpLHdLvU27YsB5NioEA5
         GdYIruAyZRZBphS7MsPtgnQAbVSO3JIepKf4HM1zSQqEgfYwkX3/LAQAk+Weqpkn7Jqz
         Wec4stjDkfkREn69Pwd9U1j54ILM3uqRDC/xj/VsCBuBn6njHrN+bsdxSA/BJboi+Hlh
         LqshdWnSS/XPGpJ0eGdq6aEv2YJMDpXMQDIzH9jWwxwXjX7pSb0qLlPM/j7ULPyvwuu5
         t59A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=in-reply-to:user-agent:content-transfer-encoding:mime-version
         :references:message-id:lines:date:subject:from:to
         :arc-authentication-results;
        bh=JGL14YOK9GEk8sERbAXvtPfkHuLWQu+D9EVvhoVzVU0=;
        b=E+x3SydyA9N3iS8mDepb6N/yNoc0Omk2hVYrL9ViHZrtQ2YZUDRow9yUexTH4T9vij
         d7dX3WPY/Xd5i76rPsbBZj2Gt2wBszcfILe29vmQFJUTsNdgrP9DNUfVAvbUQKvbQGC3
         6JGthDwP47lpNPSmkkLP+kYREefbCFgXEBnEOyuKZrOnVQ7yBbS0ks1UTUJfpShmiWLq
         ZNwMQp/x3XfiiAbdGppX2HNK7gmlvDW5Fk1CWVhWC/TgC47LbyNsIDiOVmKPWCAj4SlM
         YvEXp9Zl879h2WjXai7YONYecGY/LyjjfzbW1UogFoXvtzTrfS6OiVA4dpuIX7ApS78w
         E7Dg==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
Original-Received: from blaine.gmane.org ([195.159.176.226])
        by mx.google.com with ESMTPS id f3-v6si5129689lfb.180.2018.07.25.00.33.17
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 25 Jul 2018 00:33:17 -0700 (PDT)
Received-SPF: neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) client-ip=195.159.176.226;
Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1fiEGH-0006ME-5s
	for std-proposals@isocpp.org; Wed, 25 Jul 2018 09:31:05 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 64
Original-X-Complaints-To: usenet@blaine.gmane.org
In-Reply-To: <6a349048-5ffe-4d46-9b6a-d3246e2d505b@isocpp.org>
X-Original-Sender: david@westcontrol.com
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 195.159.176.226 is neither permitted nor denied by best guess
 record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:39390
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39390>

On 24/07/18 16:40, Nicol Bolas wrote:
>=20
>=20
> On Tuesday, July 24, 2018 at 5:08:45 AM UTC-4, David Brown wrote:
>=20
>     On 24/07/18 10:25, Ga=C5=A1per A=C5=BEman wrote:
>     > If we are to use the function's name, how do we deal with unutterab=
le
>     > functions, like lambdas, or methods? You can dismiss it as "right, =
C
>     > doesn't have those", but they might in the future. I don't think
>     it's a
>     > good idea at all.
>     >
>     > I also don't like that if I rename the function, I now have to chan=
ge
>     > its body. That makes very little sense to me. A rose by any other
>     name
>     > *should* smell as sweet.
>     >
>=20
>     Having programmed in Pascal, where you use the function's name as the
>     return value pseudo-variable, I agree with that - it is a pain.
>=20
>     It may also be a challenge for recursive functions, and it will
>     certainly be a problem if you want to use the function more than once
>     before checking for errors:
>=20
>             x =3D foo(y) + foo(z);
>             if (foo.error) ...  // Which foo call?
>=20
>     I appreciate the desire for cheap and standardised error handling, bu=
t
>     this syntax is not going to work.
>=20
>=20
> I think the design of this proposal is intended to be much more
> conservative than Niall's. In particular, it is /purely/ focused on the
> transmission of error codes via this invisible fail state. That is, it's
> a mere optimization of what you would otherwise have written in an
> error-code-based world.
>=20
> If your hypothetical `foo` function had returned an error code, then
> there's no way for that `foo(y) + foo(z)` code to work. Therefore,
> error-code-based functions wouldn't have been written that way, so
> functions under the new paradigm also wouldn't be written this way.

There are currently two main ways of handling errors in C++.

You can use C-style status returns.  In that case, "foo(y) + foo(z)"
does not work.  But you /know/ it does not work - it is very clear from
the way the functions are declared and used.

Or you can use exceptions.  Then "foo(y) + foo(z)" /does/ work, and it
is clear that it works.

With this proposal, it looks like "foo(y) + foo(z)" should work, but it
does not work.  And therein lies the danger.

>=20
> Now personally, I think that's basically throwing away a golden
> opportunity to more reasonably handle errors in C. But that is the basic
> thinking behind the proposal; that kind of compatibility is exactly what
> it's going for. The idea is that this is merely about how you transmit
> the information you would have, rather than how you process it.
>=20



--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/pj98vf%24n6o%241%40blaine.gmane.org.

.
