| Did you know ... | Search Documentation: |
| Pack with_state -- prolog/with_state.pl |
This module implements predicates and macros for easily threading
records (as in, library(record)) as state.
NB: run_state is subject to goal expansion.
go(State) :-
default_my_state(State0),
run_state(State0, State,
(
put(my_state, a, 2),
get(my_state, a, A)
)
Example:
gets(my_state, [my_field(Value1), my_term(Value2)]
Example:
puts(my_state, [my_int(1), my_term(a)]
Example:
get(my_state, my_int, Int)
Example:
put(my_state, my_int, 1)
The following predicates are exported, but not or incorrectly documented.