Skip to content

Instantly share code, notes, and snippets.

@MilesMcBain
Created November 2, 2020 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MilesMcBain/e25723026cb81b7ea8347a9b53971206 to your computer and use it in GitHub Desktop.
Save MilesMcBain/e25723026cb81b7ea8347a9b53971206 to your computer and use it in GitHub Desktop.
praise_be.R
some_praise <- quote(praise::praise())
praise_fn_code <- bquote(function() {
.(some_praise)
})
print(praise_fn_code)
#> function() {
#> praise::praise()
#> }
praise_fn <- eval(praise_fn_code)
print(praise_fn)
#> function() {
#> .(some_praise)
#> }
rm("some_praise")
ls()
#> [1] "praise_fn" "praise_fn_code"
praise_fn()
#> [1] "You are primo!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment