![]() |
YAP 7.1.0
|
This library provides lambda expressions to simplify higher order programming based on call/N.
This library provides lambda expressions to simplify higher order programming based on call/N.
Lambda expressions are represented by ordinary Prolog terms There are two kinds of lambda expressions:
The second is a shorthand for t+\X1^X2^..^XN^Goal
All other variables of Goal are considered local variables They must not appear outside the lambda expression This restriction is currently not checked Violations may lead to unexpected bindings
In the following example the parentheses around X>3 are necessary
In the following X is a variable that is shared by both instances of the lambda expression The second query illustrates the cooperation of continuations and lambdas The lambda expression is in this case a continuation expecting a further argument
The following queries are all equivalent To see this, use the fact f(x,y)
Further discussions http://www.complang.tuwien.ac.at/ulrich/Prolog-inedit/ISO-Hiord