The R Project SVN R

Rev

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

Rev 46128 Rev 47460
Line 943... Line 943...
943
    UNPROTECT(1);
943
    UNPROTECT(1);
944
    return value;
944
    return value;
945
}
945
}
946
 
946
 
947
 
947
 
948
#ifdef UNUSED
-
 
949
static void load_methods_package()
-
 
950
{
-
 
951
    SEXP e;
-
 
952
    R_set_standardGeneric_ptr(dispatchNonGeneric, NULL);
-
 
953
    PROTECT(e = allocVector(LANGSXP, 2));
-
 
954
    SETCAR(e, install("library"));
-
 
955
    SETCAR(CDR(e), install("methods"));
-
 
956
    eval(e, R_GlobalEnv);
-
 
957
    UNPROTECT(1);
-
 
958
}
-
 
959
#endif
-
 
960
 
-
 
961
static SEXP get_this_generic(SEXP args);
948
static SEXP get_this_generic(SEXP args);
962
 
949
 
963
SEXP attribute_hidden do_standardGeneric(SEXP call, SEXP op, SEXP args, SEXP env)
950
SEXP attribute_hidden do_standardGeneric(SEXP call, SEXP op, SEXP args, SEXP env)
964
{
951
{
965
    SEXP arg, value, fdef; R_stdGen_ptr_t ptr = R_get_standardGeneric_ptr();
952
    SEXP arg, value, fdef; R_stdGen_ptr_t ptr = R_get_standardGeneric_ptr();
Line 1349... Line 1336...
1349
	SET_S4_OBJECT(value);
1336
	SET_S4_OBJECT(value);
1350
    }
1337
    }
1351
    return value;
1338
    return value;
1352
}
1339
}
1353
 
1340
 
1354
#ifdef UNUSED
-
 
1355
Rboolean R_seemsS4Object(SEXP object)
-
 
1356
{
-
 
1357
    static SEXP R_packageSymbol = NULL;
-
 
1358
    SEXP klass;
-
 
1359
    if(!isObject(object))
-
 
1360
	return FALSE;
-
 
1361
    if(TYPEOF(object) == S4SXP)
-
 
1362
	return TRUE;
-
 
1363
    if(!R_packageSymbol)
-
 
1364
	R_packageSymbol = install("package");
-
 
1365
    klass = getAttrib(object, R_ClassSymbol);
-
 
1366
    return (klass != R_NilValue &&
-
 
1367
	    getAttrib(klass, R_packageSymbol) != R_NilValue) ?
-
 
1368
	TRUE: FALSE;
-
 
1369
}
-
 
1370
#endif
-
 
1371
 
-
 
1372
Rboolean attribute_hidden R_seemsOldStyleS4Object(SEXP object)
1341
Rboolean attribute_hidden R_seemsOldStyleS4Object(SEXP object)
1373
{
1342
{
1374
    static SEXP R_packageSymbol = NULL;
1343
    static SEXP R_packageSymbol = NULL;
1375
    SEXP klass;
1344
    SEXP klass;
1376
    if(!isObject(object) || IS_S4_OBJECT(object)) return FALSE;
1345
    if(!isObject(object) || IS_S4_OBJECT(object)) return FALSE;