Fork me on GitHub
#code-reviews
<
2019-08-18
>
girish14:08:49

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.

tdantas16:08:31

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)))))

tdantas16:08:41

the code is not working as expected, can you guys give me a hand ?

tdantas16:08:39

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]))))))