c3d / db48x

RPL runtime for the DM42 calculator, in the spirit of HP48/49/50
http://48calc.org
GNU Lesser General Public License v3.0
86 stars 11 forks source link

Replace tagged values for results with assignments #1266

Open c3d opened 4 hours ago

c3d commented 4 hours ago

Currently, the solver returns something like A:0.5, but @Wiljea suggested that we could return A=0.5 instead. @Wiljea was thinking of returning equations, but we could use the newly created assignment object for that purpose.

c3d commented 4 hours ago

Probably necessary to also implicitly convert assignments to equations in expression::get.

c3d commented 4 hours ago

The primary practical benefit of returning an assignment is that it makes it possible to restore the value quickly using the interactive stack.

c3d commented 4 hours ago

In that context, it makes sense that the SolvingMenu keys also return assignments.

Wiljea commented 3 hours ago

For the purposes of some demo or of possible interactive solutions in the Library Equation, will it be a good idea to allow these assignments to be encompassed in a list {a=5_m/s^2;vo=5_m/s;...} (or in a vector, if applicable) ? If so, the only practical problem is to access the "=" character while writing a list (or a vector) in the actual key layout of the calculator. That's why I am suggesting that the contextual menu (via the ۞ key) associated to lists (or vectors) might include characters such as "=" (or ";", "◄") to allow a more direct access.