Closures
Five lessons on the object behind { }: the implicit it and typed parameters, the delegate a builder uses, partial application and composition, the cache and the trampoline, and the way a closure travels as an argument and comes back from a method.
026
Closures, it and parameters
the braces, the implicit it, typed parameters and the value a closure returns
Open
027
delegate and owner
the three objects a closure sees, and the resolve strategy that picks one
Open
028
Currying and composition
partial application, the composed closure and the argument order
Open
029
Memoize and trampoline
caching a closure result, and recursion that does not grow the stack
Open
030
Closures as arguments
the last-argument rule, Closure versus a lambda, and a method that returns a closure
Open