Dinko Tenev wrote: > Doug Quale wrote: > Hmmm...storage is not an issue in the Prolog version. It generates a > candidate solution, then checks membership in the wildcard set, then > backtracks (backtracking is caused by "fail" in the test goal.) On > backtracking, it effectively "forgets" the last solution, so the memory > is freed up (or at least free to be reclaimed through GC.)
How about the other iterator characteristics? when there is a huge solution space can I ask the prolog version to give me the first 1000 solutions? The next 1000 solutions (i.e. 1000 - 1999)? If you can do that then it would appear that generators have no advantage over your prolog solution. -- http://mail.python.org/mailman/listinfo/python-list