Here's an example to convert user input to a partial Stan code, allowing to unquote variables and expressions (Disclaimer: I'm not familiar with Stan at all, so I don't know how useful this is in actual ). I think tidy eval is particularly interesting when it's used in between some DSL (or other language) and R code.

```
library(rlang)
generate_stan_model_code <- function(x, y) {
quos <- enquos(x = x, y = y, .ignore_empty = "all")
labels <- paste(names(quos), "~", purrr::map_chr(quos, as_label))
labels <- paste0(" ", labels, ";", collapse = "\n")
glue::glue("
parameters {
real<lower=0,upper=1> x;
real<lower=0,upper=1> y;
}
model {
{{labels}}
}",
.open = "{{", .close = "}}"
)
}
generate_stan_model_code(beta(1, 1))
#> parameters {
#> real<lower=0,upper=1> x;
#> real<lower=0,upper=1> y;
#> }
#> model {
#> x ~ beta(1, 1);
#> }
generate_stan_model_code(beta(1, 1), normal(0, 100))
#> parameters {
#> real<lower=0,upper=1> x;
#> real<lower=0,upper=1> y;
#> }
#> model {
#> x ~ beta(1, 1);
#> y ~ normal(0, 100);
#> }
mu <- 0.1
generate_stan_model_code(normal(!!mu, 1), normal(!!mu, 100))
#> parameters {
#> real<lower=0,upper=1> x;
#> real<lower=0,upper=1> y;
#> }
#> model {
#> x ~ normal(0.1, 1);
#> y ~ normal(0.1, 100);
#> }
get_mu <- function() runif(1)
generate_stan_model_code(normal(!!get_mu(), 1), normal(!!get_mu(), 100))
#> parameters {
#> real<lower=0,upper=1> x;
#> real<lower=0,upper=1> y;
#> }
#> model {
#> x ~ normal(0.994106655474752, 1);
#> y ~ normal(0.661887304158881, 100);
#> }
```

^{Created on 2019-01-10 by the reprex package (v0.2.1)}