Skip to content

Stack Machine

Jayson Harshbarger edited this page Apr 11, 2016 · 7 revisions

get-log-level

gets the current logging level ( ... -> ... {number} )

set-log-level

sets the current logging level ( ... {number} -> ... )

q<

moves the top of the stack to the tail of the queue ( ... {any} -> ... )

q>

moves the tail of the queue to the top of the stack ( ... -> ... {any} )

stack

replaces the stack with a quote containing the current stack ( ... -> [ ... ] )

d++

increments the depth counter

d--

decrements the depth counter

quote

pushes a quotation maker onto the stack ( ... -> ... #( )

dequote

collects stack items upto the last quote marker ( #( ... -> [ ... ] )

depth

pushes the size of the current stack ( ... -> ... {number} )

<- (stack)

replaces the stack with the item found at the top of the stack ( ... [A] -> A )

-> (queue)

replaces the queue with the item found at the top of the stack ( ... [A] -> ... )

undo

restores the stack to state before previous eval

auto-undo

define

defines a set of words ( ... { object} -> ... )

sto

stores a quote in the dictionary ( ... [A] {string} -> ... )

def

defines a word ( ... [A] {string} -> ... )

memoize

memoize a defined word ( ... {string} -> ... )

delete

deletes a defined word ( ... {string} -> ... )

rcl

recalls the definion of a word ( ... {string} -> ... [A] )

expand

expand the definion of a word ( ... {string} -> ... )

see

recalls the definition of a word as a string ( ... {string} -> ... {string} )

words

returns a list of defined words ( ... -> ... {array} )

clr

clears the stack ( ... -> )

\\

push the top of the queue to the stack ( ... -> ... {any} )

set-module

get-module

unset-module

fork

evalues the quote in a child environment ( [A] -> [a] )

spawn

evalues the quote in a child environment, returns a future ( [A] -> {future} )

require

loads and runs a ff or json file

sesssave

saves the current stack and dictionary as a JSON file

Clone this wiki locally