view interps/lambda/README @ 7408:4315d5bac235

<b_jonas> slashlearn Ravnica/Ravnica: City of Guilds is a city of guilds. \xe2\x80\x9cCity of Guilds\xe2\x80\x9d is part of its name. The Wizards of the Coast Marketing Department: We Sell Anything thought players might not notice it was a City of Guilds unless they put the tagline into the name.
author HackBot
date Sun, 17 Apr 2016 19:29:52 +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.