every   xtlang


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

Implementation

(bind-func every:[bool,[bool,!a,!b]*,List{!a}*,List{!b}*]*
  (lambda (pred lst1 lst2)
    (let ((f (lambda (l1 l2)
               (if (or (null? l1) (null? l2))
                   #t
                   (if (not (pred (car l1) (car l2)))
                       #f
                       (f (cdr l1) (cdr l2)))))))
      (f lst1 lst2))))


Back to Index

Similar Entries