Gimp Script-Fu cond 任何条件都不执行



我正在尝试在 Gimp Script-Fu 脚本中设置一个条件语句,但似乎没有任何执行。

(gimp-message "before cond")
(cond
    [#t (gimp-message "I should see this")]
    [else (gimp-message "I shouldn't see this")]
)
(gimp-message "after cond")

我得到的输出如下

script-fu.exe-Warning: before cond
script-fu.exe-Warning: after cond

我在这里做错了什么?为什么我的 gimp 消息都没有出现在 cond 语句中?

我想我从球拍文档中获得了cond语法,因为TinyScheme或更具体地说是Script-Fu的文档并不多

我发现 Gimp 识别的语法基本上是一回事,但用括号 (( 替换括号 []

(gimp-message "before cond")
(cond
    (#t (gimp-message "I should see this"))
    (else (gimp-message "I shouldn't see this"))
)
(gimp-message "after cond")

更换括号后,我得到了预期的输出。令人沮丧的是,说括号出乎意料并没有错误。

最新更新