Scripting reference · Nerdamer Language
evaluate
Evaluates a parser value immediately, optionally with substitutions.
evaluate(value) invokes the value's existing evaluation behavior from Nerdamer Scripting.
The two-argument form accepts a Dictionary of substitutions. The three-argument form accepts a variable Vector and a same-length point Vector, which is useful for repeated numerical evaluation without rebuilding substitution dictionaries.
Examples
These examples use Nerdamer Scripting.
Evaluate a numerical expression immediately.
evaluate(sin(2)) // → 0.9092974268256816954
Evaluate a structured value with Dictionary substitutions.
evaluate([x+y,x*y],{x=>2,y=>3})
// → [5, 6]Evaluate from parallel variable and point Vectors.
evaluate([u+v,u*v],[u,v],[2,3]) // → [5, 6]
Interfaces
The same operation is available through the interfaces below.
Nerdamer Scripting
Use this form in Nerdamer Scripting input passed to nerdamer(...).
evaluate(value[, substitutions]) | evaluate(value, variables, point)
Parameters
value— Expression, equation, or structured parser value to evaluate.substitutions— Optional Dictionary mapping variable names to substitution values.variables— Variable Vector used with point in the three-argument form.point— Value Vector corresponding positionally to variables.
Notes
- If evaluation cannot complete, evaluate returns the resolved input unchanged rather than creating a symbolic evaluate(...) node.
