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

Standardize on Python match/case-style blocks #681

Closed
evhub opened this issue Nov 8, 2022 · 1 comment
Closed

Standardize on Python match/case-style blocks #681

evhub opened this issue Nov 8, 2022 · 1 comment

Comments

@evhub
Copy link
Owner

evhub commented Nov 8, 2022

Should deprecate case/cases blocks with match statements inside of them in favor the Python-style match block with case statements inside of it. However, since this is inconsistent with the stand-alone match <pat> in <it> statement that puts the pattern after the match keyword, we'll also want to add a new stand-alone match statement that puts the item to be matched against after the match keyword like the Python syntax. For that, the proposed syntax is:

match <item> with <pattern>:
    ...
@evhub evhub added this to the v2.1.1 milestone Nov 8, 2022
evhub added a commit that referenced this issue Nov 12, 2022
@evhub
Copy link
Owner Author

evhub commented Nov 12, 2022

case/match syntax is now deprecated in favor of match/case or cases/match syntax. Unsure whether match ... with syntax makes sense to add or not; seems like supporting it alongside match ... in syntax could be quite confusing.

@evhub evhub closed this as completed Nov 12, 2022
@evhub evhub mentioned this issue Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant