truj / midica

A Music programming language. Translates source code into MIDI. Includes a player. Supports MIDI-Karaoke. Includes a MIDI analyzer.
https://www.midica.org/
Mozilla Public License 2.0
111 stars 13 forks source link

support if / elsif / else in block options #40

Closed truj closed 4 years ago

truj commented 4 years ago

Support new options:

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:

Maybe the following operators could be supported as well:

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 commented 4 years ago

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