Re:Structured Concurrency Definition
by jerf on Monday February 06, 2023 @09:14AM
(#34677516)
That's actually the point of the koan, in many ways. It is not true that an object is a closure and a closure is an object, in the sense that they are exactly the same in every way. Clearly they aren't, or we couldn't even have separate terms for them.
The point is more that there is not a set of "closure problems" and a set of "object problems" that can only be solved with the relevant technologies. You can always put together a solution to a problem with the other technology. It may have different cost/benefit tradeoffs. It may have different affordances. I would certainly advise against walking into an object system and trying to force it to solve every problem by objects functioning as closures, and I would advise against walking into a closure system and trying to force it to solve every problem by forcing closures to work like objects. One should work with the grain of the wood you are working in rather than insisting on treating the wood like the pottery you are more familiar with.
But it is always helpful to remember that within every object system is a closure system if you really need it, and within every closure system is an object system if you really need it. The resolution to "how can each be a subset of the other without them being equal to each other" is that there is some equivocation here. The object system that closures can implement conveniently is less rich than a dedicated object system, and vice versa. But if you just need to momentarily borrow the alternate concept, you probably don't need all the frippery you need if it is your primary tool for interacting with the world, so it works out.
The point is more that there is not a set of "closure problems" and a set of "object problems" that can only be solved with the relevant technologies. You can always put together a solution to a problem with the other technology. It may have different cost/benefit tradeoffs. It may have different affordances. I would certainly advise against walking into an object system and trying to force it to solve every problem by objects functioning as closures, and I would advise against walking into a closure system and trying to force it to solve every problem by forcing closures to work like objects. One should work with the grain of the wood you are working in rather than insisting on treating the wood like the pottery you are more familiar with.
But it is always helpful to remember that within every object system is a closure system if you really need it, and within every closure system is an object system if you really need it. The resolution to "how can each be a subset of the other without them being equal to each other" is that there is some equivocation here. The object system that closures can implement conveniently is less rich than a dedicated object system, and vice versa. But if you just need to momentarily borrow the alternate concept, you probably don't need all the frippery you need if it is your primary tool for interacting with the world, so it works out.