如何在 else
中执行多个表达式块 if
声明,当使用 ELisp 时?
最佳答案
你不需要progn
为此,因为这已经是默认行为:
高频if
可再生能源
if is a special form in `C source code'.
(if COND THEN ELSE...)
If COND yields non-nil, do THEN, else do ELSE...
Returns the value of THEN or the value of the last of the ELSE's.
THEN must be one expression, but ELSE... can be zero or more expressions.
If COND yields nil, and there are no ELSE's, the value is nil.
重用 sindikat 的例子:
(if (> 1 2)
(message "True")
(message "False")
(message "I repeat, completely false"))
当然,您会使用
progn
如果您希望计算 THEN
中的多个表达式形式。
关于emacs - ELisp:如何在 'else' block 中执行多个表达式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10330731/