微博一则房屋招租信息,Clojure改写一遍。有人写过或发现过类似程序,例如通过程序表达招聘,或个人信息等。
(let [init [8 2 1 0 3]
order [2 0 3 2 4 0 1 3 2 3 3]]
(str "Contact Way:" (reduce str (map init order)))
;"Contact Way:18013820100"
其次大家如何使用LazySeq,例如reduce返回的不是LazySeq,map返回的是LazySeq。大家是否遇到因没有注意到是LazySeq而导致问题?
(let [init [8 2 1 0 3]
order [2 0 3 2 4 0 1 3 2 3 3]]
(str "Contact Way:" (map init order)))
;"Contact Way:clojure.lang.LazySeq@5338b775"