RosettaCodeData/Task/Closures-Value-capture/Mathematica/closures-value-capture.math
2015-02-20 09:02:09 -05:00

5 lines
119 B
Text

Function[i, i^2 &] /@ Range@10
->{1^2 &, 2^2 &, 3^2 &, 4^2 &, 5^2 &, 6^2 &, 7^2 &, 8^2 &, 9^2 &, 10^2 &}
%[[2]][]
->4