[Fit] pipable order of the arguments
Hi, I would like to know what other think about the order of the pipe (See this issue https://github.com/pfultz2/Fit/issues/5). What would be the expected meaning of auto r1 =1 | pipable(f)(2); f(1,2) or f(2,1)? What would be the expected meaning of auto f2 = partial(f)(2); auto r1 =1 | pipable(f2); f(1,2) or f(2,1)? As the operator| has left-to-right associativity, we can not do auto x = 1 | 2 | pipable(f); We would need a way to pack the parameters auto x = forward_as_tuple(1, 2) | pipable(f); but this wouldn't compile as f has two parameters. or use parenthesis auto x = 1 | (2 | pipable(f)); and the result will be f(2, 1). Any ideas? Best, Vicente Vicente
Any feedback on this? Le 06/10/2015 02:52, Vicente J. Botet Escriba a écrit :
Hi,
I would like to know what other think about the order of the pipe (See this issue https://github.com/pfultz2/Fit/issues/5).
What would be the expected meaning of
auto r1 =1 | pipable(f)(2);
f(1,2) or f(2,1)?
What would be the expected meaning of
auto f2 = partial(f)(2);
auto r1 =1 | pipable(f2);
f(1,2) or f(2,1)?
As the operator| has left-to-right associativity, we can not do
auto x = 1 | 2 | pipable(f);
We would need a way to pack the parameters
auto x = forward_as_tuple(1, 2) | pipable(f);
but this wouldn't compile as f has two parameters.
or use parenthesis
auto x = 1 | (2 | pipable(f));
and the result will be f(2, 1).
Any ideas?
Best, Vicente
participants (1)
-
Vicente J. Botet Escriba