The R Project SVN R

Rev

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

Rev 46140 Rev 47460
Line 780... Line 780...
780
    /* Build and attach the names attribute for the returned object. */
780
    /* Build and attach the names attribute for the returned object. */
781
 
781
 
782
    if (data.ans_nnames && data.ans_length > 0) {
782
    if (data.ans_nnames && data.ans_length > 0) {
783
	PROTECT(data.ans_names = allocVector(STRSXP, data.ans_length));
783
	PROTECT(data.ans_names = allocVector(STRSXP, data.ans_length));
784
	data.ans_nnames = 0;
784
	data.ans_nnames = 0;
785
#ifdef EXPT
-
 
786
	if (!recurse) {
-
 
787
#endif
-
 
788
	    while (args != R_NilValue) {
785
	while (args != R_NilValue) {
789
		nameData.seqno = 0;
-
 
790
		nameData.firstpos = 0;
-
 
791
		nameData.count = 0;
-
 
792
		NewExtractNames(CAR(args), R_NilValue, TAG(args), recurse, &data, &nameData);
-
 
793
		args = CDR(args);
-
 
794
	    }
-
 
795
#ifdef EXPT
-
 
796
	}
-
 
797
	else {
-
 
798
	    nameData.seqno = 0;
786
	    nameData.seqno = 0;
799
	    nameData.firstpos = 0;
787
	    nameData.firstpos = 0;
800
	    nameData.count = 0;
788
	    nameData.count = 0;
801
	    NewExtractNames(args, R_NilValue, TAG(args), recurse);
789
	    NewExtractNames(CAR(args), R_NilValue, TAG(args), recurse, &data, &nameData);
-
 
790
	    args = CDR(args);
802
	}
791
	}
803
#endif/*EXPT*/
-
 
804
	setAttrib(ans, R_NamesSymbol, data.ans_names);
792
	setAttrib(ans, R_NamesSymbol, data.ans_names);
805
	UNPROTECT(1);
793
	UNPROTECT(1);
806
    }
794
    }
807
    UNPROTECT(2);
795
    UNPROTECT(2);
808
    R_FreeStringBufferL(&cbuff);
796
    R_FreeStringBufferL(&cbuff);
Line 954... Line 942...
954
    R_FreeStringBufferL(&cbuff);
942
    R_FreeStringBufferL(&cbuff);
955
    return ans;
943
    return ans;
956
} /* do_unlist */
944
} /* do_unlist */
957
 
945
 
958
 
946
 
959
#ifdef UNUSED
-
 
960
#define LNAMBUF 100
-
 
961
 
-
 
962
SEXP FetchMethod(char *generic, char *classname, SEXP env)
-
 
963
{
-
 
964
    char buf[LNAMBUF];
-
 
965
    SEXP method;
-
 
966
    if (strlen(generic) + strlen(classname) + 2 > LNAMBUF)
-
 
967
	error(_("class name too long in '%s'"), generic);
-
 
968
    sprintf(buf, "%s.%s", generic, classname);
-
 
969
    method = findVar(install(buf), env);
-
 
970
    if (TYPEOF(method)==PROMSXP)
-
 
971
	method = eval(method, env);
-
 
972
    if (TYPEOF(method) != CLOSXP)
-
 
973
	method = R_NilValue;
-
 
974
    return method;
-
 
975
}
-
 
976
#endif
-
 
977
 
-
 
978
/* cbind(deparse.level, ...) and rbind(deparse.level, ...) : */
947
/* cbind(deparse.level, ...) and rbind(deparse.level, ...) : */
979
SEXP attribute_hidden do_bind(SEXP call, SEXP op, SEXP args, SEXP env)
948
SEXP attribute_hidden do_bind(SEXP call, SEXP op, SEXP args, SEXP env)
980
{
949
{
981
    SEXP a, t, obj, classlist, classname, method, classmethod, rho;
950
    SEXP a, t, obj, classlist, classname, method, classmethod, rho;
982
    const char *generic;
951
    const char *generic;
Line 1063... Line 1032...
1063
    }
1032
    }
1064
 
1033
 
1065
    /* Dispatch based on class membership has failed. */
1034
    /* Dispatch based on class membership has failed. */
1066
    /* The default code for rbind/cbind.default follows */
1035
    /* The default code for rbind/cbind.default follows */
1067
    /* First, extract the evaluated arguments. */
1036
    /* First, extract the evaluated arguments. */
1068
#ifdef OLD
-
 
1069
    for (a = args; a != R_NilValue; a = CDR(a))
-
 
1070
	CAR(a) = PRVALUE(CAR(a));
-
 
1071
#endif
-
 
1072
 
1037
 
1073
    rho = env;
1038
    rho = env;
1074
    data.ans_flags = 0;
1039
    data.ans_flags = 0;
1075
    data.ans_length = 0;
1040
    data.ans_length = 0;
1076
    data.ans_nnames = 0;
1041
    data.ans_nnames = 0;