Sorry for the intrusion, but there is something I do not understand. If we, for example, stating that this function is reliable:
;; Unique with Fuzz - Lee Mac
;; Returns a list with all elements considered duplicate to
;; a given tolerance removed.
(defun LM:UniqueFuzz ( l f / x r )
(while l
(setq x (car l)
l (vl-remove-if (function (lambda ( y ) (equal x y f))) (cdr l))
r (cons x r)
)
)
(reverse r)
)
(LM:UniqueFuzz '(1.0 1.1 1.19 1.2 1.21 1.22 1.23 1.25 1.3) 0.05)
=> (1.0 1.1 1.19 1.25 1.3)
So: (1.2 1.21 1.22 1.23) are duplicates? This is the required result?
; 20150114 - 1.00 - only for test
(defun ALE_List_FindDupesFuzz (In_Lst FuzFac / OutLst TmpLst NthVal Countr)
(setq OutLst (list (car In_Lst)) In_Lst (cdr In_Lst))
(foreach ForElm In_Lst
(if (vl-position ForElm OutLst)
OutLst
(progn
(setq Countr 0)
(while (and Countr (setq NthVal (nth Countr OutLst)))
(if (equal ForElm NthVal FuzFac)
(setq Countr nil)
(setq Countr (1+ Countr))
)
)
(if NthVal
(setq TmpLst (cons ForElm TmpLst))
(setq OutLst (cons ForElm OutLst))
)
)
)
)
(reverse TmpLst)
)
(ALE_List_FindDupesFuzz '(1.0 1.1 1.19 1.2 1.21 1.22 1.23 1.25 1.3) 0.05)
(1.2 1.21 1.22 1.23)