pass by reference
View Single Post
05-07-2009, 03:12 AM
Join Date: Feb 2009
Location: New York
Leave it to WH to take my skit to another level! LOL...good stuff...
Ok. so basically..the Borg...resistance is futile...
I completely understand now thanks to WH and VI!
I was borderline understanding it, but the "skits" made it go over the top. I completely get it....this is what I was waiting for, something to just click....
Just to explain, I had a completely different viewpoint of what "pass-by-reference" worked...
Say you have $var2 =& $var1;
I thought that $var2 didn't OWN anything. That $var1 provided a "looking" glass to what it's value is, so say it's value is: Blue.
$var2 would just say, "I am blue too, THROUGH $var1"...
But in fact, the pass-by-ref is actually providing the location of the value in RAM (thanks VI) in which $var2 now can dip it's fingers in it and also OWN the value.
This is different from pass-by-value in which $var2 would get a COPY of the value in a different location in RAM. So changing it's value would not affect $var1.
But now that they are in-sync due to pass-by-ref, they are all one collective Borg's!!!!
Did I get it right??
View Public Profile
Send a private message to allworknoplay
Find More Posts by allworknoplay