I have a parallel processing code written in Wolfram Mathematica, similar to:
ParallelDo[
DoSomething[i],
{i, Select[Range[Power[2, k] - 1], # >= IntegerReverse[#, 2] &]}
]
My problem is that output of Select[Range[]] can be quite large, and Mathematica seems to generate whole list first and then starts iterating - I would like to avoid this to save memory and time. Basically what I am looking for is something similar to Python generators, that is to generate the iterator dynamically, only when it is needed.
What is some (preferably simple) way to achieve this? In other languages I would do it by making the parallelizing logic by myself, but I would like to utilize maximum of what Mathematica already provides.
enumerate? – MarcoB Jan 04 '20 at 19:23