For instance if lists contain the same elements, this will give wrong result :
(LM:ListDifference '(0 1 1 2 2 2 3 3 3 3 4 4 4 4 4) '(0 1 2 3 4))
will return : nil
;; Returns items appearing exclusively in one list but not ;;Refer:
;; another, i.e. the relative complement: l1 \ l2 ;;
Like the example with Linear ListDifference with the same elements, Lee's subfunction for intersection also fails :
For example :
(LM:ListIntersection '(1 1 2 2 2 3 4 5) '(2 2 4 6 7))
will return :
(2 2 2 4), and should (2 2 4)
This subfunction will return a list expressing the intersection of two lists, that is, a list of items common to both of the supplied lists.Refer:
Again, by my description, this result is correct since duplicate elements will reside in the list intersection.
By my definition of my function, that is the correct result.True if by lists you actually mean sets. A list (in lisp) may contain duplicates, but by definition duplicates in a set makes no sense.
BTW: How come Autolisp code tags doesnt work for me anymore? browser issue?Are you sure you used the CadLisp-7 tag? The seem to work for me:
BTW: How come Autolisp code tags doesnt work for me anymore? browser issue?Are you sure you used the CadLisp-7 tag? The seem to work for me:Code - Auto/Visual Lisp: [Select]
Only recently I've discovered that ListDifference subfunction isn't always applicable, so I am refering to this example found on
(diff '(0 1 1 2 2 2 3 3 3 3 4 4 4 4 4) '(0 1 2 3 4))
(1 2 2 3 3 3 4 4 4 4)
...