compare two lists

  • Thread starter Thread starter jayasree
  • Start date Start date
J

jayasree

i got two lists which has the insertion point and the end point

ex ins_pt (-3.5432 4.5678)
end_pt (-3.5432 4.5678)

When i use (equal ins_pt end_pt) it returns nil.

Is there any other way to compare both lists and return T.

Thanks,
Jayasree
 
If my memory is correct equal is used for comparing list and eq for
variables.

So using the two points above in the following will yield true:

(setq ins_pt '(-3.5432 4.5678)
end_pt '(-3.5432 4.5678))
(if (equal ins_pt end_pt)
(princ "\nThey are equal ")
(princ "\nThey are not equal")
)
(princ)

Also try with two lists that are not exactly the same with the optional
fuzz input variable of equal:

(setq ins_pt '(-3.5432 4.567)
end_pt '(-3.5432 4.566))
(if (equal ins_pt end_pt 0.005)
(princ "\nThey are equal ")
(princ "\nThey are not equal")
)

Hope this helps comparing lists
 
Back
Top