Re:Go: Redefining For Loop Variable Semantics
by jrumbut on Tuesday October 11, 2022 @10:50AM
(#33164013)
I feel that the original Python example is suffering from a little too much lambda.
It seems like we're iterating through something to build up a computation we may execute later. I can conceive of a situation where you might want to do that, or at least consider it, but in general I say just do the work now and build a list of results.
Re:Go: Redefining For Loop Variable Semantics
by BoppreH on Tuesday October 11, 2022 @11:36AM
(#33164646)
It looks like that because it's a minimal example. Real cases usually involve callbacks or expensive computations. How often it happens depends a lot on what you're doing.
It seems like we're iterating through something to build up a computation we may execute later. I can conceive of a situation where you might want to do that, or at least consider it, but in general I say just do the work now and build a list of results.