Mark, as far I can see all these from Se7en's challenge worked:
;; nthRemove challenge by Se7en, jan. 2004
;; Keith:
(defun NthRemover ( ndx lst / count newlist )
(setq count 0)
(repeat (length lst)
(if (/= count ndx)
(setq newlist (append newlist (list (car lst))))
)
(setq lst (cdr lst)
count (1+ count)
)
)
newlist
)
;; Keith:
;; Only removing if unique value to be removed!
(defun nthremove ( ndx lst )
(append
(reverse (cdr (member (nth ndx lst) (reverse lst))))
(cdr (member (nth ndx lst) lst))
)
)
;; Kerry B:
(defun nthremover_2 (lst i / tmp)
(if (and i (vl-consp lst) (not (minusp i)))
(progn (repeat (min i (length lst))
(setq tmp (cons (car lst) tmp)
lst (cdr lst)
)
)
(append (reverse tmp) (cdr lst))
)
lst
)
)
;; SMadsen:
(defun removeNth (lst i / a)
(setq a -1)
(vl-remove-if (function (lambda (n)(= (setq a (1+ a)) i))) lst)
)
;; SMadsen:
(defun nthRemove_2 (lst i)
(and (atom i)(setq i (cons 0 i)))
(cond ((null lst) nil)
((= (car i) (cdr i))(nthRemove_2 (cdr lst) (cons (1+ (car i)) (cdr i))))
((cons (car lst) (nthRemove_2 (cdr lst) (cons (1+ (car i)) (cdr i)))))
)
)
;; SMadsen:
(defun removeNth_2 (lst i / a b)
(cond ((>= i (length lst)) lst)
((setq a lst b (reverse lst))
(append (reverse (repeat (- (length b) i) (setq b (cdr b))))
(repeat (1+ i) (setq a (cdr a))))
)
)
)
;; Se7en:
(defun nthRemover_3 (lst item / nlst cntr)
(defun Nested-nthRemover (lst item)
(if (/= (if (not cntr)
(setq cntr 0)
cntr
)
item
)
(setq nlst (cons (car lst) nlst))
)
(setq cntr (1+ cntr))
(if (> (length (cdr lst)) 0)
(Nested-nthRemover (cdr lst) item)
(setq cntr nil)
)
(reverse nlst)
)
(Nested-nthRemover lst item)
)