times_by function
Multiply a variable by a value in place and return the new value.
How to write it
times_by(name, x)
- name
- The variable to update. Takes a variable.
- x
- The factor. Takes an expression.
Examples
a := 3; times_by(a, 2); aIn the solver,
Open in the solvera := 3; times_by(a, 2); agives6.
Related functions
- with_effort
Evaluate a body at quick, standard, deep or exhaustive effort.
- subtract_from
Subtract a value from a variable in place and return the new value.
- add_to
Add a value to a variable in place and return the new value.
- subs_repeated
Apply substitution rules again and again until nothing changes.
- construct
Apply a head that is itself computed to arguments, as in f'(0) or (x => body)(a).
- slot
The n-th argument of a function with no name: inside function(body), slot(1) is the first.