dotill   macro


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

(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))))))))


Back to Index