Conversation
pschachte
left a comment
There was a problem hiding this comment.
I don't think terminal is the right determinism for this. Terminal means that it will neither succeed nor fail. I think you'll need a new determinism that means something like "it has already succeeded so thoroughly that even if this is conjoined with other constraints, it automatically satisfies them". But then you'll need to work out how this determinism conjoins, disjoins, and otherwise combines with, all the other determinisms. This becomes tricky because none of the other determinisms is sensitive to procedure boundaries, and this one will need to be (procs shouldn't be declared to have this new determinism; and a proc all of whose branches have this determinism still has determinism det).
You can probably predict my next review comment: WYBE.md needs to be revised to explain return, and to clearly explain how it interacts with everything else, including loops, but also what if a return appears in one of the conditions in an if. There are probably other interactions I haven't thought of. It would be good to have a motivating example for this feature.
I couldn't see how you're handling variable binding in case of a return. It must be the case that all outputs of a proc are already bound when you reach a return, otherwise it must be reported as an error.
This is a work-in-progress attempt at adding a
returnstatement. In essence, it is the det dual offail, causing a call to exit, but the call succeeds.Some things are left to consider/get working correctly:
terminal, but I suspect this isn't correct. I want to say that nothing more can happen, but we haven't failed andterminalseemed the best fit here, but it isn't quite right, because there is more to go after the calluseblock ifreturnis encountered