Are nested arrays fully supported (template with an array in which element's template contains arrays and so on...) ;
Is there any valid example somewhere?
-
Nested arrays in templates?
-
I think they work. That's all I've got though, I've only put arrays one layer deep. The only problem I ran into was (mac 10.9.5) the plot object having a pointer that is not being deleted properly when I close the patch. It just spits out a warning that it couldn't find the canvas. Again this is when the patch is closed, so it should be harmless.
Maybe try making a fractal with the structs, see how many instances you can make before everything crashes.
-
You can nest them arbitrarily deep, as long as you don't create any circular depedencies like [struct foo float x float y array a foo].
If you create structs starting with the most deeply nested first (and going out from there), I doubt you'll get any crashes at all. The crashes come when you edit an existing struct to change the arguments-- especially when you already have scalars that use those structs. In that case Pd keeps state from the old struct hanging around in memory. Plus it tries to conform the existing scalars to the new data template. That's where the bugs happen.
-
That 's true that conforming is very buggy.
The source code for scalars and templates is hard to understand.
I can't distinguish what is draft from what is mature.
That's why i asked. Thanks for the reply. -
The problem is that the interface for manipulating the data-- especially with ds arrays-- is too complicated. If you asked me to implement an autocomplete feature using data structures, I'd have an easier time visualizing the design in the C source for data structures than in Pd patches.
I've tried to remedy that in Purr Data by adding some easier ways to manipulate scalar data, but it's definitely more on the "draft" side of things.