• 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: Things I thought I knew, but didn't - variable scope in repeat loops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Things I thought I knew, but didn't - variable scope in repeat loops


  • Subject: Re: Things I thought I knew, but didn't - variable scope in repeat loops
  • From: Doug McNutt <email@hidden>
  • Date: Sat, 27 Dec 2008 10:48:40 -0700


Mark got quoted this way:
 Applescript builds a list of values (or an iterator/generator) and
 sets i to the next value at the top of the loop; it doesn't look at
 the current value of i to determine what the next value of i should
 be.   So you can do anything you want to i inside the loop and it
 won't affect the loop control logic:

Doesn't that imply a limit on the number of times through a repeat loop? If there isn't a stated limit hardware will impose one when that list has to be stored.


I can remember running some Monte-Carlo calculations that were tracking photons making random tracks through the upper atmosphere. The loop count was high enough that 15 bit FORTRAN integers stored in the hardware registers were too small. Using a memory-stored integer at 24 bits created serious speed issues.

No. I wouldn't even think about using an interpreted script for that but I am curious about just what AppleScript's limit really is. Come to think of it, is there a limit on the length of an ordered list in AppleScript? Are such things stored in a stack? Are they linked so that each entry structure requires a memory pointer to the next? Or are the entries for a repeat loop really an array in consecutive memory addresses?

--

--> Life begins at ovulation. Ladies should endeavor to get every young life fertilized. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden
  • Follow-Ups:
    • Re: Things I thought I knew, but didn't - variable scope in repeat loops
      • From: Axel Luttgens <email@hidden>
References: 
 >Re: Things I thought I knew, but didn't - variable scope in repeat loops (From: Richard Rönnbäck <email@hidden>)

  • Prev by Date: Re: Things I thought I knew, but didn't - variable scope in repeat loops
  • Next by Date: Re: Thirteen Scripters Scripting
  • Previous by thread: Re: Things I thought I knew, but didn't - variable scope in repeat loops
  • Next by thread: Re: Things I thought I knew, but didn't - variable scope in repeat loops
  • Index(es):
    • Date
    • Thread