本帖最后由 wowan1314 于 2013-7-27 14:02 编辑
再写。- (defun t1 (lst)
- (setq l1 (car lst) ll (cdr lst))
- (mapcar
- '(lambda(a)
- (mapcar
- '(lambda(b)
- (if (member b a) nil (setq l1 (vl-remove b l1))
- )
- )
- l1
- )
- )
- ll
- )
- L1
- )
居然写了这么多。。。 哎- ;(T2 (list l1 l2 l3 l4))
- (defun t2 (lst / l1 l2 l3 ll t1)
- (defun t1 (lst / lst1 lst2)
- (setq lst2 lst)
- (mapcar
- '(lambda(x)
- (setq lst2 (cdr lst2))
- (if (member x lst2)
- (if (member x lst1) nil (setq lst1 (cons x lst1))
- )
- )
- )
- lst
- )
- lst1
- )
- (setq l1 (car lst) l2 (cadr lst) l3 (t1 (append l1 l2)) lst (cddr lst))
- (while (setq ll (car lst))
- (setq l3 (t1 (append l3 ll)) lst (cdr lst))
- )
- l3
- )
|