Lisp position of nested list element with children
问题 Say we have the following list: (A B C D) We can find the index of C with: (position 'C '(A B C D)) If, however one of the list elements is nested with its own children: (position 'B '(A (B 1 2 (3 x y z)) C D)) The function would yield NIL . How do we effectively locate the nth position of elements within a nested list like this, especially if the atom is located within a sub-list like, for example, y ? ----- Here's my attempt thus far: (setq lst (A (B 1 2 (3 x y z)) C D)) (defun top-level