later I need to check if the list contains an entry which has same value as a variable specified and if it does, then I want to delete the entry.

First I used member and it returned nil, why? (dolist (myvar varlist) (if (member myvar mylist) (setq mylist (delete myvar mylist))))

Then I took member function out and call delete directly, it still not working even though value at all the fields looked the same. Why?(dolist (myvar varlist) (setq mylist (delete myvar mylist)))

Here is what I did, which is working:(dolist (myvar varlist) (dolist (elt mylist) (if (equal myvar elt) (setq mylist (delete elt mylist))) ))Is there another way to do it without using second dolist loop?

Keep in mind that any comparison you make will need to examine the first member of each alist entry, not the entry itself. You may find it easier to debug if you use remove instead of delete, and don't change mylist's binding. If you mess with your input data, you can easily get bad results when you test your function, because the input data isn't what you thought.

The 'eq' test-function inside the lambda construct must be adapted to the exact data types of the variables inside the 'varlist' and the 'value' fields of *mylist*. It must be a function that produces a reasonable result and no error if comparing both values.

Your problem is that you were not doing a list comparison; you were doing an address comparison. The (list :a 'a) in *mylist* is NOT the same (list :a 'a) in *varlist* if you compare with eq. If you compare with equal, you will compare the elements. By default, member uses eq to compare. You need to specify the :test for delete as well.