(define-macro (dotill predicate expression . args)
(let ((max-iterations (if (null? args) 100000000 (car args))))
`(let impsym38479k ((cnt 0))
(let ((value ,expression))
(if ,predicate
value
(if (> cnt ,max-iterations)
(begin (log-info "Dropping out after max-iterations")
'failed)
(impsym38479k (+ cnt 1))))))))