Re: Passing *possible* variables to a handler
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.