The R Project SVN R

Rev

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

Rev 75446 Rev 75532
Line 276... Line 276...
276
	error(_("'%s' operator requires 2 arguments"),
276
	error(_("'%s' operator requires 2 arguments"),
277
	      PRIMVAL(op) == 1 ? "&&" : "||");
277
	      PRIMVAL(op) == 1 ? "&&" : "||");
278
 
278
 
279
    s1 = CAR(args);
279
    s1 = CAR(args);
280
    s2 = CADR(args);
280
    s2 = CADR(args);
281
    s1 = eval(s1, env);
281
    PROTECT(s1 = eval(s1, env));
282
    if (!isNumber(s1))
282
    if (!isNumber(s1))
283
	errorcall(call, _("invalid 'x' type in 'x %s y'"),
283
	errorcall(call, _("invalid 'x' type in 'x %s y'"),
284
		  PRIMVAL(op) == 1 ? "&&" : "||");
284
		  PRIMVAL(op) == 1 ? "&&" : "||");
285
 
285
 
286
    x1 = asLogical2(s1, /*checking*/ 1, call, env);
286
    x1 = asLogical2(s1, /*checking*/ 1, call, env);
-
 
287
    UNPROTECT(1); /* s1 */
287
 
288
 
288
#define get_2nd							\
289
#define get_2nd							\
289
	s2 = eval(s2, env);					\
290
	PROTECT(s2 = eval(s2, env));				\
290
	if (!isNumber(s2))					\
291
	if (!isNumber(s2))					\
291
	    errorcall(call, _("invalid 'y' type in 'x %s y'"),	\
292
	    errorcall(call, _("invalid 'y' type in 'x %s y'"),	\
292
		      PRIMVAL(op) == 1 ? "&&" : "||");		\
293
		      PRIMVAL(op) == 1 ? "&&" : "||");		\
293
	x2 = asLogical2(s2, 1, call, env);
294
	x2 = asLogical2(s2, 1, call, env);			\
-
 
295
	UNPROTECT(1); /* s2 */
294
 
296
 
295
    switch (PRIMVAL(op)) {
297
    switch (PRIMVAL(op)) {
296
    case 1: /* && */
298
    case 1: /* && */
297
	if (x1 == FALSE)
299
	if (x1 == FALSE)
298
	    ans = FALSE;
300
	    ans = FALSE;