 - ;函数tt 对表进行特殊合并
- ;(tt '((1 2) (2 3) (3 4) (5 6) (6 5) (6 7))) 返回 ((1 4) (5 5) (6 7))
- (defun tt (lst / f nlst)
- (setq f (lambda (x y)
- (if (= (caar y) x)
- (f (cadar y) (cdr y))
- (list x y)
- )
- )
- )
- (if lst
- (cons (list (caar lst) (car (setq nlst (f (cadar lst) (cdr lst)))))
- (tt (cadr nlst))
- )
- )
- )
|