-
Notifications
You must be signed in to change notification settings - Fork 1
Operators (Monads)
kritixilithos edited this page Mar 3, 2017
·
9 revisions
We have the stackMode horizontally, and the argument type vertically.
+ the plus operator |
string | number | array |
|---|---|---|---|
| string | concatenation | concatenation (stackMode becomes string) | |
| number | concatenation | addition | addition to each of the array's elements |
| space | sums up all the elements of the array (stackMode becomes float) | ||
- the minus operator |
|||
| string | remove all instances of argument | remove all instances of argument from stack string while converting to string mode | |
| number | remove first characters from stack | subtraction | subtraction to each of the array's elements |
* the times operator |
|||
| string | |||
| number | string multi-duplication | multiplication | multiplication to each of the array's elements |
| space | sums up all the elements of the array (stackMode becomes float) | ||
/ the slash operator |
|||
| string | |||
| number | remove character at index | float division | float division to each of the array's elements |
| regex | return matches of regex and convert to array mode | ||
S convert to string (only a monad when stringMode is array) |
|||
| number | join each element of the array with argument | ||
| string | join each element of the array with argument | ||
% the modulo operator |
|||
| string | |||
| number | modulo |