Home » Developing U++ » U++ Developers corner » Question about pick behaviour
Re: Question about pick behaviour [message #31794 is a reply to message #31793] |
Mon, 28 March 2011 12:56   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
ross_tang wrote on Mon, 28 March 2011 05:25 |
However I think it is possible to preserve the original variable, while retaining the pick semantics. We can just add a flag to the object to indicate if the object is picked or not.
|
Correct.
Quote: |
Python uses reference extensively. For example:
a = [1,2,3]
b = a
a[1] = 10
If we run the above code, it is totally valid(But in U++, it is an error). And now b is [1, 10, 3] since it shares the same data with a. And I expected U++ to do the same too.
|
Yes, this is the reason why 'picked' works as is does, 'destroying' the target. In U++, this Python behaviour is considered error-prone.
|
|
|
Goto Forum:
Current Time: Sun Aug 24 20:12:26 CEST 2025
Total time taken to generate the page: 0.08255 seconds
|