On Fri, 4 Mar 2011, Matt Barber wrote:
This all sounds about right -- I made [list-shellsort] more as a pedagogical exercise for my students
So, what is that supposed to teach them ?
than as a model of speed or efficiency (I did a "quicksort" as well that didn't end up in list-abs).
How did you achieve the quicksort ?
Why didn't it end up in list-abs ?
but then it uses fewer of the list abstractions and is less of an opportunity to show how the abstractions work "in action."
Don't you think that it would be better to show the list-abs for what they are good at, rather than for what they aren't ?
And it's a good reminder for how slow list manipulations can be.
Ah, yes. But note that [list split] is O(1), which is the cool thing about pd's lists.
one of the best exercises in constrained patching I've ever done, and fun for proving that some things are actually possible in vanilla that you think wouldn't be,
Yeah, people didn't think a pure-vanilla [list-drip] could be O(n) either. I made one and now it's the new [list-drip]. I didn't mean to actually encourage people to use list-abs though. I already had written [foreach] in C++ which is a lot easier to understand :
\class ForEach { \constructor () {} \decl 0 list (...) {for (int i=0; i<argc; i++) out0;} }; \end class {install("foreach",1,1);}
this basically just says : make a class that has an inlet 0 list method that takes every element and sends it through outlet 0. Then name this class [foreach] and make it have 1 inlet and 1 outlet.
Your [s2l] looked more desperate though. ;)
Yet, I suspect that people go ahead and use [list-sort] all the time.
uh, who would do that ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC