`map {}` can't be short-circuited like a forloop c...
# announcements
b
map {}
can't be short-circuited like a forloop can right?
s
might I ask what you’re trying to accomplish?
b
something like
val responses = (0 until N).map { try { getResponse() } catch(e: ...) { e; stop getting responses } }
. So I end up with either a list of
N
responses or a shorter list of responses that ends with a throwable object
s
that kind of seems like you’re misusing
map
tbh
like you’re not applying a transform to a collection of elements, you’re collecting side effects until a certain condition has been met
b
I'm "transforming" a list of integers into corresponding "response" objects...
i'm just trying to inject error handling into it