How to remove nested parentheses in LISP

Posted by orcik on Stack Overflow See other posts from Stack Overflow or by orcik
Published on 2010-04-21T06:54:08Z Indexed on 2010/04/21 7:13 UTC
Read the original article Hit count: 222

Filed under:
|

How can I remove nested parentheses recursively in Common LISP Such as

  (unnest '(a b c (d e) ((f) g))) => (a b c d e f g)
  (unnest '(a b))                 => (a b)
  (unnest '(() ((((a)))) ()))     => (a)

Thanks

© Stack Overflow or respective owner

Related posts about lisp

Related posts about parentheses