I mean, you can do that in Swift too. You can also use closures in Go in exactly the same way, which is what I tend to do for very small functions that don't need a name.
Functions and closures-that-don't-reference-their-environment are exactly equivalent in both languages, from a quick look? It's your choice as a developer which to use.
This particular pattern in the case of Lambda is specifically for providing a closure which is called later and repeatedly - it's not waiting for a request and then calling the closure once and then returning.
Functions and closures-that-don't-reference-their-environment are exactly equivalent in both languages, from a quick look? It's your choice as a developer which to use.
This particular pattern in the case of Lambda is specifically for providing a closure which is called later and repeatedly - it's not waiting for a request and then calling the closure once and then returning.