(add-block)
Adds a new block, returns its id, but does not change the current block (does not call set-block).
Adds a new block, returns its id, but does not change the current block (does not call set-block).
(add-instruction inst)
Appends an instruction to the current block.
Appends an instruction to the current block.
(all itms)
Assumes that itms is a list of state monad function results, threads the state map through all of them. Returns a vector of all the results.
Assumes that itms is a list of state monad function results, threads the state map through all of them. Returns a vector of all the results.
(assoc-in-plan path val)
Same as assoc-in, but for state hash map
Same as assoc-in, but for state hash map
(gen-plan binds id-expr)
Allows a user to define a state monad binding plan.
(gen-plan [_ (assoc-in-plan [:foo :bar] 42) val (get-in-plan [:foo :bar])] val)
Allows a user to define a state monad binding plan. (gen-plan [_ (assoc-in-plan [:foo :bar] 42) val (get-in-plan [:foo :bar])] val)
(get-binding key)
Gets the value of the current binding for key
Gets the value of the current binding for key
(get-in-plan path)
Same as get-in, but for a state hash map
Same as get-in, but for a state hash map
(get-plan f)
Returns the final [id state] from a plan.
Returns the final [id state] from a plan.
(emit-instruction this state-sym)
Returns the clojure code that this instruction represents
Returns the clojure code that this instruction represents
(block-references this)
Returns all the blocks this instruction references
Returns all the blocks this instruction references
(reads-from this)
Returns a list of instructions this instruction reads from
Returns a list of instructions this instruction reads from
(writes-to this)
Returns a list of instructions this instruction writes to
Returns a list of instructions this instruction writes to
(terminate-block this state-sym custom-terminators)
Emites the code to terminate a given block
Emites the code to terminate a given block
(terminator-code this)
Returns a unique symbol for this instruction
Returns a unique symbol for this instruction
(no-op)
This function can be used inside a gen-plan when no operation is to be performed
This function can be used inside a gen-plan when no operation is to be performed
(parse-to-state-machine body env terminators)
Takes an sexpr and returns a hashmap that describes the execution flow of the sexpr as a series of SSA style blocks.
Takes an sexpr and returns a hashmap that describes the execution flow of the sexpr as a series of SSA style blocks.
(persistent-value? index value)
Returns true if this value should be saved in the state hash map
Returns true if this value should be saved in the state hash map
(pop-binding key)
Removes the most recent binding for key
Removes the most recent binding for key
(push-alter-binding key f & args)
Pushes the result of (apply f old-value args) as current value of binding key
Pushes the result of (apply f old-value args) as current value of binding key
(push-binding key value)
Sets the binding 'key' to value. This operation can be undone via pop-bindings. Bindings are stored in the state hashmap.
Sets the binding 'key' to value. This operation can be undone via pop-bindings. Bindings are stored in the state hashmap.
(set-block block-id)
Sets the current block being written to by the functions. The next add-instruction call will append to this block
Sets the current block being written to by the functions. The next add-instruction call will append to this block
(update-in-plan path f & args)
Same as update-in, but for a state hash map
Same as update-in, but for a state hash map
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close