Well shoot ... look what happens when you show up late to the party ... you miss all of the fun ....
Oh, here are some observations ...
This code in not in compliance with "The Act" and will only work on VB6, does not return a value to the calling function, and does not set a retrievable value within the code.
(defun numrem (lst)
;;(setq lst '(1 2 3 4 5 6 7 8 9 0 3 3 3 3))
(vl-remove 3 lst)
(princ)
)
This code is simple, is in full compliance with "The Act" and will work with R12 through R2004, it also returns a value to the calling function and localizes all variables to prevent conflicts with other code.
(defun Remove_Atom (itm lst / i rtn_list)
(setq i 0)
(repeat (length lst)
(if (/= (nth i lst) itm)
(setq rtn_list (append rtn_list (list (nth i lst))))
)
(setq i (1+ i))
)
rtn_list
)
This code is simple and concise, will run on R12 through R2004 and sets a variable that can be retrieved by the calling function. It does not however, return a value to the calling function, nor does it make use of local variables.
(defun numrem (lst litem)
;;(setq lst '(1 2 3 4 5 6 7 8 9 0 3 3 3 3))
(foreach item lst
(if (= item litem)
(setq three (append three (list item)))
)
)
(princ)
)
This code is simple and concise, utilizes localized variables and returns a value to the calling function and is in full compliance with "The Act".
(defun RemoveFromList (Lst Item / NewLst)
(mapcar
'(lambda (x)
(if (/= x item)
(setq NewLst (cons x NewLst))))
Lst
)
(reverse newlst)
)
I think Se7en wins his own prize ....
But then I was too slow to respond