The R Project SVN R

Rev

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

Rev 28349 Rev 28433
Line 323... Line 323...
323
/* Length of Primitive Objects */
323
/* Length of Primitive Objects */
324
 
324
 
325
SEXP do_length(SEXP call, SEXP op, SEXP args, SEXP rho)
325
SEXP do_length(SEXP call, SEXP op, SEXP args, SEXP rho)
326
{
326
{
327
    SEXP ans;
327
    SEXP ans;
-
 
328
    R_len_t len;
328
 
329
 
329
    if (length(args) != 1)
330
    if (length(args) != 1)
330
	error("incorrect number of args to length");
331
	error("incorrect number of args to length");
331
 
332
 
332
    if( isObject(CAR(args)) && DispatchOrEval(call, op, "length", args,
333
    if( isObject(CAR(args)) && DispatchOrEval(call, op, "length", args,
333
					      rho, &ans, 0, 1))
334
					      rho, &ans, 0, 1))
334
      return(ans);
335
      return(ans);
335
 
336
 
336
    ans = allocVector(INTSXP, 1);
337
    ans = allocVector(INTSXP, 1);
337
    INTEGER(ans)[0] = length(CAR(args));
338
    len = length(CAR(args));
-
 
339
    INTEGER(ans)[0] = (len < INT_MAX) ? len : NA_INTEGER;
338
    return ans;
340
    return ans;
339
}
341
}
340
 
342
 
341
 
343
 
342
SEXP do_rowscols(SEXP call, SEXP op, SEXP args, SEXP rho)
344
SEXP do_rowscols(SEXP call, SEXP op, SEXP args, SEXP rho)