Message 1 of 14

Not applicable
09-13-2020
05:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have two lists the main and any other list. How to buy the items in a way that if you only have the items from my main list in the other list, return T if not nil.
'(1 3 4 30) ;; main list
(:member '(1 3 4 30)' ( 1 3))
$ T
(:member '(1 3 4 30)' (1 5 6 7))
$ nil
(:member '(1 3 4 30)' (1 4 30))
$ T
[...]
(defun :member ( main lst )
(vl-every '(lambda ( x ) (equal x main)) lst)
)
I'm going this way, but there should be an easy way to do this without needing a lot of if or cond?
Solved! Go to Solution.