set myList to myList & ... and unexpected results
set myList to myList & ... and unexpected results
- Subject: set myList to myList & ... and unexpected results
- From: Ryan Wilcox <email@hidden>
- Date: Sun, 24 Jul 2005 02:35:11 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
Perhaps someone here can help me with a puzzle. Run the following code:
- --<code language="Applescript>
set myList to {}
set myItem to {1}
set myList to myList & myItem
set item 1 of myList to 123
set myList to myList & myItem
- --</code>
The output of this code is {123, 123}, and NOT {123, 1} like I would
expect.
Could someone explain why I get this result, please? I'm not really
interested in alternative methods, I want to know why this particular
chunk of code has this result (I suspect I'm missing a key attribute of
the language in this circumstance and want to learn :) ).
Tested on 10.4.1 and 10.4, same result.
I'm very interested in hearing the answer!
Thanks in advance,
_Ryan Wilcox
================================================================
Wilcox Development Solutions: <http://www.wilcoxd.com>
Toolsmiths for the Internet Age PGP: 0x2F4E9C31
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFC4y8fbYO0qC9OnDERAgapAKCLzmzWZFw68KYnd/+8Xr1rwGPZVACcCCxJ
LPYuvj+3Co3UABUlgOIgX3Q=
=V982
-----END PGP SIGNATURE-----
_______________________________________________
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