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

Feature: Add support for multi-way conditional(s) #27

Open
aghast opened this issue Jun 3, 2022 · 1 comment
Open

Feature: Add support for multi-way conditional(s) #27

aghast opened this issue Jun 3, 2022 · 1 comment

Comments

@aghast
Copy link
Contributor

aghast commented Jun 3, 2022

Just fixed a syntax error by replacing this:

if k < 25 then 
    # ...
else if k < 40 and arg == 0 then 
    # ...
else
    # ...
end

With this:

if k < 25 then 
    # ...
else
    if k < 40 and arg == 0 then 
        # ...
    else
        # ...
    end
end

Yow! Bash definitely gets that right with elif. And also case.

I don't know if case or match or cond is better, but I fervently believe that elif needs to be added. Wow, is it painful to statically nest if/else blocks!

@gahag
Copy link
Collaborator

gahag commented Jun 3, 2022

I wholeheartedly agree. This is surely a high priority feature, and it has been discussed before in #12 . Although implementing it should be fairly easy, I'm struggling to find the time to do it recently.

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

No branches or pull requests

2 participants