Λάμβδα

From Esolang
Jump to navigation Jump to search

λάμβδα is a version of Lambda calculus, but written with Greek letters. Any Greek letter that's not reserved can be used, and case does make a difference. Any non Greek character will cause a syntax error.

Characters
Character Equivalent to Function
λ λ or \ Defines a function.
σ/ς Space Applies the function to the right to the function to the left.
Φ ( Beginning delimiter.
φ ) End delimiter.
Σ . Delimit the argument of a function.
π none Function that prints a raw expression (returns its argument).
Π none Function that prints a Church numeral as a number (returns its argument).

Examples

Do 2+2, then print the result as both a raw expression and a number.

ΠΦπΦΦλμΣλνΣλξΣλγΣμςξςΦνςξςγφφςΦλξΣλγΣξςΦξςγφφςΦλξΣλγΣξςΦξςγφφφφ

Function that returns the first element of a church pair.

λαΣαςΦλβΣλγΣβφ