KR
Size: a a a
KR
DL
RM
AC
AC
RM
Д
RM
AC
AC
(type x)
в рантайме. Кложа же сама на джаве написана - там у всего есть вполне конкретный типRM
(type x)
в рантайме. Кложа же сама на джаве написана - там у всего есть вполне конкретный типKR
AC
AC
ST
(defn get-items
[]
{:items [1 2 3]
:has-more (rand-nth [true true false])})
(defn get-items*
[prev-result]
(-> (get-items)
(assoc :continue? (not (false? (:has-more prev-result))))))
(->> (iterate get-items* nil)
(drop 1)
(take-while :continue?)
(mapcat :items))
(defn get-items
[]
{:items [1 2 3]
:has-more (rand-nth [true true false])})
(defn get-more-items
[prev-result]
(when (:has-more prev-result)
(get-items)))
(defn lazy-mapcat
[f coll]
(lazy-seq
(when (seq coll)
(concat
(f (first coll))
(lazy-mapcat f (rest coll))))))
(->> (iterate get-more-items (get-items))
(take-while some?)
(lazy-mapcat :items))
DF
DF
ST
DF