This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-21
Channels
- # aws (2)
- # bangalore-clj (1)
- # beginners (25)
- # boot (2)
- # cider (176)
- # clara (73)
- # cljs-dev (6)
- # cljsrn (31)
- # clojure (40)
- # clojure-greece (9)
- # clojure-india (1)
- # clojure-italy (14)
- # clojure-nl (9)
- # clojure-russia (4)
- # clojure-uk (156)
- # clojurescript (124)
- # core-async (37)
- # cursive (2)
- # data-science (2)
- # datomic (22)
- # emacs (3)
- # fulcro (32)
- # graphql (6)
- # java (3)
- # lein-figwheel (19)
- # lumo (29)
- # nyc (1)
- # off-topic (9)
- # onyx (15)
- # portkey (12)
- # precept (2)
- # re-frame (15)
- # reagent (10)
- # rum (7)
- # schema (2)
- # shadow-cljs (48)
- # tools-deps (35)
- # yada (1)
@tkjone I think that's an instruction telling clojure.tools.namespace not to reload that namespace when changed https://github.com/clojure/tools.namespace#disabling-refresh-in-a-namespace
nothing but tools.namespace should be looking for that metadata, so you shouldn't expect any other code's behavior to change based on it
I have a http-kit/compojure/compojure-api project that I'm building up bit by bit (and probably looking like a luminus app).
Is there a way to get the reload ring middleware to trigger when non-route files change?
At the moment I'm pumping (require 'project.my.ns :reload)
into the REPL every time I change a file
What would people say is conveying a clearer message of what the developer is trying to do:
(def last-item-index (dec data))
;; or
(def last-item-index (.indexOf data (last data)))
they behave differently if items repeat
Cool, but then if we removed the name?
(dec total-items)
;; or
(.indexOf data (last data))
I was skimming and couldn’t understand, but when read (count data)
I was quite surprised
Sorry, total-items
would be a number and yes, the .indexOf
solution is not my preference either, and as you mentioned, does not work in all cases. What I was trying to do is see if there was a clearer way of finding the last index in a vector of items.
The first way was me counting the vector, and then decrementing it by 1 because I want to use the last index in a cljs node array to select the last item
Decrementing the count not only works, but is efficient with vectors O(1) compared to O(n) finding the index of the last item. (if somehow you were forced to look up by value and not known position, isn't there a lastIndexOf
also?)
Good points. Thank you!
Hi, I finished a serie of blog articles for beginners to understand, use and implement transducers. https://dev.to/greencoder/build-your-own-transducer-and-impress-your-cat---part-1-mhp https://dev.to/greencoder/build-your-own-transducer-and-impress-your-cat---part-2-2ja0 https://dev.to/greencoder/build-your-own-transducer-and-impress-your-cat---part-3-2f9k https://dev.to/greencoder/build-your-own-transducer-and-impress-your-cat---part-4-2bp8 https://dev.to/greencoder/build-your-own-transducer-and-impress-your-cat---part-5-14di
Thank you 🙂
I am working on a serie of intense transducer exercises. Will publish on the 30th. Stay tuned.
Feedback is welcome.