3 ms·
Call-by-name is just syntactic sugar for anonymous functions. It has all the same problems. But more importantly, the whole premise is wrong. "Cache invalidati
by raquo 9y ago
Call-by-name is just syntactic sugar for anonymous functions. It has all the same problems.
But more importantly, the whole premise is wrong. "Cache invalidation" for data that has an average lifespan of 30 lines of code in a single function is not a hard problem. Real cache invalidation is hard for reasons that don't translate to the case of ephemeral constants with properly limited scope.
- forkerenok 9y ago> Call-by-name is just syntactic sugar for anonymous functions. No, it's not. It defines different evaluation semantics.
- raquo 9y agoWhich are exactly equivalent to a function call, just with a different type, and a syntax without parens. "this will be re-evaluated every time you access it"
- forkerenok 9y agoI see what you meant now. Though it seems you are mixing notions of anonymous function and function as an argument of higher order functions (it doesn't have to be anonymous).