本帖最后由 liuhe 于 2023-7-6 14:18 编辑
 - (DEFUN LH:LSTTOLST (LST1 N / LHLSTADD LST2 TEMLST)
- (defun LHLSTADD (LST1 N)
- (SETQ LST1 (REVERSE LST1))
- (REPEAT (- N (LENGTH LST1))
- (SETQ LST1 (CONS "" LST1))
- )
- (REVERSE LST1)
- )
- (REPEAT (FIX (/ (LENGTH LST1) N))
- (REPEAT N
- (SETQ TEMLST (CONS (CAR LST1) TEMLST)
- LST1 (CDR LST1)
- )
- )
- (SETQ LST2 (CONS (REVERSE TEMLST) LST2)
- TEMLST NIL)
- )
- (IF (> (REM (LENGTH LST1) N) 0)
- (REVERSE (CONS (LHLSTADD LST1 N) LST2))
- (REVERSE LST2)
- )
- )
这个简洁了 |