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

Implement catch expression #80

Open
katsaii opened this issue Aug 18, 2023 · 0 comments
Open

Implement catch expression #80

katsaii opened this issue Aug 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request low priority Not important syntax Related to the syntax of the language

Comments

@katsaii
Copy link
Owner

katsaii commented Aug 18, 2023

What is your feature request?

Implement new catch keyword for exception handling.

Please describe in detail how you expect this new feature to behave.

There will be no try keyword, just catch:

let result = potentiallyFailingExpression() catch {
  defaultResultIfAnExceptionOccurs();
};

GML-like try/catch blocks can be written in Catspeak like:

do {
  potentiallyFailingExpression();
} catch ex {
  show_message("failed! {0}", ex);
}
@katsaii katsaii added the enhancement New feature or request label Aug 18, 2023
@katsaii katsaii self-assigned this Aug 18, 2023
@katsaii katsaii added the low priority Not important label Aug 19, 2023
@katsaii katsaii added the syntax Related to the syntax of the language label Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority Not important syntax Related to the syntax of the language
Projects
None yet
Development

No branches or pull requests

1 participant