Re: applescript-users digest, Vol 3 #2135 - 16 msgs
Re: applescript-users digest, Vol 3 #2135 - 16 msgs
- Subject: Re: applescript-users digest, Vol 3 #2135 - 16 msgs
- From: Emmanuel <email@hidden>
- Date: Fri, 7 Nov 2003 08:20:17 +0100
At 11:40 PM -0500 06/11/03, Graff wrote:
>
I hope you don't mind but I took the liberty of fixing your problem and also simplifying your code a bit.
>
>
Things like this are a little bit easier to do with recursion,
No-one asked for my advice, and I can't exclude that in that particular case the idea is excellent.
But maybe I'll help someone by recalling that it is usually no good programming practice to use recursion in AppleScript where it is not fully required. When you use recursion, you are making a script which will work until the day when you really need it - that day when you've really got complex hierarchies and your script will hit the Stack overflow limit.
AFAIK, most recursive algorithms can rather easily be turned into memory-consuming but stack-savvy algorithms where you just maintain a FIFO list of the items to process: e.g. when you hit a folder, you append its contents at the end of the list.
Emmanuel
_______________________________________________
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.