Package org.renjin.sexp

Examples of org.renjin.sexp.PairList


       dispatch is done. */
    int found = 1; /* we "know" the class attribute is there */

    found++; // we also have our fake __S4_BIt for renjin

    PairList attrib = def.getAttributes().asPairList();
    for(PairList.Node s : attrib.nodes()) {
      SEXP t = s.getTag();
      if(t == R_target) {
        ev.setVariable(R_dot_target, s.getValue());
        found++;
      }
      else if(t == R_defined) {
        ev.setVariable(R_dot_defined, s.getValue());
        found++;
      }
      else if(t == R_nextMethod)  {
        ev.setVariable(R_dot_nextMethod, s.getValue());
        found++;
      }
      else if(t == Symbols.SOURCE)  {
        /* ignore */ found++;
      }
    }
    ev.setVariable(R_dot_Method, def);

    /* this shouldn't be needed but check the generic being
       "loadMethod", which would produce a recursive loop */
    if(fname.equals("loadMethod")) {
      return def;
    }
    if(found < attrib.length()) {
      FunctionCall call = FunctionCall.newCall(R_loadMethod_name, def, StringArrayVector.valueOf(fname), ev);
      return context.evaluate(call, ev);

      //      SEXP e, val;
      //      PROTECT(e = allocVector(LANGSXP, 4));
View Full Code Here


    Environment callerenv = cptr.getCallingEnvironment(); /* or rho? */

    /* get the rest of the stuff we need from the current context,
       execute the method, and return the result */
    FunctionCall call = cptr.getCall();
    PairList arglist = cptr.getArguments();
    SEXP val = R_execClosure(context, call, op, arglist, callerenv, newrho);
    return val;
  }
View Full Code Here

    super("function");
  }

  @Override
  public SEXP apply(Context context, Environment rho, FunctionCall call, PairList args) {
    PairList formals = EvalException.checkedCast(call.getArgument(0));
    SEXP body = call.getArgument(1);
    SEXP source = call.getArgument(2);

    return new Closure(rho,formals, body);
  }
View Full Code Here

  @Override
  public Expression translateToExpression(IRBodyBuilder builder,
      TranslationContext context, FunctionCall call) {
  
    PairList formals = EvalException.checkedCast(call.getArgument(0));
    SEXP body = call.getArgument(1);
    SEXP source = call.getArgument(2);

    return new MakeClosure(builder.newFunction(formals, body));
  }
View Full Code Here

  // this is the old way of dispatching function calls
  @Override
  public SEXP apply(Context callingContext, Environment callingEnvironment,
      FunctionCall call, PairList args) {

    PairList promisedArgs = Calls.promiseArgs(args, callingContext, callingEnvironment);
   
    return matchAndApply(callingContext, callingEnvironment, call, promisedArgs);
  }
View Full Code Here

TOP

Related Classes of org.renjin.sexp.PairList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.