Interface InlineCommand

All Superinterfaces:
Command

public interface InlineCommand extends Command
Simple subtype of Command that can be executed and produce a result immediately (without child stack frames or making calls).
  • Method Details

    • process

      List<Value> process(Env context, Namespace namespace, List<Value> args) throws Exception
      Execute the command with the given environment, namespace and arguments.
      Parameters:
      context - current environment
      namespace - current namespace
      args - arguments
      Returns:
      result
      Throws:
      Exception - on error
    • createStackFrame

      default InlineCommand.InlineStackFrame createStackFrame(Namespace namespace, List<Value> args) throws Exception
      Create a StackFrame to execute the command with the provided Namespace and arguments.

      The default implementation of this method returns an InlineCommand.InlineStackFrame with this command, and provided namespace and arguments. Implementations can override to further validate the context or delegate to another command.

      Specified by:
      createStackFrame in interface Command
      Parameters:
      namespace - current namespace
      args - arguments
      Returns:
      stack frame to execute command with provided arguments
      Throws:
      Exception - if stack frame cannot be created