>> 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/ ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel