TODO: UPDATE
Stack Effects:
a b -> c
Description:
Compare two numbers, true if a is different from b: 2 1 !=
Stack Effects:
a b -> c
Description:
Remainder of an integer division: 3 2 %
Stack Effects:
->
Description:
It does nothing: _
Stack Effects:
->
Description:
Open new nested stack: 1 2 ( 3 4 )
Stack Effects:
->
Description:
Close nested stack.
Stack Effects:
a b -> c
Description:
Muliply two numbers: 1 2 *
Stack Effects:
a b -> c
Description:
Add two numbers: 1 2 +
Stack Effects:
a -> b
Description:
Increment a number in the stack: 10 ++
Stack Effects:
a b -> c
Description:
Subtract two numbers: 1 2 -
Stack Effects:
a -> b
Description:
Decrement a number in the stack: 10 --
Stack Effects:
a b -> c
Description:
Divide two numbers: 1 2 /
Stack Effects:
a b -> c
Description:
Compare two numbers, true if a is smaller than b: 1 2 <
Stack Effects:
a b -> c
Description:
Compare two numbers, true if a is smaller or equal than b: 1 2 <=
Stack Effects:
a b -> c
Description:
Compare two numbers, true if a is equal to b: 2 2 =
Stack Effects:
a b -> c
Description:
Compare two numbers, true if a is bigger than b: 2 1 >
Stack Effects:
a b -> c
Description:
Compare two numbers, true if a is bigger or equal than b: 2 1 >=
Stack Effects:
->
Description:
Get a word and two strings from the concat and generate help words: ? add 'a b -> c' 'Calculate addition of two operands and put results in stack.'
Stack Effects:
-> a
Description:
Get a cell from the concat and put it in the stack: @ my_word
Stack Effects:
-> a
Description:
Get a cell from the concat of current block caller, and put it in the stack: { @@ } exe my_word
Stack Effects:
a b ->
Description:
Define word b with value a: 10 @ my_num @def
Stack Effects:
? -> ?
Description:
Create stack transfer: [ a b | a a ]
Stack Effects:
a b -> c
Description:
Calculate logic "and" of two operands: -1 -1 and
Stack Effects:
... a -> b
Description:
Get a block from the stack and create a new one. For each $ word in the block, it will get a cell from the stack and put in its place: 10 { 1 $ + } block exe
Stack Effects:
a ->
Description:
Define a word taken from the concat with the value taken from the stack: 10 def num
Stack Effects:
a b c .. N -> z
Description:
Calculate division of all numbers in the stack: ( 3 6 2 div )
Stack Effects:
a ->
Description:
Extract one cell from the stack.
Stack Effects:
a -> a a
Description:
Duplicate a cell in the stack.
Stack Effects:
a b c ->
Description:
Execute block b if a is true, or block c if a is false: 2 2 = { "true block" } { "false block" } either
Stack Effects:
a ->
Description:
Execute a word referenced in the stack: @ a_word exe
Stack Effects:
a -> a b
Description:
Check if word "a" exists and puts a boolean "b" in the stack: @ my_word exist?
Stack Effects:
a -> b
Description:
Convert an integer into a float: 10 float
Stack Effects:
a -> b
Description:
Calculate the fractional part of a float number: 1.99 fract
Stack Effects:
a b ->
Description:
Execute block b if a is true: 2 2 = { "do something" } if
Stack Effects:
a -> b
Description:
Convert a float into an integer: 10.9 int
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is a block: { } is_block?
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is a boolean: false is_bool?
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is a float: 10.0 is_float?
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is an integer: 10 is_int?
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is a string: 'hi' is_str?
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is a struct: custom_struct is_struct?
Stack Effects:
a -> a bool
Description:
Check if cell in the stack is a word: @ hi is_word?
Stack Effects:
->
Description:
Set prefix for word definition: lex 'mylex.' 10 def num lex ''
Stack Effects:
-> a
Description:
Put value of current lex prefix in the stack: lex#
Stack Effects:
a b ->
Description:
Execute block b while result of block a is true: 10 var num { num 0 > } { num -- num! } loop
Stack Effects:
a -> b
Description:
Calculate logic inversion of an operand: 0 not
Stack Effects:
a b -> c
Description:
Calculate logic "or" of two operands: -1 0 or
Stack Effects:
a b c .. N -> z
Description:
Calculate product of all numbers in the stack: ( 1 2 3 prod )
Stack Effects:
a ->
Description:
Create a setter for the word reference in the stack. The setter is named 'word!': 10 def num , @ num setter , 0 num!
Stack Effects:
-> a
Description:
Get size of current stack: size
Stack Effects:
a ->
Description:
Skip "a" words from the concat: -2 skip
Stack Effects:
a -> b
Description:
Convert a word into a string: @ my_word string
Stack Effects:
a b c .. N -> z
Description:
Calculate substraction of all numbers in the stack: ( 1 2 3 sub )
Stack Effects:
a b c .. N -> z
Description:
Calculate sumation of all numbers in the stack: ( 1 2 3 sum )
Stack Effects:
a b -> b a
Description:
Swap positions of 2 cells in the stack.
Stack Effects:
a -> a b
Description:
Get type of data in the stack without consuming it: 20 type
Stack Effects:
a ->
Description:
Define a variable and a setter with intial value taken from the stack and name taken from the concat: 10 var num
Stack Effects:
a b c ... N ->
Description:
Remove all cells in the stack: ( 1 2 3 wipe )
Stack Effects:
a -> b
Description:
Convert a string into a word: 'my_word' word
Stack Effects:
-> a
Description:
Create a block and put block cell in the stack: { 1 + }
Stack Effects:
->
Description:
Return from block, get concat position from the return stack.