Index: src/library/base/R/seq.R =================================================================== --- src/library/base/R/seq.R (revision 53680) +++ src/library/base/R/seq.R (working copy) @@ -85,4 +85,6 @@ } ## In reverence to the very first versions of R which already had sequence(): -sequence <- function(nvec) unlist(lapply(nvec, seq_len)) +# sequence <- function(nvec) unlist(lapply(nvec, seq_len)) +sequence <- function(nvec) .Call( "sequence", as.integer(nvec), PACKAGE = "base" ) + Index: src/main/registration.c =================================================================== --- src/main/registration.c (revision 53680) +++ src/main/registration.c (working copy) @@ -245,6 +245,8 @@ CALLDEF(bitwiseOr, 2), CALLDEF(bitwiseXor, 2), + /* sequence */ + CALLDEF(sequence,1), {NULL, NULL, 0} }; Index: src/main/seq.c =================================================================== --- src/main/seq.c (revision 53680) +++ src/main/seq.c (working copy) @@ -679,3 +679,28 @@ return ans; } + +SEXP attribute_hidden sequence(SEXP x) +{ + R_len_t n = length(x), s = 0 ; + int *px = INTEGER(x) ; + int x_i ; + /* error checking */ + for( int i=0; i