• 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: Passing *possible* variables to a handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing *possible* variables to a handler


  • Subject: Re: Passing *possible* variables to a handler
  • From: has <email@hidden>
  • Date: Fri, 19 Jul 2002 17:39:07 +0100

Andy Wylie wrote:

>> set v to Hamish's GetAt(5)
>> --
>> set v to Hamish's item 5
>>
> I find Hamish slow either way

Odd. The latter of the above forms gives the dreaded O(n) performance as
expected, but the former should be O(1) [constant access time], and at a
decent enough clip unless somebody's fubared the code someplace(?). Here's
the original code - give it a try; if you still find its performance
subpar, let me know.

Cheers,

has (I'm not slow, I'm just "methodical")

======================================================================

on wrapList(theList)
if theList's class is not list then error "Not a list."
script
property parent : theList

on getItem(itemIndex)
return parent's item itemIndex
end getItem

on getItems(index1, index2)
return parent's items index1 thru index2
end getItems

on setItem(itemIndex, newValue)
set parent's item itemIndex to newValue
end setItem

on concat(secondList)
return my parent & secondList
end concat

on asList()
copy my parent to plainList
return plainList
end asList
end script
end wrapList

======================================================================

--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Passing *possible* variables to a handler
      • From: Andy Wylie <email@hidden>
  • Prev by Date: Re: Filemaker Pro Script Needed
  • Next by Date: Re: unix style paths
  • Previous by thread: Re: Passing *possible* variables to a handler
  • Next by thread: Re: Passing *possible* variables to a handler
  • Index(es):
    • Date
    • Thread