member   xtlang


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

Implementation

(bind-func member:[List{!a}*,!a,List{!a}*,[bool,!a,!a]*]*
  (lambda (element lst pred)
    (let ((f (lambda (l)
               (if (null? l)
                   null
                   (if (pred element (car l))
                       l
                       (f (cdr l)))))))
      (f lst))))


Back to Index

Similar Entries