When I examine the memory address for a variable that contains a string or number, I can see the string or number starting at the variable's memory address (e.g. x:="abc"; I find "abc" in memory beginning at &x)
I understand the phrase "a reference to the object" to mean that instead of the object being stored at address &object, what is stored at &object is the address (i.e. a pointer) of where the object is stored. This seems to me in alignment with "&MyVar retrieves the address of MyVar's contents in memory"
But when I examine the memory at &object, I don't believe I'm finding an address; instead, I see a sequence of bytes that are identical for (what appears to be) all/any objects that I examine (e.g. &object1, &object2...).
And since ObjAddRef/ObjRelease use &object, that suggests to me that the object is stored at &object.
So I'm wondering whether a variable e.g. "object1" does in fact contain the address of where the object is stored, but &object is the address of where the object is stored and NOT the address of where object1's value is stored (the value being the address to where object 1 is stored)?
SUMMARY:
I understand this to mean:When you assign an object to a variable, as in myObj := {}, what you store is not the object itself, but a reference to the object
Code: Select all
ADDRESS WHERE
VARIABLE NAME VALUE IS STORED VALUE
------------------- -------------------- ---------------------------------------------------------
myObj &myObj address of where object is actually stored
Then wouldn't this mean that the contents of myObj would be an address to the object?&MyVar retrieves the address of MyVar's contents in memory
Hoping someone will be kind enough to clarify for me.