vl-member-if


(vl-member-if comparator lst)

This function returns a list, starting with first item in lst which matches the comparator function.

Arguments

comparator  (symbol, function, lambda) function used for the boolean comparison; must return NIL resp. non-NIL
lst  (list) any list of items

Return

list of all items, starting with the first item which matches the comparator function; if no list item matches the comparator, NIL is returned

Example

(vl-member-if '(lambda (x) (> x 5)) '(1 2 3 4 5 6 7 8 9 10))
returns (6 7 8 9 10)

Remarks

validation of each list item stops at the first item, which matches the comparator function (that is, the comparator function returns non-NIL), and returns the remainder of the list, from that item



©  Bricsys NV. All rights reserved.