Hi,
my function F is a complex function and in some cases I need to redefine it while keeping its old functionality. I would like to keep a copy of F before changing it. So far, I did not find a way to do this in JSL. Here is a small example, what I am trying to do. What is the correct way to really copy a function and not just link it?
Thanks!
F = Function( {x,y}, x+y ); // actually much more complex
Show(F(1,2)); // 3
// G = F; // Error, JMP complains about missing parameters
G = Function( {x,y}, F(x,y));
Show(G(1,2)); // 3
F = Function( {x,y}, x*y ); // Changes G, too.
Show(F(1,2)); // 2
Show(G(1,2)); // 2, but I want it to remain 3.