Function ("Sugar1","Sugar2",...) | Description |
---|---|

*Operators* | |

+ | Sum the top of the stack. If it's a stack, sum all the values together, otherwise, sum with the second value in the stack. If that's a stack, push a new stack where all values have the previous top of the stack added to it. |

/ | Divide either two numbers, two stacks, or a number and a stack, returning apropriately. |

% | Modulus of the popped two top values is pushed to the top of the reg stack. |

* ("×") | Same functionality as '+', yet for multiplication. |

. | Same functionality as '+', yet for concatination. |

- | Same functionality as '/', but for subtraction. |

// | Same functionality as '/' yet for integer division. |

^ | Same functionality as '/' yet for exponants. |

*Comparison* | |

< | Compare the second topmost item of the reg stack with the top. |

<= | Compare the second topmost item of the reg stack with the top. |

== ("≡","E") | Compare the second topmost item of the reg stack with the top. |

!= ("e") | Compare the second topmost item of the reg stack with the top. |

> | Compare the second topmost item of the reg stack with the top. |

>= | Compare the second topmost item of the reg stack with the top. |

and ("&") | Compare the second topmost item of the reg stack with the top. |

or ("|") | Compare the second topmost item of the reg stack with the top. |

not ("!") | If the top of the stack is truth, push false. True otherwise. |

truthy ("!!", "‼") | if the top value is truthy, push true, Otherwise, push false. |

*Reg Stack Manipulation* | |

[ | Pop the top value of the stack. |

] | Duplicate the top value of the stack. |

\ | Swap the top and second topmost values of the stack. |

asoc ("=") | Make the string on top of the stack represent the value under it, in function form. If the top of the stack is a stack, do the previous on the two values below it, but to this stack. |

getraw ("º", "g") | Get the function that a string represents |

recall | Push the function the top of the stack represents. Like getraw, but only considers the mem stack, not defaults. |

*Flow of Control* | |

if ("f{", "?") | If the top of the stack is truthy, continue, otherwise, scan and skip to the paired 'end' |

while ("w{", "¿") | if the top of the stack is truthy, continue, otherwise, scan and skip past the paired 'end'. Upon reaching the paired end, return to this while and check again. |

for ("F{", ":") | essentially for (i=a; i<=b; i+=c) where a is the top most value of the stack, b is the second and c is the third. |

function ("=>", "§", "§", "{") | Define a function between this and its paired end, push it to the stack. |

else ("}{", "¡") | "Flow of control else. |

" | |

end ("}") | Flow of control end. |

if_peek | Same functionality as 'if', but does not pop the conditional. |

while_peek | Same functionality as 'while', but does not pop the conditional. |

call ("C") | Call the function of function defined by the top of the stack. |

( | Begin defining a constant stack. |

) | Finish defining a constant stack. |

*IO and Meta Functions* | |

p | Write to the STDOUT, followed by a newline. |

w | Write to the STDOUT. |

read | Read a line from STDIN. |

exit | Stop the script then and there, or exit the subprocess. |

debug ("I") | Dumps a the contents of the stack to the STDOUT |

do | Run the top of the stack as RProgN. |

-0 | Run the string as if it were a 0 space string. |

Q | Push the current interpreted string. May behave unexpectedly outside the main function. |

*Defaulted Values* | |

ALPHABET ("A") | Push the uppercase alphabet. |

alphabet ("a") | Push the lowercase alphabet. |

time | Push the current Unix Time. |

t | Push 10. |

x | Push the string 'x'. For golfing. |

y | Push the string 'y'. For golfing. |

z | Push the string 'y'. For golfing. |

X | Push the string 'X'. For golfing. |

Y | Push the string 'Y'. For golfing. |

Z | Push the string 'Z'. For golfing. |

reg ("r") | Push the reg stack. Be careful when playing with this. |

mem | Pushes the 'mem' stack to the stack. This is technically an associative array, containing all assigned global variables. |

flow | Pushes the flow of control stack, used by 'end' for flow of control. Hard to use. |

local ("⌂","@") | Returns a local asoc array. Values can be asoc'd to this, and they can then be called the same way as they would from the mem stack, but works sepereately for sub-functions. |

goat | Goat. |

*General Functions* | |

frombase ("-B") | Convert the second topmost value from the base on top of the stack to an integer. |

base ("B") | Convert the second topmost value to the base on top of the stack. |

char ("c") | Push the ascii character represented by the value on top of the stack, or if the top of the stack was a stack, a new stack containing all the values replaced with their ascii representation. |

byte ("b") | Same functionality as 'char', but gets the byte that the ascii character represents. If the string is more than one character long, pushes a stack of numbers. |

ceil ("^^", "¯", "J") | Push the rounded up form of the top of the stack. |

decode64 | Decode a string as Base64. |

encode64 | Encode the top of the stack as base64. |

delta ("d") | Push a stack of continuous differences of a stack or a string. |

match ("M") | Return the string or all subpatterns on the second topmost position based on the top of the stack. |

replace ("R") | Replace all the values in the third topmost position with the first based on the second of the stack. Second value is a stack, replace all of the stack with the value on the top. If the top value is a function, run the function for each match, passing the match, and replace it with it's output. |

map | Replace, but but with the pattern '.' implicitely. |

find ("f") | Push the first found index of the top of the stack within the value under it, or falsey if it failed to find anything. |

floor ("_") | Floor the top value of the stack. |

foreach ("æ") | Repeatedly run the function on the top of the stack on the stack under it, passing each value to the stack before the call. |

get | Get the value represented by the top of the stack from the stack underneith it. |

hasvalue | Truthy if the second topmost value contains the top value, falsey otherwise. Only works on stacks. |

inverse | Push a new stack that is the top of the stack in reverse order. |

invert ("i") | Same as inverse, yet modifies the target stack. |

clone ("u") | Make a new stack with identical contents. |

len ("L") | Push the length of the top of the stack. Works for both stacks and strings. |

lower ("l") | Convert the topmost value to lowercase. |

max ("N") | If the top value is a stack, push its largest value, otherwise push the larger value of the top two items. |

min ("n") | Same functionality as 'max', yet for the smallest value. |

peek ("K") | Push the top of the stack of the stack under it, without popping said value. Stack underneith is still popped. |

pop ("po", "☼", "O") | Pop the top value of the stack on top of the stack. |

push ("P") | Push the top of the stack to the stack under it. |

rand | Push a random number between the second most top value and the first. |

randomseed | Seed the RNG with the top of the stack. |

rep ("£", "m") | Repeat the second topmost value of the stack the top of the stack times, as a string. |

rotate_l ("←") | Rotate the stack on top of the stack left once. |

rotate_r ("→") | Rotate the stack on top of the stack right once. |

set | Redundant, sets the value of k to v of stack t where t is the third topmost value, k is the second and v is the first. |

shuffle | Randomise the stack on top. Please avoid doing 'reg shuffle' |

split ("↔") | Split the second topmost string, grouping by the first pattern. |

sqrt ("j") | Push the square root of the top of the stack. |

stack ("s") | Push a new empty stack. |

sub ("¢", "q") | Get the substring of the third top most value of the stack between the second and first indexes, 1 indexed. |

index ("V") | Push the top of the stack'th value of the value under the top. |

sum ("++", "‡") | Same functionality as '+'. |

to ("▬", "T") | Push a stack from the second topmost value to the first. Works for strings and numbbers. |

tostack ("S") | Convert the top of the stack to a stack of characters |

type | Pushes a string name for the type of variable that is on top of the stack. |

upper ("U") | Convert the top of the stack to uppercase. |

sort ("$") | Sort the second topmost value by the top function. |

format ("F") | Pops the top of the stack to use as a template string, pops the arguments required to forfill that string, or optionally a stack to serve the same purpose, then pushes the formatted string. |

*Arithmatic* | |

sin ("D") | Pushes the sin of the popped top of the stack. Uses Radians. |

cos ("G") | Pushes the cos of the popped top of the stack. Uses Radians. |

tan ("H") | Pushes the tan of the popped top of the stack. Uses Radians. |

asin | Pushes the arcsin of the popped top of the stack. Uses Radians. |

acos | Pushes the arccos of the popped top of the stack. Uses Radians. |

atan | Pushes the arctan of the popped top of the stack. Uses Radians. |

atan2 | Pushes the arctan of the two top values of the stack, acounting for quadrants. |

log ("o") | Pushes the log of the top two values of the stack. |

deg | Convert the top of the stack to degrees from radians. |

rad | Convert the top of the stack from degrees to radians. |

factors ("k") | Push a stack containing all the unique factors of the top of the stack. |

primacy ("v") | Push true if the top of the stack is prime, false otherwise. |