prabello
10/31/2018, 11:57 AMlet{::loveThePet}
but the return end up beign different and could not chain the calls, they were returning a KFunction instead of the resultShawn
10/31/2018, 3:55 PM{::loveThePet}
is a lambda that returns a reference to loveThePet
let(::loveThePet)
invokes let
on the receiver object using loveThePet
as the function parameterlet{::loveThePet}
would be equivalent to let({ ::loveThePet })
or
val func = { ::loveThePet }
item.let(func)
What you’d be doing, in essence, is passing to .let()
a lambda that discards its arguments and simply returns that method reference, which is why you get a signature error and end up with a transform that leaves you with a KFunction
returnHuman("name")
.let(::saveAHumanReturningABall)
.let(::kickTheBallReturningABall)
.let(::keepTheBallReturnAPet)
.let(::loveThePet)
::
is not needed to qualify based on namespace