I'm not sure what you're asking, but if you use the final function I
penned from this discussion and use it to process the three samples
you provided --
( (lambda ( / flatten )
(defun flatten ( lst / f1 f2 )
(defun f1 ( lst )
(apply 'append
(mapcar 'f2 lst)
)
)
(defun f2 ( x / a )
(if x
(if (listp x)
(if (listp (setq a (car x)))
(append (f1 a) (f1 (cdr x)))
(cons a (f1 (cdr x)))
)
(list x)
)
'(nil)
)
)
(f1 lst)
)
(mapcar 'print
(mapcar 'flatten
'(
("A" ("B1" "B2" "B3" "B4" "B5") "C" "D" "E")
(10 (20.1 20.2 20.3 20.4 20.5) 30 40 50)
(10 (20 21 (22.1 22.2 (22.30 22.31 22.32) 22.4) 23 24) 30 (40 41 42) 50)
)
)
)
(princ)
)
)
It outputs this --
("A" "B1" "B2" "B3" "B4" "B5" "C" "D" "E")
(10 20.1 20.2 20.3 20.4 20.5 30 40 50)
(10 20 21 22.1 22.2 22.3 22.31 22.32 22.4 23 24 30 40 41 42 50)
Which in my mind faithfully honors the original intent of the function.
Hope that helps / clarifies.
Cheers and welcome to the swamp.