comparing 2 lists

Discussion in 'AutoCAD' started by martin, Aug 18, 2003.

  1. martin

    martin Guest

    how is it possible to see of two lists are identical or not?
    gr.
    miran
     
    martin, Aug 18, 2003
    #1
  2. martin

    Rudy Tovar Guest

    Apples and Oranges, numerical or not, length and sorting.

    Take your pick.

    You'll have to explain the conditions.

    Are you dealing with names, numbers, points, lowercase, uppercase, etc.
     
    Rudy Tovar, Aug 18, 2003
    #2
  3. martin

    Mark Propst Guest

    (defun test()
    (setq lst1(list "a" "b" "c"))
    (setq lst2(list "a" "b" "c"))
    (equal lst1 lst2))
     
    Mark Propst, Aug 18, 2003
    #3
  4. martin

    Mark Propst Guest

    exactly!
    he asked if they were identical.
    As you pointed out, he may have in mind other variations from identity, but
    what he asked for was a test for identity.
    since I can't read his mind I just went the simple route and figured he'd
    ask more clearly if that wasn't what he needed.
     
    Mark Propst, Aug 18, 2003
    #4
  5. martin

    Rudy Tovar Guest

    A list is a list, as you very well know, can and will consist of any
    variation and not some simple identity.

    Past post have already clarified that (list "a123" "b123") (list "A-101"
    "A-102") etc.

    Identical to what extreme is not as simple as you implied nor did he.

    If it were a match of layers, that doesn't even consist of simple (equal
    (list item)(list item)) unless you create an upper case and sort listing.

    I guess what he needs is to assure himself of is that the listings are
    sorted correctly first, and pass through some differing testing,
    <Length>,<Depth>, etc.

    --
    Rodolfo Tovar
    www.Cadentity.com
     
    Rudy Tovar, Aug 18, 2003
    #5
  6. martin

    Mark Propst Guest

    Estimado Senor Tovar,

    original question:
    "how is it possible to see of two lists are identical or not?"

    I think our conversation has been adequate to convey to orig poster that he
    needs to be more explicit in his question if it's not exactly what he meant
    to ask.
    As always I look forward to your valuable insights should he ask for more
    clarification on this topic.
    Respectfully,
    Mark
     
    Mark Propst, Aug 18, 2003
    #6
  7. martin

    Rudy Tovar Guest

    What makes you think I was speaking to Mark?

    I'm just keeping the thread going.
     
    Rudy Tovar, Aug 18, 2003
    #7
  8. martin

    Rudy Tovar Guest

    Oh I see, Got to watch my typing, rats.

    Sometimes I catch my self typing faster that I'm listening...to my self of
    course...
     
    Rudy Tovar, Aug 18, 2003
    #8
  9. martin

    Rudy Tovar Guest

    Sorry about that, I think I'm having brain laps. I started by continuing the
    thread with conditions, but somehow went off on a tangent.

    Ever start typing something then later realize how did I type that.

    Must be the 5 hours of sleep I got last night, or perhaps the 4 the night
    before...or Friday....
     
    Rudy Tovar, Aug 19, 2003
    #9
  10. martin

    martin Guest

    they are:
    block name, insertion point, scale, rotaion
     
    martin, Aug 19, 2003
    #10
  11. martin

    Rudy Tovar Guest

    (setq lt (ck-list <list1> <list2>))

    (member nil lt)

    (defun ck-list ( first second /)
    (mapcar 'equal first second)
    )
    --
    Rodolfo Tovar
    www.Cadentity.com
    AUTODESK
    Authorized Developer
     
    Rudy Tovar, Aug 19, 2003
    #11
  12. martin

    Rudy Tovar Guest

    Perhaps even ,

    (ck-list <list1> <list2>)

    (defun ck-list ( first second /)
    (if
    (member nil (mapcar 'equal first second))
    nil t)
    )
    --
    Rodolfo Tovar
    www.Cadentity.com
    AUTODESK
    Authorized Developer
     
    Rudy Tovar, Aug 19, 2003
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.