Constructor and Description |
---|
Lam5() |
Modifier and Type | Method and Description |
---|---|
Lam4 |
apply(Lazy<FV> arg1)
Apply this function to an argument.
|
Unknown<FV> |
apply(Lazy<FV> arg1,
Lazy<FV> arg2,
Lazy<FV> arg3,
Lazy<FV> arg4,
Lazy<FV> arg5)
Apply this function to all its arguments at once.
|
abstract Lazy<FV> |
eval(Lazy<FV> arg5,
Lazy<FV> arg4,
Lazy<FV> arg3,
Lazy<FV> arg2,
Lazy<FV> arg1)
Run the function.
|
public final Lam4 apply(Lazy<FV> arg1)
Apply this function to an argument.
This method creates an instance of Lam4
that collects the
remaining arguments and, when evaluated, invokes the eval(frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>)
method of this
class.
public final Unknown<FV> apply(Lazy<FV> arg1, Lazy<FV> arg2, Lazy<FV> arg3, Lazy<FV> arg4, Lazy<FV> arg5)
Apply this function to all its arguments at once.
This method creates an instance of Unknown
that,
when evaluated, invokes the eval(frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>)
method of this
function.
public abstract Lazy<FV> eval(Lazy<FV> arg5, Lazy<FV> arg4, Lazy<FV> arg3, Lazy<FV> arg2, Lazy<FV> arg1)
Run the function.
The run method will be called by the Lam4.eval(frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>, frege.rt.Lazy<frege.rt.FV>)
method
of the lambda object resulting from this.apply(...).
It actually performs computation and
returns a result or another lazy value that will evaluate to the result.
This method must be implemented by all subclasses.
Note that the arguments must be passed in reverse order. The reason is that in this way the byte code for any intermediate closure will only have to push its argument and invoke the next higher closure's eval method. A reordering of the arguments on the stack will not be needed. This could save a substantial amounts of memory writes (I hope).