Babbage, exprtk

Ok, I’m just canvasing information/feedback. I’m not sure if @rabauke is going to want to support merging Add: This commit creates a github actions file which will execute build by poetaster · Pull Request #8 · rabauke/harbour-babbage · GitHub since I’m introducing a lot of things, but, I’m really enjoying have a Programmable calculator.

Get’s you:
Define vars:

"x:=0; y:=1; var t[2]:={0,1}; z:=12;"

Evaluate expressions of the type:

 "while((x+=1)<z){y:=sum(t);t[0]:=t[1];t[1]:=y}"

Evaluating an expression to get nth term of the Fibonacci series.

The documentation supports copy and paste for operators or examples (menu items).

I’m working on adding multi-line input and a display of individual results from operations of iterative operations. The ability to add function templates is very, very convenient in exprtk/readme.txt at master · ArashPartow/exprtk · GitHub so I expect to add a lot of conventional calculations.

Currently, vars x,y and z are initialized (to save typing).

If you have the time, inclination please send me feedback, either here or the issue queue on github:

Still wip, but, yesterday I implemented a couple of built-ins, a shift register (aka, 2 element array) and an accumulator, to make setting up variables easier: x,y,z are inited to 0, r[2] I use as a shift register and a[22] I use as an accumulator. expressions like:

while((x+=1)<20){y:=sum(r);r[0]:=r[1];r[1]:=y;a[x]:=y} return[a];"

don’t require any variable setup to execute. use a[] to accumulate during the calculation and that ‘return’ form is handy if you want to collect the steps. the r[] is a classic shift register idea.

while((x+=1)<20){y:=sum(r);r[0]:=r[1];r[1]:=y;}

Just get’s you the last step. I’m working on a keyboard for easier entry. I think I’ll build a larger match app around this, but wanted to offer it in the babbage context first.

EDIT, of course, both register and accum. will need to be setup,depending on what you’re calculating :slight_smile: