foldr   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/adt.xtm

Implementation

(bind-func foldr:[!b,[!b,!a,!b]*,!b,List{!a}*]*
  (lambda (fn end lst)
    (let ((fold (lambda (l r) ; list result
                  (if (null? l)
                      r
                      (fold (cdr l) (fn (car l) r))))))
      (fold (reverse lst) end))))


Back to Index

Similar Entries