I am trying to understand how passing function outputs between modules work and I would like to know if my reasoning is correct.
Let’s assume we have the following modules:
module M1 function foo() a = [1,2,3] end end module M2 import ..M1 function bar(x) b = x.+1 end # 1. aux = M1.foo() c = bar(aux) # 2. c = bar(M1.foo()) end
Does this mean that “aux” (which is global variable in M2) will impact performance of function “bar” in approach # 1.?
What if we use approach # 2. ?