# File cartesian_iterator.rb, line 48 def each return false if @tot_iter < 1 elems = [] for list in @lists elems << list.restart_and_raw_next end if RUBY_VERSION <= '1.9.1'; yield *elems.map {|x| x }; else; yield *elems; end last_list_index = @lists.size-1 n = last_list_index loop do if elems[n] = @lists[n].raw_next if RUBY_VERSION <= '1.9.1'; yield *elems.map {|x| x }; else; yield *elems; end n = last_list_index next elsif n > 0 elems[n] = @lists[n].restart_and_raw_next n -= 1 else return true end end end