Interface LoxCallable

All Known Implementing Classes:
LoxFunction

public interface LoxCallable
Represents a native or user-defined value that CalcLox can invoke.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the required argument count.
    call(Interpreter interpreter, List<Object> arguments)
    Invokes the callable with already evaluated arguments.
  • Method Details

    • arity

      int arity()
      Returns the required argument count.
      Returns:
      the exact number of arguments accepted by this callable
    • call

      Object call(Interpreter interpreter, List<Object> arguments)
      Invokes the callable with already evaluated arguments.
      Parameters:
      interpreter - active interpreter
      arguments - argument values in source order
      Returns:
      the call result, or null for CalcLox nil