This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-14
Channels
- # admin-announcements (5)
- # alda (2)
- # beginners (26)
- # boot (30)
- # cider (8)
- # clojure (49)
- # clojure-argentina (1)
- # clojure-berlin (1)
- # clojure-boston (1)
- # clojure-italy (11)
- # clojure-norway (3)
- # clojure-russia (116)
- # clojurescript (156)
- # clojurex (4)
- # clojutre (9)
- # core-async (6)
- # datomic (18)
- # emacs (1)
- # events (4)
- # hoplon (159)
- # ldnclj (13)
- # luminus (4)
- # off-topic (1)
- # re-frame (14)
- # reagent (76)
how do i add a ring middleware in addition to other dependencies in my dev profile?
I was looking at magnars prone-middleware
:profiles {:dev {:ring {:stacktrace-middleware prone.middleware/wrap-exceptions}} {:dependencies [...]}}
gives me "Map literal must contain an even number of forms"
Confusing to me because it would appear that's a misleading message. Each nested map does have an even number of forms.
@mosho: the symbol referring to a namespace can be passed around as data. an actual namespace object (like you'd get from ns) is a stateful Java object (not a value) and has the same caveats
that was \ns\ above
Hi. Some help needed I have go-loop that is writing to files. go-loop receives on one channel info when it should start writing to new file. Everything works except that when app is closed (CTRL-C) then data in buffers are not flushed to disk and I’m loosing some data. How to nicely close flush all buffers when app is shutting down ?? This is result of testing in lein
(defn start-writer [dst msg] (let [dest-file (atom nil) ] (go-loop [] (alt! dst ([val] (if @dest-file (dosync (println "Got file request change " val) (.close @dest-file) (reset! dest-file (writer val))) (dosync (reset! dest-file (writer val))) )) msg ([val] (if dest-file (.write @dest-file val)))) (recur))) )
Tip: you can fence your code in three backticks to format it with a fixed-width font.
We’ve started to use @stuartsierra’s component framework for a project that needs connections to multiple databases, statsd, etc. It cleaned up the configuration and state handling quite a bit. However, it’s now pain to work in the repl because, for every function that I want to call, I have to dig out the appropriate piece of the system so I can pass it in as an argument. Has anyone tried to combine components and dynamic variables? So, a dynamic variable for each component, plus a mechanism to bind the dynamic variables of all the components of a system. (And maybe call alter-var-root on them all, for use when developing.)
ljosa: I almost always recommend against dynamic vars; see my old blog post "On the Perils of Dynamic Scope."
And you should rarely or never need to pass more than one component to a top-level API function.
If some operation depends on multiple components, then that operation should take as its argument a single component that encapsulates all those dependencies.
What is your workflow when developing an application that uses the component framework? So far, I have been doing (def system (component/start-system (build-my-system configuration)1))
in my myproject.core ns. (Only in the repl, not for production use.) Then, when working in a different namespace, I have been doing (def c (:my-component-name project.core/system))
so that I have it on hand when I want to call functions that need the component in the repl, such as (frobnicate c 42)
.
@ljosa: I add convenience functions in user.clj that do the digging out of system for me. If I have to change the system structure, I change the convenience functions too.
I am using vectors to represent math vectors in my program, now I want to update certain values by index, how should I do this? Should I use some other data structure than a vector?
(As in they don't box with a full object reference but rather store primitive arrays internally)
@ghadi: Okay, thanks. I find it ugly that I have into [] ..
on several places in my code, because lots of functions returns lists. Is there some better way?
Anyone knows what's the roadmap to leiningen 2.5.3? I'd say that https://github.com/technomancy/leiningen/issues/1963 (about gpg signing, fixed 3 weeks ago) alone deserves a new release. That's something that worked fine in 2.5.1 and got broke in 2.5.2. The issues in https://github.com/technomancy/leiningen/milestones/2.5.3 don't look like 2.5.1 regressions I find myself switching between 2.5.1 (for signing a release) and 2.5.2 (so lein test picks up .cljc files, for example) too frequently... I'm also delaying building 2.5.3-SNAPSHOT in my local machine, as my experience doing so was not a walk in the park...
i believe https://github.com/technomancy/leiningen/issues/1734 is the major outstanding bug
@timvisher yes thanks, I got there. I'm saying that all of them exist way before 2.5.2, and 2.5.2 included a critical regression IMHO, so I was wondering if there's any chance that 2.5.3 might be cut before those 4 issues get a fix. @ztellman: good to know. It's also pre 2.5.2 but I see the importance
@nberger: my understanding from @hypirion is that there will not be a release prior to that
@timvisher: Ok, thanks
There is a Leiningen mailing list (not google groups)
@nberger: The only remaining big issue is the pom task, as @timvisher mentioned. And it's good to get feedback, so thanks. I didn't know that the regression's impact was so severe, so I'll see if I can get some time this week(end) to look at the remaining blockers.