【发布时间】:2011-02-10 11:20:14
【问题描述】:
如何在 Common LISP 中递归删除嵌套括号,例如
(unnest '(a b c (d e) ((f) g))) => (a b c d e f g)
(unnest '(a b)) => (a b)
(unnest '(() ((((a)))) ())) => (a)
谢谢
【问题讨论】:
-
您不删除括号。括号只是列表打印表示的一个方面。你正在做的是扁平化列表。
标签: lisp common-lisp parentheses