本帖最后由 liuhe 于 2023-4-29 23:51 编辑
- (setq lst1 '(1 2 3 4)
- lst2 '(5 6 7 8))
- (apply 'append (mapcar 'list lst1 lst2))
- (1 5 2 6 3 7 4 8)
- (setq m '((0 1 2) (3 4 5) (6 7 8)))
- (apply 'mapcar (cons 'list m))
- (
- (0 3 6)
- (1 4 7)
- (2 5 8)
- )
- (setq m '((1 2 3 4) (5 6 7 8)))
- (apply 'mapcar (cons 'list m))
- (
- (1 5)
- (2 6)
- (3 7)
- (4 8)
- )
- (apply 'append (apply 'mapcar (cons 'list m)))
- (LH:nentseltonentselp
- '((0.0393701 0.0 0.0)
- (0.0 0.0393701 0.0)
- (0.0 0.0 0.0393701)
- (16.1693 14.733 0.0)
- )
-
- )
- ((0.0393701 0.0 0.0 16.1693)
- (0.0 0.0393701 0.0 14.733)
- (0.0 0.0 0.0393701 0.0)
- (0.0 0.0 0.0 1.0)
- )
- (defun LH:nentseltonentselp (lst / i)
- (setq i -1)
- (append
- (mapcar
- (function
- (lambda (x) (append x (list (nth (setq i (1+ i)) (last lst)))))
- )
- (reverse (cdr (reverse lst)))
- )
- (list (list 0.0 0.0 0.0 1.0))
- )
- )
(1 5 2 6 3 7 4 8)代码来至于 lee-mac
|