220 28993 <CAGsORuB4zNMAs7BCZnyqpZynYD1ERCrCYKK8eaQKybyEM9wwog@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Zhihao Yuan <zy@miator.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Suggesting a syntax for wraping overload set
Date: Wed, 19 Oct 2016 17:00:58 -0500
Lines: 59
Approved: news@gmane.org
Message-ID: <CAGsORuB4zNMAs7BCZnyqpZynYD1ERCrCYKK8eaQKybyEM9wwog@mail.gmail.com>
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 1476914493 26836 195.159.176.226 (19 Oct 2016 22:01:33 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 19 Oct 2016 22:01:33 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCSKRWMD4EHBBJW2T7AAKGQEB3A34QQ@isocpp.org Thu Oct 20 00:01:29 2016
Return-path: <std-proposals+bncBCSKRWMD4EHBBJW2T7AAKGQEB3A34QQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f72.google.com ([209.85.213.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCSKRWMD4EHBBJW2T7AAKGQEB3A34QQ@isocpp.org>)
	id 1bwyv7-0003rE-US
	for gclcip-std-proposals@m.gmane.org; Thu, 20 Oct 2016 00:01:10 +0200
Original-Received: by mail-vk0-f72.google.com with SMTP id q126sf31258734vkd.4
        for <gclcip-std-proposals@m.gmane.org>; Wed, 19 Oct 2016 15:01:12 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:sender:mime-version: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=HZ91LI60h3ZEyKqF+TQ+M8QqhMWGK28CceeWajRtufE=;
        b=LrS2UbmzwjSW1FO0ccbOr6TRzOZ4tbyOcU64OgASxq5jas1fFibtmuNXmXXGNyVMgq
         SmNUihKbkexUGW4o7kJ3Q+f3U6cWlT3qIIM5G8TMl8b/sP19r6KtgKCiaZZLo+KJoaPq
         LcTxiTVSejM0JiL/1G6LOqEK0z6c70QT7nd4mCk3uwibVl6cnWPC5+Z4r5iQs7rTiinZ
         pviycPnF5sTwJCauI47xJxrizV9HhHBAVotrMIy8c4TY4lO8GidasrgjQYUQtCPhA6vs
         I8iE7FjbovBhHju91Lc/hamD9f916yQzoifNPNThnoTSUAtwd/C3hYhj9bYybP3lVv0b
         S8rg==
X-Gm-Message-State: AA6/9RnLvbAjPzEM/RJnGG3wLbp9KT5oBqINxJ2SCW1ZwCYtIGnzV+sEyaQq9j/XVk/DCQ==
X-Received: by 10.31.151.199 with SMTP id z190mr2587544vkd.14.1476914471801;
        Wed, 19 Oct 2016 15:01:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.20.72 with SMTP id 69ls1162253iou.32.gmail; Wed, 19 Oct
 2016 15:01:10 -0700 (PDT)
X-Received: by 10.99.49.133 with SMTP id x127mr4592916pgx.68.1476914470689;
        Wed, 19 Oct 2016 15:01:10 -0700 (PDT)
Original-Received: from mail-s68.mailgun.info (mail-s68.mailgun.info. [184.173.153.196])
        by mx.google.com with ESMTPS id b3si35292839pav.115.2016.10.19.15.01.10
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 19 Oct 2016 15:01:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce+3f9131.69110-std-proposals=isocpp.org@miator.net designates 184.173.153.196 as permitted sender) client-ip=184.173.153.196;
Original-Sender: zy@miator.net
X-Mailgun-Sending-Ip: 184.173.153.196
X-Mailgun-Sid: WyI3MTBkYiIsICJzdGQtcHJvcG9zYWxzQGlzb2NwcC5vcmciLCAiNjkxMTAiXQ==
Original-Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com [209.85.213.43])
 by mxa.mailgun.org with ESMTP id 5807ed1b.7f64540a0fb0-in01;
 Wed, 19 Oct 2016 22:00:59 -0000 (UTC)
Original-Received: by mail-vk0-f43.google.com with SMTP id q126so46447000vkd.2
        for <std-proposals@isocpp.org>; Wed, 19 Oct 2016 15:00:59 -0700 (PDT)
X-Received: by 10.31.114.71 with SMTP id n68mr7638512vkc.129.1476914458854;
 Wed, 19 Oct 2016 15:00:58 -0700 (PDT)
Original-Received: by 10.176.68.33 with HTTP; Wed, 19 Oct 2016 15:00:58 -0700 (PDT)
X-Gmail-Original-Message-ID: <CAGsORuB4zNMAs7BCZnyqpZynYD1ERCrCYKK8eaQKybyEM9wwog@mail.gmail.com>
X-Original-Sender: zy@miator.net
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@miator.net;       spf=pass (google.com: domain of
 bounce+3f9131.69110-std-proposals=isocpp.org@miator.net designates
 184.173.153.196 as permitted sender) smtp.mailfrom=bounce+3f9131.69110-std-proposals=isocpp.org@miator.net
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:28993
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28993>

I gave the reason why I against using the following syntax

  [] funcname

to lift an overload set / operators into a lambda expression:
the captures are never used.  Moreover, they may end up
being misleading.  Consider the member access support in
p01192r2 prefixed with []:

  [] obj.data

So this lambda captures obj or not?

So I try to go back to the origin of the problem we are solving:
we have various kinds of things which are close to callable,
just not first-class.  And the transformation we are doing are
merely from

  f

to

  \x -> f(x)

In lambda calculus, we call this transformation Eta-expansion
(=CE=B7-reduction for the reserve process, and =CE=B7-conversion for
either -- adding or dropping an abstraction).

Scala is a language that I know for using the term Eta-expansion
in its language spec, because they face a similar problem --
methods are not functions.

And my suggestion for C++ is very simple:

  etaexpr(funcname)
  etaexpr(std::iota)
  etaexpr(<)

etc.  A new keyword, etaexpr, seems never seen according to
google and github, reads "Eta (wrapped/expanded) expression",
and means "to wrap a lexical lookup / operator / member access
into a lambda".

--=20
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://blog.miator.net/

--=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/CAGsORuB4zNMAs7BCZnyqpZynYD1ERCrCYKK8eaQKybyEM9w=
wog%40mail.gmail.com.

.
