User:Yayimhere/Primelist language

From Esolang
Jump to navigation Jump to search

Primelist(working title) is an esolang created by User:Yayimhere based on prime factors.

Lists

Lists are written like:

[a, b, c, d,...]

the elements may be numbers or other lists. Number operations act upon the sublists independently.

Operations

  • µf: applies the function f to each element in its input.
  • p: replaces each element in its input with their unique prime factors, going from lowest to highest.
  • `fx: apply f to x.
  • +: increment the first element of the list.
  • *: take the first element of the list and call it x. Multiple the next x elements of the list together.
  • {x -> y}: iff the elements of the input are all somewhere in x, return y, else return the input.
  • [f | g]: takes an input x. iff `fx ≠ x return `[f | g]`gx else return x.
  • #t: `#tx = #t, always.
  • #f: identity function.
  • ;: prepend the first input to the second.