220 39871 <pl6vog$6qv$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: What do we want from named paramaters
Date: Fri, 17 Aug 2018 19:16:03 +0200
Lines: 73
Approved: news@gmane.org
Message-ID: <pl6vog$6qv$1@blaine.gmane.org>
References: <1534441498.3721109.1476442920.71D445BF@webmail.messagingengine.com> <pl6ob7$9k1$1@blaine.gmane.org> <2d91b5c9-da43-478c-b100-eed305f3397c@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"
X-Trace: blaine.gmane.org 1534526111 13701 195.159.176.226 (17 Aug 2018 17:15:11 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 17 Aug 2018 17:15:11 +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+bncBDP6R2XHXIARBHUG3TNQKGQE423R5DQ@isocpp.org Fri Aug 17 19:15:07 2018
Return-path: <std-proposals+bncBDP6R2XHXIARBHUG3TNQKGQE423R5DQ@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+bncBDP6R2XHXIARBHUG3TNQKGQE423R5DQ@isocpp.org>)
	id 1fqiL5-0003Sm-J1
	for gclcip-std-proposals@m.gmane.org; Fri, 17 Aug 2018 19:15:07 +0200
Original-Received: by mail-lj1-f200.google.com with SMTP id q13-v6sf825548ljj.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 17 Aug 2018 10:17:18 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1534526238; cv=pass;
        d=google.com; s=arc-20160816;
        b=tYye9F/XBT85mF5ygcsPDghnB21v7EEPLXDAp9zQk8di4XL0X5P4cKNDmYi8GxOWIS
         p5Z7PajJR4l4IBV79Qko9ZEuTDQ5OwZj4WSxoWiz/rz3+rim0veCWP4dX8yUw9sn0zCh
         UEeNMNuaWT9taURVgksAPOnflaznL1enXxYKYIWqnpckppOW+ReKSITNcZ5pAfJXq8fD
         8FlACBULdAv51TLBAFtLMS9PlBZj0WcTCQrNWWEBRs6mEtNWYDGlm5MY1tJlzAzvaZuL
         ZpXoZQPyHzqb+TzxDvz7/wwa+QM48/2kQqafMhz87NoNp6Dfb2HzzgE5hlZdJU5O8fi9
         7Bsw==
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
         :mime-version:references:message-id:lines:date:subject:from:to
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=IAgPxbPZ6FZv4hkSzVC48wkb7LBLfir10jsEYF16btU=;
        b=uqFj+LsN/K8jyCFMwsUu8VxQdRqC1PK4HbzQpz2Np/E052kAhUVOglevaIF6FvNdsy
         hPPtJA+HMJyJ6O5lI01qm+/oqFRK/R4L/f/TX3BAIJB2T9Zpu6bRRqIQ19n6bc/8G438
         6U3y6a9HNyquokRvGrrvHR45D/b3F4pvLhpqdD0dVG8aE2lcpkw4Wo/bGDLtpEyggpg8
         L4MD0lXmt5VvW3iYnsKvv9HfJR3+IhGZSLBhD97q8Zi8qu6tc/Wk1ogjB3q0K/HSoAF3
         aAsRy0gudvdbIjGYtZzH3JOjkdcNTgo3Xi+chQbRsnGWX3VAp6Cb6UWk/WGon6pJdHR+
         uCUA==
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
         :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=IAgPxbPZ6FZv4hkSzVC48wkb7LBLfir10jsEYF16btU=;
        b=T7Swu8YYaoNmZl+3MkVQ23wfeSZzgXa3hORYhc25iZ0/2cY2vkis1gT5kLX+YSa48s
         aG4Y/22h3/tiQ7YhmK6bNut+aljxRxTvbHqMdNS9iaNbQNYKQPBQOAnYWkBGmyet+ZmA
         9ObxWv3l/SG4rfZYQIQDikNTvAj8i46BtvlqpMEtRzB59xQBGuBffhAYsTfNa2pHKEjS
         eCFlQrOKNj1iccx2ZxQcfRsJGMudSSmlFcsXrpjjSreibAUVQsJleX1ZzwxhVHjJx1Ff
         ll5Y3lqcZVma1DGu/uh6xKGLz67b3epBp+7HSVunlhkhiR5YENX+SE4TRB5EPIsf7XKJ
         NovA==
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: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=IAgPxbPZ6FZv4hkSzVC48wkb7LBLfir10jsEYF16btU=;
        b=ONqZRZqTwBs4od0CYAubIee0zUDNmsA545MXk5BKukTnzmQ++ErFDDHCW6w3MB6Dlw
         DVazhl6gG241xDzBW1EZm7ZARDYKcARxTul2ITitB4XR94Sc9cx6K9GF2lnCkKnIKtUU
         Ua+nVIoT6cD/IDH4IN2Mbj1//v4BXaPgibJuJYhfwcFZ+k80zjJ7pvZKTKD78Tii4a2W
         oouTSPFbSR+TyTqvnmUycKvSw4HuhNPsyF5OAMD2s5GPgCGDc2DqWrUNAJ8lwkYIpDGk
         tKIxddfGscXEbLTZluoW5eGZkFhAlY4ImxKz9oV+XlkWzRQBnIMQN3ftoFcFMxJVSHlA
         drbA==
X-Gm-Message-State: AOUpUlFdJMYyU2rVjzvaJ2D/cNxa6HNAwbrStDFYzJFZUJuByx0yeR/x
	BaSiCvmN+DltRgsPAXTHKXA=
X-Google-Smtp-Source: AA+uWPz6J8EcOq61EGGklTVmW2yHmo1ek0gta3RRLbejSiiW4Ch+uKH5RsRyTzPezaeGW+Dym0BU/A==
X-Received: by 2002:a19:ca0f:: with SMTP id a15-v6mr1767012lfg.26.1534526238514;
        Fri, 17 Aug 2018 10:17:18 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a2e:98d4:: with SMTP id s20-v6ls882348ljj.3.gmail; Fri, 17
 Aug 2018 10:17:17 -0700 (PDT)
X-Received: by 2002:a2e:5810:: with SMTP id m16-v6mr8815897ljb.134.1534526237446;
        Fri, 17 Aug 2018 10:17:17 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1534526237; cv=none;
        d=google.com; s=arc-20160816;
        b=ZmwrttkmOoPe7WjdIZatECYk7DhclTFIah/2bV9oyX5H8VCtbW8N1VB+xpRppzt7bC
         9TRpkAOMW9MXksE2uoX07Xpbr9pQX5xChUCh9SimK/ZElI6mHdgyg3lsp1vTKrwkweAS
         PGJUFkOOVE9HczwqL6b+bkl4AQS6Csoqr0gd/1QD6ChdWryJ76kwn388Qh/snbZHqIF9
         ZXvpjpQtdfrJGrLeIQhzEXJfCqPrTu+J3kBRsUsEKLEsPL0ycFhIQe8zkb/XJFtqdqLj
         a7Fd8kKBBSQQ4pkc3qs/bjsFnjUcgr/KJc0wQk8GGP3Vo6LfuvKCRdC5O4dKa6QKQtMs
         YG7g==
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=wr0JAg/vZDeXCkAVlK6Mz/Yxrd6vdDOCmUKsd4IvNuU=;
        b=IVHAd/YY7JJ39DAxigLFahCcAFoM0ZAWOv4JU1PGnxZ+WVgQbcSOKqxSBXHQTw+9I3
         CwV9vkUK+IOhzjJfJ9EQG7rlONakNBP3RxCAzkFHmrMpA0tdZsihzeVFuk/klwzKf27A
         T2NDQECN0HCO3u9Nc7MeonJWDIj+7+Dhn/m09ZnaJ9XBAJzEuKVgz2rMYS2DcqWETaod
         2tqSLnnFUEp82fkOIZNIVUqh3lWqxYT6Lo1uKLQFRDQP5ahsGPCGJ5ic/NIUiJ6vwnut
         Es25P+1X/Tx0O39D68efvsMsEQ5DgNIgCOpJjQDReLtO+TFQjDB0G/uEylJkH/7oFBEn
         vjFg==
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 r10-v6si1006707ljh.143.2018.08.17.10.17.17
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 17 Aug 2018 10:17: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 1fqiL4-0003Q7-29
	for std-proposals@isocpp.org; Fri, 17 Aug 2018 19:15:06 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 66
Original-X-Complaints-To: usenet@blaine.gmane.org
In-Reply-To: <2d91b5c9-da43-478c-b100-eed305f3397c@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:39871
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39871>

On 17/08/18 17:25, Nicol Bolas wrote:
> On Friday, August 17, 2018 at 11:09:38 AM UTC-4, David Brown wrote:
> 
>     On 16/08/18 19:44, Henry Miller wrote:
> 
>     >
>     >
>     > Third:
>     > class myString {
>     >         int compare(myString, bool CaseSensitive);
>     >         ...
>     > };
>     >
>     > in code
>     >        if(str.compare(otherString, false) == 0) ...
>     >
>     > // what does this mean, why would you call compare and not compare?
>     >
>     > This code is legal C++17, but it is user hostile. False in the
>     > context of reading the function makes no intuitive sense.  Qt has
>     > created an enum for this, but it can be argued that this is too
>     > heavy.  (you may or may not agree with the argument)
> 
> 
>     The ideal solution, IMHO, involves two parts.  I would like to see
>     function parameter scope types, and perhaps be able to define them
>     within a function declaration.  I want to see:
> 
>     class myString {
>             int compare(
>                     myString,
>                     enum class CaseSensitivity { insensitive, sensitive }
>                                     sensitivity
>             );
> 
>     Then you could write:
> 
>             if (str.compare(otherString, insensitive) == 0) ...
> 
>     The "insensitive" would automatically be looked up in the scope of
>     types
>     declared within the scope of the function declaration.
> 
> 
> That is an over-designed solution. The problem has nothing to do with
> where the enumeration gets declared. Sticking the declaration in the
> function signature doesn't really solve the problem.
> 
> What solves the problem is the fact that the identifier `insensitive` is
> looked up within the domain of how it is used. It's being used as a
> function parameter that takes an enumeration which has an enumerator
> called `insensitive`; therefore, that enumerator must be what it names.
> 
> /That/ is the feature we need: the ability to take an identifier and
> generate its "path" information based on context at the site of use.
> This ability would aid in this problem and many others (enum-classes in
> `switch/case`, having to prefix tags in tag dispatching with
> `my_namespace::`, etc).
> 
> There is no reason to wed context-specific "path" lookup to the location
> where the particular thing is declared.

Fair enough.  It sounds like you are suggesting a more general solution
that could be used in other places too.  I'm happy with that idea.



-- 
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/pl6vog%246qv%241%40blaine.gmane.org.

.
