Displaying 6 results from an estimated 6 matches for "env_bind".
2018 Feb 11
4
Parallel assignments and goto
...o variables so the expression uses the old variable values and not the new values until the assignments are all done ? and one related to restarting a loop from nested loops or from nested expressions in `with` expressions or similar.
I can implement parallel assignment using something like rlang::env_bind:
factorial_tr_2 <- function (n, acc = 1)
{
.tailr_env <- rlang::get_env()
repeat {
if (n <= 1)
return(acc)
else {
rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n)
next
}
}
}
This reduces the number of addition...
2018 Feb 11
0
Parallel assignments and goto
...s so the expression uses the old variable values and not the new values until the assignments are all done ? and one related to restarting a loop from nested loops or from nested expressions in `with` expressions or similar.
>
> I can implement parallel assignment using something like rlang::env_bind:
>
> factorial_tr_2 <- function (n, acc = 1)
> {
> .tailr_env <- rlang::get_env()
> repeat {
> if (n <= 1)
> return(acc)
> else {
> rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n)
> next
>...
2018 Feb 26
0
Parallel assignments and goto
...es so the expression uses the old variable values and not the new values until the assignments are all done ? and one related to restarting a loop from nested loops or from nested expressions in `with` expressions or similar.
>
> I can implement parallel assignment using something like rlang::env_bind:
>
> factorial_tr_2 <- function (n, acc = 1)
> {
> .tailr_env <- rlang::get_env()
> repeat {
> if (n <= 1)
> return(acc)
> else {
> rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n)
> next
> }
> }
> }
>
> This reduces the number of additiona...
2018 Feb 14
0
Parallel assignments and goto
...sion uses the old variable values and not
> the new values until the assignments are all done ? and one related to
> restarting a loop from nested loops or from nested expressions in `with`
> expressions or similar.
>
> I can implement parallel assignment using something like rlang::env_bind:
>
> factorial_tr_2 <- function (n, acc = 1) {
> .tailr_env <- rlang::get_env()
> repeat {
> if (n <= 1)
> return(acc)
> else {
> rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n)
> next
>...
2018 Feb 27
2
Parallel assignments and goto
...expression uses the old variable values and not the new values until the assignments are all done ? and one related to restarting a loop from nested loops or from nested expressions in `with` expressions or similar.
> >
> > I can implement parallel assignment using something like rlang::env_bind:
> >
> > factorial_tr_2 <- function (n, acc = 1)
> > {
> > .tailr_env <- rlang::get_env()
> > repeat {
> > if (n <= 1)
> > return(acc)
> > else {
> > rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n)
> > next
> > }
>...
2018 Feb 27
0
Parallel assignments and goto
...le
> values and not the new values until the assignments are all done ? and one
> related to restarting a loop from nested loops or from nested expressions
> in `with` expressions or similar.
> > >
> > > I can implement parallel assignment using something like
> rlang::env_bind:
> > >
> > > factorial_tr_2 <- function (n, acc = 1)
> > > {
> > > .tailr_env <- rlang::get_env()
> > > repeat {
> > > if (n <= 1)
> > > return(acc)
> > > else {
> > > rlang::env_bind(.tailr_env, n = n - 1, ac...