• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: set myList to myList & ... and unexpected results
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >set myList to myList & ... and unexpected results (From: Ryan Wilcox <email@hidden>)

  • Prev by Date: Re: Mount a Firewire disk
  • Next by Date: Re: set myList to myList & ... and unexpected results
  • Previous by thread: set myList to myList & ... and unexpected results
  • Next by thread: Re: set myList to myList & ... and unexpected results
  • Index(es):
    • Date
    • Thread