;; tail recursive version of range
(bind-func adrange:[ADList{!a}*,!a,!a,!a]*
(lambda (mn mx i)
(let ((rng (lambda (m x lst)
(if (< x m)
lst
(rng m (- x i) (ADCons x lst))))))
(rng mn mx (ADNil)))))