Hi Stephen,
the release version of inline-r on Hackage should work fine.
It seems that you're running into issues on the `master` branch, i.e. the bleeding edge of development. We're in the process of changing slightly how quasiquotes behave. While in the past all quasiquotes would run in the global environment, we now have them run in their own local child environment of the parent environment. As a result, where you could previously do
ghci> [r| f <- function(x) x + 1 |]
ghci> [r| f(1) |]
using the current inline-r master branch you should now do
ghci> [r| f <<- function(x) x + 1 |]
ghci> [r| f(1) |]
That is, use the <<- operator rather than the <- operator.
The reasons for this change are:
* it makes the semantics for quasiquotations easier to understand: [r| c(x_hs, y_hs, z_hs) |] is syntactic sugar for applying the following R function:
function(x, y, z) c(x, y, z)
* to our knowlegde there is no reliable way in R to unset bindings in the global environment. Meaning that we could have added a binding to the global environment for each antiquotation variable instead but then it becomes hard to remove these bindings after executing the code of each antiquotaton.
* The <- operator shadows bindings from the base library without warning. This means that the referential transparency of pure quasiquotes can be compromised: you could add a new binding for "+" and then any quasiquote that happens to run after you do that rather than before would now return a different result.
* The <<- operator on the other hand refuses to rebind any "locked" binding (i.e. pretty much all bindings that are part of same package, be it on CRAN or in the standard library). So you can't accidentally change the meaning of an R expression.