提高程序Lisp运行速度的方法[转] test lisp

1、变量名称不超过六位字符;

2、能用+1函数的不用(+ x 1),同理-1函数;

3、能在循环外运算的移到循环外;

4、能用整数的不用实数;

5、能用cons的不用append;

6、能一次计算出来不计算两次;

7、能通过函数功能过滤得到选择集的不用循环筛选;

8、能使用默认值的用默认值;

9、能通过系统变量改变绘图系统的不用命令改变;

10、能用+的不用*,能用*的不用/;

;;;                                                                    ;
;;;  GP-IO.LSP                                                         ;
;;;                                                                    ;
;;;  Copyright 1987, 1988, 1990, 1992, 1994, 1996, 1997, 1998          ;
;;;  by Autodesk, Inc. All Rights Reserved.                            ;
;;;                                                                    ;
;;;  You are hereby granted permission to use, copy and modify this    ;
;;;  software without charge, provided you do so exclusively for       ;
;;;  your own use or for use by others in your organization in the     ;
;;;  performance of their normal duties, and provided further that     ;
;;;  the above copyright notice appears in all copies and both that    ;
;;;  copyright notice and the limited warranty and restricted rights   ;
;;;  notice below appear in all supporting documentation.              ;
;;;                                                                    ;
;;;  Incorporation of any part of this software into other software,   ;
;;;  except when such incorporation is exclusively for your own use    ;
;;;  or for use by others in your organization in the performance of   ;
;;;  their normal duties, is prohibited without the prior written      ;
;;;  consent of Autodesk, Inc.                                         ;
;;;                                                                    ;
;;;  Copying, modification and distribution of this software or any    ;
;;;  part thereof in any form except as expressly provided herein is   ;
;;;  prohibited without the prior written consent of Autodesk, Inc.    ;
;;;                                                                    ;
;;;  AUTODESK PROVIDES THIS SOFTWARE


原文地址:https://www.cnblogs.com/InspiringMind/p/3750383.html