This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/cas/parse

Reading an expression written as Viv text into the CAS

cas(text) reads an expression in Viv's own syntax into the store (lib/cas/store): numbers, names, + - * / ^, parentheses and calls of the heads the CAS knows. The precedence is Viv's: ^ binds tightest and to the right, so -x^2 is and 2^3^2 is ; then unary minus; then * and /; then + and -.

A decimal is read exactly: 0.1 is , not the double nearest it, and 2.5e-3 is . A number with more digits than holds is refused. sqrt(u) is , pow(a, b) is , ln is log, and the name pi is the constant . A call of a function the CAS does not know is a refusal that names it.

Used with import cas.parse.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 19–296