This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-23
Channels
- # admin-announcements (24)
- # alda (1)
- # aws (10)
- # beginners (15)
- # boot (51)
- # cider (37)
- # clojure (198)
- # clojure-berlin (3)
- # clojure-czech (48)
- # clojure-poland (1)
- # clojure-russia (7)
- # clojure-seattle (1)
- # clojurescript (347)
- # editors (64)
- # emacs (46)
- # hoplon (13)
- # immutant (24)
- # jobs (17)
- # ldnclj (20)
- # ldnproclodo (3)
- # off-topic (8)
- # om (37)
- # onyx (19)
- # re-frame (18)
- # reagent (54)
- # remote-jobs (2)
- # testing (9)
- # yada (1)
- # yleinen (4)
i need to create a breadth first search wrapper using zippers. any ideas?
here's one without a zipper (returns first match of pred)
(defn breadth-first [pred coll] (when (seq coll) (or (first (filter pred coll)) (breadth-first pred (apply concat (filter coll? coll))))))
or - I don't know what a "wrapper" is, so maybe that's totally irrellevant
@abhayarawal: did a quick google-ing and didn’t find anything, should be pretty nice exercise writing it
here’s my actual problem. http://stackoverflow.com/questions/32729795/shortest-path-using-breadth-first-search-in-clojure
@abhayarawal: do you always start searching from the root?
thanks!
@abhayarawal: got it working here: https://gist.github.com/darwin/6fbc796aa6a8a17e71b3
the iteration needs to carry some state around, see the bfs-visits example it was more difficult than anticipated
thanks darwin. i’ll check it out
Any pointers on how our clojurebot /clj is implemented? I want to take it with me to other room
component library is using a lot of syntax like (map->Something) - I can’t find any macro "map->” and it is not part of clojure core. What this is ?
@mr-spock: it's a convention
mr-spock: it’s from defrecord
: http://clojure.org/datatypes