【发布时间】:2016-04-17 06:58:34
【问题描述】:
(deftask test1 "first test task" [] (print "1") identity)
(deftask test2 "second test task" [] (print "2") identity)
(boot (comp (test1) (test2)))
=> 12nil
(boot (comp (fn [x] (print "1") identity) (fn [x] (print "2") identity)))
=> 21nil
如果我在任务上使用comp,执行顺序是从左到右。如果我在匿名函数上使用comp,执行顺序是从右到左。这种不一致如何合理?
【问题讨论】:
标签: clojure function-composition boot-clj