view interps/lambda/README @ 12500:e48c08805365 draft default tip

<b_jonas> ` learn \'The password of the month is Cthulhuquagdonic Mothraquagdonic Narwhalicorn.\' # https://logs.esolangs.org/libera-esolangs/2024-04.html#lKE Infinite craft
author HackEso <hackeso@esolangs.org>
date Wed, 01 May 2024 06:39:10 +0000
parents 859f9b4339e6
children
line wrap: on
line source

Lambda calculus interpreter
(c) Nikita Ayzikovsky, 2006

Usage:

run lambda.py, which reads a single-line lambda calculus program from stdin.

Syntax:

A program can optionally contain any number of definitions, followed by
an expression.

Definitions are of the form

  name = expression ;

Expressions are standard lambda calculus expressions, with the symbol lambda
denoted by \. E.g.

  \x,y,z.(x (z y))

Don't forget to surround with brackets anything that ought to be surrounded
with brackets (any lambda body where something gets applied to something else)
"\x,y.x y" is an application of \x,y.x to y; but  "\x,y.(x y)" is a single function
of two variables.

IO:

Input is not implemented.
For output, an expression of the form "text", when evaluated, prints 'text'
and evaluates to the identity function.
#show is a special function that evaluates its argument, and prints out
the result before returning it.
#list is a special expression that, when evaluated, prints the list of all
definitions.


DEFINITIONS:

Definitions ('name = exp;') are persistent between program runs. To get
rid of all definitions, remove the file defs.pickle.