A Lingo puzzle (at least for me):
The Number 1 sequence, below, indicates that when a variable is assigned a
value that is taken from a property list, the assignment is done by value;
the original list is not affected, when you change the value of the new
variable.
The Number 2 sequence--using deleteProp()--indicates the reverse, i.e. that
the new variable becomes a pointer to the list, and changing it in fact
changes the original list.
Number 1:
Test=[#a : ["a", "b"]]
Test1 = Test[#a]
put Test1
-- ["a", "b"]
Test1 = ["x", "y"]
put Test
-- [#a: ["a", "b"]]
Number 2:
Test=[#a : ["a", "b"]]
Test1 = Test[#a]
put Test1
-- ["a", "b"]
Test1.deleteProp(1)
put Test1
-- ["b"]
put Test
-- [#a: ["b"]]
Questions:
1) Why the different behavior? How is it useful?
2) I want to delete an item from my Test1 w/o affecting the original list
Test. How?
Thanks for any tips!
Slava
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
- Re: <lingo-l> value or reference? Slava paperno
- Re: <lingo-l> value or reference? Carl West
- <lingo-l> Default to Direct to Stage Kyle Smeby
- Re: <lingo-l> Default to Direct to Stage Colin Holgate
- Re: <lingo-l> value or reference? Buzz Kettles
- Re: <lingo-l> value or reference? Tab Julius
- Re: <lingo-l> value or reference? Slava Paperno
- <lingo-l> Flash flicker Kyle Smeby
- <lingo-l> longDate again Phil Gross
- Re: <lingo-l> longDate again Buzz Kettles
- Re: <lingo-l> longDate again Phil Gross
