Object oriented Lambda Calculus
Object-oriented Lambda Calculus is an esolang created by User:Joaozin003 which extends Lambda-calculus by adding classes.
Just like functions, classes are anonymous, but their members are referred to by name. To define a class, use
The body is a list of names and function definitions, in this format:
Functions can refer to a
this variable, which gets the object's instance.
All functions set a specific attribute. For example, if you want to use
foo to change the attribute
bar, you would do:
The return value is what
bar would get set to.
To access an attribute, put the attribute's name in single quotes after the instance. Example:
~(ival:\f.\x.x;succ(val):\f.\x.f (this'val' f x))'succ'
val attribute? If an instance gets evaluated by itself, it's as it did
ival is the initial value.