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

support if / elsif / else in block options #40

Closed
truj opened this issue Oct 6, 2019 · 1 comment
Closed

support if / elsif / else in block options #40

truj opened this issue Oct 6, 2019 · 1 comment
Labels
enhancement midicapl For changes in the MidicaPL language

Comments

@truj
Copy link
Owner

truj commented Oct 6, 2019

Support new options:

  • if <condition>
  • elsif <condition>
  • else

All these options should work as a block option for nestable blocks.
For convenience reasons, if should also work as a call option or a channel command option. But for elsif and else that does not make sense.

The condition part should support one boolean expression with 2 values and one operator between them. The following operators should be supported:

  • equals (e.g. ==)
  • not equals (e.g. !=)

Maybe the following operators could be supported as well:

  • lower (e.g. <)
  • lower or equal (e.g. <=)
  • higher (e.g. >)
  • higher or equal (e.g. >=)
  • defined (e.g. no operator and only one value)

More complicated boolean expressions could be implemented in the future but for now they are not yet needed. E.g. something like $a==$b||$c<5||$d

@truj truj added enhancement midicapl For changes in the MidicaPL language labels Oct 6, 2019
@truj
Copy link
Owner Author

truj commented Oct 22, 2019

if as a channel command option will not be implemented. Only for blocks and calls.
defined will be implemented as if $x.
undefined will be implemented as if !$x.
Another condition type is in. Example: if $x in 1; 2; 3; 8

@truj truj closed this as completed in 95b0ab6 Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement midicapl For changes in the MidicaPL language
Projects
None yet
Development

No branches or pull requests

1 participant