The 'remove-if' function searches through 'list-expr' and removes any elements that pass the 'test'. Note that this operation is non-destructive, it does not modify or affect 'list-expr' directly, it creates a modified copy.
(setq mylist '(1 2 3 4 5 6 7 8)) ; set up a list (remove-if 'oddp mylist) ; returns (2 4 6 8) (remove-if 'evenp mylist) ; returns (1 3 5 7) (print mylist) ; prints (1 2 3 4 5 6 7 8) ; note that MYLIST is not affected (setq mylist '(a nil b nil c)) ; set up a list (remove-if 'null mylist) ; returns (A B C)
Common Lisp: XLISP does not support the ':from-end', ':start', ':end', ':count' and ':key' keywords which Common Lisp does.
See the
remove-if
function in the