clojush.pushstate

->PushState

(->PushState exec code integer float boolean char string zip vector_integer vector_float vector_boolean vector_string input output auxiliary tag return environment genome)

Positional factory function for class clojush.pushstate.PushState.

define-push-state-record-type

macro

(define-push-state-record-type)

define-registered

macro

(define-registered instruction definition)

end-environment

(end-environment state)

Ends the current environment by popping the :environment stack and replacing all stacks with those on the environment stack. Then, everything on the old :return stack is pushed onto the :exec stack.

instruction-table

keyword->symbol

(keyword->symbol kwd)

make-push-state

(make-push-state)

Returns an empty push state.

map->PushState

(map->PushState m__6522__auto__)

Factory function for class clojush.pushstate.PushState, taking a map of keywords to field values.

pop-item

(pop-item type state)

Returns a copy of the state with the specified stack popped. This is a utility, not for use as an instruction in Push programs.

push-item

(push-item value type state)

Returns a copy of the state with the value pushed on the named stack. This is a utility, not for use in Push programs.

push-state-from-stacks

(push-state-from-stacks & {:as stack-assignments})

Takes a map of stack names and entire stack states, and returns a new push-state with those stacks set.

register-instruction

(register-instruction name)

Add the provided name to the global list of registered instructions.

registered-for-stacks

(registered-for-stacks types-list)

Takes a list of stacks and returns all instructions that have all of their stack requirements fulfilled. This won’t include random instructions unless :random is in the types list. This won’t include parenthesis-altering instructions unless :parentheses is in the types list.

registered-for-type

(registered-for-type type & {:keys [include-randoms], :or {include-randoms true}})

Returns a list of all registered instructions with the given type name as a prefix.

registered-instructions

registered-nonrandom

(registered-nonrandom)

Returns a list of all registered instructions aside from random instructions.

stack-assoc

(stack-assoc value type position state)

Puts value at position on type stack in state. This is a utility, not for use as an instruction in Push programs. NOT SAFE for invalid positions.

stack-ref

(stack-ref type position state)

Returns the indicated item of the type stack in state. Returns :no-stack-item if called on an empty stack. This is a utility, not for use as an instruction in Push programs. NOT SAFE for invalid positions.

state-pretty-print

(state-pretty-print state)

top-item

(top-item type state)

Returns the top item of the type stack in state. Returns :no-stack-item if called on an empty stack. This is a utility, not for use as an instruction in Push programs.