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

Allow x, y: int syntax for declaring local variables #540

Merged
merged 14 commits into from
Dec 31, 2024
Merged

Conversation

Akuli
Copy link
Owner

@Akuli Akuli commented Dec 30, 2024

Limitations:

  • Initial value cannot be set: x, y: int = 0 is an error. This is by design, because x, y = foo looks like Python's unpacking. (Jou doesn't have unpacking.)
  • Only works for local variables, not for e.g. globals, class fields (could be useful), function parameters.

Fixes #536

@Akuli Akuli changed the title Allow x, y: int syntax with local variables Allow x, y: int syntax for declaring local variables Dec 30, 2024
@Akuli Akuli merged commit e638fcd into main Dec 31, 2024
23 checks passed
@Akuli Akuli deleted the local-multi-declare branch December 31, 2024 14:26
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.

Declare many variables which have the same type just in one line?
1 participant