This thread got busy.
I built a tail recursive (recursive procedure using an iterative process) procedure this morning. Its not very fast nor has it been ``cleaned'' --in fact, its fairly messy and almost incoherent-. If you want, you can time it but it will most likely be slow compared to the others in this thread (I didnt look at the code in this thread, but kinda felt i knew the direction the posters of this thread would go in so I did it to be different not fast).
(defun remove_dups-iter (tmp sofar lis)
(if (null lis)
;; cleanup
(reverse (apply 'append (cons tmp sofar)))
(remove_dups-iter
;; re iterate
(cons
;; tmp list
(if (not (member (car lis) tmp)) (car lis) )
(if (eq (type (car lis)) 'STR) 'nil tmp) )
(cond
;; sofar list
((eq (type (car lis)) 'STR)
(setq sofar (cons tmp sofar))
(setq tmp nil)
sofar)
( sofar ) )
;; remainder of list
(cdr lis))) )
(defun remove_dups_in-between-chars ( lst / tmp )
;; a cleaner interface
(remove_dups-iter '() '() lst) )
(remove_dups_in-between-chars '("a" 3 4 5 5 "b" 8 7 6 3 2 2 1 1 "c" 5 67 87 76 "d" 9 0 5 49 5 9))
=> ("a" 3 4 5 nil "b" 8 7 6 3 2 nil 1 nil "c" 5 67 87 76 "d" 9 0 5 49 nil nil)