Skip to content
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

Finish special operators #7

Merged
merged 4 commits into from
Oct 1, 2023
Merged

Finish special operators #7

merged 4 commits into from
Oct 1, 2023

Conversation

Bike
Copy link
Member

@Bike Bike commented Oct 1, 2023

Implements progv, catch, throw, and unwind-protect, and adds new ANSI tests for them. The first three were semi-implemented but not tested, and the last was not implemented at all. With these changes, the compiler handles all standard special operators.

Bike added 4 commits October 1, 2023 09:43
karlosz put it in early on but it had never been much tested, as
Clasp does not use it yet.
Like CATCH, the instruction has been there, but was not used.

Having UNBIND work on both PROGV and SPECIAL-BIND environments
might be mildly annoying for a shallow binding implementation
that might have to distinguish between two kinds of dynenvs.
But at least it should be implementable.
That's all the standard special operators.

An alternative design would be to inline the cleanup, and have the
PROTECT instruction refer to a label. The cleanup would then end
with a special resume instruction, that would either continue
unwinding, or jump back to whatever local exit caused the cleanup.
But that would be really complicated.

Originally I was going to call the cleanup instruction "deprotect"
as a chemistry joke, but I figure deprotect sounds like it's
merely removing protection, rather than actually doing things.
@Bike Bike merged commit f16b433 into main Oct 1, 2023
2 checks passed
@Bike Bike deleted the finish-special-operators branch October 1, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant