Alternative way of querying coll
I was wondering if it is possible to query data from a coll using symbol other than the index.
For example, I have data stored in a coll :
1, alpha beta gamma
2, omega theta zeta
I want to be able to get "beta gamma" when I ask "alpha" and "theta zeta" when I ask "omega", and still has the Integer index. I presume there is a way of doing this with Javascript...
Anybody has a clue?
Thanks a lot for your help guys!
hi
you can try something like this. but i think it needs to be adapted...
cheers
g
Yeah it works, the principle is there, but I feel that the dump operation would a bit costly on the CPU usage, since my coll is very very large...
Maybe something with javascript or lua...
Still thanks g!
And also, since there is many symbols in each index, I presume it would be problematic of getting any of them using iter and match.
yes, not very efficient, and you'll have a problem too if the same symbol is present at different indexes...
g
In fact, I think if I was be sure I could do what I want with coll using Javascript, I would spend some time trying to learn it...
Anybody can confirm this is the way to go?
Merci quand même Guillaume!
why don't you just use the initial data element as an index, instead of ints?
T
Because I using the coll content with a jit.cellblock and I need the sorting to be steady and logic. That is why is use a Int as an index. I also use "insert" and renumbering to be sure everything is in the same order, which makes it difficult to change it to symbol indexed coll.
Each line of data is like a cue, containing lines of actions that are parsed when I trigger it. Actually, I'm triggering them sequentially, one at a time, but I really need to be able to trigger them with a symbol.
Please help!
Thanks.