Re: processing time & stack overflow
Re: processing time & stack overflow
- Subject: Re: processing time & stack overflow
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 28 Aug 2001 09:06:25 -0700
On 8/28/01 8:49 AM, "Paul Skinner" <email@hidden> wrote:
>
on 8/28/01 11:05 AM, Arthur J Knapp wrote:
>
>
> on NewOrder(lst)
>
> set {s1, s2, len} to ,
>
> {random number from 1 to 100000, 31415, lst's length}
>
> repeat with i from 1 to len
>
> set {j, s1} to {(s1 mod len) + 1, (s1 * s2) mod len}
>
> set {lst's item i, lst's item j} to ,
>
> {lst's item j, lst's item i}
>
> end repeat
>
> end NewOrder
>
>
>
> set lst to {"a", "b", "c", "d"}
>
>
>
> NewOrder(lst)
>
>
>
>
Nice. I'm still digesting it. You do want to return the value of 'lst'
>
at the end though.
>
I don't see any OSAX calls. Was that in the previous version you mention?
'random number' is an osax call from Standard Additions. It's not a
3rd-party osax, but it is an osax nevertheless. Arthur mentions it because
osax calls, to Standard Additions as to any other osax, are somewhat
time-and-memory-demanding if you are going to repeat it thousands of times,
and if you're counting (Arthur is always counting).
--
Paul Berkowitz