but the return end up beign different and could not chain the calls, they were returning a KFunction instead of the result
s
Shawn
10/31/2018, 3:55 PM
{::loveThePet}
is a lambda that returns a reference to
loveThePet
Shawn
10/31/2018, 3:56 PM
let(::loveThePet)
invokes
let
on the receiver object using
loveThePet
as the function parameter
Shawn
10/31/2018, 3:56 PM
they are very different expressions
Shawn
10/31/2018, 3:57 PM
let{::loveThePet}
would be equivalent to
let({ ::loveThePet })
or
Copy code
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
Shawn
10/31/2018, 3:59 PM
the requisite expression would therefore look more like this