Merged
Conversation
Allow re-using the same symbol for the fiber and error. This allows you to write code like (try (print "hi") ([_ _] (print "oh no"))), fixing a regression introduced in janet-lang#1605.
ianthehenry
added a commit
to ianthehenry/bauble
that referenced
this pull request
Oct 25, 2025
This code should work regardless of the Janet version used, and we can back it out after janet-lang/janet#1659 lands upstream.
Contributor
|
Thanks for the report and the fix (and sorry we broke things!). Would you mind adding a test to help prevent regressions? |
361213f to
a2c368f
Compare
Contributor
|
Thanks for the tests! |
a2c368f to
0c34033
Compare
Contributor
|
FWIW, using 0c34033 I ran tests for most of my projects as well as |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following code worked before Janet 1.39.0, but now errors:
#1605 introduced a nicer way to ignore the "arguments" in the catch clause, but in doing so broke this pattern.
I realize that's equivalent to
(try (print "something") ([_] (print "oh no"))), which still works, but I was used to writing the above to make it less likely that I would forget about the fiber argument if I changed code to something that wanted to re-raise. So upgrading to Janet 1.39.0 broke some code in the wild.