[PD] Re: pure == slow, impure == fast ? was purepd
Mathieu Bouchard
matju at artengine.ca
Wed Nov 23 05:31:32 CET 2005
On Mon, 21 Nov 2005, Frank Barknecht wrote:
> In Zexy a similar object is called [repack], however repack starts a new
> list as soon as the specified length is reached and then waits until the
> new list is filled.
For the record, that's like [#import]->[#export_list] in GF.
> A [repack] clone is not part of [list]-abs (yet), but it's simply done
> using a:
> [list prepend]X[t a]
That's a O(n^2) operation, which means it's sloooow, especially for big
lists.
Also, I'd vote in favour of allowing the self-connecting an object, so
that we don't have to use [t a] or whatever as a kludge to pretend that
what we want is not connecting an object to itself. It would simplify
[list prepend]X[t a] and also [+]X[t f] and also [max]X[t f] and such.
However it wouldn't simplify [f]X[+].
> Zexy's drip and my [list-drip] "unpack" a list, that is, they spit out
> each element of a list after another.
For the record, that's like [foreach] in GF. That's also like [#export] in
GF (but #export is made for integers and can also handle floats if you
tell it to but it doesn't do symbols nor pointers).
> [list-drip] has a IMO quite useful second outlet which sends a bang,
> after the whole input list was consumed.
That should be a standard feature.
> And regarding the usefulness of [list-drip]: Of the currently 40
> list-abstractions 19 use a kind of "drip".
There's a reason. Guess why I called it [foreach] in GF: it's because many
languages have something like that, called either "foreach" or "for" or
"each". Instead of having an outlet, they take a "code block" or
"closure" or "function pointer" as an argument. Well, an outlet is pretty
much like a souped-up function pointer, if you ask me.
(I'm studying relationships between Pd and other very different languages)
____________________________________________________________________
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
Freelance Digital Arts Engineer, Montréal QC Canada
More information about the Pd-list
mailing list