The R Project SVN R

Rev

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

Rev 24736 Rev 24845
Line 512... Line 512...
512
		error("repeated formal argument 'recursive'");
512
		error("repeated formal argument 'recursive'");
513
	    if ((v = asLogical(CAR(a))) != NA_INTEGER) {
513
	    if ((v = asLogical(CAR(a))) != NA_INTEGER) {
514
		*recurse = v;
514
		*recurse = v;
515
	    }
515
	    }
516
	    if (last == NULL)
516
	    if (last == NULL)
517
		last = ans = next;
517
		ans = next;
518
	    else
518
	    else
519
		SETCDR(last, next);
519
		SETCDR(last, next);
520
	}
520
	}
521
	else if (n != R_NilValue && pmatch(R_UseNamesSymbol, n, 1)) {
521
	else if (n != R_NilValue && pmatch(R_UseNamesSymbol, n, 1)) {
522
	    if (n_usenames++ == 1)
522
	    if (n_usenames++ == 1)
523
		error("repeated formal argument 'use.names'");
523
		error("repeated formal argument 'use.names'");
524
	    if ((v = asLogical(CAR(a))) != NA_INTEGER) {
524
	    if ((v = asLogical(CAR(a))) != NA_INTEGER) {
525
		*usenames = v;
525
		*usenames = v;
526
	    }
526
	    }
527
	    if (last == NULL)
527
	    if (last == NULL)
528
		last = ans = next;
528
		ans = next;
529
	    else
529
	    else
530
		SETCDR(last, next);
530
		SETCDR(last, next);
531
	}
531
	}
532
	else last = a;
532
	else last = a;
533
    }
533
    }
534
    return ans;
534
    return ans;
535
}
535
}
536
 
536
 
537
 
537
 
538
/* The change to lists based on dotted pairs has meant that it was */
538
/* The change to lists based on dotted pairs has meant that it was
539
/* necessary to separate the internal code for "c" and "unlist". */
539
   necessary to separate the internal code for "c" and "unlist".
540
/* Although the functions are quite similar, they operate on very */
540
   Although the functions are quite similar, they operate on very
541
/* different data structures. */
541
   different data structures.
-
 
542
*/
542
 
543
 
543
/* The major difference between the two functions is that the value of */
544
/* The major difference between the two functions is that the value of
544
/* the "recursive" argument is FALSE by default for "c" and TRUE for */
545
   the "recursive" argument is FALSE by default for "c" and TRUE for
545
/* "unlist".  In addition, "list" takes ... while "unlist" takes a single */
546
   "unlist".  In addition, "c" takes ... while "unlist" takes a single
546
/* argument, and unlist has two optional arguments, while list has none. */
547
   argument.
-
 
548
*/
547
 
549
 
548
SEXP do_c(SEXP call, SEXP op, SEXP args, SEXP env)
550
SEXP do_c(SEXP call, SEXP op, SEXP args, SEXP env)
549
{
551
{
550
    SEXP ans;
552
    SEXP ans;
551
 
553