Operators
This page is dynamically generated by the scripts/gen_op_tables.aya script.
Type Abbreviations
Number | N |
String | S |
Char | C |
Block | B |
Dict | D |
Symbol | J |
Operators
! | N|C | N : 1-N (logical not, complementary probability)C : swap case | ȕ__new__ |
# | LA..#A | LA..#A : map | љ |
$ | A | A : deepcopy (duplicate) | љ |
% | NN|BN | NN : modBN : repeat B N times | ȕ__mod__ / __rmod__ |
& | SS|NN | SS : list all expressions matching the regexNN : bitwise and | ȕ__and__ / __rand__ |
* | LS|LC|NN | LS : joinLC : joinNN : multiply | ȕ__mul__ / __rmul__ |
+ | CC|SA|AS|NN | CC : addSA : append stringAS : append stringNN : add | ȕ__add__ / __radd__ |
- | CC|NN | CC : subtractNN : subtract | ȕ__sub__ / __rsub__ |
/ | LB|NN | LB : foldNN : divide | ȕ__div__ / __rdiv__ |
; | A | A : pop and discard | љ |
< | SS|CC|NN | SS : less thanCC : less thanNN : less than | ȕ__lt__ / __rlt__ |
= | AA | AA : equality | ȕ__eq__ |
> | SS|CC|NN | SS : greater thanCC : greater thanNN : greater than | ȕ__gt__ / __rgt__ |
? | AA | AA : if A1, then A2. If A2 is block, execute it | љ |
@ | AAA | AAA : rotates the top three elements on the stack [abc->bca] | љ |
A | A | A : wrap in list | љ |
B | J|L|N|C | J : increment in placeL : uncons from frontN : incrementC : increment | ȕ__inc__ |
C | L|S|N | L : sort least to greatestS : sort least to greatestN : bitwise not | ȕ__sort__ |
D | ALN | ALN : set index | ȕ__setindex__ |
E | L|N|S | L : lengthN : 10^NS : length | ȕ__len__ |
F | NN | NN : unsigned right bitshift | љ |
G | S|N | S : read a string from a filename or URLN : isprime | љ |
H | NNN|SNN|LNN | NNN : convert base of N|S|L from N1 to N2SNN : convert base of N|S|L from N1 to N2LNN : convert base of N|S|L from N1 to N2 | љ |
I | LL|LN|LB | LL : get indexLN : get indexLB : filter | ȕ__getindex__ |
J | LL|LA|AL|AA | LL : join listsLA : add to listAL : add to listAA : create list [ A A ] | љ |
K | LL|LA|AL|AA | LL : concatenate lists (modify list 1)LA : add to list (modify list)AL : add to list (modify list)AA : create list [ A A ] | љ |
L | LL|AN|NL | LL : reshapeAN : create list by repeating A N timesNL : reshape | љ |
N | SS|LA|DJ|DS | SS : return index of first occurance, -1 if not found; keep list on stackLA : return index of first occurance, -1 if not found; keep list on stackDJ : contains key; keep dict on stackDS : contains key; keep dict on stack | љ |
O | LB|DB | LB : Map block to listDB : Map block to dict | ȕ__each__ |
P | A | A : to string | ȕ__str__ |
Q | L|N | L : random choiceN : N>0: random number 0-N, N<0: random number N-0, N=0: any int | ȕ__random__ |
R | L|N|C | L : len L = 2: range [N1, N1+1, …, N2], len l = 3: range [N1, N2, …, N3]N : range [1, 2 .. N]C : range [1, 2 .. N] | ȕ__range__ |
S | B|J|L | B : duplicate block, add locals if they do not existJ : is definedL : sum (fold using +) | љ |
T | N | N : negate | ȕ__negate__ |
U | L | L : reverse | ȕ__reverse__ |
V | J|L|N|C | J : decrement in placeL : uncons from backN : decrementC : decrement | ȕ__dec__ |
W | B|D | B : while loop (repeat as long as block returns true)D : export all variables | љ |
X | A | A : assign to variable x and pop from stack | љ |
Y | A | A : assign to variable y and leave on stack | љ |
Z | N|S | N : cast to bignumS : parse to bignum | љ |
\ | AA | AA : swap top two elements on the stack | љ |
^ | SS|NN | SS : levenshtein distanceNN : power | ȕ__pow__ / __rpow__ |
.! | B|N|S | B : copy block without headerN : signumS : parse if number | ȕ__signum__ |
.$ | ..AN | ..AN : copies the Nth item on the stack to the top (not including N) | љ |
.% | NN | NN : integer division | ȕ__idiv__ / __ridiv__ |
.& | SSS|LLB | SSS : replace all occurances of the regex S1 with S2 in S3LLB : zip with | љ |
.' | L|N|S | L : convert number list to string using UTF-8 encodingN : cast to charS : cast to char | љ |
.( | NN | NN : left bitwise shift | љ |
.) | NN | NN : signed right bitwise shift | љ |
.* | B|L | B : decompileL : compile | љ |
.+ | BD|BJ|BL | BD : swap vars in a copy of B for values defined in DBJ : constant capture variable from outer scopeBL : constant capture variables from outer scopeDD : update D1 with the values from D2 (modify D1)NN : gdc | љ |
.- | LL|LN|DJ|DS|NN | LL : remove items at indices L1 from L2LN : remove item at index N from LDJ : remove key from dictDS : remove key from dictNN : lcm | љ |
./ | N | N : ceiling | ȕ__ceil__ |
.; | ..A | ..A : clear the entire stack | љ |
.< | SS|LN|CC|SN|NN | SS : greater ofLN : head / pad 0CC : greater ofSN : head / pad ’ ’NN : greater of | ȕ__head__ |
.= | LL|LA|AL | LL : element-wise equivalenceLA : element-wise equivalenceAL : element-wise equivalence | љ |
.> | SS|LN|CC|SN|NN | SS : lesser ofLN : tail / pad 0CC : lesser ofSN : tail / pad ’ ’NN : lesser of | ȕ__tail__ |
.? | AAA | AAA : if A1 then A2, else A3. If A2/A3 are blocks, execute | љ |
.@ | ..AN | ..AN : moves the Nth item on the stack (not including N) to the top | љ |
.A | ..A | ..A : wrap entire stack in a list | љ |
.B | AL | AL : append item to the back of a list | љ |
.C | LB|NN | LB : sort least to greatest by applying B to LNN : xor | љ |
.D | A | A : throw an exception containing A | љ |
.E | L | L : length, keep list on stack | ȕ__len__ |
.F | L | L : flatten nested list | љ |
.G | ASN | ASN : write A as a string to file located at S. N = 0, overwrite. N = 1, append | љ |
.I | LNA|DSA|DJA | LNA : getindex with default valueDSA : getindex with default valueDJA : getindex with default value | ȕ__getindex__ |
.K | BB | BB : try B1, if error, execute B2. Neither block has access to the global stack | љ |
.M | A | A : get metatable | љ |
.N | LB | LB : return the index of the first element of L that satifies E; keep list on stack | љ |
.P | A | A : print to stdout | љ |
.Q | - |
| љ |
.R | N | N : range [0, 1, .., N-1] | љ |
.T | L | L : transpose a 2d list | љ |
.U | S | S : requests a string using a ui dialog, S is the prompt text | љ |
.V | AL | AL : append item to back of list | љ |
.\ | N | N : floor | ȕ__floor__ |
.^ | N | N : square root | ȕ__sqrt__ |
.| | B|N | B : get meta information for a blockN : absolute value | ȕ__abs__ |
.~ | B|J|S|C|D | B : get contents of blockJ : deref variable; if not a block, put contents in blockS : parse contents to a blockC : parse contents to a blockD : set all variables | љ |
:! | AA | AA : assert equal | љ |
:# | D:#B|L:#B | D:#B : map over key value pairsL:#B : map | ȕ__each__ |
:$ | ..AN | ..AN : copies the first N items on the stack (not including N) | љ |
:% | S | S : interpolate string | љ |
:& | A | A : duplicate reference (same as $ but does not make a copy) | љ |
:' | S|N|C | S : convert a string to bytes using UTF-8 encodingN : identity; return NC : to int | љ |
:* | LLB | LLB : outer product of two lists using B | љ |
:; | ..AA | ..AA : clear all but the top of the stack | љ |
:< | SS|CC|NN | SS : less then or equal toCC : less then or equal toNN : less then or equal to | ȕ__leq__ / __rleq__ |
:= | AS|AJ|AC | AS : assign A to variableAJ : assign A to variableAC : assign A to variable | љ |
:> | SS|CC|NN | SS : greater than or equal toCC : greater than or equal toNN : greater than or equal to | ȕ__geq__ / __rgeq__ |
:? | A | A : convert to boolean | љ |
:@ | AA | AA : isinstance | љ |
:A | ..AN | ..AN : collect N items from stack into list | љ |
:C | J|S | J : convert symbol to string nameS : return S | љ |
:D | ASD|AJD | ASD : set dict indexAJD : set dict index | љ |
:E | D | D : number or items in a dict | љ |
:G | : Return the variable scope stack as a list of dicts | љ | |
:I | DJ|DS | DJ : get dict item from keyDS : get dict item from key | љ |
:K | D | D : return a list of keys as symbols | љ |
:M | BD|DD | BD : duplicate block with the given metadataDD : set D1’s meta to D2 leave D1 on stack | љ |
:N | LA | LA : find all instances of A in L | љ |
:O | J | J : Aya meta information | љ |
:P | A | A : println to stdout | љ |
:R | - |
| љ |
:S | B|S|C | B : if block has single var or op convert to symbol list, else return empty listS : convert to symbolC : convert to symbol | љ |
:T | A | A : type of (returns a symbol) | љ |
:V | D | D : return a list of values | љ |
:Z | N | N : sleep (milliseconds) | љ |
:` | BN:`A | BN:`A : wrap next N instructions in a block | љ |
:| | LL | LL : remove all elements in L2 from L1 | љ |
:~ | L | L : remove duplicates | љ |
M! | N | N : factorial | ȕ__fact__ |
M# | A | A : hash code of the object | љ |
M$ | - |
| љ |
M? | B|N|S | B : get help data for operatorN : list op descriptions where N=[0:std, 1:dot, 2:colon, 3:misc]S : search all help data | љ |
MC | N | N : inverse cosine | ȕ__acos__ |
MI | NN | NN : create complex number | љ |
ML | N | N : base-10 logarithm | ȕ__log__ |
MS | N | N : inverse sine | ȕ__asin__ |
MT | N | N : inverse tangent | ȕ__atan__ |
Mc | N | N : cosine | ȕ__cos__ |
Md | N|S | N : cast to doubleS : parse double, if invalid, return 0.0 | ȕ__float__ |
Me | N | N : exponential function | ȕ__exp__ |
Mi | N | N : imag part of complex number | ȕ__imag__ |
Mk | CS | CS : add special character | љ |
Ml | N | N : natural logarithm | ȕ__ln__ |
Mm | D | D : true if the dict has a metatable, leave D on stack | љ |
Mp | N | N : list primes up to N | љ |
Mr | N | N : convert to fractional number | љ |
Ms | N | N : sine | ȕ__sin__ |
Mt | N | N : tangent | ȕ__tan__ |
Mu | NN | NN : y x Mu => atan2(y,x) | љ |