cross posting from #clojurescript
Complete clojure/cljs newbie, bootstrapped a project with shadow-cljs to display latest artworks from behance
https://github.com/girishso/xilop
For some reason not able to get routing working.. tried using secretary
/`accountant`… maybe i’m missing something obvious(?).
Also, would appreciate any feedback on coding style/structure or anything that stands out to you.
hey guys, quick help I’m trying to implement my own flatten function using only loop recur
(defn my-own-flatten [tree]
(loop [[h & t] tree
result []]
(cond
(nil? h) result
(coll? h) (recur h result)
:else (recur t (conj result h)))))
the code is not working as expected, can you guys give me a hand ?
I’ve fixed my function what you guys think ?
(defn my-own-flatten [tree]
(loop [[h & t] tree
result []]
(cond
(nil? h) result
(coll? h) (recur t (doall (concat result (my-own-flatten h))))
:else (recur t (doall (concat result [h]))))))