From db88987c1360498f40b71a74f3614a74ca2a8588 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 1 Mar 2020 21:14:18 +0100 Subject: [PATCH] example: Show how to apply reaction systems. --- example/example.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/example/example.org b/example/example.org index 21af583..c7a3eee 100644 --- a/example/example.org +++ b/example/example.org @@ -498,6 +498,27 @@ tab | b | "x" | "q" | "z" | :END: + Here is how we can apply this reaction system to a state: + #+BEGIN_SRC racket :results output drawer :var input-rs=munch-table(rs1) +(let ([rs (unorg-rs input-rs)]) + (apply-rs rs (set 'x 't))) + #+END_SRC + + #+RESULTS: + :RESULTS: + (set 'z) + :END: + + Let's see which reactions got applied: + #+BEGIN_SRC racket :results list :var input-rs=munch-table(rs1) +(let ([rs (unorg-rs input-rs)]) + (list-enabled rs (set 'x 't))) + #+END_SRC + + #+RESULTS: + - a + - b + * Local Variables :noexport: # Local Variables: