Question: Formal parameters understanding

December 22 2013 Majmaj 50
Maple

2

Hi everyone.

i want to undestand how to use the passing by reference in Maple i do this:

generate_x := proc (x)

    x := (rand(1 .. 10))()

end proc;

generate_y := proc (y)

    y := (rand(1 .. 5))();

    print(y)

end proc;

print_xy := proc ()

     local x, y;

     generate_x(x);

     print(x);

     generate_y(y) end proc;

print_xy();

#print(x)  works but generate_y(y) doesn't print the value of y.

Can you help me to understand WHY i dont get the print of y.

Thanks and happy christmas to you!

Please Wait...