Heap iterators in the compile function