This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-18
Channels
- # architecture (25)
- # beginners (57)
- # boot (3)
- # cider (38)
- # clara (6)
- # cljsrn (6)
- # clojure (54)
- # clojure-china (4)
- # clojure-greece (1)
- # clojure-italy (3)
- # clojure-romania (1)
- # clojure-russia (7)
- # clojure-spec (68)
- # clojure-uk (46)
- # clojurescript (73)
- # community-development (2)
- # core-async (7)
- # cursive (17)
- # datomic (143)
- # duct (2)
- # emacs (12)
- # events (5)
- # figwheel (3)
- # fulcro (15)
- # hoplon (19)
- # jobs (12)
- # jobs-discuss (85)
- # nginx (3)
- # off-topic (111)
- # onyx (7)
- # other-languages (1)
- # re-frame (30)
- # reagent (19)
- # remote-jobs (1)
- # ring (7)
- # rum (1)
- # shadow-cljs (18)
- # spacemacs (4)
- # specter (4)
- # sql (24)
- # test-check (1)
- # unrepl (10)
- # vim (6)
- # yada (1)
Hey guys, anyone can help me?
@noisesmith Thank you very much. It seems subseq
can perfectly solve my problem. đ»
what is the best way to concat a collection of Vectors into a single vector, i.e. [[1 2 3] [a b c] [:d :e :f]] -> [1 2 3 a b c :d :e :f]
flatten
?
Concat?
(into [] (concat [1 2 3] [a b c] [:d :e :f]))
I'm going to stick with (reduce into [] ...) for now; I still don't feel comfortable with transducedrs
@sundarj: hmm, https://github.com/clojure/clojure/blob/clojure-1.9.0-alpha14/src/clj/clojure/core.clj#L7494 is not too bad, it's in fact rathedr straight forward
I'm trying to create a function spec and get it to throw the spec error, but even after defining an fspec it doesn't throw a spec related error, just the standard clojure error. For example
(defn test-inc [s] (inc s))
(s/fdef test-inc
:args (s/cat :i number?)
:ret number?)
(test-inc "s")
This only throws the runtime ClassCastExcception, not the spec error. Is it something I have to enable for the repl or is there another step?@theeternalpulse You have to instrument
the var. https://clojure.org/guides/spec#_instrumentation_and_testing
Thanks for that.
@theeternalpulse And if you donât notice, thatâs a backtick thatâs used in
(stest/instrument `test-inc)
(I didnât notice for a few days, wondered why I got nowhere⊠but I have old old eyes)i have a yogthos/config
+ clojure + maven + gradle question if anyone feels daring. we have a larger java project that includes our clojure project as a dependency. gradle fetches the clojar and executes it correctly (we can see the output), but the clojure project doesn't seem to pick up our config.edn
(something it does see it standalone development and production):
task blueGenesStart(type: JavaExec) {
main = "bluegenes.server"
classpath = configurations.providedRuntime
args = [ '-Dconfig=/path/to/config.edn' ]
}
...nor does it work if we use gradle to place config.edn
on the classpath. any ideas? đwhy do some people use 2 semicolons for comments instead of 1 ?
;; like this
it's a Scheme style ?
Why does
(with-open [w (jio/writer (.getOutputStream proc))]
(binding [*out* w]
(doseq [[k v] uri]
(printf "%s=%s\n" k v))))
not work but removing the binding
does? (proc is a java.lang.Process)seems to be working fine here
user=> (.exec (Runtime/getRuntime) "cat")
#object[java.lang.UNIXProcess 0x6ee6f53 "java.lang.UNIXProcess@6ee6f53"]
user=> (def p *1)
#'user/p
user=> (require '[ :as jio])
nil
user=> (def is (jio/reader (.getInputStream p)))
#'user/is
user=> (with-open [w (jio/writer (.getOutputStream p))] (binding [*out* w] (print "asd")))
nil
user=> (.readLine is)
"asd"
Was there a state of clojure for 2017? Doesnât that usually come out now?
we kind of missed the 2017 window :) 2018 survey coming next week
Hey guys. I'm doing a personal project using Compojure for routing and Selmer for HTML and templating. I set :resource-paths to ["resources/public"] in my project.clj and tried to link my CSS files in my HTML files, but it couldn't find the css files. I don't know why that issue is happening
do the paths your templates ask for match the relative path from resources/public ?
also, usually you would set [âresourcesâ] as resource-paths and then use (wrap-resources "public")
as a middleware to specify which resources to serve to clients
because most of the time you have non-code resources that you donât want to serve to clients over http
anyone know where the multimethod for clojure.core/print-method
is defined for java.lang.Object
instances?
@alexstokes Looks like here https://github.com/clojure/clojure/blob/861d48ea761418fcb59dc4eb1c63bd29c2f35231/src/clj/clojure/core_print.clj#L87
great thanks @seancorfield