Nite Flite Script Library 1.5 (NEW!)
March 10, 07 A collection of script libraries that implement the basic computer science structures (Stacks, queues, priority queues), file operations (read, write, and append), and sorting (Bubble sort, Insertion sort, Merge sort, and Quick sort). These routines can be used and reused in lots of ways.
At the same time, these libraries also help new scripters to Understand the basics of programming. The routines in this collection, while by no means "the final word" on the subject, have been written with an eye toward helping scripters to write better code that is both fast and clean.
Requirements: Mac OS X 1.4 (Universal)
About these Scripts...
LINKED LISTS - When I set about putting these together, I realized that most computing classes start with linked lists, then build on that to make stacks, queues, and priority queues. I thought long and hard about trying to make a linked list implementation, but AppleScript's list object already fulfills about 95% of what you could accomplish with a linked list. So I skipped linked lists and went on to..
STACKS - This implementation uses AppleScript lists to implement a standard "first-in-first-out" stack. It allows stacks of any AppleScript type that can be put into a list.
QUEUES - Also uses lists, and allows any list-friendly AppleScript data type.
PRIORITY QUEUES - This implementation keeps the priority and the cargo separately, so the cargo can be anything AppleScript will allow (including other lists or records) and the priority can be any data type that is comparable - meaning, you can Say that one item is greater, equal, or lesser than another item. Lists, for example, are not comparable.