assign by reference (arrays)?

Rob Cozens rcozens at pon.net
Fri Mar 22 12:40:33 EST 2002


>  > Looking at it another way, one might say all inline variable
>>  assignments ARE by reference: "put x into y"  replaces the value of
>>  "y", not a copy of "y".
>
>If you could say
>   put "cat" into x
>   put a reference of x into y
>   put "dog" into y
>   put x&&y
>the message box would show
>   dog dog
>
>When you say
>   put "cat" into x
>   put x into y
>   put "dog" into y
>   put x&&y
>the message box would show
>   cat dog
>and you are coping the value of x and creating a new variable y with a copy
>of the value of x or you are over writing the exiting value of the variable
>y with a copy of the value of x.

Michael, et al:

My point was the practical result of "put x into y" is the result one 
would get if y were passed by reference in a parameter: the value of 
y changes. In this line, y would be unchanged if "passed by value".
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)



More information about the use-livecode mailing list