stevedonovan/Penlight — pull request #53 by pkazmier (2013-03-19 01:40:25+00:00)
Title: Added iterators to allow traversing tables in a sorted manner

Here is my first pass at the two functions. I'm a complete newbie so please review closely.

I struggled with the names of the two functions, but finally settled on `sort` (returns iterator that traverses by sorted key order - the most common use case) and `sortv` (for traversing by sorted value order - less common). I added them to `tablex` because I wouldn't know where to begin with finding a right home for them per your comment about `tablex` getting too large (baby steps).

I added two test cases to validate the functions work. I had to think about how best to do that as I had to compare elements from the iterator to make sure they were in the right order, so I wrote a helper function to do so.

Finally, I updated the PL manual with a new paragraph in the array section of the document.

This would close issue #52.