I have the following closure:
def func
def inner_func
list << 3 # how to append an element to the outer `list`?
end
list = []
inner_func
list
end
I am not sure how I can append something to list
from inner_func
, as the above attempt is wrong.