std-member-if


Synopsis

(std-member-if <pred> <lst>)

Description

STD-MEMBER-IF searches the list for any matching element and returns the rest of the list including the first found element.

In Visual Lisp it is builtin as VL-MEMBER-IF, in Vital Lisp as VLX-MEMBER-IF.

Examples

(std-member-if 'numberp '(0 1 2 3))      => (0 1 2 3)
(std-member-if 'stringp '(0 "1" 2 "3"))  => ("1" 2 "3")

Arguments

pred: a function or lambda list accepting one argument and returning either nil or non-nil.

lst: any proper list.

Return Value

A list.

Side Effects

Beware that the predicate pred may produce any side-effects.

It may throw an stack overflow error if the recursion stack is exhausted. In plain AutoLISP this may be a maximal lisp length of about 240, dependent of the version.

Module

(std-require 'STDLIST)

Defined in STDLIST