I'm not sure what you were expecting.   But in both m1 and m2 you pass back the same object you passed in.  So in the main part of the program a and b both point to the same object.

Since they are the same object any change made to b is a change made to a.

In m3 you create a new object and pass that object back.  Now in the main program a points to one object and b points to a second object.  A change made to the second object will not be seen in the first object.


The point I was trying to make is that ooRexx and the USE ARG statement differs significantly from just ARG, at least in non-ooRexx environments. This was all new to me, because USE ARG works with pointers while ARG does what the copy method does, creates a copy of the input argument. At least it works so in the mainframe Rexx that I'm used to, where you cannot modify a caller's argument because you get a copy of it.

Staffan