Re: Proposal: Lua should have arrow operators
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Proposal: Lua should have arrow operators
- From: Charles Heywood <vandor2012@...>
- Date: 2017年7月03日 23:31:50 +0000
I personally feel that while it is nice, it'll lead to ambiguousness. Haskell does it nicely: functions with multiple arguments essentially "return" a new function, so `x y $ z 1` would be like z(1)(x(y))` (I think it was Haskell...). Because Lua has only one function call for multiple arguments, I feel it's a tad bit weird.
It looks very functional. I like it.
If it's not costy, it would be an incredible addition!
2017年07月03日 23:44 GMT+01:00 Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br>:
> math.exp( 1 )->cosh()->round( 7 )
You can almost do that right now:
debug.setmetatable(0,{
__bor = function (x,y) return y(x) end
})
print(math.exp(1) | math.cosh)
--