adrange   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/tests/core/algebraic_data_types.xtm

Implementation

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


Back to Index

Similar Entries