vl-remove-if-not (AutoLISP)

Returns all elements of the supplied list that pass the test function

Supported Platforms: Windows and Mac OS

Signature

(vl-remove-if-not predicate-function lst)
predicate-function

Type: Subroutine or Symbol

The test function. This can be any function that accepts a single argument and returns T for any user-specified condition. The predicate-function value can take one of the following forms:

  • A symbol (function name)
  • '(LAMBDA (A1 A2) ...)
  • (FUNCTION (LAMBDA (A1 A2) ...))
lst

Type: List

A list to be tested.

Return Values

Type: List or nil

A list containing all elements of lst for which predicate-function returns a non-nil value

Examples

(vl-remove-if-not 'vl-symbolp (list pi t 0 "abc"))
(T)