220 38751 <CALvx3hZU8ZTfbumn7+5-mmphSWMOasohaXp=pdJRkHbOMsnoSQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Richard Hodges <hodges.r@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Safe Navigation Operator
Date: Wed, 20 Jun 2018 16:45:10 +0200
Lines: 115
Approved: news@gmane.org
Message-ID: <CALvx3hZU8ZTfbumn7+5-mmphSWMOasohaXp=pdJRkHbOMsnoSQ@mail.gmail.com>
References: <e57c6f00-96d1-4453-b31e-7e97d50833cb@isocpp.org> <9f6e5511-efcd-4e4f-8776-0b869ed54a69@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="00000000000022fec1056f13d9f3"
X-Trace: blaine.gmane.org 1529505796 25952 195.159.176.226 (20 Jun 2018 14:43:16 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 20 Jun 2018 14:43:16 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD4PBM7UWAHRBAWRVHMQKGQEQC5ISIQ@isocpp.org Wed Jun 20 16:43:12 2018
Return-path: <std-proposals+bncBD4PBM7UWAHRBAWRVHMQKGQEQC5ISIQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f199.google.com ([209.85.223.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBD4PBM7UWAHRBAWRVHMQKGQEQC5ISIQ@isocpp.org>)
	id 1fVeKG-0006dP-0g
	for gclcip-std-proposals@m.gmane.org; Wed, 20 Jun 2018 16:43:12 +0200
Original-Received: by mail-io0-f199.google.com with SMTP id s19-v6sf709iog.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 20 Jun 2018 07:45:23 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1529505923; cv=pass;
        d=google.com; s=arc-20160816;
        b=VUoyQHbzT256/GzPXAyMKFNwC9dQEvunez/BUPdmngDwdD/Dp4SnPU/h41PGLeLxNz
         3CPo0yahBeTnq5rcW8DMgbMIANDdEpu2Zks1jWjR7JWIfUMfOprql7ehckgQTotPc4lQ
         Te4ToiKpgOLt6Urni/BFiMWpVNhZ0xbVEpzHt2c+Rjf+gj5n7kTFz0C64RbeO80xser4
         kwflrUyccqJQGsjDPGd+Bmh6c7PzpMeamqiVZIWMt5m23UkLekYkT5VcM0WOBC/xB9CO
         L4Nu1/sCvi/w/TldQaePjNYjUPwhQ/QYi5h5oe9YOKWqJtuJN4dwRL+alI6QWFmxxV11
         W5sg==
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:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=KhgZ6Hg1lKvxigsSBdkOBpJRAhqkEZYk4Cnrht4AFZg=;
        b=mmMZy77edra41Uue4QLJBnAIihluZMgz+wFamFjHL5DFahDiwYI39zm7j8bwzwHXE5
         DlCewERv5u5lMlWm1W+5kfkXI9jvfmyWHEsKg0+0Rq2jvPOTccYD/C+04rMeVGp5dAuA
         z4PgkQL5W+c3iWbiBdXtMq7SuGg5YJcf2WeEEy9PnCaigH82BNr0KRHRLRw/08/Jkisv
         Kaaz6txo6AJROZmL7UGODgYqsqnXZkUt0SqG7Uz7UJoBfYze3gkImrIe8oYr76rulQqz
         SIC8u1h5SGP2TbSGfRnLTSHF2GdjN9yBcJFIwYBrdZi/VgnO7rvdELtg8ayCNR6SWmRi
         rHkg==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=ieDhtxj4;
       spf=pass (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=hodges.r@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject: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=KhgZ6Hg1lKvxigsSBdkOBpJRAhqkEZYk4Cnrht4AFZg=;
        b=AuKG5S1SxUDe7bhS6OjApwSnX17sC/0SWFvd3CQLJG9s0RBDzKnkpgV7KWzw4mTLDx
         HhpMakDgtTn6qVFbNQ8iTjNaY5D0KKw6cbgn2tlObgYmJ0LgTfJeZHBGD9T7Z1o1MiGc
         lx9Cz1bZk7OlR6rjaDxe7vjVluRU0I6WdmOYb4AXZRN3XudzvgxnQ7rW7j0K7n77kVCk
         xwmJZwWCEyb37U1OI37BrhRmRCupwU/l6umt6xbsvjmaxLtVHSJnu4CMQoO7SIWuaz50
         HxmCHFJMhUwdfiuYLr31iOsb62gNtJw4Yp6PQAAWJhKRGKK+qKlD4/r+HbObr9BMmoIt
         mLXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject: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=KhgZ6Hg1lKvxigsSBdkOBpJRAhqkEZYk4Cnrht4AFZg=;
        b=CtHguspjyvzr8UcSNAeLMqOFZGcTo2GyrO5V3U/cgUUrcShKLoyq3VuVkGAkIUi2mL
         YEO5Y0JS2Q+b+2L/9TxPAsJrfWQini+wW0yiMDJj3zOgaCRd/uuuEBeCxkQsGS/v0D4w
         J+FKpkD6SuNb18sOfAqGebJqaU/Ps5rYk3sR21ddSHeZleEws0G0rmBIQ7uawwRloWl4
         4Q6v7pv3VZPHauRGVEEt6o/arHQLYV8ubYvDf7cpMY1QUBzltgwHmyj4/mRc3D3Cp+tZ
         FK2cLIg+pNzvhg1J22+Tq/ySCO85OQKOf8P+KZwtbq8PL/bZqOgmapC1awgAIatL6Ey5
         8dMQ==
X-Gm-Message-State: APt69E2ZsKYRqNFwEy7yWMaa3HOh1+qqe1bueWDO1i8ouHYNahE9nlll
	73WqAwIBfZ7u1eVi8HWNVBotlg==
X-Google-Smtp-Source: ADUXVKKjJ9+UCwazeOrrpCO8rS1QSsFMrpKxv8+xdoVbLGKN0ZAWA4rRAwO0rcLj2etCx9zfonliww==
X-Received: by 2002:a24:dbc5:: with SMTP id c188-v6mr837711itg.37.1529505923112;
        Wed, 20 Jun 2018 07:45:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a6b:6f15:: with SMTP id k21-v6ls384747ioc.22.gmail; Wed, 20
 Jun 2018 07:45:22 -0700 (PDT)
X-Received: by 2002:a6b:2550:: with SMTP id l77-v6mr16470248iol.47.1529505922085;
        Wed, 20 Jun 2018 07:45:22 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1529505922; cv=none;
        d=google.com; s=arc-20160816;
        b=C/Y80bfcN0zOIcrfe5pi+aznvTLiOpApcbv3nyXbBEMP0igAUlh8Z1EHoh60XpnOyP
         G+swhdxC382n9TFjW7PnSKXCNb8QAsVpVrj9Zm4bxHVF2uX7vll7+BRLWPYininpzBNU
         PFgXO8k97OnYzzzMERr3SuJtqctxA6T7ITQBovuKW2zSBEQySngvzSW+H0B3X6ucYGnW
         RH8CXkmr5UI+bsmzIQli2y+frs41hEOVkfzpdKco/aTh748iPpI3yZk63kWcQugk2NIa
         sax/Cb+s7xPAhtkPHf9xaxONXwIc/eIvauVxNyTiR+60cqMklDhZHz/sAAiO0rZXET2a
         untg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature:arc-authentication-results;
        bh=mgmMhNNLH6sYb3Njn0XAo/2fizl9KTwjKaAPsVEVlMc=;
        b=zR8qDO3NiJsBAQ1ZkG/mtZ3MuwylENQsmhn7Lnfkw6q1pPkHh9T1nT7Q9ng+iI+dst
         rHcyKBLQr3/bPKf2HnTsAkSCA+Etdso1R//kkVUidSjP7qHrHdlpVh7W2P1tDvhOCDzO
         RdMrc8+8rhWPFY7kOwFBvf/XTbMbMmaccpDMjNYLYHTBQAc/Ty6SDvtc/eU/lckyryxV
         KUN/MMYtqiJKSas191b5zurJD+bqj/nL7aJVQ3pzUrkBrSeGkMzx5cEplowJ2PtzqYXb
         yyC2YwQFyMLYWQn4vsotirftcLxYg9OzVqVNpTEVTMRW0aw2bSdPfSR6CeajJqd0+rWQ
         8qzQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=ieDhtxj4;
       spf=pass (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=hodges.r@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id a2-v6sor1239623ita.71.2018.06.20.07.45.22
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Wed, 20 Jun 2018 07:45:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a24:96:: with SMTP id 144-v6mr1869992ita.76.1529505921561;
 Wed, 20 Jun 2018 07:45:21 -0700 (PDT)
In-Reply-To: <9f6e5511-efcd-4e4f-8776-0b869ed54a69@isocpp.org>
X-Original-Sender: hodges.r@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=ieDhtxj4;       spf=pass
 (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=hodges.r@gmail.com;       dmarc=pass (p=NONE
 sp=QUARANTINE 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:38751
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38751>

--00000000000022fec1056f13d9f3
Content-Type: text/plain; charset="UTF-8"

On Wed, 20 Jun 2018 at 16:36, Nicol Bolas <jmckesson@gmail.com> wrote:

> On Wednesday, June 20, 2018 at 6:01:57 AM UTC-4, saii...@gmail.com wrote:
>>
>> Hi,
>>
>> a Safe Navigation Operator like in C#, Ruby or Kotlin would make the code
>> so much simpler and easier to read.
>>
>
> This is only true because those languages do not have non-nullable
> references. Or if they have them, they aren't the common case.
>
> I haven't written a lot of code that does so many chained accesses of
> nullable references like verifying them becomes a syntactic burden of a
> kind worthy of added syntax. We have the option to have functions return a
> non-nullable reference, so in many cases, we don't return pointers.
>
> Having this many NULL checks suggests that maybe the system in question is
> just poorly designed.
>

^^ this ^^


>
> Also, what happens if the function needs to return something? What you're
> talking about can only be used in functions with no return values. That
> seems decidedly limiting.
>
> --
> 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
> 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/9f6e5511-efcd-4e4f-8776-0b869ed54a69%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9f6e5511-efcd-4e4f-8776-0b869ed54a69%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

-- 
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 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/CALvx3hZU8ZTfbumn7%2B5-mmphSWMOasohaXp%3DpdJRkHbOMsnoSQ%40mail.gmail.com.

--00000000000022fec1056f13d9f3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed=
, 20 Jun 2018 at 16:36, Nicol Bolas &lt;<a href=3D"mailto:jmckesson@gmail.c=
om">jmckesson@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr">On Wednesday, June 20, 2018 at 6:01:57 AM UTC-4, <a hr=
ef=3D"mailto:saii...@gmail.com" target=3D"_blank">saii...@gmail.com</a> wro=
te:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi,<div><br></d=
iv><div>a=C2=A0Safe Navigation Operator like in C#, Ruby or Kotlin would ma=
ke the code so much simpler and easier to read.</div></div></blockquote><di=
v><br></div><div>This is only true because those languages do not have non-=
nullable references. Or if they have them, they aren&#39;t the common case.=
</div><div><br></div><div>I haven&#39;t written a lot of code that does so =
many chained accesses of nullable references like verifying them becomes a =
syntactic burden of a kind worthy of added syntax. We have the option to ha=
ve functions return a non-nullable reference, so in many cases, we don&#39;=
t return pointers.</div><div><br></div><div>Having this many NULL checks su=
ggests that maybe the system in question is just poorly designed.</div></di=
v></blockquote><div><br></div><div>^^ this ^^</div><div>=C2=A0</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr"><div><br></div><div>Also, what hap=
pens if the function needs to return something? What you&#39;re talking abo=
ut can only be used in functions with no return values. That seems decidedl=
y limiting.</div></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9f6e5511-efcd-4e4f-8776-0b869ed54a69%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9f6e5511-efcd-=
4e4f-8776-0b869ed54a69%40isocpp.org</a>.<br>
</blockquote></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALvx3hZU8ZTfbumn7%2B5-mmphSWMOasohaX=
p%3DpdJRkHbOMsnoSQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hZU8ZTf=
bumn7%2B5-mmphSWMOasohaXp%3DpdJRkHbOMsnoSQ%40mail.gmail.com</a>.<br />

--00000000000022fec1056f13d9f3--

.
