This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-26
Channels
- # bangalore-clj (3)
- # beginners (47)
- # boot (20)
- # cljs-dev (7)
- # cljsjs (16)
- # cljsrn (3)
- # clojure (46)
- # clojure-art (4)
- # clojure-berlin (1)
- # clojure-brasil (2)
- # clojure-greece (1)
- # clojure-india (5)
- # clojure-russia (1)
- # clojure-spec (34)
- # clojure-taiwan (2)
- # clojure-uk (8)
- # clojurescript (69)
- # cursive (9)
- # datascript (26)
- # datomic (1)
- # emacs (2)
- # events (1)
- # hoplon (8)
- # leiningen (3)
- # off-topic (4)
- # proto-repl (4)
- # re-frame (3)
- # reagent (1)
- # rethinkdb (8)
- # rum (3)
- # vim (83)
@dpsutton I was thinking if I changed the acc to (.indexOf x) and compared it with a modular is equal to zero .
@dominicm , oke, then I have to think of another way to make the code I made with dpsutton without the counter
https://clojurians.slack.com/archives/beginners/p1480106600004642 are you trying a loop-less version of this?
yes, and with the help of dpsutton we made this one :
(fn [s n] (last(reduce (fn [[ acc output] x] (if (= acc n ) [ output] [ (+ acc 1) (conj output x)] ))
the idea is that you pass it a seq of some time and ask it to drop every nth member. so (drop-nth [1 2 3 4 5 6] 3)
=> [1 2 4 5]
i was thinking without an explicit argument for the counter, and using a mutable inside
sean mentioned that we could pass that state in and not mutate a var so we did it better
I still have to work on my developer mind set. Sometimes I cannot figure out which small steps I can take to solve a problem
In this case, you could try to turn
[1 2 3]
into [[0 1] [1 2] [2 3]]
Then you can filter those into the ones where the first is an nth
Then nap over them and get the second value out
I suspect one of you plugins in your Leiningen setup has an old version of tools.namespace being pulled in.
The Clojure.spec error points to this
(clojure.tools.namespace.find (:require [ :as io] [clojure.set :as set] [clojure.tools.namespace.file :as file] [clojure.tools.namespace.parse :as parse]) (import ( File FileReader BufferedReader PushbackReader InputStreamReader) (java.util.jar JarFile JarEntry)))
and the import should be :import therethanks @seancorfield I will check it out
I'm on my phone right now but check in your ~/.lein folder and see what plugins you have configured.