ALPL

From Esolang
Jump to navigation Jump to search

ALPL (A Lambda Programing Language) is an esoteric programming language that was invented by User:Kros.

Description

Combinators
=x (x is any character except whitespace characters or [.]`=?01.) Take one argument and store it in a variable named x. Return the argument.
? Take two arguments and one bit from input and return the first argument if the bit received was 1, else return the second argument.
0 Take one argument and return it, with the side effect of outputting a bit 0.
1 Like 0 but output bit 1 instead.
Commands
`xy Apply function x to parameter y.
[p.f] Define a function with parameters p that does f. (Every parameter name is one character long and is not whitespace or [.]`=?01.)

Examples

Print "Hi!"

````````````````````````001001000110100100100000[x.x]

Cat program

`[x.````?10xx][x.````?10xx]

Smaller version:

`=c[x.````?10xx]`cc

Hello World

`=H[x.````````01001000x]
`=e[x.````````01100101x]
`=l[x.````````01101100x]
`=o[x.````````01101111x]
`=_[x.````````00100000x]
`=W[x.````````01010111x]
`=r[x.````````01110010x]
`=d[x.````````01100100x]
`=![x.````````00100001x]
````````````Hello_World!_

Truth-machine

`=T[x.`````````00110001Tx]
`=m[x.````````00110000x]
``Tm?