This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-17
Channels
- # admin-announcements (16)
- # beginners (1)
- # boot (7)
- # business (1)
- # cljs-dev (1)
- # clojure (119)
- # clojure-dev (2)
- # clojure-germany (1)
- # clojure-za (4)
- # clojurescript (73)
- # cursive (3)
- # datomic (2)
- # devcards (8)
- # editors (1)
- # events (1)
- # funcool (1)
- # ldnclj (3)
- # liberator (1)
- # off-topic (1)
- # om (52)
- # onyx (1)
- # re-frame (5)
- # reagent (28)
mini newbie question: I have a quoted vector that is getting passed to a function as a argument. I want to look inside that vector and pick some stuff out, but all I get is (clojure.core/unquote myVector)
. Can I somehow get the initial representation back?
seems like this was an issue with the framework I used. Somehow all I got was a literal (clojure.core/unquote myVector)
@nberger: the project.clj contains no profiles info. I can make the jar fine locally and on the Jenkins server via ssh. But when Jenkins runs it it fails.
@tom: I don't know what it might be... you could try moving the ring configuration from profiles.clj to project.clj and see if it picks it up from there. Btw, do you have a link to the source code of lein-jenkins or how is it called?
i'm having a problem importing a java library. i'm importing it with (:import (uk.ac.abdn.simplenlg.lexicon)) which works fine, but when I try to use it with (. Lexicon getDefaultLexicon) I get an error saying couldn't resolve symbol
@mo-love: Your code doesn't say anywhere that you want to import a class called Lexicon
. You would need to do (:import (uk.ac.abdn.simplenlg.lexicon Lexicon))
or (:import uk.ac.abdn.simplenlg.lexicon.Lexicon)
(I'm just guessing at the full path to the class.) Unfortunately Clojure has no simile to Java's import my.package.*;
that imports all the classes in a package (they must be enumerated individually).
@aengelberg: got it working with (:import (simplenlg.lexicon Lexicon))
@aengelberg: thanks a lot
Cool, no problem @mo-love
What's the go-to solution when a namespace A depends on a namespace B and vice versa, when refactoring is not an option (not too keen on refactoring Clojurescript compiler)?
@jaen what are those namespaces in the compiler? It sounds weird because as far as I know, such circular dependencies are not allowed in Clojure
@bensu: since there's none right now. My code for module preprocessing needs functions from both from cljs.js-deps
as well as cljs.closure
and needs to be available for cljs.js-deps
. This causes a circular dependency. I see no obvious way how to structure it on my side to get around that.
@bensu: last time I spiked it, there were some bigger functions, but in my last try I only see report-errors
which is a utility, but it's less full featured than the spike right now
What would be a killer Clojure program or lib that doesn't exist yet? I have too much time on my hands.
Hi! whats the most idiomatic way to get the first non nil value from a seq ? I'm currently stuck with this : (is (= false (first (filter (complement nil?) [nil false true]))))
a more obvious one would be (some some? colll)
(which after reading @magnars looks wrong )
What's the test?
Oh. Should've read that more closely, sorry
I was immediately thinking of tyler's solution...
Obviously you can also write (some #(not (nil? %)) coll) if that speaks more to you
@meikemertsch: that falls into the same some
trap, it needs to be (some #(when (some? %) %) coll)
Argh!
:satisfied:
Haha, I only make it worse by throwing in (first (map #(not (nil? %)) coll))
@dnolen: I'm dreading that - I do not trust dynamic languages to refactor well and my understanding of the cljs compiler is really rudimentary (Cursive helps, but it's still quite complex to me). This will also make the surface of the patch bigger. But if I'll have to then well, I'll have to bite the bullet and do that, hopefully it won't hurt too mcuh. @thheller: basically taking what Maria Neise/Geller did (JS module conversion to GClosure modules), moving that from where it is right now to the dependency resolution stage and extending that to full libraries instead of single files. So basically - plumbing, but you have to fit into the existing piping, which I seem to have some problems with, not being fluent enough in the codebase.
@jaen you might want to try https://github.com/thheller/shadow-build
Unless you mean one could plug babel.js as a custom build step and let cljs compiler take it from there?
Oh, interesting. Though I see it's lein-based and I kind of don't miss how messy is (or at least was) getting a nice clsj workflow with lein since I tried boot.
Hmmm, that's quite interesting if this could be done without patching the compiler (I mean, I guess it could be done, since my first spike didn't even touch compiler and it worked), but that would mean I've sunk quite a bit of time into something that's ultimately not really all that needed ; e
I'll take a look at this sometime, though even then there might be some value for compiler to understand that anyway (though that depends on what other people though think).
the compiler doesn't really need to understand any of it since the compiler is for compiling cljs
@thheller: my most complex example included React + material-ui + ReactMotion and all their dependencies. The less complex one was just React with modified reagent that could use it.
Yeah, I know, I wanted to get it working right first, then see what happens when I filp the advanced switch.
@thheller: well, cljs compiler understands GClosure modules. Maria's work was about getting CJS/UJS/AMD translated to GClosure, so the compiler could understand them natively and that they could participate in GClosure optimisations and whatnot.
Though that's probably not the right channel to discuss the specifics of that besides the circular dependency problem, since that's the only thing strictly Clojure-related.
Hmph, quite possibly. But then I could just use browserify and webpack as a build step called from boot, shove the results into :foreign-libs
and call it a day. I tend to be prone to overengineering '
Hah, not really, no. This all started with me trying to get material-ui to work without an intermediate build step. And that needs React for better or worse.
hehe the javascript generated by the conversion process is scary .. if that works at all I'd be amazed
If I have a symbol foo.bar/sym
and I want to get its name as a symbol, sym
. Is there such a function, or must I use (symbol (name 'foo.bar/sym))
?
any tips for restarting a jar if it exits? I usually use upstart, but upstart doesn’t properly detect when this app has exited (using expect fork
)
There's an example in https://github.com/clojure-cookbook/my-daemon/blob/master/README.md
Hi, guys, I wrote a demo project which might help newcomers understand, what’s going on in clojure web applications. It’s simple multiplayer starcraft clone using reagent, http-kit, core.async, chord, compojure and secretary. Check it out http://github.com/edvorg/yet-another-craft
@nberger thanks for the suggestion. also looking into capsule (lein-capsule) and wonder if anyone is using it
Does anybody know how to express div.foo { display: flex; display: -webkit-flex; }
with Garden? The straightforward translation [:div.foo {:display "flex" :display "-webkit-flex"}]
obviously fails because of the duplicated map key.
I tried the super ugly workaround [:div.foo {:display "flex" "display" "-webkit-flex"}]
, getting rid of the duplicate key by using a string instead of a keyword the second time, but it still doesn't work, as the first key/value pair simply disappears in the output.
I'm randomly generating instances of functions that have fixed parameters (a matrix, a vector, and a scalar). I'd like people to be able to call them like normal Clojure functions, but also look up the values of the parameters if necessary. Is having a record implement IFn like this https://gist.github.com/currymj/f26441cc01a8f3650e5f a terrible way to do it? Bad practice in general?