#clojure log - Oct 23 2014

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

1:22 rritoch: What's the best way to append a single item to a vector? I typically use (into myvec [ item ]) but this syntax is deplorable, is there a better way?

1:22 justin_smith: conj

1:22 ,(conj [1 2 3 4] 5)

1:22 clojurebot: [1 2 3 4 5]

1:22 rritoch: justin_smith: thx, didn't realize conj wouldn't turn it into a sequence

1:23 justin_smith: yeah, conj is basically a protocol method as a function, so it does the "approriate" thing for various types

1:23 ,(conj #{1 2 3} 4)

1:23 clojurebot: #{1 4 3 2}

1:25 justin_smith: note that "appropriate thing" can mean things that look very different

1:25 ,(conj '(1 2 3) 4)

1:25 clojurebot: (4 1 2 3)

1:25 justin_smith: ,(conj [1 2 3] 4)

1:25 clojurebot: [1 2 3 4]

1:26 rritoch: justin_smith: yeah, I get the same "reversals" with into so I'm constantly casting to vec and back to sequences in some code to preserve ordering

1:28 justin_smith: (into [] (rseq [1 2 3 4 5]))

1:29 ,(into [] (rseq [1 2 3 4 5]))

1:29 clojurebot: [5 4 3 2 1]

1:29 justin_smith: that's actually faster than reverse, and keeps the data type to boot

1:29 it works because vectors can efficiently be walked backward (and rseq exposes that fact)

1:32 rritoch: That's cool.

1:32 justin_smith: there are also finger-trees, which are an immutible data structure that is designed from access on either end, insertion into the middle, etc.

1:32 https://github.com/clojure/data.finger-tree

1:33 rritoch: Is it faster than using into+subvec?

1:33 justin_smith: I think so, because it continues to use the same base structure

1:34 there is a nice library for testing these things: criterium

1:34 it takes a while to run, but gives very good micro-benchmarks

1:36 rritoch: Looks good, I'll try it with my own apps, but my client isn't very interested in speed, mostly concerned with readability and maintainability of code, which is where that (conj) apposed to (into) will be very helpful.

1:38 I'm back to actual work today, but just working on the easy stuff, documentation + unit test development.

1:40 I really like leiningen's unit testing, but my only issue is that I'm maintaining over 50+ apps, short of using ant I'm not aware of any way of testing them all automatically

1:41 justin_smith: rritoch: one thing that works nicely is setting up jenkins to do the testing before deploy (or whichever other CI server you may like to use)

1:47 wxjeacen: dears, I wanna write an desktop app with clojure

1:47 what is the best option for me ?

1:47 seesaw?

1:48 akurilin: hey folks: does anybody know what's happening to Korma's ownership?

1:49 I'm not at all sure, but it looks like there's been only one merged PR in teh past 3 months

1:50 justin_smith: wxjeacen: yeah, seesaw is probably the most straightforward

1:50 wxjeacen: justin_smith: ok ,thanks a lot

1:52 justin_smith: akurilin: I have been seeing more people talk about yesql lately - instead of a DSL in clojure, it uses a source file of actual sql code to define a parameterized function

1:52 https://github.com/krisajenkins/yesql

1:58 akurilin: justin_smith: I remember that one, cool. Prob is that we have a huge codebase that's already half on CJJ and half on korma

1:58 adding a 3rd option at this point would be pretty ballsy

1:58 justin_smith: akurilin: yeah, fair enough, I haven't used it myself either

1:59 just noting where the chatter is :)

1:59 akurilin: the reaosn why I'm asking about Korma because I submitted a PR there for a modification to its c3p0 initializion code and I'm curious if that's worth waiting for

1:59 or if I should just fork my own version and clojars it

1:59 justin_smith: it seems odd that korma would even be touching the c3p0 init stuff - why not just let the end user configure it directly?

2:00 akurilin: it basically passes through configs to c3p0, just not all of them

2:00 I needed one extra setting it wasn't supporting

2:00 justin_smith: oh wait wait, this may be a good moment to invoke this image: http://i.imgur.com/MdbUlkO.png

2:00 akurilin: very tiny change: https://github.com/korma/Korma/pull/256/files

2:01 justin_smith: yeah, that is small

2:02 akurilin: it's an important one because actually setting the min pool size below init pool size doesn't work at all

2:03 and I needed exactly 2 connections in the conn pool, not 3 :P

2:08 justin_smith: akurilin: I am of the firm belief that if the purpose of some piece of code is to provide access to an underlying java API, then full access to that API should be granted

2:09 akurilin: I mean, sure, hide the array under a vector, but for c3p0 it should be exposing the pool so you can use it to its full power

2:13 akurilin: Sure, I wonder if there was something about initialization order here

2:14 or maybe c3p0 lets you reconfigure it whenever you want

2:14 Not familiar enough with it to really say

2:19 justin_smith: akurilin: the c3p0 pool is a spec that jdbc uses

2:19 check out how concise this lib is https://github.com/ToBeReplaced/jdbc-pool/blob/master/src/org/tobereplaced/jdbc_pool.clj

2:19 it's not a super complex thing

2:21 (well to be fair he does use a little macro to generate setter methods for any keys you pass in, but it's still small)

2:26 akurilin: justin_smith: heh yeah clever little thing there with making those method names and eval

4:10 borkdude: has anyone maintained the twitterbuzz sample application for clojurescript somewhere, or has something analogous, without using React? (repost from #clojurescript)

4:38 dysfun: is there anything in clojure like the C preprocessor's #LINE directive?

4:40 borkdude: sorry, never mind about twitterbuzz, the 1.1 API broke it

4:48 thheller: @bbloom just saw your cljsd proposal. https://github.com/thheller/shadow-build had slightly different design goals but yours should be pretty straightforward to integrate

4:59 SagiCZ1: is there a "doc" alternative for java classes?

5:00 hyPiRion_: SagiCZ1: yeah, use javadoc if you're in the lein repl

5:00 e.g. (javadoc java.util.ArrayList)

5:01 SagiCZ1: but that opens in browser

5:01 so inconvenient

5:05 noidi_: dysfun, in a macro you can get the line from which the macro was called with (:line (meta &form))

5:06 e.g. (defmacro line [] (:line (meta &form)))

5:06 (line) ;= 1

5:07 dysfun: yes, but i wish to *set* it

5:08 noidi_: ah, right

5:08 noidi: why do you want to do that?

5:09 dysfun: i've written my own reader and i want to change where errors are reported from

5:11 the only other option seems to be to wrap the entire thing in a try and rewrite the exception object

5:12 because it's mainly to get correct line numberings when there's an unhandled exception (e.g. unreadable)

5:12 clgv: SagiCZ1: no, just `javadoc` since that his how api documentation is usually done in java

5:12 SagiCZ1: what do you mean? it could pull the information out and print it to repl

5:13 dysfun: hrm, i suppose that's true

5:13 clgv: SagiCZ1: yeah well, that's probably to specialized to be in core, since you'd need to parse the html - you wouldnt be happy to see html tags in repl right?

5:14 SagiCZ1: i guess

5:16 clgv: if you do not find a library that does that the `javadoc` approach is good enough with respect to the effort to implement a different solution that parses javadoc and tries to output it in a reeadable fashion in the repl

5:17 SagiCZ1: yeah i could write a util function that parses the information and prints it to repl if side effect of javadoc fn wasnt opening the browser

5:20 clgv: SagiCZ1: just extract the part that determines the URL from the `javadoc` function

5:21 SagiCZ1: then you can just read the document form the URL

5:21 SagiCZ1: good idea

5:22 clgv: SagiCZ1: if you succeed you can publish it as lib for others to use...

5:23 SagiCZ1: i would

5:23 clgv: SagiCZ1: maybe check if anyoneelse did that already ;)

5:26 SagiCZ1: i bet someone did

5:54 dysfun: SagiCZ1: you can also use w3m or similar to render it in text

5:54 * dysfun does this as a mutt filter

6:00 scottj: SagiCZ1: if you use emacs, you might want to use eww (available in 24.4) to display the javadoc

6:05 elfenlaid: hi, quick question, is it possible to create macro like deref symbol (@)?

6:11 SagiCZ1: scottj: yeah i dont use emacs.. learning a new language and an obscure editor at the same time seemed like a bad idea, although i tried it for couple days..

6:14 mearnsh: obscure?

6:15 wink: obscure.

6:19 SagiCZ1: mearnsh: yes

6:19 scottj: SagiCZ1: if you use screen and w3m, you could use this http://pastie.org/9669872 (might be able to replace "screen" with "tmux" and have it work) it creates a new tab with the docs open in w3m

6:20 SagiCZ1: what is w3m?

6:20 scottj: a text web browser

6:23 if you just want text in your repl, you could change it to (-> (clojure.java.shell/sh "w3m" "-dump" url) :out println)

6:24 I think you'll discover quite quickly though that hypertext is convenient :)

6:36 SagiCZ1: scottj: thank you very much

7:08 zapho53: Anyone using thalia? I added this - :repl {:dependencies [[thalia "0.1.0"]]} - to my ~/.lein/profile.clj but (require 'thalia.doc) in lein repl results in "Could not locate thalia/doc__init.class or thalia/doc.clj on classpath"

7:09 Lein repl downloaded the lib and it's in $HOME/.m2/repository.

7:11 hyPiRion_: zapho53: try to put it in the :user profile

7:14 zapho53: hyPiRion_: That's what I did.

7:14 hyPiRion_: It only complains when I try to require it.

7:17 hyPiRion_: zapho53: like this: `{:user {:dependencies [[thalia "0.1.0"]]}}` ?

7:19 zapho53: hyPiRion_: No, just - :repl {:dependencies [[thalia "0.1.0"]]} - which is what the git doc says.

7:24 hyPiRion_: That gets me past the exception but now - user=> (doc map) - results in: "CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc)"

7:25 hyPiRion_: Omit trailing ")"

7:29 hyPiRion_: zapho53: that's strange. I tried out having profiles.clj as both {:repl {:dependencies [[thalia "0.1.0"]]}} and {:user {:dependencies [[thalia "0.1.0"]]}}, and they both work fine

7:30 zapho53: hyPiRion_: Ah, I only added the one you suggested, not both.

7:31 hyPiRion_: zapho53: no, I mean, I tried {:repl {:dependencies [[thalia "0.1.0"]]}}, and then {:user {:dependencies [[thalia "0.1.0"]]}} afterwards

7:31 not both simultaneously

7:33 zapho53: hyPiRiion: Well only the one you suggested got me past the classpath exception but it still doesn't work with (doc)

7:33 hyPiRion_: what lein version are you on?

7:34 zapho53: hyPiRion_: Weirder still - I switched to a different clj project and it works.

7:35 hyPiRion_: zapho53: oh, then that's because you define :repl in the other project, and therefore shadow the profiles.clj definition

7:37 zapho53: hyPiRion_: I'll take a look.

7:38 hyPiRion_: It's better to specify the :repl dependency directly in the project.clj for now, from what I gather.

7:39 zapho53: hyPiRion_: The only oddities seem to be - :main ^:skip-aot db2.core :target-path "target/%s" - nothing about :repl

7:40 hyPiRion_: those looks in and by itself fine

7:41 zapho53: hyPiRion_: No profile.clj for the project where thalia fails

7:41 hyPiRion_: zapho53: project.clj, not profile.clj

7:41 or well, both of them can override the defaults

7:42 zapho53: hyPiRion_: As I said, the project.clj has only those 2 unusual entries. The rest are simple plugin deps

7:42 hyPiRion_: alright. Hrm.

7:43 zapho53: could you write an issue on the thalia github page with a minimal example?

7:45 SagiCZ1: where do you put documentation for defmethod?

8:02 clgv: SagiCZ1: in defmulti

8:03 SagiCZ1: you are actually calling a multimethod that has a certain contract of what it does - at call site you do not intend to call some specific implementation that does something entirley different then all the other multimethod implementations for different types

8:15 visof: hi

8:15 can i write java lambda expression inside closjure?

8:15 clojure*

8:36 clgv: visof: yes, you can

8:36 visof: you mean lambda functions right?

8:36 ,((fn [x] (* x x)) 3)

8:36 clojurebot: 9

8:37 clgv: ,(#(* % %) 3)

8:37 clojurebot: 9

8:37 der23: hola

8:37 cud sum1 tell me frm wer i can learn clojure frm basics?

8:38 clgv: der23: english please?

8:38 der23: Could someone tell me from where I can learn clojure from basics? :)

8:39 clgv: der23: there are a few good books and some online material. which one do you prefer?

8:39 der23: Online material, please :)

8:40 clgv: http://www.braveclojure.com/, http://clojure-doc.org/

8:40 der23: How long would it take me to grasp this?

8:40 clgv: there is at least one more I do not recall right now

8:40 that's really depending on you

8:40 hard to tell

8:41 der23: I have been coding in CPP for the past 4 years.

8:42 clgv: do you have any functional programming languages or lisp experience?

8:42 der23: Well, I had a course in Scheme last semester.

8:42 I didn't learn much in depth.

8:42 clgv: that might help to speed up learning

8:42 oh well...

8:43 der23: Hmm. I just know the basics like making functions, recursive, iterative, table, tree etc. :/

8:43 clgv: I did learn clojure by reading through a book and playing around with the examples on a repl

8:45 I usually recommend solving the exercises on 4clojure.com

8:46 visof: clgv: so converting this JavaRDD<Integer> lineLengths = lines.map(s -> s.length()); should be (map (fn [x] (.length x)) lines) ?

8:48 this java map just take lambda expressions in java or functions represented by class which implement org.apache.spark.api.java.function

8:48 clgv: so i try to use pass the easier which is lambda expressions if possible

8:49 clgv: but when i try to run this i got java.lang.ClassCastException: Cannot cast testspark.core$_main$fn__13 to org.apache.spark.api.java.function.Function , which refer anonymous fn i passed need to be casted to Function

8:49 so what you suggested guys?

8:51 clgv: visof: well they expect a special class derived from their Function interface

8:51 visof: you can use `reify` to build one

9:13 TimMc: bbloom: I was able to get the bencode crash reliably with that chunk of code I pasted earlier.

9:19 sveri: Hi, I wonder if it is possible to invalidate a session for a user that is logged in via the friend library? Or is it possible to invalidate a seesion for a given client at all?

10:02 roelof: I have this assignment : http://pastebin.com/92KgLFLC

10:02 so I made this : http://pastebin.com/5kdEFvuY

10:03 but now I see this error message : nsupportedOperationException nth not supported on this type: PersistentArrayMap clojure.lang.RT.nthFrom (RT.java:857)

10:03 which I do not understand

10:03 where did I go wrong ?

10:07 perplexa: roelof: conj the author to authors and assoc authors to book.

10:08 roelof: perplexa: so I have to make 2 conj or do you mean something else ?

10:08 perplexa: read again, please.

10:10 roelof: perplexa: oke, sorry for the two quick answers. So I have to make 2 things. One assoc to make the authors work and a conj for the authors

10:10 but I still do not understand what the error message mean

10:11 and can this be done in one "rule"

10:12 perplexa: ,(def book {:title "some book" :authors [{:name "some author"} {:name "other author"}]}) (def new-author {:name "added author"}) (assoc book (conj (:authors book) new-author))

10:12 clojurebot: #'sandbox/book

10:12 perplexa: wat

10:13 ,(let [book {:title "some book" :authors [{:name "some author"} {:name "other author"}]} new-author {:name "added author"}] (assoc book (conj (:authors book) new-author)))

10:13 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/assoc>

10:13 perplexa: ,(let [book {:title "some book" :authors [{:name "some author"} {:name "other author"}]} new-author {:name "added author"}] (assoc book :authors (conj (:authors book) new-author)))

10:13 clojurebot: {:title "some book", :authors [{:name "some author"} {:name "other author"} {:name "added author"}]}

10:13 perplexa: there.

10:13 :P

10:14 shouldn't do your assignments for you tho ;(

10:14 * perplexa stands in a corner and sulks

10:15 roelof: perplexa: I know, Im studing your solution to understand what is going on

10:15 I find this one confusing

10:15 and for your peace. its a self study

10:20 Bronsa: roelof: you can use update-in in this case

10:20 ,(update-in {:foo [1 2]} [:foo] conj 3)

10:20 clojurebot: {:foo [1 2 3]}

10:20 roelof: perplexa: I did a little bit investigation and am I right that the conj takes care that the new author get's added and not override the old values ?

10:21 Bronsa: every time you find yourself in need to do something like (assoc x :foo (f (:foo x) ..)) you should use update-in instead

10:21 roelof: Bronsa: thanks, that one is not explained in my course. I just learned to use conj and assoc

10:22 * perplexa was actually just thinking of the update-in, too

10:22 Bronsa: roelof: maybe they'll talk about update-in/assoc-in/get-in later on, they are really handy

10:22 perplexa: as long as there's just one :foo and it's not in some nested map that works idd ;p

10:23 Bronsa: perplexa: you talking about update-in?

10:23 perplexa: yeah ;p

10:24 Bronsa: perplexa: update-in does work for nested-maps, that's its main use-case

10:24 well I didn't understand you then.

10:24 perplexa: yeah i know, what i'm trying to say is that when he wants to update only one value and there are multiple matches, it could not work as expected as he intents

10:25 roelof: then it schould like this update-in ( :authors [friedman, felleisen]} conj new-author) ?

10:25 Bronsa: roelof: the solution you posted earlier doesn't make a lot of sense btw

10:25 roelof: none of what you just wrote make any sense

10:25 roelof: still he wonders why the exercise talks about using let

10:26 then I hope the course is talking about update-in and I will understand better how it works

10:27 Bronsa: roelof: take some more time to understand the fundamentals before, I'm sorry I didn't understand you were just starting to learn the language when I suggested update-in

10:28 roelof: you should definitely play with assoc/conj before using more "advanced" functions

10:30 roelof: Bronsa: np, in the next exercises I can play more with assoc and conj. I do the I loveponies tutorial where you have to do a lot self

10:30 mavbozo: roelof: maybe the current lesson wants to teach you about using let

10:32 roelof: (defn add-author [book author]

10:32 (let [old-authors (:authors book)

10:32 updated-authors (conj old-authors author)]

10:32 (assoc book :authors updated-authors )))

10:33 roelof: mavbozo: nope, let is already used in the first lesson

10:33 mavbozo: oke, like that way

10:34 but everyone thanks for the lessons but I have to leave, Daugther get swimming lessons

10:54 bbloom: thheller: hm, interesting. i'll check it out. cljs.closure is a bit hairy, i was already contemplating rewriting it for my purposes

11:26 gfredericks: does the clojure compiler note when a local stops being used mid-function and clear it?

11:27 bbloom: gfredericks: i don't know for sure, i but i think that the locals-clearing thing does lexical liveness analysis and inserts null sets anywhere a local dies

11:28 mdrogalis: bbloom: Huh, I didnt know that. That's interesting

11:29 bbloom: gfredericks: grep for `canBeCleared` in compiler.java

11:29 let me know what you figure out :-)(

11:30 gfredericks: bbloom: oh I'm just going to run this code and see if I get an OOM :P

11:30 bbloom: ha

11:31 mdrogalis: lool

11:32 Bronsa: gfredericks: bbloom is right -- the only caveat is that if a local is never used, it'll never be cleared

11:32 gfredericks: HUH.

11:33 okay that' shouldn't be a problem

11:33 danko: gooood morning vietnam!

11:33 bbloom: Bronsa: is that a debugging feature? or just a side effect of clearing code being part of the local-use emit function?

11:33 Bronsa: bbloom: the latter

11:35 danko: so i am rocking this brave and true book right now

11:35 pretty awesome, huh?

11:37 mj_langford: 👍

11:39 danko: i appreciate that mj

11:39 some acknowledgement in this world

11:40 just left my job to start company, pretty exciting stuff

11:40 learning clojure as i think it could come in handy

11:41 gfredericks: bbloom: OOM

11:41 bbloom: gfredericks: i can draw no conclusions w/o seeing your code

11:43 gfredericks: bbloom: yeah.

11:44 danko: do y'all do web server programming mainly?

11:44 i am just leaving high frequency trading

11:51 djames: If my goal is to use Emacs/Clojure on the Mac but also not stray too far from Linux installs, is http://emacsformacosx.com a good choice?

11:54 bostonaholic: djames: I installed via homebrew => brew install --cocoa --srgb emacs

11:54 but was using emacsformacosx.com before that

11:55 djames: bostonaholic: what prompted the change?

11:55 bostonaholic: brew upgrade

11:57 djames: bostonaholic: haha. I mean, where you dissatisified with the DMG install?

11:57 bostonaholic: djames: it made it easy to upgrade emacs instead of needing the DL a new dmg and installing

11:57 djames: bostonaholic: got it; otherwise, the same?

11:57 bostonaholic: yeah, I believe so

11:57 nullptr: emacsformacosx.com is a great choice if you want vanilla emacs in binary form, homebrew version is fine too

11:57 djames: nullptr: thanks

11:58 nullptr: homebrew version has a few flags to play with, and you have to compile it, but it will upgrade automagically ... both reasonable choices, you basically end up with vanilla emacs via either path

12:16 thedanko: test

12:17 i am liking cursive

12:20 mdrogalis: Clojure survey, some of these answers to "things I want" are border-line comical.

12:20 "() instead of [], () instead of {}." Sure, we'll get that into 1.8

12:21 bbloom: mdrogalis: that's either a joke or an angry common lisper

12:21 technomancy: mdrogalis: linky?

12:21 bbloom: or both

12:21 mdrogalis: http://cdn.cognitect.com/stateofclojure/2014/clj-feature.txt

12:21 bbloom: Yeah, true

12:21 nullptr: guessing http://blog.cognitect.com/blog/2014/10/20/results-of-2014-state-of-clojure-and-clojurescript-survey

12:22 mdrogalis: "distributed core.async" Really?

12:22 thheller: @bbloom happy to help if you have questions. docs are basically non-existant unfortunately

12:22 nullptr: tl;dr "faster", and "types"

12:22 mdrogalis: nullptr: *Nod*

12:23 bbloom: thheller: yeah, i'm peaking at it. it's a bug bummer that google closure's require/provide stuff is so wonky w/ respect to file names and provides

12:23 peeking*

12:23 technomancy: apparently two people want "-" as a clojure feature, did no one tell them subtraction is already supported?

12:23 mdrogalis: technomancy: They couldn't find it in the docs.

12:23 technomancy: oh snap

12:24 bbloom: all the people mentioning typing blows my mind

12:24 go use scala, or import core.typed

12:24 what more do they want?

12:24 thedanko: if you ask people what they want, they'll tell you a faster horse

12:24 hiredman: types and tpye inference?

12:24 technomancy: bbloom: inference?

12:24 justin_smith: "A faster mechanism for dispatch on multiple JVM types (multimethods ain't it!)" this person should know about protocols

12:24 mdrogalis: "Whatever Rich thinks is a good idea" We've gone full cult :)

12:24 bbloom: technomancy: hiredman: psha. just infer everything is dynamic. done :-)

12:25 mj_langford: Man, sad I missed that survey. I'd hvae asked for "Dr. Clojure" for new folks.

12:25 mdrogalis: It'd be nice if there was a brief "reply" to some of these - because a few of these requests already exist.

12:25 hiredman: "A specification for alternative implementations of clojure"

12:25 technomancy: who made this text file... they forgot to escape quotes inside strings. ಠ_ಠ

12:26 bbloom: technomancy: fucking computers

12:26 technomancy: surely you know what they meant, just parse-by-magic

12:27 technomancy: "Fully supported and documented standard library. I thought contrib was the right way to go." dems fightin' words

12:27 hyPiRion_: "A golang compiler backend"

12:28 mdrogalis: "Ability to propagate exceptions between threads on deref" That sounds .. Interesting. Is this common place anywhere else?

12:28 technomancy: hyPiRion_: someone is unfamiliar with the golang runtime apparently =)

12:28 justin_smith: mdrogalis: it happens already with futures

12:28 Bronsa: clj-weakness.txt: "JIRA"

12:29 mdrogalis: justin_smith: Eh? Ah, I guess so. I discarded the "deref" bit mentally.

12:29 I was picking threads bonking out and instantly taking down other threads.

12:30 Bronsa: "Limited BDFL bandwidth." that's a really nice way to put it

12:30 justin_smith: mdrogalis: you can see it in action with (future (#(let [a 0] (/ 1 a)))), @*1

12:31 mdrogalis: (simpler versions of this did the exceptional thing before the future even sent off thanks to optimization I guess)

12:31 hyPiRion_: technomancy: I'm not sure why, but people somehow assumes go is faster than the jvm.

12:31 mdrogalis: justin_smith: Good point

12:31 technomancy: hyPiRion_: and they assume that google go supports dynamic loading

12:32 justin_smith: mdrogalis: it makes sense - if you are using the value, you should care about the exceptional condition invoked in calculating it

12:33 technomancy: heh, someone wants robert hooke for cljs

12:33 or, they said that's what they want

12:33 what they actually want is vars for cljs

12:33 justin_smith: the visual programming a-la Mx/MSP request would be a fun little cljs html5 hack

12:33 technomancy: haha, "Static typing à la Haskell (core.typed should win)"

12:33 so... which do you want? like haskell or like core.typed?

12:34 hyPiRion_: huh

12:34 mj_langford: I'd love something that told us what was backwards derivable

12:34 hyPiRion_: "Extremely optional typing system" – I thought we had that already

12:34 mj_langford: And generate core typed for us as much as possible

12:34 and we could take that further (if that makes sense)

12:35 * bbloom shakes head

12:35 bbloom: git s

12:35 er wrong window

12:35 hiredman: or extra space, we'll never know

12:36 bridgethillyer: May I please have the, say, 2 sentence version explanation of feature expressions?

12:37 mdrogalis: Do something conditionally depending on what host you're compiling against.

12:37 hyPiRion_: bridgethillyer: I think it's like (def foo #+cljs cljs-expression #+clj clj-expression)

12:37 justin_smith: bridgethillyer: kind of like #ifdef in C but more elegant

12:37 mdrogalis: e.g. Clojure, do X, Cljs, do Y

12:37 bridgethillyer: Oh!!

12:37 bbloom: justin_smith: questionably more elegant

12:37 hiredman: http://dev.clojure.org/display/design/Feature+Expressions "There are Clojure dialects (Clojure, ClojureScript, ClojureCLR) hosted on several different platforms. We wish to write libraries that can share as much portable code as possible while leaving flexibility to provide platform-specific bits as needed, then have this code run on all of them."

12:38 justin_smith: bbloom: at least our macros are syntax aware

12:38 bridgethillyer: hyPiRion_, justin_smith: thanks - Exactly what I needed - I get it now

12:38 bbloom: justin_smith: i'd call that less broken, but no more elegant :-)

12:38 bridgethillyer: hiredman: thanks!

12:38 hyPiRion_: np =)

12:39 mmeix: What would be the simplest way to turn [:a (3)] into [:a 3] ?

12:39 Bronsa: (fn [_] [:a 3])

12:39 nullptr: ha

12:40 hiredman: one of the barf sexp paredit commands?

12:40 TimMc: M-s

12:40 hyPiRion_: (fn [x [y]] [x y])

12:41 TimMc: mmeix: Seriously though, you need to specify the problem a little better.

12:41 Bronsa: hyPiRion_: more like (fn [[x [y]]] [x y])

12:41 hyPiRion_: Bronsa: yeah, more like that

12:42 mmeix: Ok, I fiddled with a function with gave me something like {:a (2 3) :b (4)}

12:43 joobus: (flatten (quote [:a (3)]))

12:43 oops, wrong window

12:43 Bronsa: joobus: too late, we're all judging you for using flatten now

12:44 joobus: i figured...

12:44 justin_smith: ,(update-in '[:a (3)] [1] first)

12:44 clojurebot: [:a 3]

12:44 mmeix: I would apply some function, if there would be more than one argument in the (...), if only one just get the "inner" songle value

12:45 Bronsa: mmeix: so your imput is {:a (1 2) :b (3)}, what would the output be?

12:45 technomancy: wow... cljs has been around for how many years now, and people are still saying their biggest desire is "clojure off the jvm"

12:45 Bronsa: input*

12:45 justin_smith: mmeix: that's a bad idea - it's more useful if all of them are the same type - if any are sequences, let them all be

12:45 mmeix: otherwise the complexity of that conditional difference leaks into all the other related code, everyone needs single / plural conditionals

12:46 mmeix: Bronsa: {:a (1 2) :b (3)} ==> {:a 3 :b 3}

12:46 Bronsa: mmeix: a being 3 because 2+1?

12:46 mmeix: (with + as reducing func)

12:46 yes

12:47 Bronsa: mmeix: you can use reduce-kv for that

12:47 thedanko: hey guys, i am not sure what the protocol is exactly, but i wanted to introduce myself and say hi to everyone. i have been doing OO programming for a few years as a trader. i left my job last week and will be starting a company that will likely be highly software driven. i am taking a few months off and have decided to spend the first couple weeks at least starting to get familar with clojure. it seems like it will be mind-expand

12:47 ing to learn it.

12:47 hyPiRion_: (into {} (for [k v] [k (reduce + v)])) is also doable, perhaps more straightforward

12:47 Bronsa: ,(reduce-kv (fn [m k v] (assoc m k (reduce + v))) {} '{:a (1 2) :b (3)})

12:47 clojurebot: {:b 3, :a 3}

12:47 justin_smith: ,(reduce-kv (fn [m k v] (assoc m k (apply + v))) {} '{:a (1 2) :b (3)})

12:47 clojurebot: {:b 3, :a 3}

12:47 justin_smith: great minds think alike

12:48 mmeix: aha, reduce-kv was below my radar, thanks

12:48 joobus: bronsa and justin_smith are the same bot...

12:48 Bronsa: hyPiRion_: yeah, for some reason I always prefer reduce-kv over into {} + for

12:48 joobus: :P

12:48 justin_smith: actually I like hyPiRion's version

12:48 (inc hyPiRion)

12:48 lazybot: ⇒ 51

12:49 hyPiRion_: Bronsa: we should really get a map-vals function in core I think. It's very common to map over values in maps

12:49 Bronsa: I guess reduce-kv might be slightly more efficient though

12:49 hyPiRion_: yeah map-vals is defined in a ton of projects

12:49 justin_smith: Bronsa: yeah, but in that case the into/for version is more straightforward to read

12:49 Bronsa: justin_smith: sure

12:50 mmeix: thanks to all, as ever :-)

12:50 Bronsa: I think I actually called it update-vals rather than map-vals in tools.analyzer

12:50 thedanko: is this thing on? apologies if so!

12:51 justin_smith: I DEMAND AN APOLOGY

12:51 thedanko: ha, thanks!

12:51 {blake}: justin_smith, Sorry.

12:53 hyPiRion_: thedanko: cool, best of luck with learning :) I felt it was really valuable with a non-OO point of view programming-wise

12:54 thedanko: hyPiRion_: awesome and thanks, i am certainly high confused currently which is exciting because it means i am learning something new!

12:54 {blake}: OK, I've built a ring server that, on request, reads a file and creates a map which contains a spec for an input screen. Now I want to generate a web-based interface from that spec, and I'm trying to decide whether I should have a CLJS app that builds the interface from the map, or have the ring server serve HTML. Or some mix.

12:55 I'm leaning toward an Om-based app that parses the map all on its own, with the idea that that will give me the best opportunities for a responsive UI.

12:56 Any thoughts?

12:58 joobus: {blake}: if you are going to use react, then use OM or reagent on the client. Otherwise, use something like enlive to build on server. IMO

12:58 hyPiRion_: thedanko: yeah, it think it was really hard to work with Clojure in the beginning, but that's because there are so many non-OO (well, non-Java/non-C#) concepts you're not familiar with yet

12:59 {blake}: joobus, The motivation there being that it's probably easier to build the interface on the server, right?

12:59 justin_smith: hyPiRion: thedanko: but the upside is that Clojure introduces ways of programming that are often much simpler than OO

13:00 joobus: {blake}: i don't know. I think it is more a question of whether or not you want to use react.

13:00 thedanko: justin_smith: sweet! that's what i am hoping to understand soon.

13:00 gfredericks: does anybody know anything about incomplete stacktraces? not missing entirely, just clearly only showing the top 20 frames or so

13:00 this is the case for .getStackTrace so should have nothing to do with clojure tooling

13:01 justin_smith: {blake}: well, the advantage with react is you can update without a full page load, and get good responsive interaction, the advantage on server side is you can pre-build and cache things and less demands on the client's browser / computer - it depends on what kind of UI you need to have IMHO

13:01 gfredericks: is JIT in play?

13:01 gfredericks: because JIT is allowed to do weird things

13:02 gfredericks: justin_smith: how can I make it not in play?

13:02 the jvm was started by `lein repl`

13:02 hyPiRion_: gfredericks: I think the lein repl optimisations have/had a bug on stacktraces, which caused them to be too aggressively GCed

13:03 puredanger: gfredericks: if you're using pst - it takes a number of frames to show I think

13:03 gfredericks: puredanger: I'm using .getStackTrace

13:03 {blake}: justin_smith, The funny thing is, my interface should just be (basically) an input screen, all submitted at once, followed by an output screen. Maybe no react, then. The peeps around here are ga-ga for bootstrap, and I had sort of come to the whole Om/React thing through that. So maybe a wrong turn on my part.

13:03 justin_smith: gfredericks: -Djava.compiler=NONE

13:03 gfredericks: justin_smith: k I will try that thanks

13:04 justin_smith: gfredericks: that could require :replace in the :jvm-opts in project.clj

13:04 puredanger: justin_smith: I can't imagine that will end well :)

13:04 justin_smith: puredanger: oh?

13:04 puredanger: I've never used it, just have to imagine that that's going to be really slow

13:05 gfredericks: is it fully interpreted bytecode?

13:05 hyPiRion: gfredericks: see if it's reproducible with :jvm-opts []

13:05 thedanko: ha, that reminds me. i am really psyched about writing programs that can run on human time after HFT. stupid microseconds!

13:05 gfredericks: yeah good plan

13:06 thedanko: pure interpreted is probably still not human time, ha

13:06 joobus: {blake}: do you have experience with react? Setting an app up is more involved than writing a page of html inputs, which can be advantageous sometimes, and sometimes not.

13:06 justin_smith: puredanger: the suggestion pretty much comes from a "eliminate free variables until you find the cause" debugging philosophy - I would never suggest that setting as a long term solution :)

13:06 puredanger: oh understood. :)

13:07 {blake}: joobus, No, I'm just starting with React.

13:07 thedanko: so does anyone have a good autoformatting setup for cursive?

13:08 the default one doesn't seem to break up lines

13:08 well whatever i am doing doesn't

13:09 justin_smith: thedanko: cfleming_ is the cursive author, so if anyone knows it would likely be him

13:09 thedanko: justin_smith: sweet, thanks. i'll try a little more before bothering him.

13:09 {blake}: thedanko, Yeah, it doesn't seem to have an opinion on line breaks, from what I can tell.

13:10 thedanko: mj_langford: downloading lisp_cast now, thanks for the rec!

13:12 justin_smith: thedanko: mostly I was just making sure that his name was uttered, that would make his IRC client alert him to this convo if he was available but not actively watching :)

13:13 thedanko: justin_smith: oh wow, thanks for explaining! i am new to IRC also.

13:14 justin_smith: thedanko: the feature is not something ALL clients would do, but common enough to risk a chance on

13:16 gfredericks: still incomplete with :jvm-opts ^:replace [] :(

13:19 justin_smith: gfredericks: :jvm-opts ^:replace ["-Djava.compiler=NONE"]

13:19 can't hurt to try at least

13:24 thedanko: woa just got to memoize

13:24 tripppy

13:24 gfredericks: I'm giving up for now

13:25 AMALLOY: THIS IS STILL COOL, RIGHT?

13:25 hiredman: gfredericks: has anyone mentioned fastthrow?

13:25 TimMc: AMALLOY: You're infected!

13:25 gfredericks: hiredman: that was my first thought but my guess was that that only removes stacktraces entirely -- am I wrong?

13:25 TimMc: I wonder if I still have immunity.

13:25 hiredman: gfredericks: no idea

13:26 gfredericks: hiredman: I'll use my googler, thanks

13:26 hiredman: gfredericks: or try it and see?

13:26 justin_smith: (inc AMALLOY)

13:26 lazybot: ⇒ 177

13:26 hiredman: it is one of those options that is on by default so you have to set a flag to turn it off

13:39 TimMc: Haha, who put "illuminated macros" for their desired Clojure feature?

13:50 "Rich Hickey's hair" <- But we already have it!

13:54 justin_smith: TimMc: Rich does, but I can't pull it in via a project.clj dep

13:54 technomancy: you have to add sonatype-oss first

13:54 it's a common mistake

13:56 llasram: ha!

14:00 dharanimanne: hi. I'm new and I would like to contribute to clojure. Where do I start?

14:01 * technomancy looks at his shoes uncomfortably

14:01 mdrogalis: technomancy: You stepped in something. :(

14:01 hiredman: if you want to contribute code you'll need a contributor agreement

14:01 llasram: dharanimanne: Write a library to do something interesting

14:01 justin_smith: dharanimanne: a lot of interesting things can be done in a library, so you could start there

14:01 llasram: dharanimanne: For good or ill, very little development happens within Clojure itself

14:01 justin_smith: dharanimanne: contributions to the language itself are a whole other can of worms

14:01 technomancy: mdrogalis: man, it's going to take a lot of scrubbing to get the jira smell off

14:02 hiredman: http://clojure.org/contributing

14:02 llasram: dharanimanne: The good is that it doesn't need to -- even something as radical as core.async is just a library

14:03 dharanimanne: thanks. I'll look into the page

14:05 hiredman: once you fill out the ca, you can start submitting patches to clojure itself or the collection of contributed libraries (which is mostly just everything under the clojure org on github)

14:06 alex miller every once in a while tries to send out an email with good "starter" issues (I've seen him do it twice, that is enough to establish a trend)

14:06 mdrogalis: technomancy: *Step step step step SPLOOOSH* who the heck put a Jira ticket here?

14:07 bostonaholic: mdrogalis: Top 10 Clojure Features Requested in 2014: https://gist.github.com/bostonaholic/cef5a4916d46782ed368

14:07 mdrogalis: bostonaholic: Nice :)

14:07 {blake}: Heh, "Fast startup" and "Faster startup" are two separate entries.

14:08 technomancy: someone needs to do an analysis like this guy did https://www.youtube.com/watch?v=3MvKLOecT1I

14:08 classification, etc. super thorough.

14:08 hiredman: needs stemming

14:08 technomancy: "fsvo needs"

14:08 bostonaholic: I'm sure it's not perfect, but it's close

14:08 {blake}: Consisting, one presumes, of those who want the startup to be faster in absolute terms versus those who would be satisfied with an incremental improvement in startup (even if still slow).

14:08 hiredman: is there no stemmer in binutils?

14:09 llasram: Maybe named entity recognition

14:10 {blake}: What distinguishes "feature expressions" from "Feature expressions"?

14:10 bostonaholic: yeah, my script was done quickly

14:10 those would be the highest freq of single line answers

14:11 really should split the lines into bigrams/trigrams and count freq from there

14:16 {blake}: llasram, Case! Some want "feature expressions" as a general thing, while others are clearly referring to "Feature Expressions!", perhaps as an ideology or a name brand.

14:16 bostonaholic, Oh, not busting on you at all, by the way. Just being goofy.

14:16 bostonaholic: no worries

14:17 llasram: {blake}: Oh! It's pretty obvious in retrospect. I mean, the Feature Expressions were even playing at the Tabernacle last week

14:17 bostonaholic: ditto :-)

14:18 {blake}: llasram, I saw Feature Expressions open for Turing Machine back in the '80s.

14:18 bostonaholic: all are welcome to improve my script

14:18 (working on v2 now!)

14:18 djames: ACL played at ACL last year. That was so meta.

14:19 {blake}: djames, If they'd been commited to the meta, they would've all torn their ACLs before going on.

14:20 djames: Acronym Overloading was quite impressed by that whole act.

14:21 But the Standardization Committee blew a gasket and left without finishing their set.

14:21 beppu: How do I make the inversions-raw function in this post tail recursive? http://boards.4chan.org/g/thread/44813406#p44836395

14:23 djames: beppu: you have code posted at 4chan?

14:23 * djames is afraid to click that link

14:23 beppu: It's harmless.

14:27 llasram: beppu: You want to enumerate all non-descending pairs each element can form which any subsequent element in the input sequence?

14:27 s,which,with,

14:27 justin_smith: beppu: my first instinct at a shallow reading is it should be using mapcat

14:27 beppu: llasram: yes

14:27 arrdem: does anyone have a self-hosted CI solution they like for Clojure projects?

14:28 or is it just `lein test` :P

14:28 justin_smith: arrdem: had to use jenkins at work, it didn't suck balls (but I did not have to install or do system setup either)

14:28 technomancy: while true do git pull && lein test && sleep 60; done

14:28 {blake}: Aw, man, I hate it when that happens.

14:28 justin_smith: arrdem: one of the steps in jenkins was lein test :)

14:29 {blake}: Going through the enlive tutorial (https://github.com/swannodette/enlive-tutorial/)

14:29 beppu: justin_smith: use mapcat instead of trying to recursively conj?

14:29 arrdem: technomancy: I've had a shell open with `watch -n 60 lein test` as a "CI" solution before

14:29 technomancy: arrdem: actually... hook that up with http://tools.suckless.org/ii/

14:29 and you're in business =D

14:29 justin_smith: beppu: yeah, but like I said that comes from a shallow reading, so may be off base

14:29 beppu: ok

14:29 llasram: beppu: Do you want an example of Clojure-style tail-recursion, or just a version which doesn't blow the stack on a large collection?

14:29 {blake}: And the first command fails. (hn-headlines) is supposed to pull from news.ycombinator.com and gets a 403. :(

14:30 arrdem: technomancy: oshit nice one!

14:30 beppu: llasram: either would be fine.

14:30 arrdem: (inc technomancy)

14:30 lazybot: ⇒ 153

14:30 technomancy: arrdem: lein test will write a .lein-test-failures file or something you could cat that to an irc channel with ii =)

14:30 justin_smith: technomancy: or even watch the file for changes...

14:31 beppu: I tried to (juxt conj) and change (inversions-raw (rest lst)) to (recur (rest lst)) but I was told that recur wasn't in the tail position.

14:31 arrdem: eh just write a post-recieve that pokes the rebuild system

14:31 asynchronously

14:33 dbasch: beppu: in (apply concat (filter not-empty (inversions-raw lst)))), why the filter clause?

14:34 beppu: dbasch: part of the result set of inversions-raw were a bunch of empty lists that I didn't want

14:34 dbasch: I didn't know how else to get rid of them.

14:34 llasram: beppu: https://www.refheap.com/92198

14:35 arrdem: beppu: if you apply concat to a sequence containing empty lists... the empty lists do nothing

14:35 beppu: llasram: That looks elegant. Thank you.

14:35 arrdem: orly? didn't know that.

14:35 arrdem: unless I'm loosing my mind...

14:35 llasram: arrdem: You are not

14:35 arrdem: &(apply concat '((1 3) () (4 5)))

14:35 lazybot: ⇒ (1 3 4 5)

14:36 llasram: Well, you might be, but not on that :-)

14:36 arrdem: llasram: thanks for the vote of confidence :P

14:37 beppu: llasram: Is it OK if I post your version in that thread?

14:37 llasram: arrdem: It's difficult to escape your history. I understand.

14:37 dbasch: arrdem: that’s why I asked the question, it’s redundant

14:37 llasram: beppu: sure thing

14:37 beppu: thanks for your help everyone

14:40 pwmask: How would I read a password from console input without having the password printed? Java interop with System/console is giving me troubles

14:45 hyPiRion: pwmask: java.io.Console.readPassword()

14:47 arrdem: hyPiRion: ... is that actually a thing?

14:47 that is a thing.

14:47 (inc hyPiRion)

14:47 hyPiRion: arrdem: yes, http://docs.oracle.com/javase/7/docs/api/java/io/Console.html#readPassword()

14:47 lazybot: ⇒ 52

14:49 hyPiRion: I have also implemented setEcho if you want to shoot yourself in the foot: https://github.com/hyPiRion/com.hypirion.io/blob/master/src/com/hypirion/io/ConsoleUtils.java#L56-L67

14:51 arohner: are there any libraries/gists for profiling core.async channels? I have a process using several chans, and I'm curious to see which ones are full, empty, etc

14:52 pwmask: hyPiRion: java.io.Console.readPassword() is not working for me.

14:53 beppu: llasram: (take-while seq (iterate rest coll)) <-- that's really cool

14:53 (inc llasram)

14:53 lazybot: ⇒ 39

14:53 hyPiRion: pwmask: in the lein repl, right? You'll have to use it with `lein run -m clojure.main`

14:54 pwmask: hyPiRion: will it work when I uberjar my code?

14:55 hyPiRion: pwmask: almost definitely. As long at it works when you do `lein run`, it will work when you call the uberjar

14:55 pwmask: Oh, i meant if I would need to do anything special to add the -m portion to my uberjar

14:55 hyPiRion: oh, nono

14:55 it has to do with the lein repl setup

15:06 rsslldnphy: Anyone using cemerick/friend seen an issue where a single request for a page requiring authentication is allowed *after* logout, with all subsequent requests being properly prevented?

15:07 pwmask: hyPiRion: yep that works. Thanks!

15:08 hyPiRion: pwmask: np

15:10 borkdude: I would have liked some analysis of this data like Chas Emerick did with the previous surveys http://blog.cognitect.com/blog/2014/10/20/results-of-2014-state-of-clojure-and-clojurescript-survey

15:10 for example: how many people use cljs and don't use clj

15:11 puredanger: I wrote about half of one but I decided to release the data rather than wait till I finished that (which might be a while)

15:12 borkdude: puredanger cool

15:13 puredanger: in particular, I think it's most instructive to compare across the last few years

15:13 borkdude: puredanger I think people who use clj(s) at work has gone up

15:13 puredanger: but it really means building whole new charts that combine data across several surveys and that is slow

15:13 borkdude: puredanger sure. I am particularly interesting now in the usage of cljs though, if people are using it who don't use clojure

15:14 puredanger I'm not sure how I can derive that daya

15:14 puredanger: yeah, can't really see that (except it's prob very few since 98% of respondents said they were using clojure)

15:17 noonian: people do come here from time to time trying to figure out how to compile cljs when they obviously have not used clojure and the dev tools

15:22 pwmask: hyPiRion: is there any way to ensure System.console() won't return null? I know this is more of a java issue, but I'm not sure I understand why java believes it doesn't have a console in some cases

15:25 hyPiRion: pwmask: No, you cannot ensure the user has access to a console. Double-clicking on an uberjar for example won't open up a console, and if you redirect stdin from the shell you're in, you don't have access to the "console" either

15:26 (Presumably the user is using the program wrong if you get back null)

15:31 akurilin: Hey folks: is there an straightforward way I could glob files with an "older than x hours" filter on it?

15:31 I was looking at raynes/fs

15:31 One option is that I glob and then check the age in clj

15:33 danielcompton: akuriliin: file-seq + a filter?

15:44 mdrogalis: Is there a way to make clojure.tools.namespace.repl/refresh not refresh the tests?

15:51 akurilin: danielcompton: yeah probably something along those lines

15:57 ToBeReplaced: akurilin: if java 7+, java.nio.file gets you that, and i wrote a wrapper to make it a bit easier (nio.file)

16:01 tony_: I'd like to start using ClojureScript for my frontend development. Can someone recommend a workflow for dev/browser-repl?

16:02 borkdude: tony_ I suggest checking out weasel

16:03 tony_ if you want to use Om, you can check out Chestnut. If you want to use Reagent check out the lein new liberagent template

16:03 tony_: or give me their thank you borkdude

16:04 *thank you borkdude

16:04 i tried Austin, but had some trouble setting it up and gave up

16:06 mi6x3m: hey clojure, what's the best way to create an empty sequence?

16:07 tbaldridge: mi6x3m: nil, or ()

16:07 mi6x3m: tbaldridge: oh, () is actually a literal

16:08 tbaldridge: mi6x3m: yep, although most of the time, nil works as well

16:08 ,(map inc nil)

16:08 clojurebot: ()

16:08 dbasch: mi6x3m: it’s rare that you need to create an empty sequence though

16:08 mi6x3m: (inc tbaldridge)

16:08 lazybot: ⇒ 12

16:08 mi6x3m: well I need it in this case for consistency

16:09 noonian: there's also the empty function so you can write generic things that return the same type, i.e. (fn [col] (into (empty col) (map inc col)))

16:10 lodin: noonian: Watch out for vector vs list there though.

16:11 akurilin: ToBeReplaced: oh neat, thanks for keeping me posted

16:11 danielcompton: mdrogalis: can you pass it a directory of files to refresh?

16:11 akurilin: btw what is pom.xml.asc when submitting to clojars?

16:11 Do I need that in my source control at all?

16:12 noonian: lodin: yeah, you mean because of reverse ordering?

16:12 and performance

16:12 lodin: noonian: Don't know about performance, but yeah, reverse ordering.

16:13 noonian: cool

16:15 stuartsierra: akurilin: .asc files are GPG signatures; should be generated automatically by your build tool.

16:15 jdmmmmm: Midje question: Does anyone know how to get fact names with variable interpolation?

16:15 Ex, this does not show the evaluated string: (def x "foo") (fact (str "example " x) (cons 'a '()) => '(a b))

16:16 JohnJoyy: hi guys, any hardened soul could help me make a connection to SQL Server in Clojure? I'm having trouble doing it in a Mac after being able to get it done against a remote machine

16:16 lodin: noonian: Ah, you're thinking about list not being editable, so transients can't be used? (I just looked at the source of into.)

16:16 akurilin: stuartsierra: I guess my question is, is it ok for me to get rid of it after a push to clojars?

16:17 stuartsierra: akurilin: yes

16:18 akurilin: perfect, thank you

16:18 noonian: lodin: i just mentioned performance on the off chance that it was what you were referring to. I don't normally worry about it unless its a problem and I don't know specifically with into if it is a problem

16:20 jdmmmmm: JohnJoyy: Have you mapped 127.0.0.1 to your mac machine name in your /etc/hosts file? I've never tried what you're trying to do, but I have had to make this configuration for other locally running server processes.

16:21 technomancy: akurilin: they should be in the default .gitignore

16:21 weavejester: What are people’s thoughts on the #=() reader form? Is it something that should be used in code?

16:21 JohnJoyy: jdmmmmm: I am already able to connect with another client on Mac, I'm suspecting this is a problem with the Java classpath in Mac, does it assume the /Library/Java/Extensions or do I need to set it?

16:22 technomancy: weavejester: IMO it's a measure of last resort

16:22 jdmmmmm: JohnJoyy: What's your error?

16:22 JohnJoyy: jdmmmmm: java.sql.SQLException: No suitable driver found for jdbc:sqlserver:10.211.55.4\sqlexpress

16:23 technomancy: eval at read-time, like eval at runtime, is almost always a hacky way of doing something sketchy

16:23 weavejester: technomancy: I was trying to get the current namespace with *ns*

16:23 So rather than writing (resource/url ‘foo.bar.baz “index.html”)

16:24 Which would evaluate to “foo/bar/baz/index.html”

16:24 I could write (resource/url *ns* “index.html”)

16:24 jdmmmmm: JohnJoyy: Without answering your exact question, a strategy of connecting is mentioned here: https://github.com/clojure/java.jdbc

16:24 weavejester: I was considering using #= to force the *ns* to be evaluated at the moment it’s compiled

16:24 akurilin: technomancy: fair enough. It wasn't there in the Korma .gitignore so I added it now.

16:24 weavejester: i.e. #=(resource/url *ns* “index.html”)

16:24 Is that terrible? :)

16:24 jdmmmmm: JohnJoyy: This should obviate any platform-dependent classpath issue you might face.

16:25 technomancy: weavejester: ::index.html maybe

16:25 weavejester: technomancy: Oh! That’s something I hadn’t considered...

16:25 (resource/url ::example “.html”)

16:26 But is that easier to understand than

16:26 JohnJoyy: jdmmmmm: yeah I tried that, couldn't manage to locate a Maven repository accessible to my system

16:26 weavejester: #=(resource/url *ns* “example.html")

16:26 hiredman: syntax quote also namespace qualifies

16:26 `foo

16:26 technomancy: weavejester: admittedly both methods are hacky

16:26 jdmmmmm: JohnJoyy: Are you're using leiningen?

16:26 JohnJoyy: jdmmmmm: yeah

16:26 weavejester: (resource/url `example.html) ...

16:28 JohnJoyy: jdmmmmm: should I use this https://github.com/kumarshantanu/lein-localrepo ?

16:29 weavejester: Maybe I should just fully qualify the namespace

16:29 But that seems prone to error

16:29 I could do (def ns *ns*) at the top level, but ick :)

16:29 or (def current-ns *ns*)

16:29 jdmmmmm: JohnJoyy: I think you'd have to install locally and use the :resource-paths leiningen configuration. Cf. http://stackoverflow.com/questions/2404426/leiningen-how-to-add-dependencies-for-local-jars

16:29 technomancy: heh, yeah ns is hard-coded

16:31 weavejester: If a namespace foo.bar.baz depends on resources foo/bar/baz/* I’d preferably like a way of specifying the namespace once

16:31 So I could write (def current-ns *ns*) and then (resource/url current-ns “example.html”)

16:40 My code looks neater with #= ...

16:49 noonian: what is this #= thing you speak of

16:49 JohnJoyy: jdmmmmm: tnx I'll try that

16:50 noonian: it's not very googleable

16:51 ToBeReplaced: weavejester: fwiw i'd go the (def ^:private this-ns *ns*) route if you're only using it within that namespace

16:52 weavejester: ToBeReplaced: Yeah… I don’t like the repetition, but it might be the clearest way of doing it.

16:52 ToBeReplaced: kind of weird having the namespace map directly to a file though... you could alternatively do (defmacro myurl ...) in a utility file

16:53 weavejester: ToBeReplaced: In my case it’s because the namespace relies on an external resource

16:53 ToBeReplaced: For instance, foo.bar.endpoint.example might rely on the resource “foo/bar/endpoint/example/index.html”

16:54 ToBeReplaced: right

16:54 (defmacro myurl [basename] `(resource/url ~*ns* ~basename)) maybe?

16:56 weavejester: ToBeReplaced: Yes, or simply (defmacro this-ns [] (ns-name *ns*)) might work.

16:56 I guess I’d need to quote it, but you get the idea.

16:56 Or just (defmacro this-ns [] *ns*) might work

16:57 amalloy: weavejester: probably not

16:57 trying to embed a Namespace object in code doesn't sound happy

16:58 weavejester: amalloy: Just tried it, and it works fine

17:00 ToBeReplaced: there's definitely good reason for it... consider tools.logging

17:02 weavejester: I’m actually tempted by the eval reader form

17:02 Since it’s very explicit as to what it does

17:03 Whereas a macro that grabs *ns* seems a little more iffy.

17:07 sg2002: Hello. Does anyone here uses Korma? I have somewhat newbish problem: I need to be able to close my db connection manually. But I also want transactions to work. Found this https://github.com/korma/Korma/issues/160, but there's no way to specify this custom object to the transaction macro...

17:09 Oh, nevermind found with-db macro in korma sc. That worked...

17:19 zerokarmaleft: what's the advantage of using core.async/pipe vs directly hooking up two processes with one channel?

17:20 the shared channel seems to functioning as a pipe already

17:24 arohner: zerokarmaleft: a/pipe copies between two channels

17:29 akurilin: ztellman: quick question: what's the name of that streams library you wrote a while ago?

17:29 Can't remember the name for the life of me :(

17:29 ztellman: akurilin: manifold?

17:29 arohner: lamina?

17:29 akurilin: aah ok

17:29 ztellman: I have a number of them

17:29 akurilin: ztellman: arohner thanks guys :P

17:29 I'm trying to transform a byte[] into an output stream

17:29 so I can Ring it out

17:29 ztellman: akurilin: byte-streams

17:29 that's the one you want

17:30 akurilin: ztellman: thank you sir <3

17:30 ztellman: and you want it to be an inputstream, btw

17:31 akurilin: ztellman: oh ok I ahve these things backwards every time

17:32 zerokarmaleft: arohner: well yes, I mean use cases

17:33 arohner: zerokarmaleft: for example, you could have multiple data sources that can be processed the same

17:33 so you copy from multiple sources to the same dest

17:34 zerokarmaleft: ah

17:34 arohner: I'm using a/pipeline in code I'm writing right now, to use different levels of parallelism

17:47 cfleming_: thedanko: Did you get that formatting issue sorted out?

17:48 thedanko: cfleming: greetings! not yet. i am watching the lisp cast video now and i see how he is putting in line breaks

17:48 cfleming: but i don't see how or whether cursive can do that automatically

17:48 cfleming: thedanko: I haven't seen the video - can you describe what you're trying to achieve?

17:48 thedanko: cfleming: it does some autoformatting but no line breaks currently.

17:49 cfleming: thedanko: Are you talking about e.g. automatically inserting line breaks between map entries, or similar?

17:49 thedanko: cfleming: i am brand new to clojure from java. in java, the autoformat would create line breaks when the lines got long or in other reaosnable places.

17:50 cfleming: thedanko: Ok, I see - Cursive doesn't do that yet, but the latest version actually just got a formatter upgrade that will allow that.

17:50 thedanko: I still have to add the options so you can control where the breaks go.

17:50 thedanko: cfleming: sweet, thanks. not trying to complain at all obviously, it's a great program! just wanted to make sure i wasn't missing something.

17:51 cfleming: thedanko: It's harder in general in Clojure than in Java because the syntax is so flexible, it's not immediately obvious what is a parameter when you're formatting, for example.

17:51 thedanko: No, no worries, I'm always interested to know what people are missing.

17:52 thedanko: So, hopefully within a couple of builds that will be in there, but it'll be more limited than you're used to in Java

17:52 thedanko: Like a lot of the tooling in general, the language makes it more difficult.

17:52 thedanko: cfleming: i look forward to it!

17:53 cfleming: just curious, do you primarily use the REPL in intellij?

17:54 cfleming: well i am not just curious i guess. i want to make sure i have a goodsetup going. cursive and the local repl seem great so far.

17:54 cfleming: thedanko: It's a mix - I often have the REPL running just to run tests, but do most of my work on tests and code in the editor.

17:54 thedanko: I tend to use the REPL editor more when I'm playing with an idea or exploring an API.

17:55 thedanko: cfleming: nice, thanks! great to hear from an expert.

17:55 cfleming: thedanko: You'll find over time what works for you, people have different ways of working with the REPL - see http://literateprogrammer.blogspot.co.nz/2014/10/hiding-repl.html for some discussion on that.

17:56 EvanR2: damn we have experts here?

17:56 technomancy: verma: was this your comment here? https://github.com/technomancy/leiningen/issues/1721

17:56 borkdude: someone know why this websocket conn isn't working just by looking at this screenshot? https://www.dropbox.com/s/zz57vgy2rhq5aop/Screenshot%202014-10-23%2023.50.30.png?dl=0

17:56 thedanko: haha

17:57 technomancy: EvanR2: no, only Señor Software Developers

17:57 nwolfe: haha

17:57 EvanR2: aye yai yai

17:57 cfleming: I prefer Mr Señor, actually.

17:58 thedanko: cfleming: the keyboard shortcut guide on your website is awesome. have been working on them today. that was one of the first things i taught new hires.

18:05 cfleming: thedanko: Great, thanks - glad it's useful!

18:16 technomancy: can any lein-ring users tell me if https://github.com/technomancy/leiningen/issues/1710 is fixed with the latest commit on lein master?

18:19 vIkSiT: hmm, whats the easiest way to get keys from a map while making sure that it returns empty in case that key doesn't exist?

18:20 justin_smith: vIkSiT: do you want the keys, or the values for certain keys?

18:20 vIkSiT: eg, in python, I could do mymap.get("key1", {}).get("key2", {}) ...

18:20 at every level, i'm trying to get the value for a given key

18:20 so i'm thinking (-> my-big-nested-map :key1 :key2 :key3)

18:20 justin_smith: ,(get-in {:a {:b {:c 0}}} [:a :b :c])

18:21 clojurebot: 0

18:21 vIkSiT: ->>* rather

18:21 ah

18:21 get-in.

18:21 ty justin_smith!

18:21 justin_smith: np

18:21 also works with vectors (but not lists / lazy-seqs)

18:21 ,(get-in [[[42]]] [0 0 0])

18:21 clojurebot: 42

18:22 justin_smith: kind of like foo[0][0][0] in an algol family lang

18:22 vIkSiT: ,(get-in {:a {}} [:a :b])

18:22 clojurebot: nil

18:22 vIkSiT: ah

18:25 justin_smith: ,(get-in {:a {}} [:a :b] ::not-found) vIkSiT:

18:25 clojurebot: :sandbox/not-found

18:25 vIkSiT: aaah

18:25 very neat

18:25 justin_smith: you probably would want that if you want to disambiguate

18:25 vIkSiT: true

18:25 justin_smith: the namespaced keyword helps

18:26 vIkSiT: So, how do you guys think about large code base organization? eg, i have a functionality that queries a server. but, there are three ways of doing it.

18:26 so in OO world, you'd make an abstract class that does basic stuff

18:26 and then implement class1 2 and 3

18:27 which does some specific stuff.

18:27 now, should I be thinking protocols? multimethods?

18:27 something else?

18:27 amalloy: functions. always think about functions

18:28 justin_smith: vIkSiT: provide functions that operate on some shape of data, and then have your querying functions return data in that shape

18:28 vIkSiT: the data you provide should be as seamlessly usable with clojure built-in functions as possible

18:29 vIkSiT: ring is a good example - you can use various http servers, all end up handing you a hash-map with certain keys you can operate on

18:30 then you hand a hash-map or string back to the ring adapter and you're done

18:30 vIkSiT: hmm

18:31 why not protocols then?

18:31 justin_smith: and then separately you have compojure that gives convenience macros for acting on that data (mainly the specific problem of routing)

18:31 vIkSiT: for instance, why can't I have an "indexer" protocol that contains the functions "query", "delete" and "index"

18:31 justin_smith: well, in that specific example ring does use a protocol

18:31 vIkSiT: ah

18:32 and then i could have a "indexer-type1 and indexer-type2

18:32 justin_smith: vIkSiT: but here is the thing - I define protocols if I want other people to be able to hand me implementations that plug into my code

18:32 vIkSiT: where indexer and query are overwritten

18:32 CaptainRant: Whats the idiomatic way to check that after refactoring my function still returns an object of the same type(s) as before ?

18:32 justin_smith: vIkSiT: if I just have two functions that could be used to get the same sort of data, I don't need a protocol for that

18:32 vIkSiT: right. for instance, if someone needs to write a new indexer for this service

18:32 then all they do is implement the protocol

18:32 and only worry about implementing the two funcions

18:32 justin_smith: vIkSiT: exactly

18:33 vIkSiT: and all other internal stuff (connection handling for instance) is within that protocol

18:33 right, this isn't about just two functions

18:33 sg2002: Hello. I have another somewhat lamish question - what would be an idiomatic way to implement a stream in clojure? By stream I mean a lazy seq, every element of which can be read and after reading it can be gcd.

18:33 vIkSiT: it's about f[1..n] where, fn relies on fn-1, and so on till f1.

18:33 justin_smith: sg2002: lazy-seq

18:33 vIkSiT: so if i want to implement f'n

18:34 then i would either need to rewrite f1-n as f'1-f'n

18:34 or, somehow encapsulate

18:34 justin_smith: (doc lazy-seq)

18:34 clojurebot: "([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. See also - realized?"

18:34 vIkSiT: justin_smith ^

18:34 justin_smith: vIkSiT: yeah, that sounds about right

18:35 sg2002: justin_smith: The problem with lazy-seqs is that elements keep growing, hogging the memory.

18:35 justin_smith: vIkSiT: but remember that in clj land it's less often about information hiding, and more often about providing standard interfaces so functionality can be composed with the standard tools

18:35 sg2002: that's your fault for holding onto the head

18:35 sg2002: don't hold the head, and the elements get gc'd

18:36 sg2002: if you have a small example that has that issue, I can probably show you an alternate version that doesn't hold the head of the sequence

18:37 sg2002: justin_smith: Hmm, is there a way to stop holding head? I'm observing my lazy seq right now, it does not really seem to be gc-ing. And why would it? How clojure would know that I don't need some elements?

18:37 justin_smith: sg2002: because you don't have any object that provides access to those elements

18:37 that's what not holding the head means

18:38 ,(nth (range) 100000)

18:38 clojurebot: 100000

18:38 justin_smith: in the above, there is no reason for the vm to hold onto the 0,1,2,...

18:38 and it is smart enough to gc them

18:39 ,(def numbers (range))

18:39 clojurebot: #'sandbox/numbers

18:39 justin_smith: ,(nth numbers 1000000)

18:39 clojurebot: eval service is offline

18:39 sg2002: justin_smith: Ok, I have a lazy seq. Over this lazy seq I do a doseq . In doseq I pass element to some fn, after which I don't need it anymore. Would it gc?

18:39 justin_smith: in this example, it needs to hold onto the head

18:39 it can't throw them away

18:40 sg2002: as long as no binding is in scope to access the head of the sequence, yes

18:40 sg2002: the problem comes up as you see in my second version above, when "numbers" is still in scope

18:40 it crashed

18:43 mikefikes: justin_smith: in (nth (range) 100000), does the argument vector count as a binding that could hold onto the head of the ooutput of (range)?

18:43 amalloy: mikefikes: no

18:44 justin_smith: mikefikes: no - because there is no way outside that form to access that value

18:44 mikefikes: and the compiler can take that into account when compiling that form

18:44 mikefikes: Cool, the compiler elides it?

18:44 amalloy: it only "counts" if you actually refer to that binding; the compiler knows when you use a lexical binding for the last time, and nulls out the reference once it can prove you're never touching it again

18:44 eg, consider (defn foo [xs] (last xs))

18:44 justin_smith: mikefikes: not elides it, just constructs things such that the values can be quickly reclaimed after usage

18:45 amalloy: xs is obviously in scope the whole time that foo is finding the last element in (foo (range 1e7))

18:45 mikefikes: Nice :)

18:45 amalloy: but the compiler sees that you're never reading it again, so it's eligible for collection

18:51 mikefikes: Interestingly (nth (range) n), where n is some huge integer, returns the correct result instantaneously for me in ClojureScript, as if the compiler has short-circuited something.

18:52 justin_smith: mikefikes: it runs pretty fast in clj too

18:52 stuartsierra: I think there's an experimental implementation of Range as a reified type in ClojureScript.

18:53 mikefikes: It is taking a long time and pegging my CPU in JVM Clojure

18:53 justin_smith: mikefikes: oh, interesting

18:53 SegFaultAX: How big is n?

18:54 mikefikes: Google Closure is not involved when evaluating things in a browser REPL, is it? Or is it as Stuart says, something intrinsic about the implementation?

18:54 (time (nth (range) 10000000000000))

18:54 "Elapsed time: 0 msecs"

18:54 => 10000000000000

18:55 Bronsa: mikefikes: yeah nth on range is implemented via arithmetic operations on start+step rather than by walking the entire seq

18:55 mikefikes: (The above is with ClojureScript)

18:55 Bronsa: so it's constant time

18:56 stuartsierra: https://github.com/clojure/clojurescript/blob/92a00c388a442186cb25ee328f0a71423df55341/src/cljs/cljs/core.cljs#L7536

18:56 Bronsa: it has been that way for a long time btw

18:56 mikefikes: Cool, I wanna learn more about what its doing there. Is that a capability that we mere humans have at our disposal when writing code?

18:57 Bronsa: mikefikes: yes

18:58 mikefikes: Bronsa: Is that true in CLJ also? Or is it "yes" because of the prevalent use of protocols in CLJS?

18:58 Bronsa: mikefikes: it's not the case in CLJ atm

18:59 mikefikes: but there's a ticket open to change the implementation of range to somewhat match the one used in CLJS

19:00 mikefikes: http://dev.clojure.org/jira/browse/CLJ-1515

19:00 mikefikes: Thanks Bronsa and Stuart, reading that stuff now :)

19:01 Bronsa: mikefikes: the cljs impl is easier to read than the one proposed in the clj ticket as cljs is implemented in cljs while for clj the impl is in java

19:03 mikefikes: So... will the ClojureScript compiler one day in the far off future be revised to emit JVM bytecode, etc. Seems like there is too much investment in the curent Clojure compiler to ever abandon it.

19:03 justin_smith: mikefikes: there have been various attempts at making clojure self hosting (or at least more self hosting than it is now)

19:04 Bronsa: mikefikes: cljs has a different compilation model than clojure so that's highly unlikely

19:04 mikefikes: however I've implemented a compiler on top of tools.analyzer.jvm that emits jvm bytecode https://github.com/clojure/tools.emitter.jvm

19:05 mikefikes: Ahh OK. I thought the ClojureScript compilation model was temporary. I don't yet truly appreciate the compile time / runtime considerations.

19:06 Bronsa: mikefikes: no, it's by design and unlikely to change

19:08 mikefikes: If the Clojure compiler were being written today, would it follow the ClojureScript compiler design? In other words, is Clojure the way it is simply due to history, or is it on purpose?

19:09 (For what little I know, JVM bytecode and JavaScript are interchangable execution targets.)

19:09 hiredman: fuh

19:09 no

19:10 justin_smith: mikefikes: there's a saying on ##java java : javascript :: ham : hamster

19:10 hiredman: it would likely have protocols at (or near) the bottom like clojurescript but have clojure's runtime model

19:11 I mean, that would be my guess, the clojurescript model didn't come of design really, but necessity, from my understanding

19:12 clojurescript has to be the way it is to use the google closure optimizer and it has to use the google optimizer to have an acceptable foot print

19:12 Bronsa: hiredman: you're right

19:13 hiredman: as some who has written a lot of clojure, I find clojurescript rather anemic

19:13 Bronsa: mikefikes: were clojure to be reimplemented today I'd guess quite a few things might be different but I seriously doubt the compilation model would be one of those

19:13 hiredman: care to explain that statement a bit?

19:14 technomancy: my guess is no vars

19:14 hiredman: Bronsa: it just doesn't have all the stuff

19:14 maybe I just haven't bothered to figure out how you setup a repl for it

19:15 Bronsa: technomancy: I haven't written any cljs myself but it's my understanding that the lack of vars are not an issue really

19:15 hiredman: there was a lot lost in the translation to javascript, dnolen and company have been working overtime to recover it (source maps, etc)

19:16 technomancy: Bronsa: yeah, and lack of a repl is "not that bad" when using google go if you listen to the true believers. I'm not buying it. =)

19:16 clojurebot: Ik begrijp

19:16 technomancy: thanks clojurebot; you're super helpful

19:16 mikefikes: The bot burped?

19:17 ghadishayban: someone asked for Go as a backend in the survey

19:17 surprise surprise

19:17 hiredman: well, people are the worst, so it was bound to be asked for

19:18 Bronsa: hiredman: I guess that's true, still having all the clj interfaces as protocols is something I envy a lot of cljs

19:19 hiredman: sure

19:20 mysamdog: Well, it's been a while since I've asked a stupid question here, so here I go

19:21 Bronsa: it has its own issues though, because protocols don't partecipate in a hierarchy like interfaces do, there's no way to extend a -- say -- ISeq interface to a protocol and be done, in cljs you have to extend every concrete type

19:22 hiredman: Bronsa: there are some pretty sophisticated deftype like macros that help with that sort of thing

19:22 I think ztellman has some kind of def-map-type thing

19:22 Bronsa: this shows with https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L8054-L8141

19:23 ztellman: https://github.com/ztellman/potemkin#def-map-type

19:23 djames: mikefikes: are you indirectly asking if one compiler may one day serve both the JVM and JavaScript?

19:23 Bronsa: hiredman: sure I implemented something similar myself years ago https://github.com/Bronsa/neurotic

19:24 mikefikes: djames: Yes. One to rule them all, maybe even other targets like SIL. Having host interop is nice, but it also leaks through in negative ways, but I understand that these are all pragmatic considerations.

19:25 hiredman: SIL?

19:25 mikefikes: If nothing else, pushing protocols farther down in Clojure's compiler might be nice.

19:25 Swift Intermediate Language; I'm guessing it is like bytecode but for Swift

19:26 hiredman: ugh, gross

19:26 Bronsa: mikefikes: honestly, as things are now I doubt there will be a significant reworking of the Clojure compiler ever

19:27 sg2002: justin_smith: Thanks for the info. Good to know that clojure is doing the smart thing. Got the hintch that it doesn't from debugging a memory hog, now found, that it's not clojure, but on of my libs.

19:27 mikefikes: Bronsa, yeah, that's what I figure

19:27 hiredman: the issue is, clojurescripts reduced semantics demand less of the host, so it seems like the style of clojure likely to spread to other platforms, which is sad, because clojure is better

19:28 dwwoelfel: Has anyone experienced line numbers being off with advanced compilation on ClojureScript source maps?

19:28 mikefikes: hiredman: I have no interest in Swift, I just want to be able to code in Clojure and target iOS

19:29 djames: mikefikes: that would be nice

19:29 mikefikes: So far, I've been using ClojureSwift, but the interop is painful

19:29 Bronsa: from a compiler-writing POV I have to say I've frequently envied the lack of "runtime available" macros & resident compiler in cljs, I'm sure arrdem can sympathize with this

19:29 mikefikes: Heh, ClojureScript :)

19:30 hiredman: Bronsa: sure, and imagine the optimization passes you could do if you knew all the types at compile time!

19:30 Bronsa: there are optimizations that go from really hard to simply impossible because of the compilation model of clj :(

19:30 hiredman: sure

19:31 it leans hard on the optimizations in the jvm

19:33 justin_smith: sg2002: cool - fyi for future reference the jdk comes with a profiler (jvisualvm) and there are other profilers out there too, and profiling is the best way to figure out what is using up all your RAM / making your program slow / etc/

19:34 sg2002: justin_smith: Yep used jvisualvm.

19:41 verma: is there a workaround around this: https://github.com/technomancy/leiningen/issues/1710

19:41 can't get the output jar to work

19:42 justin_smith: verma: technomancy was asking people to try out some fix for that earlier

19:43 verma: justin_smith, hmmm

19:43 justin_smith: verma: he asked if people would try out lein master and see if it's fixed

19:43 verma: justin_smith, yeah the issue says that it probably didn't

19:44 technomancy: verma: that comment is 11 days old; I think today's master has a fix

19:44 verma: oh nice

19:44 checking

19:44 technomancy: verma: also, is this your comment here? https://github.com/technomancy/leiningen/issues/1721

19:44 sometimes freenode nicks and github usernames don't match up and it's super confusing

19:45 verma: technomancy, no, I did work on that issue a little bit, trying to earn a sticker

19:45 it got quite complex fast

19:46 bostonah_: mdrogalis: {blake}: llasram: even after improving the script, the results were nearly identical - https://gist.github.com/bostonaholic/cef5a4916d46782ed368

19:55 verma: technomancy, so I checked out the latest master, and went into the leiningen-core directory, and did a lein bootstrap, I then went to ../bin and tried to run lein, it came back with Failed to download https://github.com/technomancy/leiningen/releases/download/2.5.1-SNAPSHOT/leiningen-2.5.1-SNAPSHOT-standalone.jar

19:55 guess its looking for its release

19:55 how do I use lein from this checkout?

19:56 {blake}: bostonaholic, If you combine fast/faster startup, it ties for first with "feature expressions".

19:56 bostonaholic, Or, wait, no it doesn't...wait I'm confused...this is the same list.

19:56 bostonaholic: yeah, I'd like to improve it to combine like terms, but that's a bit more work

19:57 same with "Types" vs. "type checking"

19:58 technomancy: verma: don't copy bin/lein out of the checkout; symlink it or just run bin/lein

19:58 {blake}: bostonaholic, Eh, it's pretty visible.

19:58 Could do it by hand.

19:59 verma: technomancy, ok

20:03 technomancy, lein --version gives out: Leiningen 2.5.1-SNAPSHOT on Java 1.8.0_11 Java HotSpot(TM) 64-Bit Server VM

20:03 but I still cannot create the jar

20:03 it fails with the same error

20:03 technomancy, Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method.

20:04 technomancy: oh, this is lein-ring, not lein uberjar

20:04 verma: Error: Could not find or load main class wtx_slack.handler.main

20:04 oh

20:07 technomancy, is there a way around this to get a jar?

20:08 technomancy: I've tested lein uberjar

20:08 I don't know about lein-ring; I've never used it

20:10 verma: technomancy, ok, thanks for your help

21:29 sher: hello, quick clojure question

21:31 sherry: 'allo, quick clojure q

21:37 kenrestivo: that's pretty quick.

21:42 i'm trying to decide which of the component frameworks to use. so far there is trapperkeeper, system, frodo, and leaven to evaluate. any others i've missed?

21:47 sherry: hi, quick clj question

21:48 ??

21:48 lazybot: sherry: What are you, crazy? Of course not!

21:48 clojurebot: BOT FIGHT!!!!!111

21:49 sherry: hullo? quick clojure q

21:49 kenrestivo: /ignore

21:49 sherry: how come people who use clojure a such pussies compared to python programmers?

21:51 rpaulo_: doh

21:52 sherry: hullo

21:53 justin_smith: kenrestivo: what about stuart sierra's component library?

21:53 kenrestivo: all of these use it, AFAICT. they're built around it

21:54 justin_smith: ahh, OK, I did not realize

21:54 kenrestivo: maybe i should write my own. then there will be 5

Logging service provided by n01se.net