but what is the [scalar] object supposed to do? Is it just a specific instance of a struct in the linked list?
What it does is create its own subpatch and append a single scalar of a given template (struct). This way it's a bit like the table object. I often use it when I don't care about the graphical representation and just want to use a struct as a container of heterogenous data. I think it's meant to get an interface similar to [array] and [text] in the future, but even in its current rudementary form it's quite useful.
Regarding your request of a 'delete' method:
We can already delete scalars from the glist by selecting their graphical representation in the subpath and hit `del', just with any other object. Pointers will get marked invalid (error message about pointer being 'empty' or 'stale') and therefore stay safe. So the functionality is there, we just need a way to delete a scalar by pointer.
in the meantime, here's a little hack how to delete specific scalar instances (as long the scalar has a drawing instruction and is visible + editable). get the scalar's x + y coordinates with [get], then send following message to the subpatch containing the scalar: [mouse x y 1 0, mouseup x y 1, key 1 8 0(
Christof
Gesendet: Dienstag, 03. Januar 2017 um 07:04 Uhr Von: "Derek Kwan" derek.x.kwan@gmail.com An: pd-list@lists.iem.at Betreff: [PD] Request - Deleting struct instances, progress?
I suppose since we're doing this about feature requests, I'd like to ask about deleting instances of structs in linked lists =).
I've read through the list archive and seen this pop up a few times, one of the issues being brought up being stale pointers if I recall correctly. Is there any progress on this? Would it be possible to just copy over the data from the next node (if it exists) into the requested deleted node and dealloc the original next node? And if a current [pointer] is empty/stale, the next [pointer] the same, just reset to the head as a failsafe? Admittedly, I'm not very familiar with the mechanisms behind [pointer]s so I could be talking complete nonsense so apologies in advance...
I suppose that this is a somewhat unrelated question, but what is the [scalar] object supposed to do? Is it just a specific instance of a struct in the linked list?
I'd also echo William's words and say thanks for Pd, Miller =)
Derek
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list