Impossible! Operator Reference

Text Filter
 
Types
Parametric
 
Category
 
API
 
Symbol Name Args Type Description Example
= equal 2 A → B → bool Compare two values by structual equality. 1 2= ⇒ f
< lesser 2 float → float → bool Check if first float is lesser than second. 1.2 2.4< ⇒ t
< lesser 2 int → int → bool Check if first integer is lesser than second. 1 2< ⇒ t
< build 2 list → A → list Build a list by taking another list and a top value. {2,3}1< ⇒ {1,2,3}
> unbuild 1 list → list A Split a list onto the stack in head element and trail {1,2,3}> ⇒ {2,3}1
> greater 2 float → float → bool Check if first float is greater than second. 1.2 2.4> ⇒ f
> greater 2 int → int → bool Check if first integer is greater than second. 1 2> ⇒ f
<- push 2 stack → A → stack Push value onto the stack specified. {<1,2}'a<- ⇒ {<'a,1,2}
<- add 2 map → A → map Add key value pair to the map. {:}"foo""bar" <- ⇒ {"foo":"bar"}
<- set 3 array → int → B → array Set item of array specified by integer. {:5:}1 3<- ⇒ (:n 2 n n n)
-> get 2 array → int → A Get the element at position specified by index. (:3:)0'a<--> ⇒ 'a
-> extract 2 array → range → array Build a subarray of original one by composing elements. (:1,2,3,4,5,6)2..4-> ⇒ (:3,4,5)
-> extract 2 map → list → list Retrieve all values mapped to keys contained in list into a list. {1:2,3:4,5:6}{1,5}-> ⇒ {2,6}
-> get 2 map → A → B Get the value mapped to supplied key from the map. {1:2,3:4,5:6}{1,5}-> ⇒ {2,6}
-> get 2 list → int → A Get the element at position specified by index. {1,2,3,4,5}2-> ⇒ 3
-> extract 2 list → range → list Retrieve all elements contained in range as a new list. {1,2,3,4,5}1..2 4..4|-> ⇒ {2,3,5}
-> char at 2 string → int → char Retrieve the char at position specified by index. "abcd"2-> ⇒ 'c
-> imply 2 bool → bool → bool Logic implication. t f-> ⇒ f
? if 2 bool → lambda → . Behave like if operator. If the boolean is true then the lambda is executed. f[2]?t[4]? ⇒ 4
?? ifelse 3 bool → lambda → lambda → . Behave like if/else operator. Execute first lambda if flag is true, second otherwise. f[10][20]=? ⇒ 20
<> is contained 2 int → range → bool Push true if number is inside range. 2 1..3<> ⇒ t
<> while 2 lambda → lambda → . Execute second lambda until first lambda returns false. 5[;0>][;^1-]<>
<> partition 2 list → lambda → list list Split a list according to a predicate. 1..10~[5>]<> &rArr {6,7,8,9,10} {1,2,3,4,5}
! factorial 1 float → float Compute factorial of float. 6.0! ⇒ 720.0
! apply 1 lambda → . Executes lambda, which will use the current stack. [+]2 4#>! ⇒ 6
!! curry 1 lambda → lambda Use stack value before lambda to partial apply it with the function. 2[+]!!3! ⇒ 5
!!! uncurry 1 lambda → lambda Uncurries the function by unapplying last curried argument. N/A
[#] noop 0 . → lambda Push an empty lambda that does nothing onto the stack. 2 [#]!^ ⇒ 2
[] recur 1 int → lambda Retrieve a function from the call stack (used for recursion). 6[;0=[,1][;1-1[]!*]??]! ⇒ 720
% swap 2 A → B → . Swap the two topmost elements of the stack. 'a 'b % ⇒ 'b 'a
; dupe 1 A → . Duplicate the topmost element of the stack. 4;+ %rArr; 8
#> rise 3 A → B → C → . Rise third value to the top. 2 4 2#>+= ⇒ t
<# sink 3 A → B → C → . Sink topmost value at third position into the stack. 2 2 4<#+= ⇒ t
$ pick 1 int → A Pick the element on the stack at position specified by integer and copy to the top. 1 2 3 1$ ⇒ 5
, drop 1 A → Drop topmost element of the stack. 2'a,2+ ⇒ 4
,, drop all 1 A → Drop the whole stack. N/A
^ peek 1 A → . Print the topmost element of the stack without dropping it. "abc"^ ⇒ "abc" (string)
^^ print 1 A → . Pop and print the topmost element of the stack. "abc"^^ ⇒ "abc" (string)
# var set 1 char → . Store the value in a register chosen by char before # (shorthand #a). 2'a#4#b,,'b@@a+ ⇒ 6
@ var get 1 char → A Retrieve the value from the register chosen by char after @ (shorthand @a). 2'a#4#b,,'b@@a+ ⇒ 6
@exp euler 0 . → float Euler constant. N/A
@phi golden ratio 0 . → float Golden ratio. N/A
@pi pi 0 . → float Pi constant. N/A
+ sum 2 float → float → float Addition between two floats. 2.2 3.1+ ⇒ 5.3
+ sum 2 int → int → int Addition between two integers. 2 2+ ⇒ 4
+ sum 2 vector2 → vector2 → vector2 Addition between two 2D vectors. (0.0;1.0)(0.5;2)+ ⇒ (0.5;3.0)
+ insert 2 range → int → range Insert the specified index inside range. 1..1 3..3|2+ ⇒ 1..3
+ append 2 char → char → string Build string by concatenating two characters. 'f'o'o++ ⇒ "foo"
+ append 2 char → string → string Build string by concatenating a character and a string. 'f'o'o++ ⇒ "foo"
+ shift 2 char → int → char Shift a char by adding the integer value to the ASCII code. 'a2+ ⇒ 'c
+ append 2 string → A → string Append string rapresentation to existing string. "x:"4+ ⇒ "x:4"
+ insert 2 list → A → list Add an element to the top of a list. {2,3,4}1+ ⇒ {1,2,3,4}
+ insert 2 set → A → set Add an element to specified set. {;1,2,3};4+1+ ⇒ {1,2,3,4}
- sub 2 float → float → float Subtraction between two floats. 2.2 3.1 ⇒ -0.9
- sub 2 int → int → int Subtraction between two integers. 5 3- ⇒ 2
+ sub 2 vector2 → vector2 → vector2 Subtraction between two 2D vectors. (1.0;1.5)(2.2;1.3)- ⇒ (-1.2;0.2)
- remove 2 list → A → list Removes specified value from the list. 2.2 3.1 ⇒ 5.3
- difference 2 set → set → set Compute difference between first and second sets. {;1,2,3,4}{;2,4}- ⇒ {;1,3}
- remove 2 set → A → set Remove value from set. {;1,2,3}2- ⇒ {;1,3}
- shift 2 char → int → char Shift a char by subtracting the integer value to the ASCII code. ''a2+ ⇒ 'c
- split 2 range → int → range Removes an integer from the range, splitting the range if needed 1..10 3- ⇒ 1..2 4..10
* max 2 list → → A Find maximum alement of a list. {5,10,2,0}/ ⇒ 10
* times 2 float → float → float Multiplication between two floats. 2.2 1.8* ⇒ 3.96
* times 2 int → int → int Multiplication between two integers. 3 5* ⇒ 15
* dot product 2 vector2 → vector2 → vector2 Dot product between two 2D vectors. (1.0;0.5)(0.4;1.5)* ⇒ (0.4;0.75)
** exp 1 float → float Exponential function. 1.0** ⇒ 2.7182
** pow 2 int → int → int Square power between two integer. 3 4** ⇒ 81
** concat 2 list → list → list Concatenate two lists. {1,2}{3,4}** ⇒ {1,2,3,4}
/ min 2 list → → A Find minimum alement of a list. {5,3,1,2}/ ⇒ 1
/ div 2 float → float → float Division between two floats. 3.4 0.6/ ⇒ 5.666
/ div 2 int → int → int Division between two integers. 3.4 0.6/ ⇒ 5.666
/ split 2 string → regex → list Split a string according to specified regex. "1,2,3;5"\[,;]\/ ⇒ {1,2,3,5}
/ split 2 string → string → list Split a string according to specified delimiters. "1,2,3;5"",;"/ ⇒ {1,2,3,5}
/ split 2 string → char → list Split a string according to specified delimiter. "1,2,3,5"',/ ⇒ {1,2,3,5}
// log 1 float → float Natural logarithm between two floats. 10.0 2.0// ⇒ 0.693147
// flatten 1 list → list Flatten a list by flattening inner lists to their values. {1,2,3,{4,5}}// ⇒ {1,2,3,4,5}
// compile 1 string → regexp Compile a string to a regular expression. N/A
// mod 2 int → int → int Remainder of division between integers. 14 3// ⇒ 2
_ negation 1 float → float Negate float. 2.0_ ⇒ -2.0
_ negation 1 int → int Negate integer. 4_ ⇒ -4
_ size 1 string → int Push the length of the string. "abcde"_ ⇒ 5
_ size 1 map → int Push the size of the map. {:}_ ⇒ 0
_ size 1 list → int Push the size of the list. {1,2,3}_ ⇒ 3
_ size 1 bitset → int Push the dimension of the bitset. ()_ ⇒ 3
_ flip 1 vector2 → vector2 Flip a vector. (2.0;-1.5)_ ⇒ (-2.0;1.5)
<< pow 1 float → float Calculate square product of float. 4.0<< ⇒ 16.0
<< implode 1 list → string Convert a char list to a string. {'f,'o,'o}>> ⇒ "foo"
<< left shift 2 int → int → int Left shift the integer by specified amount. 2 7<< ⇒ 256
>> sqrt 1 float → float Calculate square root of float. 225.0>> ⇒ 15.0
>> explode 1 string → list Convert a string to a char list. "foobar">> ⇒ {'f,'o,'o,'b,'a,'r}
>> right shift 2 int → int → int Right shift the integer by specified amount. 4096 3>> ⇒ 512
>> filter 2 list → lambda → list Filter list keeping all elements that satisfy predicate. {1,2,3,4,5,6}[2//0=]>> ⇒ {2,4,6}
>> filter 2 map → lambda → map Filter map keeping all elements that satisfy predicate (both key and value are passed). {1:2,2:3,3:4,4:5}[,2//0=]>> ⇒ {2:3,4:5}
>> filter 2 set → lambda → set Filter set keeping all elements that satisfy predicate. {;1,2,3,4,5,6}[2//0=]>> ⇒ {;2,4,6}
~ not 1 bool → bool Logical not. t~ ⇒ f
~ not 1 int → int Bitwise not. 121~ ⇒ -122
~ reciprocal 1 float → float Calculate multiplicative inverse of float value. 5.0~ ⇒ 0.2
~ reverse 1 string → string Reverse a string. "raboof"~ ⇒ "foobar"
~ concretize 1 range → list Transform a range to an explicit integer list. 1..1 3..4|~ ⇒ {1,3,4}
~ reverse 1 list → list Reverse a list. {1,2,3,4} ⇒ {4,3,2,1}
~ not 1 bitset → bitset Negate bitset. (.fftfft)~ ⇒ (.ttfttf)
~ det 1 matrix → float Compute the determinant of the matrix. ||4 1 3|2 2 5|3 3 1||~ ⇒ -39.0
| or 2 bool → bool → bool Logical or t f | ⇒ t
| or 2 int → int → int Bitwise or. 3 5|^ ⇒ 7
| merge 2 range → range → range Range union. 1..3 2..4 6..7|| ⇒ 1..4 6..7
| union 2 set → set → set Set union. {;1,2}{;2,3}| ⇒ {;1,2,3}
| extract 2 string → range → string Extract characters from string and concatenate them to a new one. "abcde"1..2| ⇒ "bc"
| union 2 bitset → bitset → bitset Bitset union. (.t)(.ft)| ⇒ (.tt)
& and 2 bool → bool → bool Logical and. t f & ⇒ f
& and 2 int → int → int Bitwise and. 3 5& ⇒ 1
& intersect 2 set → set → set Set intersection. {;1,2}{;2,3}& ⇒ {;2}
& intersect 2 range → range → range Range intersection. 1..4 6..8|2..7& ⇒ 2..4 6..7
& intersect 2 bitset → bitset → bitset Bitset intersection. (.t)(.ff)& ⇒ (.ff)
.> floor 1 float → float Round float value to previous integer. 2.4.> ⇒ 2.0
.> each 2 string → lambda → . Executes the lambda for every char of the string. "abcde"[^].> ⇒ 'a'b'c'd'e
.> each 2 list → lambda → . Executes the lambda for every element of the list. {1,2,3}[^].> ⇒ 1 2 3
.> each 2 map → lambda → . Executes the lambda for every element of the map. {'a:1,'b:2,'c:3}[%^%^].> ⇒ 'a 1 'b 2 'c 3
.> each 2 range → lambda → . Executes the lambda for every integer contained inside the range. 1..4[^].> ⇒ 1 2 3 4
.>. map 2 list → lambda → list Transform the list by mapping every element using the provided lambda. {1,2,3,4}[2*].>. ⇒ {2,4,6,8}
.>. map 2 map → lambda → map Transform the map by mapping every value using the provided lambda. {1:2,3:4}[%,2*].>. ⇒ {1:4,3:8}
:>. lowcase 1 string → string Convert the string to lowercase. "AbCDefG":>. ⇒ "abcdefg"
:>. to int 1 float → int Convert float to integer. 2.4:>. ⇒ 2
:>. compose 2 int → int → range Build a single range from two integers. 1 3:>. ⇒ 1..3
:>. fold 3 list → lambda → A → A Fold a list by taking accumulator value an passing it through the list. {1,2,3,4}[+]0:>. ⇒ 10
.? min 2 int → int → int Push the minimum of two integers. 10 5.? ⇒ 5
.? min 2 float → float → float Push the minimum of two floats. 3.5 3.1.? ⇒ 3.1
.? any 2 list → lambda → bool Push true if one of the elements of the list satisfies lambda, false otherwise. {1,2,3,4}[3>].? ⇒ t
.? find first 2 string → char → int Push the first index that is equal to char inside string, -1 if not present. "abcdef"'c.? ⇒ 2
.? contains 2 string → string → string Push true if second string is contained inside first one. "foobar""oob".? ⇒ true
:? max 2 int → int → int Push the maximum of two integers. 10 5:? ⇒ 10
:? max 2 float → float → float Push the maximum of two floats. 4.4 5.2:? ⇒ 5.2
:? every 2 list → lambda → bool Push true if all elements of the list satisfies lambda, false otherwise. {1,2,3,4,5}[6<]:? ⇒ t
:? find all 2 string → char → list Find all indices in string for char specified and return them in a list. "abcabcabc"'b:? ⇒ {1,4,7}
.>: upcase 1 string → string Convert the string to uppercase. "AbCDefG".>: ⇒ "ABCDEFG"
.>: to float 1 int → float Convert integer to float. 3.>: ⇒ 3.0
.>: contains 2 list → A → bool Push true if element is contained inside list. {1,'a,"foo"}"foo".>: ⇒ t
.>: contains 2 map → A → bool Push true if specified key is present inside map. {1:'a,2:'b,3:'c}2.>: ⇒ t
:> ceil 1 float → float Round float value to next integer. 2.4:> ⇒ 3.0
:> xor 2 int → int → int Bitwise xor. 4 5:> ⇒ 1
:> xor 2 bool → bool → bool Logical xor. t t:> ⇒ f
@> random 1 range → int Generate a random integer from range. The distribution is uniform between all of them. 1..3 5..7|@> ⇒ 5
@> random 1 int → int Generate a random number between 0 and integer passed less 1. 10@> ⇒ 2
@> sort 1 list → list Sort list according to builtin comparators. {5,1,7,3}@> ⇒ {1,3,5,7}
Letters A, B, C, etc. are used to reference whatever type