-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
dsl 🗒️Issues regarding the domain specific programming languageIssues regarding the domain specific programming language
Description
In order to work enumerations, numbers and union types we could add an exhaustive switch expression with some predefined conditions:
Usage with an enum:
enum SomeEnum {
A,
B,
}
// ...
switch {
enumInstance is A -> { /* ... */ }
enumInstance is B -> { /* ... */ }
}
Usage with a numbers:
switch {
integer < 0 -> { /* ... */ }
integer == 0 -> { /* ... */ }
else -> { /* ... */ }
}
Usage with object:
switch {
obj is Type1 -> { /* ... */ }
obj is Type2 -> { /* ... */ }
else -> { /* ... */ } // might not always be necessary if we can prove exhaustiveness
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dsl 🗒️Issues regarding the domain specific programming languageIssues regarding the domain specific programming language
Type
Projects
Status
Backlog