Re: Creating list references in handlers. Bad code or bug?
Re: Creating list references in handlers. Bad code or bug?
- Subject: Re: Creating list references in handlers. Bad code or bug?
- From: Victor Yee <email@hidden>
- Date: Sat, 15 Sep 2001 10:29:56 -0400
Ok, I should have done this first. This seems to put a perspective on the level of referencing here:
on theHandler()
local theData, refA, refB
set theData to {theList:{"unchanged!"}}
set refA to a reference to (get theList of theData)
set refB to a reference to theList of theData
set item 1 of contents of refB to "changed!"
return {refA, refB}
end theHandler
theHandler()
--> {{"changed!"}, theList of {theList:{"changed!"}}}
There does seem to be data sharing involved with both references. But it looks as if the type of references are different.
Victor