From csardi.gabor at gmail.com  Sat Mar  4 18:41:18 2017
From: csardi.gabor at gmail.com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Sat, 4 Mar 2017 17:41:18 +0000
Subject: [Rd] can we override "if" in R?
In-Reply-To: <CAFLer83hbY+3QEfoukAmt4Hy77P5=NyW3a+pyigV0CJVjzjYdA@mail.gmail.com>
References: <CAFLer83hbY+3QEfoukAmt4Hy77P5=NyW3a+pyigV0CJVjzjYdA@mail.gmail.com>
Message-ID: <CABtg=KkmsPVZc0Y-Rru5+DkzLHabrkVDOZWcip5jhYHD-D4HZg@mail.gmail.com>

You can. Perhaps needless to say, be careful with this.

? `if` <- function(...) FALSE
? if (TRUE) TRUE else FALSE
[1] FALSE

G.

On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng <zhengda1936 at gmail.com> wrote:
> Hello,
>
> I heard we can override almost everything in R. Is it possible to
> override "if" keyword in R to evaluate my own object instead of a
> logical value?
>
> Thanks,
> Da
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] can we override "if" in R?
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=