Right had my morning coffee.
MSPB, thatās super useful. Itās one of those calculations thatās a pain to do in your head. It would also be really useful with DEL and TR.TIME.
Itāll also be a really good OP to start with, as itās a pure function. Iād add it to ops/maths.c. There are instructions on adding a new OP in the readme, let me know if you run into any problems, and I can use that info to improve the docs. Donāt forget to run the tests as there as some that check to see if all the values have been filled in properly.
If you can also add some docs for MSPB that would also be amazing, but if itās too much to take in all at once thatās okay too. (Especially if you want to generate the PDFs, as youāll need Latex/TexLive.)
(What Linux are you on?)
Remember there are symbolic options:
IF ! A: ...
IF > A 0: ...
Iām not so sure about these, I donāt think I would use them. Especially if the variable is hard coded. Iād be more keen on something that took a variable as input. Maybe we should also use a symbol? So:
?0 X: # if X is zero
?>0 X: # if X is greater than 0
?== X Y: # if X == Y
etc, etc
(Iām not sure I even like that)
Anyway, Iāll let others chip in, if they think theyāll find them useful.
As a slight aside, Iām in the process of adding a ternary OP (TER, with alias ?), along with some inline array and scale generation OPs:
See here for a description of the ternary OP:
+1 on STOP. Iād consider using a different name though, as STOP maybe be useful in other contexts (e.g. with PLAY). How about BREAK with HCF as an alias for the nerds amongst us (i.e. me).
I would add an extra field to exec_state_t:
typedef struct {
bool if_else_condition;
uint8_t exec_depth;
bool is_exiting; // or whatever you feel is best
} exec_state_t;
Then you need to figure out the best place to bail out. Possibly youāll need to do the check in multiple places.
This OP feels like it needs a few tests added too. E.g. how it interacts with MODs and sub commands. And to also make sure that any future additions continue to play nicely with it.