I'm trying to understand the lazy evaluation example in Prof Hadley Wickham's Advanced R. Question has been asked about the adder
function example. My question is on the other example. Why the output to the following code is "a" "x"
? Why is there an "x"
there? If x
is only evaluated at line [3], how can it include itself?
[1] f <- function(x = ls()) {
[2] a <- 1
[3] x
[4] }
[5] f()