Ok, I think I solved this with `whileSelect`, but ...
# coroutines
d
Ok, I think I solved this with
whileSelect
, but what's the boolean that needs to be returned for? It doesn't look docuemented in the guide's examples..?
e
whileSelect { ... }
is a shorthand for
while(select { ... }) {}
, so the value of the boolean result is self-explanatory.
d
You mean it doesn't exit the loop until it's true? And select by itself returns whatever result it gets from the first onXXX that gets called? I looked through the kdocs and the guide, and I don't think I saw something talking about this, unless I missed something?
d
Thanks! I was looking at the guide (finally noticed that there were changes from the last time I read it... I think I'll have to go through it again...), and the onXXX functions, I hadn't realized that
select
itself returns those results... When Roman showed that piece, it dawned on me, especially since whileSelect isn't mentioned in the api overview, you really have to look for that page.