robierzo Posted September 23, 2012 Posted September 23, 2012 Hello. I need get two list: 1º-. I have a list: (setq lista1 '((10 20) (30 40) (25 63) (78 45) (30 40) (12 36) (25 63) (33 70))) Remove the points that are repeated in a list. Result: lista1-A '((10 20) (30 40) (25 63) (78 45) (12 36) (33 70)) 2º-. I have a list: (setq lista2 '((10.05 20.35) (30.48 40.69) (25.74 63.09) (78.42 45.60) (10.03 20.35) (12.72 36.44) (25.78 63.12) (33.22 70.99))) Remove the points that are repeated in a list (margen of error in the distance between points = 0.10m.) Result: lista2-A '((10.05 20.35) (30.48 40.69) (25.74 63.09) (78.42 45.60) (12.72 36.44) (33.22 70.99)) Regards Quote
Tharwat Posted September 23, 2012 Posted September 23, 2012 (foreach x lista1 (if (not (member x lst)) (setq lst (cons x lst)) ) ) (reverse lst) Quote
robierzo Posted September 23, 2012 Author Posted September 23, 2012 O.K., tharwat. The first case is perfect. For the segond case??? Regards. Quote
Tharwat Posted September 23, 2012 Posted September 23, 2012 O.K., tharwat. The first case is perfect. For the segond case???Regards. Your second issue is not that clear to me , more specifications needed . Quote
Lee Mac Posted September 23, 2012 Posted September 23, 2012 http://lee-mac.com/uniqueduplicate.html Quote
robierzo Posted September 23, 2012 Author Posted September 23, 2012 Thank you very much to two. Lee, your website is very interesting. It's what he wanted. I will give an overview. Thank you very much. A greeting. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.