220 26299 <CAJ4VuxsF56gcafA15-a6eiN3+vsHdEOf8NTqg7w6-S0b9fTCpQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Gor Nishanov <gornishanov@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: RFC: await, structured binding and std::expected
Date: Sun, 12 Jun 2016 10:22:32 -0700
Lines: 85
Approved: news@gmane.org
Message-ID: <CAJ4VuxsF56gcafA15-a6eiN3+vsHdEOf8NTqg7w6-S0b9fTCpQ@mail.gmail.com>
References: <a6a9247a-9684-4e12-aaeb-162c638c8bc0@wanadoo.fr>
 <fd851a3a-5e85-48ca-88b4-936bc040e6c3@isocpp.org> <cc7864ac-8365-3d26-1f61-57ddc294ed5e@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1465752162 28411 80.91.229.3 (12 Jun 2016 17:22:42 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 12 Jun 2016 17:22:42 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC47RF4IW4GRBWNU625AKGQEFIBYLPA@isocpp.org Sun Jun 12 19:22:37 2016
Return-path: <std-proposals+bncBC47RF4IW4GRBWNU625AKGQEFIBYLPA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f200.google.com ([209.85.161.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC47RF4IW4GRBWNU625AKGQEFIBYLPA@isocpp.org>)
	id 1bC95n-0002v1-4Y
	for gclcip-std-proposals@m.gmane.org; Sun, 12 Jun 2016 19:22:35 +0200
Original-Received: by mail-yw0-f200.google.com with SMTP id c72sf268539280ywb.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 12 Jun 2016 10:22:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :content-transfer-encoding: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=KhJRdMmLWd1Hu50atvzzWnOBL0Z8MwebQZnOvNY+56k=;
        b=tB3oX2+T/UVFMMHywaBtS3fP0NfQlHT/3S4eL5wr/5xdIVyF4lYmfcz4wpiwdMOJiM
         24zYX4nG3Y0PZb8lF+ml4HdSsXQnKDxhlWrWtpBWUZpK4uk15DgT5108P0E0LVGaZMrH
         Tb3afYxU27gk4xNukDsMr/SlyGDubObYvCDvWpjB0MNOsEKlkc5g60OdjMKViBsTCZBg
         KzvEe68xqgE4EgeUX1LS9QjOW9/InZHOJpbX347qDRcRpdUlIVehIvTc0JEvArHs3e4a
         zWFQ7GdDM5We1pPH7n1xzhwHtV8O0u2SbGK9B86L3Mr95QAqbDdZWmFDKZncBJEeGez6
         gzzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:content-transfer-encoding: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=KhJRdMmLWd1Hu50atvzzWnOBL0Z8MwebQZnOvNY+56k=;
        b=Nvhs/yVNinfz/bTmscRGZHDv/1XyEuOJwdo+fXdSm7MvfLaA/2+Vs4fyYCIv/wzp3C
         ejBQfUX7JpgVfmKs3lJUrDPUAVdx2J7k6a9iuAr6Z1HIL5nMZ3/Wsk4zur5u0q0rQ7S0
         wx2vhH7oBaN99gFjJJXaIGPosVnMBfV8kMhYnhGMcLgotmZn4mfr9N5POPdExl7ZSmuO
         RZvINVjmJq7gECTt9KoIu0ymjqjlYZ4nlSm5DP602NG4UHWn/677xn8qjN16usldg0du
         u83xo13fhf5LuctvzWXQY2WcPEL3+sweXL+IQu+W1heuJGlV6uliE4Vw7f7GNS0hdh+K
         pzl 
X-Gm-Message-State: ALyK8tJb751EhkWM/lS5BMJa/XWy95pJsTOEfaDVpXn+8RpE59CT1oTbcdvr48kwXhqnAw==
X-Received: by 10.129.102.87 with SMTP id a84mr9150872ywc.15.1465752154129;
        Sun, 12 Jun 2016 10:22:34 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.29.76 with SMTP id d73ls1355867iod.0.gmail; Sun, 12 Jun
 2016 10:22:32 -0700 (PDT)
X-Received: by 10.107.59.78 with SMTP id i75mr16808012ioa.125.1465752152912;
        Sun, 12 Jun 2016 10:22:32 -0700 (PDT)
Original-Received: from mail-io0-x234.google.com (mail-io0-x234.google.com. [2607:f8b0:4001:c06::234])
        by mx.google.com with ESMTPS id b126si8537700itc.73.2016.06.12.10.22.32
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 12 Jun 2016 10:22:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of gornishanov@gmail.com designates 2607:f8b0:4001:c06::234 as permitted sender) client-ip=2607:f8b0:4001:c06::234;
Original-Received: by mail-io0-x234.google.com with SMTP id o127so57062243iod.2
        for <std-proposals@isocpp.org>; Sun, 12 Jun 2016 10:22:32 -0700 (PDT)
X-Received: by 10.107.21.194 with SMTP id 185mr16592254iov.59.1465752152690;
 Sun, 12 Jun 2016 10:22:32 -0700 (PDT)
Original-Received: by 10.107.26.70 with HTTP; Sun, 12 Jun 2016 10:22:32 -0700 (PDT)
In-Reply-To: <cc7864ac-8365-3d26-1f61-57ddc294ed5e@wanadoo.fr>
X-Original-Sender: GorNishanov@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 gornishanov@gmail.com designates 2607:f8b0:4001:c06::234 as permitted sender)
 smtp.mailfrom=gornishanov@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
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:26299
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26299>

I did not spend any time thinking about it.

Probably it would be better to have something other than awaitable
with a simpler semantics. try_xxx equivalent of await_xxx.

It is possible that someone can come up with a cool generalization of
the "syntactic sugar" that coroutines do that is not tied to
coroutines (as in functions that can suspend their execution and
return control back to the caller to be resumed or destroyed at a
later point as desired).

If that works out, that would be great.



On Sun, Jun 12, 2016 at 9:20 AM, Vicente J. Botet Escriba
<vicente.botet@wanadoo.fr> wrote:
> Le 11/06/2016 =C3=A0 19:01, Gor Nishanov a =C3=A9crit :
>
>
>
> On Sunday, May 29, 2016 at 3:01:09 AM UTC-7, Vicente J. Botet Escriba wro=
te:
>>
>> Hi,
>>
>>
>> Using structured binding like syntax to mean await when we don't want to
>> await
>>
>> For a lot of people it troubling to use await with std::expected [P0323R=
0]
>> as we don't await anything
>>
>>
>
> Just to comment on this point. One suggestion to improve readability of t=
hat
> use of away was to repurpose 'try' :-) .
> So that you code looks:
>
>    int i =3D try foo(bla); // try will unpack expected<int> and propagate=
 the
> error if required. Compile time error if used with future-like awaitables=
..
>
> Beside disabling futures-like awaitable types, What would be the differen=
ce
> between try and await?
>
>    int [i] =3D foo(bla)
>
> vs
>
>    int i =3D try foo(bla);
>
> I would go with the latter.
>
> Yes, I find the try expression more appropriated.
>
> Vicente
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/NkykzTGqH7Q/=
unsubscribe.
> To unsubscribe from this group and all its topics, send an email 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/cc7864ac-836=
5-3d26-1f61-57ddc294ed5e%40wanadoo.fr.

--=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/CAJ4VuxsF56gcafA15-a6eiN3%2BvsHdEOf8NTqg7w6-S0b9=
fTCpQ%40mail.gmail.com.

.
