• cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2021-07-20


2021-07-22 »

Nick Message Date
ricky_clarkson FuzzyBottom: Incidentally I had never tried that, and typed it waiting for you to say that the compiler disagreed with me [01:24]
ricky_clarkson Kotlin just doesn't seem to surprise me very much, which is nice. [01:24]
Matthijs [Matthijs!] has joined #kotlin [06:30]
javabot [javabot!~javabot@about/java/javabot] has joined #kotlin [09:36]
_xor [_xor!~xor@] has joined #kotlin [10:23]
FuzzyBottom So how does it work like that? Maybe cheeser knows if you do not. How does returnLambda()("Hello", "world") send hello world to a lambda return statement? Maybe I am just not comprehending something simple [10:27]
cheeser ("Hello", "world") is not a lambda [10:43]
FuzzyBottom No, but in the code that I pasted, it was a function that returned a lambda of String. I will see if I can find that piece of code. It was String, String -> String as a return [10:48]
FuzzyBottom I was trying to understand higher order functions, and was trying to understand returning a function [10:49]
cheeser what's the code in question? [10:50]
FuzzyBottom I am trying to find it. I will put it on pastebin in a minute [10:51]
cheeser nods. [10:51]
FuzzyBottom [10:54]
FuzzyBottom I was trying to understand how calling the function the way ricky_clarkson did worked. [10:54]
cheeser right. ok. so the question is ... [10:55]
cheeser it's using the `invoke` operator/method and passing in those arguments [10:55]
cheeser () is an operator mapped to invoke() [10:55]
cheeser you can ctrl-click on the ( and it'll open up invoke() iirc [10:56]
FuzzyBottom Maybe I am just not getting it. I understand the invoke() aspect, but confused on how returnLambda()("Hello", "world") passes hello world to a function with no parameters. [11:00]
FuzzyBottom Sorry if this is easy and I am not understanding it. [11:00]
FuzzyBottom bbiab [11:00]
cheeser returnLambda() returns a function of a type (String, String) -> String [11:00]
cheeser ("...", "...") calls invoke() on that function with the contained arguments [11:01]
FuzzyBottom Okay, I get it now. Thank you. [11:24]
cheeser np [11:26]
cheeser returnLambda is probably poorly named but whatever [11:26]
FuzzyBottom Yes, I know. This was for my amazing coding skills, so I could see how things worked, and I just called it that. [11:27]
FuzzyBottom I am still at the stage of programming that I see some questions people ask on here, and am confused by those, let alone your answers :) [11:27]
cheeser no worries [11:28]
cheeser we all learned sometime. hopefully. ;) [11:28]
FuzzyBottom Hopefully is the keyword here. I am getting better. Learning C++ actually does help me with my kotlin skills. You were right when you mentioned learning another might help. [11:29]
cheeser the contrast can helpful when it's not confusing. :) [11:29]
FuzzyBottom That's true, but it makes me appreciate kotlin that much more for how simple it makes things. [11:30]
cheeser nods. [11:31]
orbyt [orbyt!~textual@] has joined #kotlin [12:31]
zitat [zitat!~ben@user/zitat] has joined #kotlin [12:52]
javabot [javabot!~javabot@about/java/javabot] has joined #kotlin [02:42]
Techcable [Techcable!~Techcable@] has joined #kotlin [03:16]
shailangsa [shailangsa!] has joined #kotlin [03:55]
samuelbernardo [samuelbernardo!] has joined #kotlin [04:59]
orbyt [orbyt!~textual@] has joined #kotlin [05:31]
vishwin [vishwin!~brioux@2001:470:1f07:302::1] has joined #kotlin [05:32]
deepy [deepy!deepy@user/deepy] has joined #kotlin [07:07]
buzel [buzel!~buzel@fsf/member/buzel] has joined #kotlin [10:48]