Hallo,
oh, and I also now committed two more abstractions that Matt Barber sent me offlist, of which one is a sorting abstraction as well. Matt's [list-shellsort] uses the Shell sorting algorithm: http://en.wikipedia.org/wiki/Shell_sort which generally is a bit faster than insertion sort, but I didn't benchmark the two Pd implementations (the speed in Pd of course also depends on how much element shuffling and list-dripping is needed)
Anyway, currently list-shellsort only does ascending sorting, so I just decided to include both Michal's list-sort, which probably is easier to understand, and Matt's list-shellsort in the current SVN's [list]-abs collection. Choose your poison. ;)
Frank
Michal Seta hat gesagt: // Michal Seta wrote:
Hi all,
It is amazing how we take things for granted. Most programming languages provide some sort of list sorting function/method. Surprisingly (or not) pd does not (or my search skills are null, or I am not bleeding edge enough). I needed a solution that works with a vanilla pd.
I was almost going to do the academia move and announce a pd exam, and have little pd-bees come up with a solution but I needed it *now* else I would not sleep or have terrible nightmares. So here it is. Thank heavens (but give your offerings to fbar's footils shrine) for list-abs.
Busy pd-bees, should you care to improve on my solution, please be my guest, I am sure there are better ways of accomplishing this trivial task. In any case, go forth and sort the world around (or within) you.
./MiS
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list