From h.wickham at gmail.com  Fri Dec 13 14:59:24 2013
From: h.wickham at gmail.com (Hadley Wickham)
Date: Fri, 13 Dec 2013 07:59:24 -0600
Subject: [Rd] Status of reserved keywords and builtins
In-Reply-To: <CALLn38MY7tqe=fMCJf9qk5Y3itoniFSZKgN14cDBZoqZcUuYiA@mail.gmail.com>
References: <CALLn38MY7tqe=fMCJf9qk5Y3itoniFSZKgN14cDBZoqZcUuYiA@mail.gmail.com>
Message-ID: <CABdHhvHiNSXcAvJAJwnUqEV=qcdkpr0FLcb9uMwz6CUNhcuz=g@mail.gmail.com>

>> It would have those benefits, but it would be harder to prototype
>> changes by actually replacing the `if` function.  Implementations that
>> want to optimize the calls have other ways to do it, e.g. the sorts of
>> things the compiler does.
>>
>
> Does anyone actually prototype changes to the `if` function?

I do - in the dplyr package (https://github.com/hadley/dplyr), I
construct environments where many of the most common R functions are
replaced by alternates that return SQL strings. This makes it possible
to use R's parser, while translating output into another language. I
think it's a pretty elegant approach that's facilitated by lexical
scoping and first-class environments, but it's an admittedly rare
case.

Hadley

-- 
http://had.co.nz/



[Rd] Status of reserved keywords and builtins
Hadley Wickham