example: Illustrate building interactive processes.

This commit is contained in:
Sergiu Ivanov 2020-03-03 01:01:21 +01:00
parent 0d73b33ff3
commit cbdfdabe7a

View file

@ -579,6 +579,34 @@ tab
each state to avoid confusion between the states at different steps each state to avoid confusion between the states at different steps
of the evolution. of the evolution.
The graphical presentation for interactive processes is arguably
less readable than just listing the contexts and the results
explicitly. Here is how you can do it.
#+NAME: rs1-ip
#+HEADER: :var input-rs=munch-sexp(rs1) :var input-ctx=munch-sexp(ctx1)
#+BEGIN_SRC racket :results table drawer
(build-interactive-process (unorg-rs input-rs) (read-ctx input-ctx))
#+END_SRC
#+RESULTS: rs1-ip
:RESULTS:
| (y x) | nil |
| (z) | (z) |
| nil | nil |
| (t) | nil |
| nil | nil |
:END:
The first column of this table shows the current context. The
second column shows the result of application of the reactions to
the previous state. The interactive process contains one more step
with respect to the context sequence. This is to show the effect
of the last context.
Note that empty sets are printed as =nil=.
* Local Variables :noexport: * Local Variables :noexport:
# Local Variables: # Local Variables:
# eval: (auto-fill-mode) # eval: (auto-fill-mode)