List Commands Library for 50g
|
08-13-2017, 04:59 PM
Post: #67
|
|||
|
|||
RE: List Commands Library for 50g
(08-13-2017 04:22 PM)Werner Wrote: The RPL SORT routine uses binary insertion. Since insertion in this case is a stack roll, and that has been implemented very efficiently in machine language, you're going to have a hard time beating it using SysRPL only. Glad you saw this post, Werner. And also glad that John was already aware of your LSORT routine, which appears to be quite the speed demon. I have no desire to reinvent this wheel. I'm pretty certain that my Saturn code would be larger and slower than what you've already done anyway. I wasn't aware that SORT (or LSORT) would handle a list of sublists in the way you've pointed out -- that's a nice way to achieve the desired results. Combining the two lists: Code: { "longest" "longer" "long" } Code: DUP SIZE LSDIV SWAP ADD ...which then leaves it to the user to choose which sort they want to use. After sorting, the combined list elements can be easily separated again if needed: Code: LCLLT 2 LSDIV LRLL EVAL |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)