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 loveThePetShawn
10/31/2018, 3:56 PMlet(::loveThePet) invokes let on the receiver object using loveThePet as the function parameterShawn
10/31/2018, 3:56 PMShawn
10/31/2018, 3:57 PMlet{::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 KFunctionShawn
10/31/2018, 3:59 PMreturnHuman("name")
.let(::saveAHumanReturningABall)
.let(::kickTheBallReturningABall)
.let(::keepTheBallReturnAPet)
.let(::loveThePet)Shawn
10/31/2018, 4:00 PMShawn
10/31/2018, 4:00 PM:: is not needed to qualify based on namespace