Josef Eschgfaeller on Fri, 10 Oct 2014 18:34:50 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Question about apply


I cannot understand the following behavior:
--------------------------------------------------
v=[1,2,3,4]

a=[]; b=[];
apply (x->a=concat(a,[x]),v);
print(a)

\\ [1, 2, 3, 4]

\\ Same within a function:
f (v) = {my (a,b);
a=[]; b=[];
apply (x->a=concat(a,[x]),v);
print(a)}

f(v)
\\ []
--------------------------------------------------
Thanks

Josef Eschgfaeller