The R Project SVN R

Rev

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

Rev 14425 Rev 15783
Line 267... Line 267...
267
/* Length of Primitive Objects */
267
/* Length of Primitive Objects */
268
 
268
 
269
SEXP do_length(SEXP call, SEXP op, SEXP args, SEXP rho)
269
SEXP do_length(SEXP call, SEXP op, SEXP args, SEXP rho)
270
{
270
{
271
    SEXP ans;
271
    SEXP ans;
-
 
272
 
272
    if (length(args) != 1)
273
    if (length(args) != 1)
273
	error("incorrect number of args to length");
274
	error("incorrect number of args to length");
-
 
275
 
-
 
276
    if( isObject(CAR(args)) && DispatchOrEval(call, "length", args,
-
 
277
					      rho, &ans, 0, 1)) 
-
 
278
      return(ans);
-
 
279
	
274
    ans = allocVector(INTSXP, 1);
280
    ans = allocVector(INTSXP, 1);
275
    INTEGER(ans)[0] = length(CAR(args));
281
    INTEGER(ans)[0] = length(CAR(args));
276
    return ans;
282
    return ans;
277
}
283
}
278
 
284