Search found 4 matches

by socket2810
Sun Jan 04, 2015 3:17 pm
Forum: Support and Development
Topic: Nested Table Iterator
Replies: 19
Views: 9441

Re: Nested Table Iterator

Thanks for those, even thought I still can't understand how you're using next in your "stack". I profiled all our functions and surprisingly yours, using hash tables were faster than mine using an array (the coroutine solution was barely faster, thought). Perhaps my solution returning the ...
by socket2810
Sun Jan 04, 2015 7:55 am
Forum: Support and Development
Topic: Nested Table Iterator
Replies: 19
Views: 9441

Re: Nested Table Iterator

But then I wouldn't have a stack. You do not need the order of the elements. Perhaps I don't, but I'd want to. As a matter of fact, I just tried to make it without using a stack, and even after I had exceeded my personal amount of not indicated programming practices, I still didn't managed to do it...
by socket2810
Sat Jan 03, 2015 7:32 pm
Forum: Support and Development
Topic: Nested Table Iterator
Replies: 19
Views: 9441

Re: Nested Table Iterator

It is simply easier. The function I made that does what you asked isn't something easy to do for someone new to Lua, not everyone knows how iterator functions works in Lua, or ipairs/pairs/next for example. Also if you have all your results before you iterate over them, you will also know how many r...
by socket2810
Sat Jan 03, 2015 3:08 am
Forum: Support and Development
Topic: Nested Table Iterator
Replies: 19
Views: 9441

Re: Nested Table Iterator

Probably you should rather iterate through all the tables with a simple recursive function while adding all values to a return table, then iterate through that table, however, if you really want an iterator function, I've quickly made one for you, coupled with an example after said function: functio...