如果LISP编程中仍使用语句,例如:
- (if (this is true)
- .. do this...
- .. else do this...
- )
或使用progn包装多个语句:
- (if (this is true)
- (progn
- .. do this..
- .. and this..
- ) ; end Progn
- .. else do this..
- ) ; end If
或具有多个程序:
- (if (this is true)
- (progn
- .. do this..
- .. and this..
- ) ; end Progn
- (progn
- .. else do this..
- .. and this..
- .. and this..
- ) ; end progn
- ) ; end If
对于调用子函数:
子函数定义如下:
- (defun mysub (arg1 arg2 / var1 var2)
- .. do something..
- )
使用“defun”而不是“defun c:”,其中arg1和arg2是运行它所需的参数,var1和var2是局部变量。
可以这么说:
其中x和y是参数arg1和arg2的值。
希望这对你有意义,如果我错过了什么,尽管问
李 |