;;AUTOLOAD: delete-item
;;AUTODOC: delete-item "delete first occurence of an item in a list"
;;(delete-item list item)
;;
;;removes item from list (tested with the equal predicate)
;;returns the list or () if item wasn't there

(defun delete-item (l i &aux pos)
  (if (not (typep l List))
    (error 'Errors:BadArgType l 0 'List)
  )
  (if (setq pos (seek l i))
    (delete l pos)
))

;;AUTOLOAD: delete-item-eq
;;AUTODOC: delete-item-eq "delete first occurence of an item in a list"
;;(delete-item-eq list item)
;;
;;removes item from list (tested with the eq predicate)
;;returns the list or () if item wasn't there

(defun delete-item-eq (l i)
  (catch 'Found 
    (dotimes (n (length l))
      (if (eq i (n l))
	(throw 'Found (delete l n))
))))
