• 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: Creating list references in handlers. Bad code or bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating list references in handlers. Bad code or bug?


  • Subject: Re: Creating list references in handlers. Bad code or bug?
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 3 Oct 2001 15:47:15 -0700

On Wednesday, October 3, 2001, at 02:50 PM, Michael Sullivan wrote:

On Sunday, September 16, 2001, at 01:19 PM, Victor Yee wrote:

Hmmm, is this a bug?

set x to {1, 2}
set end of x's contents to 3
x
--> {1, 2}

It is, as we say, "working as designed." There are two problems here:
one is that object specifiers for AppleScript internal objects (like
lists) are fully evaluated at each sub-bit.

I'm not sure I get what this means. By sub-bit are you referring to a
parse unit?

Sorry, I should have been clearer there. What I meant was an individual "x of y" expression. If you say "foo of bar of baz", AppleScript evaluates "bar of baz", then evaluates "foo of the result".

Now that I think about it a bit more, that's irrelevant here; the key point is that "contents" of a list is a computed property like "reverse", so you can't affect the underlying list through it. If "contents" just returned the exact same list, the snippet above would have returned {1, 2, 3}.


--Chris Nebel
AppleScript Engineering


References: 
 >Re: Creating list references in handlers. Bad code or bug? (From: email@hidden (Michael Sullivan))

  • Prev by Date: Re: What about facespan
  • Next by Date: PHOTOSCRIPTER HELP
  • Previous by thread: Re: Creating list references in handlers. Bad code or bug?
  • Next by thread: RE: Creating list references in handlers. Bad code or bug?
  • Index(es):
    • Date
    • Thread