On Sun, 2 Oct 2005, david golightly wrote:
I'm trying to teach myself how to use the data structure feature in 0.38-3 - it seems this feature is still very much under development - is there a way to dynamically delete structures, to "un-append" them from a list? I want data structures to appear alongside sound-events, then expire as the events pass on.
Well, that would require not just un-append but also delete from anywhere
in the linked-list. There's possibly also a difference between deleting an
object and just removing it from the list. If it's possible to just remove
the object and keep it alive, or if it's possible to keep pointers to any
object, then it's necessary to use a deallocation mechanism, unless the
plan is to never deallocate, or to make Pd just as low-level as C/C++.
Other than C/C++, which languages make it normal to put the
responsibility/burden of deallocating on the programmer? How many Pd users
want to do that?
BTW, I find that the inconsistent terminology used in the documentation to describe data structures makes it quite baffling to the neophyte, as terms like "list" (a list of scalars) confuse with a normal pd list of atoms (floats, symbols etc.) and they're treated quite differently.
Yes they are. From language to language, terminology varies a lot, but Pd is the only one I know which has always used twice the word "list" to mean two completely different things, and this at the core of the language.
On one side there are list-messages (and anything-messages) which are stack-allocated indexed-lists of atoms, which you can't explicitly get a pointer to.
On the other side you have heap-allocated linked-lists of atoms, which you can (and have) to get a pointer to.
That's two completely different worlds.
Also, the name "data structures" is very unfortunate because it already means more than that and less than that too. Everywhere else, data structures are considered to not be tied to any appearance at all, and they are normally a lot more flexible than they are in Pd (especially before 0.39, but even with 0.39)
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju Freelance Digital Arts Engineer, Montréal QC Canada