Topic: Suggesting a syntax for wraping overload set
Author: Zhihao Yuan <zy@miator.net>
Date: Wed, 19 Oct 2016 17:00:58 -0500
Raw View
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.
.