-
Notifications
You must be signed in to change notification settings - Fork 4
Stack Machine
gets the current logging level
( -> {string} )
sets the current logging level
( {string} -> )
moves the top of the stack to the tail of the queue
( {any} -> )
moves the tail of the queue to the top of the stack
( -> {any} )
replaces the stack with a quote containing the current stack
( ... -> [ ... ] )
f♭> 1 2 3 stack
[ [ 1 2 3 ] ]
increments the internal d counter, if d > 0 words are pushed to the stack as literals
f♭> d++ drop :d--
[ drop ]
decrements the d counter
pushes a quotation maker onto the stack
( -> #( )
collects stack items upto the last quote marker
( #( ... -> [ ... ] )
pushes the size of the current stack
( -> {number} )
f♭> 1 2 3 depth
[ 1 2 3 3 ]
loads and runs a ff or json file
( {string} -> {any} )
replaces the stack with the item found at the top of the stack
( [A] -> A )
f♭> 1 2 [ 3 4 ] <-
[ 3 4 ]
replaces the queue with the item found at the top of the stack
( [A] -> )
f♭> 1 2 [ 3 4 ] -> 5 6
[ 1 2 3 4 ]
restores the stack to state before previous eval
set flag to auto-undo on error ( {boolean} -> )
defines a word
( {string|atom} [A] -> )
f♭> sqr: [ dup * ] ;
[ ]
defines a set of words from an object
( {object} -> )
f♭> { sqr: "dup *" } define
[ ]
stores a quote in the dictionary
( [A] {string|atom} -> )
f♭> [ dup * ] "sqr" sto
[ ]
defines a word
( [A] {string|atom} -> )
f♭> [ dup * ] "sqr" def
[ ]
memoize a defined word
( {string|atom} -> )
deletes a defined word
( {string|atom} -> )
recalls the definion of a word
( {string|atom} -> [A] )
f♭> "sqr" rcl
[ [ dup * ] ]
expand a quote
( [A] -> [a b c])
f♭> [ sqr ] expand
[ [ dup * ] ]
recalls the definition of a word as a formatted string
( {string|atom} -> {string} )
f♭> "sqr" see
[ '[ dup * ]' ]
returns a list of defined words
( -> {array} )
clears the stack
( ... -> )
f♭> 1 2 3 clr
[ ]
push the top of the queue to the stack
( -> {any} )
saves the current stack and dictionary as a JSON file
evalues the quote in a child environment
( [A] -> [a] )
f♭> [ 1 2 * ] fork
[ [ 2 ] ]
evalues the quote in a child environment, returns a future
( [A] -> {future} )
evalues the quote in a child environment, waits for result
( [A] -> [a] )
pushes one element from stack to parent.
( A -> )
f♭> [ 1 2 3 send 4 ] fork
[ 3 [ 1 2 4 ] ]
pushes current stack to parent
( ... -> )
f♭> [ 1 2 3 return 4 ] fork
[ 1 2 3 [ 4 ] ]
stops execution, push queue to stack, loses other state
( ... -> )
f♭> [ 1 2 * suspend 3 4 * ] fork
[ [ 2 3 4 * ] ]
executes each element in a child environment
( [ A B C ]-> [ [a] [b] [c] ])
executes each element in a child environment, returns first to finish
( [ A B C ]-> [x])
- Introduction
- Language
- Words
- Internal
- Definitions
- Examples