Infix form of makeActiveBinding which creates an active binding between a name and an expression: every time the name is accessed the expression is recomputed.

x %<a-% value

Arguments

x

unquoted expression naming variable to create

value

unquoted expression to evaluate every time name is accessed

Examples

x %<a-% runif(1)
x
#> [1] 0.6007609
x
#> [1] 0.1572084
x %<a-% runif(10)
x
#>  [1] 0.007399441 0.466393497 0.497777389 0.289767245 0.732881987 0.772521511
#>  [7] 0.874600661 0.174940627 0.034241333 0.320385731
x
#>  [1] 0.40232824 0.19566983 0.40353812 0.06366146 0.38870131 0.97554784
#>  [7] 0.28989230 0.67838043 0.73531960 0.19595673
rm(x)