Skip to content

Operators

João Pedro Neto edited this page Nov 8, 2020 · 38 revisions

check notes below for table interpretation

Nulary Functions (Nilads)

Unary Functions (Monads)

Assuming a as top of stack

Fraction String (1 char) List
a+1 next char in codebase Map
a-1 prev char in codebase Map
! Factorial of a Factorial of cd(a) Map !

Binary Functions (Dyads)

Assuming b as top of stack, a below b

Frac×Frac Frac×Str Str×Frac Str×Str Frac×List List×Frac Str×List List×Str List×List
+ a+b u(a+c(b)) ibid. u(c(a)+c(b)) M + ibid. M + c(a) ibid. M + zip(a,b)

Notes:

  • c(char) is the value of char in the codebase

  • u(n) is the char with codebase n

  • unless stated, string operators consider a circular codebase; eg. i=(i+1)%256

  • Fraction x rounds to ⌊x⌋ when needed as int

  • Map op/M op means map operation op over elements of String/List (recursively with lists of lists)

  • unless stated, zip/zipWith cycle the smaller list

Clone this wiki locally