Rewrite of zloop in lisp.