Hi guys,
Today I was kinda stuck with my ideas and attempts about this.
I was trying to write the following sub-functions:
Function #1 that determines if all of the items are equal to 'nil' or 'T'. (maybe use vl-every?)
Lets name it: (defun IsEveryItem)
Function #2 that determines if there are items equal to 'nil' or 'T'. (use vl-some!)
Lets name it: (defun IsSomeItem)
Check the examples to understand what I mean:
(setq LstOne (list nil nil nil nil nil nil))
(setq LstTwo (list T T T T T T T T))
(setq LstThree (list nil T T nil T nil nil))
(IsEveryItem 'T LstOne) -> nil
(IsEveryItem 'T LstTwo) -> T
(IsSomeItem 'nil LstOne) -> T
(IsSomeItem 'T LstOne) -> nil
(IsSomeItem 'T LstThree) -> T
(IsSomeItem 'T LstThree) -> T
I remember that once I was successful about writing func #1, by just doing something like:
(defun IsEverythingNil ( Lst / ) (if (= 0 (length (vl-remove 'nil Lst))) 'T nil))
But honestly, my approach seems kinda lame... so I've created this thread to see your professional suggestions about this task.