1

我有一个表格列表:

(or a b c (and d e) f g (and h i) (==> x y))

我喜欢像这样移动以以下开头的子and列表or

(or (and d e) (and h i) a b c f g (==> x y))

我怎样才能做到这一点?我不确定什么是最好的方法,因为它是一个列表,我不能像使用其他数据结构一样放置任何我想要的元素。

4

1 回答 1

1
? (stable-sort (rest '(or a b c (and d e) f g (and h i) (==> x y)))
               (lambda (x y)
                 (and (consp x) (eq (first x) 'and))))
((AND H I) (AND D E) A B C F G (==> X Y))
于 2013-02-01T16:56:46.163 回答