-
-
Notifications
You must be signed in to change notification settings - Fork 9
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 request: switch expression #343
Comments
Yes I've also been wanting this. There will be something similar supported in Adept 3.0 (this feature is already in progress for it) In the meantime however, if your values are predicable, a function or table could work
---or---
|
Cool! I like the "array get" workaround, but obviously the As for the switch expression, it will be available in Adept 3, but will you backport it to Adept 2? |
Adept 2 isn't designed to handle the semantics of it, so it's unlikely to be backported in the near term. Adept 3 still has a lot of work going into it, and will probably take a year or two before it'll be ready enough to start being used. (There are a lot of major improvements and so takes awhile) Adept 2 will still always be maintained including after its release, and will most likely receive additional improvements in the form of backported features and/or potentially support in the new compiler. |
For example, if I could write this code:
Into this:
It would make the code shorter to type as
rateText
is only typed once. Its also much nicer to look at.Currently, typing this switch expression makes the compiler error "unexpected switch token in expression".
The text was updated successfully, but these errors were encountered: