replace unless macro by a while macro