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

(Request) Else-if chains #427

Closed
developedby opened this issue May 21, 2024 · 0 comments · Fixed by #511
Closed

(Request) Else-if chains #427

developedby opened this issue May 21, 2024 · 0 comments · Fixed by #511
Assignees
Labels
enhancement New feature or request syntax About Bend's syntax

Comments

@developedby
Copy link
Member

Long chains of if-else-if-else-if-else are annoying to right now as they will continuously increase
indentation.

I propose a python-like if-elif-else

if a:
  ...
elif b:
  ...
else:
  ...

Other options for keywords are elsif and else if

An alternative syntax would be like a switch

if:
  case a:
    ...
  case b:
    ...
  else:
    ...

Or using when like in bend.
I like the first one because it is already what people expect from a python-looking language.

@developedby developedby added enhancement New feature or request syntax About Bend's syntax labels May 21, 2024
@imaqtkatt imaqtkatt self-assigned this May 27, 2024
@imaqtkatt imaqtkatt linked a pull request May 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax About Bend's syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants