-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null continuation doesn't escape from calling context. #1212
Comments
Note: I have temporarily kludged around the problem in the cases library by adding a no-op command after the catch. |
Good catch, will fix. Thanks! |
I'm confused. I know that there is an issue if you try to catch the very end of a script unless you specifically tag it. But I can't reproduce the behavior you describe. Here's your test case: http://snap.berkeley.edu/snapsource/snap.html#cloud:Username=jens&ProjectName=ctest it says 'b' and then stops. Doesn't it for you? |
That's because you missed my comment above saying I edited the CASES library to add a no-op (the HIDE VARIABLE block) at the end. Edit the CASES block, remove that no-op, and then try. |
Du-oh. Thanks! |
Okay, can you please test my fix for null continuations in the dev version: |
Yay! It works. It didn't break the thread demo either. :-)
|
Thanks for the quick test. The fix is really simple: A null continuation terminates the thread, same as |
Seems sad that you had to special case it. An empty stack should really be just like any stack. (And while you're at it, I want world peace.) |
I already did special case null continuations, but only as noops, which was clearly wrong, all I did now was to change it from "doYield" to "doStop". In a perfect Scheme world, of course, scripts would be represented as lists, so I could just "set" it to the end of that list. In a perfect blocks language the blocks themselves are the ... actually I don't know anything about perfect languages. But Yay for world peace! |
Yay 🎉 |
From Jonathan50 via forum:
Continuations (and so catch/throw, and so the multibranched conditionals library) don't “escape” when there is nothing to do (the continuation is empty).
So if I have a cases block with nothing after it then all the cases are tested…
Confirming: This script
should just say "b" but actually says b-c-d unless another command follows the CASES block.
The text was updated successfully, but these errors were encountered: