pre_increment function
Add 1 to a variable in place and return the new value.
How to write it
pre_increment(name)
- name
- The variable to update. Takes a variable.
Examples
a := 1; pre_increment(a)In the solver,
Open in the solvera := 1; pre_increment(a)gives2.
Related functions
- pre_decrement
Subtract 1 from a variable in place and return the new value.
- increment
Add 1 to a variable in place and return its old value.
- release_hold
Evaluate an expression that was held.
- set
Assign a value to a name; also written name := value.
- piecewise
Cases written value if condition, with an optional otherwise case.
- set_delayed
Define a function; also written f(x) := body.