Liking cljdoc? Tell your friends :D

fsm-clj.core


defsmcljmacro

(defsm name transitions)

Define a State Machine. e.g. (defsm foo [[:state1 -> :state2 when :event1] [:state2 -> state1 when :event2]]) foo will be a function that when called start the fsm. By default, the start state will be the state of the first transition.

You can start it in 3 different ways: Simplest form: (foo) With accumulator: (foo 0) Starting in a different state: (foo 0 :state2)

Define a State Machine.
e.g.
(defsm foo
  [[:state1 -> :state2 when :event1]
   [:state2 -> state1 when :event2]])
foo will be a function that when called start the fsm.
By default, the start state will be the state of the first transition.

You can start it in 3 different ways:
Simplest form:
(foo)
With accumulator:
(foo 0)
Starting in a different state:
(foo 0 :state2)
sourceraw docstring

send-eventclj

(send-event fsm event)
(send-event fsm event message)
source

show!clj

(show! fsm)

Graphically generate the State Machine (open a Swing viewer).

Graphically generate the State Machine (open a Swing viewer).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close