Displaying 1 result from an estimated 1 matches for "switchlist".
Did you mean:
switchinst
2009 Dec 10
1
switch() called with just the EXPR argument causes R to hang (PR#14124)
...**********************************
SEXP attribute_hidden do_switch(SEXP call, SEXP op, SEXP args, SEXP rho)
{
int argval;
SEXP x, y, w;
x = eval(CAR(args), rho);
if (!isVector(x) || length(x) != 1)
error(_("switch: EXPR must return a length 1 vector"));
PROTECT(w = switchList(CDR(args), rho));
if (isString(x)) {
for (y = w; y != R_NilValue; y = CDR(y))
if (TAG(y) != R_NilValue && pmatch(STRING_ELT(x, 0), TAG(y), 1)) {
while (CAR(y) == R_MissingArg && y != R_NilValue)
y = CDR(y);
UNPROTECT(1);
return (ev...