this has been on my wish list for a while and I want to do a PR. do you guys have suggestions which kind of interface you would prefer? these come to my mind:
I tend towards the last option, since [pointer] is already used to traverse a subpatch, so [delete( could go well with [traverse(, [bang( and [next(. the canvas messages would also makes sense to me. having a dedicated object seems rather overkill.
there's another feature I'd love to have: being able to compare two pointers for equality. (it's such a fundamental thing for working with pointers/iterators but there's no way to do this in Pd, apart from hacky things like assigning each scalar some unique ID).
I'm struggling with a good interface, though. again, a dedicated object feels awkward to me. maybe an [equal <pointer>( message to [pointer] which compares the incoming pointer with the stored pointer and outputs 0 or 1?
Gesendet: Sonntag, 20. Mai 2018 um 14:40 Uhr Von: "Derek Kwan" derek.x.kwan@gmail.com An: "Roman Haefeli" reduzent@gmail.com, pd-list@lists.iem.at Betreff: Re: [PD] Data structures - delete specific scalar?
Roman Haefeli reduzent@gmail.com writes:
Hey all
Following up a thread from 2011: https://lists.puredata.info/pipermail/pd-list/2011-04/088306.html
I would like to know whether it is impossible to delete a specific scalar, by pointer. If so, why is that? Does it use a design that makes it difficult to allow this? To my untrained eye there is no apparent reason why it is possible by editing the GUI graphically/manually, but not per message.
Roman _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
If I'm not mistaken, this relates to a thread I started in Jan 2017 and I think this bit from Christof Ressi might prove releavant to these discussions so hopefully this link could help with the current discussion:
https://lists.puredata.info/pipermail/pd-list/2017-01/117295.html
Derek
-- Derek Kwan www.derekxkwan.com
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
2018-05-20 10:31 GMT-03:00 Christof Ressi christof.ressi@gmx.at:
- [delete( message for [pointer]: deletes the scalar of the currently
stored pointer.
+1
On Sun, 2018-05-20 at 15:31 +0200, Christof Ressi wrote:
this has been on my wish list for a while and I want to do a PR. do you guys have suggestions which kind of interface you would prefer? these come to my mind:
- [delete] object: send it a pointer and it will delete the scalar
I thought this one to be the most natural, since there is also an [append] object.
- [delete <p>( message for canvases
There are no other uses where a method uses a pointer as argument, are there?
- [delete( message for [pointer]: deletes the scalar of the currently
stored pointer.
Sounds good, too, and seems what has the most thumb-ups yet.
I tend towards the last option, since [pointer] is already used to traverse a subpatch, so [delete( could go well with [traverse(, [bang( and [next(. the canvas messages would also makes sense to me. having a dedicated object seems rather overkill.
You're probably right.
Roman