- ;;假设 (setq l1 '((1 3 2) (2 3 4) (3 4 5)))
- ;; (setq l2 '(( 3 4 2) (3 5 1) (4 6 7)))
- (mapcar '(lambda (a b) (apply 'mapcar (cons a b)))
- '(min max)
- (list l1 l2)
- )
- 结果:'((1 3 2) (4 6 7))
- 上式等价与==>
- (list
- ((lambda (a b) (apply 'mapcar (cons a b)))
- 'min l1)
- ((lambda (a b) (apply 'mapcar (cons a b)))
- 'max l2)
- )
- 上式等价与==>
- (list
- (apply 'mapcar (cons 'min l1))
- (apply 'mapcar (cons 'max l2))
- )
- 上式等价与==>
- (list
- (apply 'mapcar (list 'min '(1 3 2) '(2 3 4) '(3 4 5)))
- (apply 'mapcar (list 'max '( 3 4 2) '(3 5 1) '(4 6 7)))
- )
- 上式等价与==>
- (list
- (list
- (min 1 2 3)
- (min 3 3 4)
- (min 2 4 5)
- )
- (list
- (max 3 3 4)
- (max 4 5 6)
- (max 2 1 7)
- )
- )
|