如果在“finally”块中存在“if”语句,并且包含“finally”的“try”位于 CLJS 的“go”块中,那么“try”的结果始终为 nil。
示例代码
(ns demo
(:require-macros
(link: cljs.core.async.macros :refer [go)]))
;; 输出: "in a try"
(println (try "in a try" (finally (if true nil ))))
;; 输出: "in a try"
(go (println (try "in a try" (finally nil))))
;; 输出: nil
(go (println (try "in a try" (finally (if true nil )))))