This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-12
Channels
- # aatree (9)
- # admin-announcements (2)
- # alda (4)
- # announcements (2)
- # beginners (87)
- # boot (218)
- # braid-chat (14)
- # cbus (2)
- # cider (19)
- # cljs-dev (17)
- # cljsjs (1)
- # cljsrn (5)
- # clojure (84)
- # clojure-android (1)
- # clojure-czech (8)
- # clojure-ireland (3)
- # clojure-madison (20)
- # clojure-poland (22)
- # clojure-russia (54)
- # clojure-sanfrancisco (1)
- # clojurescript (81)
- # clojurewest (4)
- # community-development (94)
- # conf-proposals (5)
- # core-async (199)
- # css (3)
- # cursive (68)
- # datavis (2)
- # datomic (23)
- # dysphemism (138)
- # editors (7)
- # hoplon (8)
- # jobs (8)
- # jobs-discuss (7)
- # ldnclj (2)
- # liberator (6)
- # off-topic (32)
- # om (200)
- # omnext (2)
- # onyx (88)
- # proton (58)
- # re-frame (14)
- # reagent (1)
- # ring-swagger (26)
- # yada (14)
Here’s another - lets you run code in your slides https://github.com/MysteryMachine/jobim
does anyone know of a way to work with clojure dependencies from source? if im working a lib and an app at the same time
yup, checkouts is definitely what you want
@jtackett: for the future cases there is simple profiler bundled with jdk (in the bin directory) called jvisualvm
@karol: Having no prior experience with Java I was unaware of this. Thank you for point it out.
@kul: it's not. boot.core
is where state is stored and pods can't have access to that state/modify it
@kul: also there's #C053K90BR, just FYI
On a scale of Rich Would Do It to Totally Unidiomatic how bad is formatting let
s like so (if the value I have to bind is so long it would make the code drift too much to the right)?
(let [new-fields
(dispatch-method
(:aggregate/fields aggregate)
event state)]
#_"rest of code")
compared to more standard way of formatting:
(let [new-fields (dispatch-method (:aggregate/fields aggregate)
event state)]
#_"rest of code")
totally readable to me. emacs’ cider would line the binding and the form up vertically, if you let it indent for you
Yeah, it looks strange to me as well; but on the other hand I want to avoid the march of the code to the right
(let [new-fields (dispatch-method
(:aggregate/fields aggregate)
event state)]
#_"rest of code")
for the first, I'd do this:
(let [new-fields
(dispatch-method
(:aggregate/fields aggregate) event state)]
#_"rest of code")
@dm3: I kind of don't like putting the first param on new line, but the way you wrote it looks quite sensible, I guess
@rm: hmm, but if there's more bindings, it would be harder to tell which form binds to which name if they are not indented IMO
good morning
@sveri - something like
(when-lets [x true, y false] [x y])
? If so, there's an example here: https://github.com/ptaoussanis/encore/blob/master/src/taoensso/encore.cljx#L165look for when-not-let
in my upcoming library "core.blimey"
it's a work in progress
including many handy macros like (don't ...)
which doesn't execute the body in order
can't-even?
of course not don't be ridiculous
@jaen: In the sente source code he has some let
bindings like you asked about (binding on one line and the value on the next) and he put an empty line in between each of these. I found it very easy to parse.
Though I'm not sure if that's readable to me, but maybe due to the sheer size of the function, rather than formatting of the let
Yeah, that is an enormous function. I remember having to scroll up and down to figure out where the let bindings end and the body begins.
Agreed.
wouldn't thread macros help ?
(grmbl, disregard. lagging again)
is it possible to eval the arguments of a macro before it gets passed into it? i'm attempting to call a clojure macro from clojurescript
@naomarik: No, by definition. Macros execute at compile time. By the time your clojurescript code (compiled into JavaScript) is running, the macro no longer exists.
ahh.. is there a way to pass in a variable in my clojurescript to the macro as an argument?
passing in a string literal gives me what i want, anything else doesn't seem to work for this
i guess the next question would be to see if it's possible to include a clojure function that wraps a macro into clojurescript just last night i found it's possible to include clojure macros in clojurescript, mind was blown
Not sure if I completely understand, you can pass in a variable, but if it's something that's not defined at compile time, it can't use it to change what the macro compiles to, you can just place the symbol into new form. For example:
user=> (defmacro foo [thing] `(if ~thing (println "hello") (println "goobye")))
#'user/foo
user=> (macroexpand '(foo bar))
(if bar (clojure.core/println "hello") (clojure.core/println "goobye"))
Note the ~thing
which means "don't evaluate this"a string literal exists at compile time, that's why it worked. if the value only exists at runtime by definition the macro has no access to it as stuart said
(defmacro foo [x] (.length x))
=> #'com.zendesk.dataflow.Main/foo
(foo "foo")
=> 3
(def bar "foo")
=> #'com.zendesk.dataflow.Main/bar
(foo bar)
java.lang.IllegalArgumentException: No matching field found: length for class clojure.lang.Symbol
I’m trying to understand the semantics of context switching in a go
routine. Is there a difference between (go (<! (async-foo)))
and (go (blocking-foo))
where the underlying IO adapter blocks for blocking-foo
and puts an async result with async-foo
?
yes, you definitely do not want to do the second one. go blocks are executed on a shared limited size thread pool, so if they get blocked by something other than a core.async operation that thread pool can be potentially exhausted. if they're blocked by a core async op, like <! then they relinquish the thread and its put back in the pool