The R Project SVN R

Rev

Rev 45667 | Rev 47460 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 45667 Rev 46128
Line 760... Line 760...
760
	setAttrib(CAR(args), R_ClassSymbol, R_NilValue);
760
	setAttrib(CAR(args), R_ClassSymbol, R_NilValue);
761
    }
761
    }
762
    return CAR(args);
762
    return CAR(args);
763
}
763
}
764
 
764
 
-
 
765
static SEXP s_S4inherits;
-
 
766
static SEXP do_S4inherits(SEXP obj, SEXP what, SEXP which) {
-
 
767
    SEXP e, val;
-
 
768
    if(!s_S4inherits)
-
 
769
      s_S4inherits = install(".S4inherits");
-
 
770
    PROTECT(e = allocVector(LANGSXP, 4));
-
 
771
    SETCAR(e, s_S4inherits);
-
 
772
    val = CDR(e);
-
 
773
    SETCAR(val, obj);
-
 
774
    val = CDR(val);
-
 
775
    SETCAR(val, what);
-
 
776
    val = CDR(val);
-
 
777
    SETCAR(val, which);
-
 
778
    val = eval(e, R_MethodsNamespace);
-
 
779
    UNPROTECT(1);
-
 
780
    return val;
-
 
781
}
-
 
782
 
-
 
783
 
765
SEXP attribute_hidden do_inherits(SEXP call, SEXP op, SEXP args, SEXP env)
784
SEXP attribute_hidden do_inherits(SEXP call, SEXP op, SEXP args, SEXP env)
766
{
785
{
767
    SEXP x, klass, what, which, rval = R_NilValue /* -Wall */;
786
    SEXP x, klass, what, which, rval = R_NilValue /* -Wall */;
768
    int i, j, nwhat, isvec, nclass;
787
    int i, j, nwhat, isvec, nclass;
769
 
788
 
770
    checkArity(op, args);
789
    checkArity(op, args);
771
 
790
 
772
    x = CAR(args);
791
    x = CAR(args);
-
 
792
    if(IS_S4_OBJECT(x))
-
 
793
        return do_S4inherits(x, CADR(args), CADDR(args));
773
    klass = R_data_class(x, FALSE);
794
    klass = R_data_class(x, FALSE);
774
    nclass = length(klass);
795
    nclass = length(klass);
775
 
796
 
776
    what = CADR(args);
797
    what = CADR(args);
777
    if(!isString(what))
798
    if(!isString(what))