The following does almost what I want. How do I get it to generate the same output without the nils? Thanks,
Stan
(setq modes '((a b c) (d e f) (g h) (i j) (k) (l m n)))
(defun xnotemodes (x) (if (= (length x) 3) x ))
(mapcar #'xnotemodes modes)
--> ((a b c) (d e f) nil nil nil (l m n))
Here are two things I tried which did not work:
(setq modes '((a b c) (d e f) (g h) (i j) (k) (l m n)))
(defun xnotemodes (x) (remove-if (= (length x) 3) x ))
(mapcar #'xnotemodes modes)
--> ERROR: Undefined function t called with arguments (a).
(setq modes '((a b c) (d e f) (g h) (i j) (k) (l m n)))
(defun xnotemodes (x) (remove-if
(not (equal (length x) 3))
x))
(mapcar #'xnotemodes modes)
-->ERROR: Undefined function nil called with arguments (a).