【发布时间】:2018-08-03 14:57:55
【问题描述】:
得到 TypeError: 不知道如何包装
运行时
;a fn object
(setv a_fn (fn [x] (+ 1 x)))
;a mock predicator
(setv predicator True)
;inject predicator and a_fn into a (cond ..)
(setv cond_expr `(cond [(~predicator) [~a_fn]]))
;eval at another place
(eval cond_expr)
如何创建 "cond_expr" 以获得结果 [a_fn] ?
【问题讨论】:
标签: hy