Esempio n. 1
0
  @Override
  public SEXP apply(Context callingContext, Environment rho, FunctionCall call, PairList args) {

    Context functionContext = callingContext.beginFunction(call, this, args);
    Environment functionEnvironment = functionContext.getEnvironment();

    ClosureDispatcher.matchArgumentsInto(getFormals(), args, functionContext, functionEnvironment);

    if (Context.PRINT_IR) {
      System.out.println(function.getScope());
    }

    SEXP result = function.getScope().evaluate(functionContext);
    functionContext.exit();

    return result;
  }
Esempio n. 2
0
 public IRClosure(Environment environment, IRFunction function) {
   super(environment, function.getFormals(), function.getBody());
   this.function = function;
 }