Class JavaFunction<T>
java.lang.Object
team.unnamed.mocha.runtime.binding.JavaFunction<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface team.unnamed.mocha.runtime.value.Function
Function.Argument, Function.Arguments -
Method Summary
Modifier and TypeMethodDescription@Nullable Valueevaluate(@NotNull ExecutionContext<T> context, @NotNull Function.Arguments arguments) Executes this function with the given arguments.@Nullable Methodmethod()@Nullable Objectobject()booleanpure()Determines if this function is pure or not.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface team.unnamed.mocha.runtime.value.Value
getAsBoolean, getAsNumber, getAsString, isString
-
Method Details
-
object
-
method
-
evaluate
@Nullable public @Nullable Value evaluate(@NotNull @NotNull ExecutionContext<T> context, @NotNull @NotNull Function.Arguments arguments) Description copied from interface:FunctionExecutes this function with the given arguments. -
pure
public boolean pure()Description copied from interface:FunctionDetermines if this function is pure or not.A pure function is a function that has the following properties:
- The function return values are identical for identical arguments, and
- The function has no side effects
The compiler or interpreter may pre-evaluate these functions ahead of time. In case of compiling, the function may be called during compile time, to use the function's result instead.
-