Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はフォームのリストを持っています:
(or a b c (and d e) f g (and h i) (==> x y))
そして、次のようにサブリストを次のように移動するのandがor好きです:
and
or
(or (and d e) (and h i) a b c f g (==> x y))
これどうやってするの?それはリストであるため、何が最善の方法なのかわかりません。他のデータ構造の場合のように、好きなように要素を配置することはできません。
? (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))