<p dir="ltr">Hello, this is my first e-mail on the list, and i don't understand the code of pd or anything like that, but I have an idea. Plus, sorry for bad english.</p>
<p dir="ltr">If it was possible to have an array of pointers, maintained by the user, we could jump to some scalar in the list, say I have 1000 scalars, and an array with pointers to 100th, 200th, 300th, or any combination. This would improve the search.</p>
<p dir="ltr">Maybe this would be a list/array of pointers inside another scalar? What do you think?</p>
<p dir="ltr">Using this design, the user itself can create his own structures with pointers, creating trees,  graphs with the scalars themself.</p>
<p dir="ltr">It make sense?</p>
<br><div class="gmail_quote"><div dir="ltr">Em Qua, 29 de mar de 2017 08:47, Derek Kwan <<a href="mailto:derek.x.kwan@gmail.com">derek.x.kwan@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"Christof Ressi" <<a href="mailto:christof.ressi@gmx.at" class="gmail_msg" target="_blank">christof.ressi@gmx.at</a>> writes:<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> I have - and traversing large lists of scalars by pointer can be veeeery slow.<br class="gmail_msg">
><br class="gmail_msg">
yeahhhh, i figured that could be the case =P<br class="gmail_msg">
<br class="gmail_msg">
> you could hide the fact that it's a linked list from the user but I<br class="gmail_msg">
> don't know if that's a good thing to do. It doesn't seem transparent<br class="gmail_msg">
> to me ("why is accessing the 1000th elements slower than the 1st<br class="gmail_msg">
> element?").<br class="gmail_msg">
<br class="gmail_msg">
I suppose you could tell the user via documentation, but then you'd have<br class="gmail_msg">
go into what a linked list is and why linked list indexing is<br class="gmail_msg">
O(n) versus array O(1) to explain the speed difference and yeah,<br class="gmail_msg">
I see your point haha. And it's probably not good either to have a layer<br class="gmail_msg">
of abstraction that isn't totally necessary either.<br class="gmail_msg">
<br class="gmail_msg">
><br class="gmail_msg">
> if you don't use the graphical representation, you can just as well<br class="gmail_msg">
> work with data structure arrays and get fast random access. there is<br class="gmail_msg">
> one little but unfortunate drawback compared to using lists of<br class="gmail_msg">
> scalars: drawn instances of array elements don't respond to mouse<br class="gmail_msg">
> events, making them more or less useless as UI elements. if you<br class="gmail_msg">
> click/select an element, you only get a pointer to the array, not to<br class="gmail_msg">
> the element(s). if you click on the canvas, you get pointers to the<br class="gmail_msg">
> array + all array elements (for whatever reason).<br class="gmail_msg">
> The right behaviour IMHO would be that clicking/selecting array<br class="gmail_msg">
> elements gives you pointers to the array *and* the clicked/selected<br class="gmail_msg">
> element(s). clicking on the empty canvas shouldn't trigger any mouse<br class="gmail_msg">
> events!<br class="gmail_msg">
><br class="gmail_msg">
> Apart from that, data structure arrays are quite easy to handle and<br class="gmail_msg">
> much more efficient than linked lists of scalars<br class="gmail_msg">
<br class="gmail_msg">
ah, that's interesting. admittedly, i haven't used pd structs that much<br class="gmail_msg">
in my pd work as of yet but the stuff i want to do seems to be<br class="gmail_msg">
increasingly lending itself to that (or a similar) sort of paradigm so<br class="gmail_msg">
i'll keep that in mind!<br class="gmail_msg">
<br class="gmail_msg">
Derek<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Derek Kwan<br class="gmail_msg">
<a href="http://www.derekxkwan.com" rel="noreferrer" class="gmail_msg" target="_blank">www.derekxkwan.com</a><br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
<a href="mailto:Pd-list@lists.iem.at" class="gmail_msg" target="_blank">Pd-list@lists.iem.at</a> mailing list<br class="gmail_msg">
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br class="gmail_msg">
</blockquote></div>