Re: set myList to myList & ... and unexpected results
Re: set myList to myList & ... and unexpected results
- Subject: Re: set myList to myList & ... and unexpected results
- From: jj <email@hidden>
- Date: Sun, 24 Jul 2005 10:14:30 +0200
> set myList to myList & myItem
Seems here you're storing a reference to "myItem", as if being "myList" an
empty list it was being ignored and just discarded from the concatenation.
Ie, it is copied the list myItem to myList, instead of being created a new
one with both's contents. Seems that this expression is equivalent:
#################
set myList to myItem
#################
That's why blah, blah, blah and you see the stunning result.
If "myList" was not an empty list, or you were concatenating more lists, you
would see the expected behaviour. Eg:
#################
set myList to {1}
set myItem to {1}
set myList to myList & myItem
--> blah, {123, 1, 1}
#################
Or:
#################
set myList to {}
set myItem to {1}
set myList to myList & myItem & {}
--> blah, {123, 1}
#################
So, this is a bug or a feature (it maybe a faster behaviour but obviously
inconvenient?)
jj
--
http://www.macscripter.net/
http://www.osaxen.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden