2 ms·
"A closure is just a method where the instance members are implicit. A method is just a closure where the closed over state is explicit." I agree with you abou
by moron4hire 3y ago
"A closure is just a method where the instance members are implicit. A method is just a closure where the closed over state is explicit."
I agree with you about service classes. I think one of the things that service classes do well that regular functional code does not is indicate to the consuming developer which parameters are meant to be provided by the environment and are largely static, and which are meant to vary per invocation.
Lisp does this instead with dynamic scope. But dynamically scoped dependencies felt too much like global variables to me. The service class instance has its scope bound to it and it won't change. But dynamically scoped functions always felt like the ground could get ripped out from under me at any time.