不做太多解释了,上代码
(defn incs [i](+ i 1) )
(defn mydouble [x] (fn [y](x (x y))))
(((mydouble (mydouble mydouble)) incs) 5) ; 结果21
不纠结名称,系统函数包含了,改个名。
(defn square [x](* x x))
(defn compose [x y] (fn [z] (x (y z)) ))
((compose square inc ) 6) ; 结果49
别怀疑了,代码也是执行过的。就这样吧