Jump to content

Higher-order functions: Difference between revisions

Line 1,775:
\\ we sent a copy of lambda, and any value type closure copied too
Print Bar(Foo, 20)=407
Print BarBar1(&Foo(), 20)=407
\\ we can get a copy of Foo to NewFoo (also we get a copy of closure too)
</lang>
NewFoo=Foo
Print Bar1(&Foo(), 20)=409
Print Bar2(&Foo, 20)=411
Print Bar2(&NewFoo, 20)=409
 
</lang>
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.