decrement function
Subtract 1 from a variable in place and return its old value.
How to write it
decrement(name)
- name
- The variable to update. Takes a variable.
Examples
a := 1; decrement(a); aIn the solver,
Open in the solvera := 1; decrement(a); agives0.
Related functions
- pre_decrement
Subtract 1 from a variable in place and return the new value.
- divide_by
Divide a variable by a value in place and return the new value.
- construct
Apply a head that is itself computed to arguments, as in f'(0) or (x => body)(a).
- evaluate
Evaluate an expression even where it would be held.
- add_to
Add a value to a variable in place and return the new value.
- function
A function with no name; also written x => body.