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));