When I send "clear" into the right inlet of [list cat], and then try to re-populate the list by sending something into the left inlet, pure data crashes.
Does this happen to anyone else?
[list cat] crash
When I send "clear" into the right inlet of [list cat], and then try to re-populate the list by sending something into the left inlet, pure data crashes.
Does this happen to anyone else?
@porres [list] is a fundamental data structure in PD for storing, well, lists. It's very useful for gathering and storing messages into a single message of various elements. "cat" is a creation argument that defines its behavior so that it accumulates messages that are sent to it. There are other creation arguments too that define different behavior.
If you haven't already, I suggest checking out the help-patch for list, it's really helpful. I didn't use it that much until recently but it's a game changer. It's also pretty indispensable for my current project.
Also, if you could try making a [list cat] object, add a few elements, then clear it, then try to add more again, and let me know if it crashes, that would be helpful. I want to know if it's just me or if there's a bug.
@pure_datum [list append cat]/[list prepend cat] works. [list cat] alone does not create an object for me. you delete the list (cat) if you send a bang to the right inlet of [list append cat]/[list prepend cat]. "clear" has no meaning for [list] if i am not wrong. perhaps you use a library that has another [list] object that is different from the vanilla one?
@Jona Strange. I am using extended libraries, but in the list help-patch meta info, it says it's the version by Miller Puckette, so I assumed that it was the vanilla list.
However, I just went and checked the version in the vanilla git repo and it indeed does not accept a cat argument.
Apologies to @porres. I now realize you probably know what list is and you were just confused because I was using an argument that's not in vanilla.
I guess in the version I have, someone altered list and didn't update the meta info. I'll just avoid the cat argument I guess.
It's a Purr Data class. In Pure Data Vanilla it's a line in a todo list.
@pure_datum Yep, it's a double free error. Perusing the source code I also noticed an "off-by-one" error when sending a non-list message to the object (a.k.a. the "anything" method).
Fixes are in the works:
https://git.purrdata.net/jwilkes/purr-data/merge_requests/283
(It will eventually produce some testing installer binaries if you follow that pipeline link, click on your OS and then click the "Download Artifacts" button. Or you can just wait for the next release)
Keep in mind that [list cat]
sends output on each concatenation. So for optimal performance with larger lists you'll probably want a [spigot]
below it that only opens once you are finished concatenating.
it seems [list cat] in Purr Data is similar to [list store] in Pd Vanilla. How is it different? BTW, I don't see [list store] documented in Purr Data.
Actually, better put, it seems [list cat] in Purr Data is just a limited version of [list store], which can append, prepend and do more things in Pd Vanilla. So they're very different, cause [list store] is more powerful, so it just seems that [list cast] is superfluous. So when I ask how different they are, it was more of a rhetorical question... I see now that I tested that there are different design choices, where [list cat] keeps outputting values when appending. I personally think it makes more sense the way this is handled in [list store], where you get the list you want in the end with a bang.
BTW, I don't see [list store] documented in Purr Data.
The class exists, it just wasn't listed in the help patch. It is now.
Also, I just saw that [list cat]
wasn't reentrant. It will be in the next release.
not sure if you've also documented [list fromsymbol] and [list tosymbol] as well
not sure if you've also documented [list fromsymbol] and [list tosymbol] as well
Yes, I have.
I did a little testing on my Chromebook for accumulating lists of 10, 100, and 1000 floats with [list cat]
, [list store]
, [list prepend]x[t a]
, and "add2 $1" with a message box.
[list store]
is the fastest, but message box accumulation has pretty close performance to it[list prepend]x[t a]
is the slowest with [list cat]
the 2nd slowestSo I'd say [list cat]
is there mostly for backward compatibility at this point.
BTW-- I haven't tested it, but I'd bet that [list split]
is significantly faster than using the "get" message with [list store]
, especially for large lists.
@jancsika [textfile] seems even faster: https://forum.pdpatchrepo.info/topic/10556/vanilla-list2symbol-abstraction-pd-0-47/9
@Jona [textfile]
uses the same data structure underneath as a message box. So the performance for accumulating a list should be about the same as a message box. But I haven't tested it.
@jancsika thanks, interesting to know that they use the same data structure. in the link from my last post is a test.
Oops! Looks like something went wrong!