foreach: allow a single argument to foreach_int() and foreach_ptr().