Fork me on GitHub

@seb321 glad you found core.matrix helpful! Please do send issues / PRs my way if you find any use cases in which it could be improved, trying to make it as generally useful for everyone as possible

Alex Miller (Clojure team)02:03:37

@bfabry: I don't think you should expect that to necessarily work forever


@alexmiller fair enough, I don't think I would simple_smile metaprogramming stuff seems to be inherently like that


Is there a collection library of schemas for plumatic schema? Looking for common things like URL, email etc.


[kixi/schema-contrib "0.2.0"]


vikeri: ^


@rm: A bit worrying that they have not merged pull requests and not updated since Aug 2014 though. The whole point of this kind of lib is to have everyone contribute...


I don't know, I'm not involved into development, I just use the lib, it works


is there a form similar to cond-> but that uses the 'running value' as input to each predicate?


(magicond-> 1
   true (* 2)
   even? inc
   #(= 3 %) (fn[_] "seven")
   string? clojure.string/upper-case)
something like this?


@rauh: perfect! thanks so much


Hi there I'm struggling with a simple import of a Java class. I suspect the problem is that this Class has a . in it's name. (import ) will yield a ClassNotFoundException. However, it looks to me to be the correct classname regarding the JavaDoc: Java Interop beginners help is much appreciated(;


@munen: try import javax.sound.sampled.Port$Info


@zcaudate: This works! Thank you very much! May I know where you learned about that? I actually did some digging before I asked here and didn't get a clue.


@munen: ummm… that’s a very good question…


i kinda just picked it up reading source code


@zcaudate: That's a very good answer that I can relate to. I have written a couple Clojure and CLJS apps so far, but I still am just a beginner regarding Clojure. In time I do hope to be able to help other people here as quickly as you just did. Again, thank you very much^^


@munen this is hidden in the java interop documentation. "Note that nested classes are named EnclosingClass$NestedClass, per the JVM spec."


@jmayaalv: Now I'm a bit embarrassed. I did have that page open, of course. This is one of those times to just RTFM better... I skimmed it multiple times, but I didn't read everything in that chapter, because I didn't deem it relevant. How wrong I was. I'll re-read the whole page right now just in case. You have my gratitude!


@munen this post explains this and many other "special" characters very well: . And I just noticed it has a search feature at the top!


does anyone still use textmate for clojure?


atom’s too slow… and I’m too cheap to pay for sublime


the textmate bundle hasn’t been updated in 5 years


I use intellij + cursive


@nberger: I remember seeing this one on HackerNews a good while ago. Back then I didn't have the chance to do much in Clojure, though. I'll get into that one today and learn me some internals. Thanks for the reference!


I use emacs + cider and like the pair. Unfortunately, it is not easy to start with.


I found Prelude a good starting point


from the same creator as CIDER


@borkdude: I use emacs too but I have mate . programmed into my muscle memory


@zcaudate: Even though I disqualified myself a bit here, I'm a bit of an editor Nerd. I've been using and pushing VIM for 14 years, but for Clojure I switched to Emacs+Cider and wouldn't look back. Also Emacs is a wonderful operating system, not just an awesome editor^^


@zcaudate: alias mate=emacs


yeah… @twashing got me onto spacemacs


this is the smallest issue ( ;


@zcaudate: Just start Emacs once and never quit it again^^


@munen: it’s too powerful… I serious don’t know what to do with it at times


@munen: yeah, true. I have been using emacs since '03. Each year I try to find better alternative, but failed.


@zcaudate: When I started, I did move everything I did in Mail, Evernote and Things (GTD Tool) into Emacs within the week. Now I don't have to leave it for the occasional look at the browser*g*


@featalion: I'm not sure it's possible. The underlying concept of being similar to a LISP machine is hard to improve upon. Took me a long time to figure out that VIM might be the best Editor, but it could just be one of the programs that I run inside Emacs^^


I was stupid and never looked into Emacs, because I wasn't doing Lisp and the shortcuts of Emacs looked just too clumsy compared to VIM's modal editing. It's interesting, though, how many friends I could interest with a couple of demos or talks during coffee(;


@munen: it is only true in common, but not to execute specific tasks. I haven't found better solution for programming, but I still prefer google's interface for email and trello web interface, for example.


@featalion: I have to admit, that I'm in Love with Mu4e (the mail client). I have 5 mail addresses for different companies and none of them is from Google. So far I was lucky not to have to use it. I know it of course, I did use it some years ago for work and didn't like it for the reason that it didn't fit well into my GTD workflow of being able to cross-reference Mails, Notes and Todos. Now, that's even more awesome with Org-Mode and Mu4e^^ I'm not using Trello, but Pivotal - and for that I confess to also use the web client, because it is really well done.


Being a web-dev, there's certainly a couple pages that I still visit from time to time^^


@munen: all my last customers use google apps for business. and it is very easy to forward email to master address and filter them there. it is also possible to send messages from "remote" email addresses. But in your case emacs rocks for sure ( ;


@featalion: Yeah, I'm not going to argue against Google Apps^^ I also did what you just explained some years ago and have friends who still do it. I do like the option to not share everything with Google, though. Plus, I really like the workflow of Mu4e - and did tweak it with some Elisp goodness to make i even better^^


hey people, quick question: how do I place type hints with reader conditionals?


for example, I'd like x to be type-hinted with Foo when compiled to clojure in (fn [x] 42)


the solution seems to be: (fn [#?(:clj ^Foo x :default x)] 42)


hi, how does partition work? I tried (partition 30 (range 5)) and it returned me empty list.


@darnok use partition-all


According to ClojureDocs, defn has this as a function signature: (defn name doc-string? attr-map? [params*] prepost-map? body), where supposedly, the attributes in attr-map are added to the var metadata. I've defined a function: (defn foo {:a :b} [] nil), which matches the signature, but when I check the metadata using (meta 'foo), all that is returned is the standard function compilation metadata. Any idea why this is not acting as the documentation specifies?


works for me -- but you need to call (meta #'foo) to see it


Thanks. It's the var metadata. Now I understand.


Let's say I have the following: (def k '[(:aaa 1 :bbb 2 :ccc 3)]) What would be a nice and clean way to update the value after :aaa, or :bbb, :ccc? (I know it could be easy if the list '() was a map, but sadly it's not)


thiagofm: if the order doesn’t matter, it would be pretty simple to transform it into {:aaa 1 :bbb 2 :ccc 3}, update it, and then concat it back together


@matthavener: (into {} k) wouldn't work for this. I'm thinking about just mapping over and do what I want


But I was looking for the "woooah" solution


(into {} (map vec (partition 2 k))


cljs.user> (into {} (map vec (partition 2 k))) {} 😞


I'll go with the map, it's okay


@thiagofm: If you are often updating the value after one of those, then the map will be your best bet (using update-in or assoc). If you need to keep it as a list and you can write your own update-after fn and it will still feel pretty clean when you use it.


I think you want to partition (first k) for @matthavener's suggestion


Hi, could any give me any ideas why when I call my (-main "--input" "something" "--output" "something") works fine from the repl but when I launch (after using lein uberjar) with the args passed in as java -jar --input" "something" --output "something" it dosen't do anything...


(defn -main
  [& args]
  (let [args-map (parse-opts args cli-options)
        input-path (get-in args-map [:options :input-path])
        file-list (list-directory-from-HDFS input-path)]
    (pmap upload->file-storage file-list)))


well, pmap is sort of lazy


(also terrible)


crankyadmin: check out doall


Thanks both. I was looking for any easy to do it in parallel. pmap seemed like a sensible idea. Whats a better approach


hiredman: doesn’t pmap use executors behind the scenes?


Cool. In the above snippet; where would the doall be place? Do I wrap the pmap or dump it all together?


yeah, wrap the pmap which forces realization of the seq, which forces the execution of upload->file-storage


Sweet! Thank you.


Yep. That fixed it! Thanks again guys simple_smile


I'm studying about declarative databases, and abstracting away from REST backends, and it's led me to decision overload with Falcor, GraphQL, Relay, and DataScript all thrown in the mix. What should I use if I want have a more declarative database, where I can request with JSON syntax from the client side, and avoid many REST endpoints? And are these solutions a layer over, ex Mongo, or Postgres, or something else entirely?


josh.freckleton: you should probably look at simple_smile and join #C06DT2YSY


@matthavener: I'v been reading up on it and from what I can tell, is still not production ready, no? Something like reagent feels a bit more stable, is there anything that would work if I went the reagent route, or is it really just


sorry, I don’t know enough about reagent to know if it would work. my limited understand of reagent suggests you’d have to write a lot of the equivalent falcor/relay functionality yourself


@smw: thanks, I love re-frame! How do you build a non-REST backend for doing declarative database requests in re-frame??


Not something I’ve thought about simple_smile You might consider asking in #C073DKH9P or #C0620C0C8


is there an idiomatic way to accomplish this, taking a vector and converting it to a map?:

(defn make-entry [id name contact description]
  {:id          id
   :name        name
   :contact     contact
   :description description})


I'd like to make many of these maps dynamically, and i'd love if I could add/remove things from the parameters without duplicating the effort by creating an entry that pointst to that...


you’ll have to write a macro for that


good point, just curious if there was a better way simple_smile


ah nice, so would you think like this:?

(defn make-entry [& rest]
  (zipmap [:id :name :contact :description] rest))
(make-entry "a" "josh" "123-4567" "hi there")


that looks a lot better


I’m trying to simplify some with-redefs(-fn) code — how do I go from a fully qualified symbol to a var?


I think it’s ns-resolve?


Oh, resolve!


is there an easy way to get a limited collection? maybe just (take 5 (into [] items)) ?


@base698: Surely in that case you’d use (into [] (take 5 items)) instead?


unless you’re really trying to materalise the rest of the items sequence unnecessarily.


Is there an issue with clojars? I just pushed a SNAPSHOT version, it uploaded it just fine, but when I try to use it from a project, I get an error that says: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.danielsz:system:jar:0.3.0-20160322.233127-13 in clojars (


@danielsz: Is [org.danielsz/system "0.3.0-SNAPSHOT"] your artifact?


➜  system1 lein deps 
Retrieving org/danielsz/system/0.3.0-SNAPSHOT/system-0.3.0-20160322.233148-13.pom from clojars
Retrieving reloaded/repl/reloaded.repl/0.1.0/reloaded.repl-0.1.0.pom from clojars
Retrieving com/stuartsierra/component/0.2.1/component-0.2.1.pom from clojars
Retrieving prismatic/schema/1.0.4/schema-1.0.4.pom from clojars
Retrieving com/stuartsierra/component/0.3.1/component-0.3.1.pom from clojars
Retrieving org/danielsz/system/0.3.0-SNAPSHOT/system-0.3.0-20160322.233148-13.jar from clojars
Retrieving prismatic/schema/1.0.4/schema-1.0.4.jar from clojars
Retrieving reloaded/repl/reloaded.repl/0.1.0/reloaded.repl-0.1.0.jar from clojars
Retrieving com/stuartsierra/component/0.3.1/component-0.3.1.jar from clojars


for fresh project


@danielsz: may be your ~/.m2 is wrong or there're some DNS issues?


@danielsz: I think you might try renaming ~/.m2 it and then lein deps too


@andrewboltachev: Ah, you don't have any trouble retrieving it? It's only me?


@andrewboltachev: That's already good news simple_smile


sorry, Slack is very slow for some reason for me. JS hangs while I type


@andrewboltachev: no problem. Thanks. I don't get it. Clojars is accessible to me (so not a DNS issue). I'm using Boot in my project, but I never had this problem before.