vl-remove-if Q

Discussion in 'AutoCAD' started by BillZ, May 26, 2004.

  1. BillZ

    BillZ Guest

    R2005 Vlisp:

    I rewrote some of an existing program that displays a list of directories to be removed from a list. You select the ones you want to be removed (delst).
    I use:
    (if (> (length delst) 0) ;if deleting directories
    (setq curlst (vl-remove-if '(lambda (x)(member x curlst)) delst)
    )
    )
    But the whole list (curlst) disappeared.
    Shouldn't just the items in delst have been removed from curlst with this code?

    TIA

    Bill
     
    BillZ, May 26, 2004
    #1
  2. BillZ

    BillZ Guest

    Nevermind,

    I think I got it.

    Bill
     
    BillZ, May 26, 2004
    #2
  3. BillZ

    Joe Burke Guest

    Bill,

    Just curious... was this the problem?

    (setq curlst '("a" "b" "c" "d"))
    (setq delst '("a" "c"))

    Command: (vl-remove-if '(lambda (x) (member x curlst)) delst)
    nil
    Command: (vl-remove-if '(lambda (x) (member x delst)) curlst)
    ("b" "d")

    Joe Burke
     
    Joe Burke, May 26, 2004
    #3
  4. BillZ

    BillZ Guest

    nil, when I needed ("b" "d")


    Bill
     
    BillZ, May 26, 2004
    #4
  5. BillZ

    zeha Guest

    (setq curlst '("a" "b" "c" "d"))
    (setq delst '("a" "b"))

    (vl-remove-if '(lambda (x) (car (member x delst))) curlst)
     
    zeha, May 26, 2004
    #5
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.