3 ms·
Maybe CL got this right with the condition/restart system? In addition to their utility for experimental programming, conditions work really well for handling e
by blacktriangle 6y ago
Maybe CL got this right with the condition/restart system? In addition to their utility for experimental programming, conditions work really well for handling errors programatically.
The general problem seems to be something weird happening far down in the system, for which the correct way forward is dependent on how we got there. This situation can't be handled where the issue happened since that would break encapsulation, but unrolling the stack all the way up blows away the context that is necessary to understand how to move forward. I don't see how a system that either unwinds the stacks (throwing errors) or tries to encapsulate the state through the system (Either) would truly solve the issue.
- enriquto 6y agocomputers don't do "weird" things. If you think this is the case it means that the interface you are using is incomplete or not well-specified.
- finder83 6y agoI agree, for the actual handling part, I think CL's error system is the best I've seen, and I'm surprised that more languages don't implement a similar system. It doesn't solve the issue of forcing programmers to handle errors..but then, CL doesn't care a lot about hand holding.
- masklinn 6y agoOne advantage of condition systems is that the caller gets to decide whether the condition is even an error. Though the restarts are still under the control of the callee.