![]() | ![]() | ![]() | Functions - Abstraction and application | Documentation and user's manual | Table of contents | OCaml programs |
Consider the following code.
First three values:
Then the same values expressed using local definitions:
Now the abstraction step:
Finally the application step (three times):
|
Now consider this code.
First three values:
Then the same values expressed using local definitions:
Now the abstraction step:
Finally the application step (three times):
|
In both cases, there is first an abstraction step from three expressions.
Then in both cases there is (three times) an application step. An application step consists of applying the (functional) value of the expression f to arguments that correspond to what is particular in the initial expression considered. This results in obtaining the value of this initial expression.
|
Clearly both cases are similar, though the initial values are functional in the second one, which gives a higher-order function. |
![]() | ![]() | ![]() | Functions - Abstraction and application | Documentation and user's manual | Table of contents | OCaml programs |