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

Add switch statement #9

Closed
IAmCheeseman opened this issue Dec 31, 2021 · 1 comment
Closed

Add switch statement #9

IAmCheeseman opened this issue Dec 31, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@IAmCheeseman
Copy link
Contributor

IAmCheeseman commented Dec 31, 2021

with either of these syntaxes:

switch h {
    case "h" {
        println(h)
    }
    default {}
}

or

switch h {
    case "h":
        println(h)
    default:
        code()
}
@Dot32Dev
Copy link

Dot32Dev commented Jan 1, 2022

I like them the first syntax for the switch statement, but perhaps the : syntax could be for single liners
Given that we can do let variable = if {} it also would make sense to have let variable = switch {}

@BergerAPI BergerAPI added the enhancement New feature or request label Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants