This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-26
Channels
- # admin-announcements (1)
- # beginners (167)
- # boot (117)
- # boulder-clojurians (1)
- # cbus (1)
- # clara (3)
- # clojure (87)
- # clojure-conj (2)
- # clojure-japan (2)
- # clojure-russia (23)
- # clojure-spain (3)
- # clojure-za (2)
- # clojurescript (184)
- # community-development (8)
- # core-async (7)
- # core-matrix (4)
- # cursive (36)
- # data-science (74)
- # datascript (3)
- # datomic (171)
- # events (6)
- # hoplon (83)
- # ldnclj (5)
- # ldnproclodo (1)
- # lein-figwheel (2)
- # leiningen (19)
- # liberator (2)
- # off-topic (5)
- # om (227)
- # onyx (5)
- # re-frame (142)
- # reagent (4)
- # yada (5)
you could use core.async and read the values from a channel in a loop and write to the file
Not certain, but I would assume logging libraries make all kinds of optimizations to the logging process. If a flat file log is what you need, I would seriously consider just using log4j or logback.
That being said, I believe either an agent or a core.async chan+process would do what you want.
(TBH using an agent for controlled side-effects always seemed like a bit of a hack, but I think it fits the bill for some scenarios. So take that as you will )
The main benefit of agents for side effects is that they are stm aware.so you can safely send from inside a ref txn
Because agent sends are held till when the txn completes
@meikemertsch: ah thanks, great idea!
user> (throw (ex-info "lol" {}) ... or this?)
ExceptionInfo lol clojure.core/ex-info (core.clj:4593)
i mean understand why this happens, but i don't understand why this is allowed to happen.
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2421-L2428 throw seems like it will check
but def
is a special form and
(def fe "fi" :fo :fum)
CompilerException java.lang.RuntimeException: Too many arguments to def, compiling:(/private/var/folders/sv/xytbwbxn6pg835_hkmyf8lxc0000gn/T/form-init786571130783712406.clj:1:1)
i'm not sure why throw
is allowing that to slide. it could be a repl thing but it doesn't seem likely.
looks like the patch to throw
was recently added https://github.com/clojure/clojure/commit/fd50af1680f40d199bac373f4638e2dde02bfa5a
hey everyone, i am new to clojure and using http://braveclojure.com as a starting point. i hope to gain lots of knowledge from everyone here and share my experience as i embark on this journey. cheers!
Anyone have any thoughts about how Im structuring this simple component based webapp server side (i guess system.clj is a good place to start) https://github.com/nowprovision/webhookproxyweb/blob/master/src/webhookproxyweb/system.clj
to anybody using Midje autotest, is it supposed to support deleting namespaces?
After deleting/renaming some file I get a “LOAD FAILURE” and need to restart the jvm
using Midje 1.7.0
@danlebrero nope AFAIR
https://github.com/marick/Midje/issues/288 is the closest we got to that
quickly glanced at midje, it doesn't seem to use tools.namespace and instead does some ad-hoc namespace handling
basically, this https://github.com/marick/Midje/blob/master/src/midje/data/project_state.clj
@mishok13: thanks a lot.
@danlebrero:I didn't really help you here, did I?
@mishok13: you confirmed my suspicion
which is quite helpful
I suspect that *assert* is not being set to
false` when building my uberjar. When I start my app from the uberjar, then connect to its nrepl and evaluate *assert*
, I get true
. I can't afford to run my pre and post conditions in production. How do I ensure that they're off?
anyone know how to get comments in the interior of a function to get pulled into the documenation section with Marginalia? I’ve tried ; and ;; and they always stay in the code section
@ghadi: any idea of what the future of squee looks like? I really liked the approach and impl.
@ragge thanks. I have my attention turned towards a different library right now (stay tuned) but I'd be glad to merge in some tests
The one feature I haven't pushed up yet, is "data readers" for SQL. Rather than receiving a java.util.Date from the underlying resultset, you can receive java.time or Joda -- customizable by datatype
I'm just happy about the connection & transaction implementation. It's just simpler than clojure.java.jdbc
When you say "data readers" for SQL, do you mean something similar to IResultSetReadColumn
in java.jdbc?
@ghadi: would you accept contributions for tests/minor things (found a few docstring errors)?
seriously though, no, I don't think there's anything like that but it should be fairly easy to write one
@mbertheau: (comp some? get-in)
^^ doesn't work for (contains-in? {:a {:b nil}} [:a :b])
I have
(fn [m [k & ks]]
(if (contains? m k)
(if (nil? ks)
true
(recur (k m) ks))
false))
now. Improvements are very welcome!I like from @mishok13
(defn contains-in? [coll key]
(not= :not-found (get-in coll key :not-found)))
hmm, just realized that (contains? {:a {:b nil}} [:a :b]) => false
they key [:a :b]
exists, just happens that the value is nil
@mbertheau: I would modify it slightly for the case when keys aren't keywords
(fn [m [k & ks]]
(if (contains? m k)
(if (nil? ks)
true
(recur (get m k) ks))
false))
bostonaholic: you have a collision on (contains-in? {:a {:b :not-found}} [:a :b])
, easily fixed by using a new Object that won't be equal to anything else.
Hi everybody! I'm testing a small service to make dependency graphs for clojure projects. You feed it a github url and it gives you back a dep graph. Anybody wants to try it out? http://asterion-dev.elasticbeanstalk.com/index.html
@bensu: In other news, I need to simplify my library: https://i.imgur.com/qb3uA4C.png
@bensu: Nice would be nice to be able to either hover over or click on a node and have the path highlighted
a def/defn creates a var that depends on the var of any referenced symbol in it's source. Almost like a call graph
@bensu: and I'll add another feature request for branches.. ala https://github.com/xeqi/clojars-web/tree/lucene-index-component