(setq a nil)
(setq b nil)
(defun one ()
(if a
(funcall two)
(progn
(print 's)
(if b
(funcall two)
(progn
(print 'ss)
(funcall one)
)
)
)
)
)
(defun two ()
(print 'sss)
)
(one)
本文通过具体的 Lisp 代码示例展示了条件分支及函数递归调用的过程。介绍了如何使用 if 和 progn 语句来实现不同的逻辑路径,并演示了如何通过 funcall 进行函数调用。
(setq a nil)
(setq b nil)
(defun one ()
(if a
(funcall two)
(progn
(print 's)
(if b
(funcall two)
(progn
(print 'ss)
(funcall one)
)
)
)
)
)
(defun two ()
(print 'sss)
)
(one)
2302
2096

被折叠的 条评论
为什么被折叠?