On Wed, Apr 12, 2006 at 03:09:04AM +0200, pd-list-request@iem.at wrote:
From: Frank Barknecht fbar@footils.org Subject: Re: [PD] feature request for [list]
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
Frank Barknecht wrote:
- negative indices to [list split] (patch available @sourceforge)
- a fast [drip] made native to [list] (source code in Zexy)
by [drip] do you mean [repack 1] or the "real" (delay-based!) [drip]?
Both. ;) I'm just talking about a way to serialize a list into single atoms. But now that you mention it: Actually I need two kinds of serialization: One that just unfolds a complete list into its single elements, and another one, which does it on demand. I called it "list-dripslow" which is a bad name, but here, only one element is sent to the outlet, and on each bang the next element is sent.
I'd like to second the suggestions of these additions to Pd. I think the important features to add would be those that can't currently be simulated with abstrations and other builtins. For example, [s2l] which as discussed works like Perl's split() function. Negative indicies could be simulated with the help of [mod] if only there was a [list length] as suggested by Frank. The drip style serialization which you suggest above could also be simulated easily with [until] and [list length] and [list split].
So basically I'd like to see a [list length] and an [s2l].
Chris.
chris@mccormick.cx http://mccormick.cx
Hallo, Chris McCormick hat gesagt: // Chris McCormick wrote:
I'd like to second the suggestions of these additions to Pd. I think the important features to add would be those that can't currently be simulated with abstrations and other builtins. For example, [s2l] which as discussed works like Perl's split() function. Negative indicies could be simulated with the help of [mod] if only there was a [list length] as suggested by Frank. The drip style serialization which you suggest above could also be simulated easily with [until] and [list length] and [list split].
So basically I'd like to see a [list length] and an [s2l].
You can do "list length" with a simple counter and "list split" already. It's called [list-len] in [list]-abs. However unfolding a list using [until] and [list split] is very slow. I did benchmarks comparing it to [drip] and it takes ages longer. As a "drip" operation is used so often - Matju once compared it to the "for"-loop of other languages - it is important that "drip" is fast, and not only fast, but very fast. I'd much prefer to have a fast unfolding operation over getting "list length".
And negative indices are just very convenient, and the object is already in.
I don't think that [s2l] should become part of [list]. To me it is a typical string operation, like Perl's split and string.split() in Python.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Wed, 12 Apr 2006, Frank Barknecht wrote:
As a "drip" operation is used so often - Matju once compared it to the "for"-loop of other languages - it is important that "drip" is fast, and not only fast, but very fast. I'd much prefer to have a fast unfolding operation over getting "list length".
It wasn't just a comparison. I have coded such a (clockless) drip, and its name is [foreach].
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada