There are a number of ways, depending on how you want to identify the item to remove:
;;----------------------------------------------------------------- ;; CUT_LIST.LSP (c)1995-96, John F. Uhden, CADvantage ;; This function deletes the first instance of an item from a list:
;; Corrected thanks to trouble shooting by Peter B. Tobey (defun @cv_cut_list (item items / m) (if (setq m (member item items)) (progn (setq items (reverse items)) (repeat (length m)(setq items (cdr items))) (append (reverse items) (cdr m)) ) items ) ) ;;********************************************** ;; NOTE: To cut all, use (vl-remove item items) ;;---------------------------------------------- ;; Tony Tanzillo (01-25-02) (defun @cv_cut_nth (lst pos / head) (repeat pos (setq head (cons (car lst) head) lst (cdr lst) ) ) (append (reverse head) (cdr lst))
)
If the item might have some value that falls within a range or maybe matches a string pattern then you can...
Command: (vl-remove-if '(lambda (x)(wcmatch (strcase x) "*A*"))'("It" "was" "a" "dark" "night"))
("It" "night")
There's also a (vl-remove-if-not) function that works the same way.