elixush v0.0.3 Elixush.PushState
Summary
Functions
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
Returns an empty push 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
Returns a copy of the state with the value pushed on the named stack. This is a utility, not for use in Push programs
Takes a map of stack names and entire stack states, and returns a new push-state with those stacks set
Add the provided name to the global list of registered instructions
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
Returns a list of all registered instructions with the given type name as a prefix
Returns a list of all registered instructions aside from random instructions
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
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
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
Functions
Specs
end_environment(map) :: map
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.
Specs
pop_item(atom, map) :: map
Returns a copy of the state with the specified stack popped. This is a utility, not for use as an instruction in Push programs.
Returns a copy of the state with the value pushed on the named stack. This is a utility, not for use in Push programs.
Specs
push_state_from_stacks(map) :: map
Takes a map of stack names and entire stack states, and returns a new push-state with those stacks set.
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.
Specs
registered_for_type(atom, map) :: Enum.t
Returns a list of all registered instructions with the given type name as a prefix.
Specs
registered_nonrandom :: Enum.t
Returns a list of all registered instructions aside from random instructions.
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.
Specs
stack_ref(atom, integer, map) :: any
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.