220 39877 <2755b639-002d-a94b-a3d4-3a0197259cda@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Named Parameters for C++
Date: Fri, 17 Aug 2018 13:53:11 -0400
Lines: 82
Approved: news@gmane.org
Message-ID: <2755b639-002d-a94b-a3d4-3a0197259cda@gmail.com>
References: <CAPuuy5eBx1ybcPjS6dNsk7n1_c2uhdRBS19qr=q5cj3cTURnLQ@mail.gmail.com>
 <pl3ogk$csr$1@blaine.gmane.org>
 <f3af9e48-f865-476e-8724-4af19ce23369@isocpp.org>
 <pl671k$gsb$1@blaine.gmane.org>
 <823c098a-0fb0-18c3-82f3-e8a8616312f1@gmail.com>
 <pl6vh8$kta$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1534528270 24731 195.159.176.226 (17 Aug 2018 17:51:10 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 17 Aug 2018 17:51:10 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.9.1
To: std-proposals@isocpp.org, David Brown <david@westcontrol.com>
Original-X-From: std-proposals+bncBC37LBFWUIFBBCMX3TNQKGQE474T5NY@isocpp.org Fri Aug 17 19:51:05 2018
Return-path: <std-proposals+bncBC37LBFWUIFBBCMX3TNQKGQE474T5NY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f199.google.com ([209.85.216.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBCMX3TNQKGQE474T5NY@isocpp.org>)
	id 1fqitt-0006Gw-0O
	for gclcip-std-proposals@m.gmane.org; Fri, 17 Aug 2018 19:51:05 +0200
Original-Received: by mail-qt0-f199.google.com with SMTP id l13-v6sf6913425qth.8
        for <gclcip-std-proposals@m.gmane.org>; Fri, 17 Aug 2018 10:53:14 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1534528393; cv=pass;
        d=google.com; s=arc-20160816;
        b=0KgoIoONAX3DynGVpgqUzrEnILG4E9NUz5jpZwNEkkoi/GCUKjeFxcl8j4avT9AdMm
         /GRnQySmnDHPV6LRpeA+yN2XFw08xDr0dGfuMNt3yQuiAJqfWVjNF8VZYCeklcAjQIE8
         wk5D0a/K+ZG8Jsm+qQIStGVO2CdHI94ZKa+7O3/hQA0yDZoo+OMpnJXy5Mr/DRhRK66L
         MbH2kwOLna6xdWIi3wY3oZk1HfLUYGMl1xxuDQU2kYNkKzyzhngZe2p4lLHoVq7TSHYU
         O9Z+N01SWR/78Xc3RCu6CP9FjP66kwQ4t81yjKUvUlaUw68I8vKc3a+Drb9pZPCPcb6t
         oCqw==
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:content-language
         :in-reply-to:mime-version:user-agent:date:message-id:openpgp:from
         :references:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=3M3My5A1wpFzirpmK+EOGZd1K0OQ/uUeiMeQRVMS1GE=;
        b=aDE/vMF9OY0wXUB5Rug9LwhkAMc8nvKlm9ct8WnqTPTO71ReXs0eoXQ+aI+ZVLFuXq
         Tf9WTIMZRnZdYM3cSCHe7PEyZn46tPICLM+poFOYv2wN4vgWRl408geLLK3aqS4tLjW+
         5Bnn0nefYmAbvt+kfM9ylGT49EC5OpBrnw3eAVcb+fbFSh+k/9Xm36K/vUKn2p6ArLG7
         cK1trvXR6B3cn3K8Ypb46CwfTWLSP36MlVTfppdgh/49h3l2+cOT2Wr4uDkDEC95e7cv
         ck4WvF7mFV/FFAshvfXPjPK3zgkL/aeji1K78qgxhpN8Dam71S5qhCA/zJsWHnOrreNd
         x4 
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=X+2+q6+4;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@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=subject:to:references:from:openpgp:message-id:date:user-agent
         :mime-version:in-reply-to:content-language: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=3M3My5A1wpFzirpmK+EOGZd1K0OQ/uUeiMeQRVMS1GE=;
        b=qW/4SJwCUgkj0ej9r3TL/5RrhvNQUn64Uv7HEUo7qpTsFIG7rSEqLvhVgSAbf7Zhv+
         NH0eoIOSs18c0vupAUlxPwXcYLMM7IVRANnyKV9JOILV+98j3VctoWAbEvegQEk/uRMB
         L5i2dNWv3rGCCRfoOXqIIJs2jyKK5nN6xtZudb3uNNdakEBxmEon9trHugsGJgQcWX0S
         Hmpx+lgUYxGTRgzDgugBtKQickuRFXgUA5IgXTxWu2X4CI/Ps1O4+VTkF94fcvnvGCu2
         sqcltj2u5xIZvYz2yi3dXtrw3ohxTifPXsTuGg5C3cFhC/gk46YeJGg3HzvNtUXKDZmF
         nd2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:openpgp:message-id
         :date:user-agent:mime-version:in-reply-to:content-language
         :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=3M3My5A1wpFzirpmK+EOGZd1K0OQ/uUeiMeQRVMS1GE=;
        b=SNN3VzcL3lbCfaXqfWnGfHkNDspQ2H0ufr8kTDo/sdr/04yk7RDA04rUXsLsR6Wcil
         ggQQIBQvsuFAGzGXSFzObw2rsV2T2kphmCfKhaMn7zPXyQhZY1Bfw/OLznJxNvQn4NRa
         zWxfTprNyeNFG78d0clr9DVJOYfGzq7tbjrEqMeBZxX9pioFHsfidw42fLeEalzWJ/XV
         MHuAh04FmfZfdMUzirX1j+FcIcyjfT5K+TQgqqSRT6XVRHiEkNUPBj0HVvwx177nd6I8
         qalsjKW9+QVguJDoENvwvhiTrdS0a8DdsHFaNMhj2Are0k2970VeU/bd2wa5YypHAdUV
   
X-Gm-Message-State: AOUpUlGurmYmeyX0uYJLJbTfkdilHgRABTNJ02/sFLKnZvXzmP3+xyqA
	CMSBlpyP0EAtiDnsbD7MeFCkxg==
X-Google-Smtp-Source: AA+uWPxHk8Y3VJTNoKFFC5Bzmvr6wNlxyAB0iBNW+fo7ZwqgkNIf1O616QdOeqlMZYCc6wk+F2mtOQ==
X-Received: by 2002:ac8:2575:: with SMTP id 50-v6mr20047017qtn.1.1534528393829;
        Fri, 17 Aug 2018 10:53:13 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a37:d443:: with SMTP id l64-v6ls4364409qki.0.gmail; Fri, 17
 Aug 2018 10:53:12 -0700 (PDT)
X-Received: by 2002:a37:3891:: with SMTP id f139-v6mr33419527qka.177.1534528392926;
        Fri, 17 Aug 2018 10:53:12 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1534528392; cv=none;
        d=google.com; s=arc-20160816;
        b=QNZCZcnw9KlxiEGivrui1crLbw9Z/yQeew049OqKW+BwptZRtiAJxumVkDwTJbokGH
         RkkqsnSm3dRo3oGXTnhdbJUy8W7GHStphJbUbBsCVNfIZf0FseTLTil69M5rGGIfUveh
         OhP83JYvuREyvJzk3u8rH1WdnOY37Ff5On01Y7atiK887qtrY0NeUr98sMMino/7+Bz8
         gEBv2JP5bT/nLZXxNk6AQ57NmUqyHNrNKMcUnxIMylReTledA5xPqdpv6fif9uMEaPBZ
         j2HCzupiDdLS+vCiLtQhZpKn2788PToBQXNcOp0qtHxIt/Qadz3vsjLAttsPHxJdAuD9
         ai7w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:openpgp:from:references:to:subject
         :dkim-signature:arc-authentication-results;
        bh=ocZxg19IyapfgPRLkg8RYupGgAnQcFCxSbfxYe8xq6o=;
        b=szRIaWIc6dSBsUcDkZV7q3ZQ/ktS3+VsFn8Vy+laWttPwcRfVtPG6o2QO1U5YD082x
         Qd+je8EDH7AR7M+kncF9kdE4Zkyxv+PsmgKvlnSzzf8F8TwHTdJkF+tBKFhpa4ItcwoY
         9em5bNjMfb8G94r4aFrujPk2mVQMltDfWddywSEv1Sl8pvCGHiD+DKMB8o1ZY2g8jKbb
         usKb8ZJveEK7j/LdZXV5B25LOEesuxxwsoeJet3Ajj3xJE/wCetCMa9rERbm7lIK/jG8
         SgxEn73o75GmCOH+nmW6avbFDCaByjD11z17zIYomJBNr+UiuhUJsOOwMVEdT/hhuHuS
         ZcyA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=X+2+q6+4;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@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 e24-v6sor837531qkj.5.2018.08.17.10.53.12
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Fri, 17 Aug 2018 10:53:12 -0700 (PDT)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a37:1866:: with SMTP id j99-v6mr3722989qkh.344.1534528392731;
        Fri, 17 Aug 2018 10:53:12 -0700 (PDT)
Original-Received: from gryphon.kitware.com (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id 134-v6sm1459638qke.94.2018.08.17.10.53.11
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 17 Aug 2018 10:53:11 -0700 (PDT)
Openpgp: preference=signencrypt
In-Reply-To: <pl6vh8$kta$1@blaine.gmane.org>
Content-Language: en-US
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=X+2+q6+4;       spf=pass
 (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=mwoehlke.floss@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:39877
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39877>

On 2018-08-17 13:12, David Brown wrote:
> On 17/08/18 17:16, Matthew Woehlke wrote:
>> On 2018-08-17 06:14, David Brown wrote:
>>> On 16/08/18 15:08, mihailnajdenov@gmail.com wrote:
>>>> First - you make something, that has been private for 30+ years, public.
>>>
>>> No, it is not.  The names for parameters are in function declarations,
>>> in headers - these are public.
>>
>> No, they aren't. Or, more correctly, while they are "public" in the
>> sense that a user can see them by reading the header, they aren't a
>> (normative) part of the API, any more than comments are. To *the
>> compiler*, they may as well not exist.
>>
>> You are proposing to change that. That is a *serious* change.
> 
> Nah, you are overreacting.

You are certainly entitled to believe that. I happen to disagree, but
more importantly, AFAICT quite a few others also disagree. The point is,
you are facing an uphill battle to convince the committee on this matter.

Right now, changing the names of function parameters is SC+BC. IIUC, you
are proposing to make it at least SIC, if not also BIC. I honestly can't
see how you're going to convince the committee that that's okay.

> At most, it is a /tiny/ issue compared to
> the huge amount of implementation stuff in typical C++ headers that
> really is supposed to be private implementation details.  (Hint: lots of
> it is labelled "private:".)

You mean like this?

  class foo
  {
    ...interface...
  private:
    FooPrivate* d;
  };

No so much "leaked" there...

> Some people have suggested a syntax for function declarations (or
> definitions) that indicated that one or more of the parameters /must/ be
> used as named parameters.  I can see that being useful if they are to be
> used for overloads, but not otherwise.

Well, I don't believe I've ever been one of them. I currently don't see
any reason why such a feature would be desirable.

There *are* instances (overload resolution, skipping parameters) when a
*call* needs to use a name, but I don't see the value in having a
declaration that says you *must always* use the name.

>>> and the whole idea would be useless if
>>> special syntax were needed to declare that a function uses named parameters.
>>
>> I don't think you can *avoid* that, since there is very strong
>> opposition (see above) to turning all existing functions into functions
>> that have named parameters. Also, everyone that *is* proposing to have
>> named parameters with syntax apparently don't share this opinion.
> 
> I don't think your argument against allowing people to use named
> parameters for existing functions is at all convincing.

Who's arguing that?

I would make this perfectly legal:

  void foo(int x); // note: not a named parameter
  foo(.x=5); // okay, but maybe warn in pedantic mode
  foo(.a=5); // okay, but probably warn

-- 
Matthew

-- 
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/2755b639-002d-a94b-a3d4-3a0197259cda%40gmail.com.

.
