#clojure log - Mar 30 2015

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

0:04 cfleming: justin_smith: I have some interesting things to show about debugging and laziness at my Clojure/West talk too

0:04 justin_smith: cfleming: awesome, I'll be there with bells on

0:04 cfleming: WAT?!?! Where's my local context?

0:04 Sorry, doesn't exist any more

0:04 justin_smith: heh

0:07 cfleming: It really kills the expression evaluation buxx

0:07 s/buxx/buzz/

0:15 amalloy: cfleming: wasn't a compiler flag added to disable locals clearing?

0:15 not that this necessarily solves it; there's a reason locals clearing exists

0:15 cfleming: amalloy: Yeah, Cursive automatically turns that on when debugging

0:16 rhg135: cfleming: fond a minor bug, it tries to load clj files in the cljs repl

0:17 cfleming: this is different though - when you evaluate an expression while debugging, you can use local vars which aren't actually captured in your closure. Cursive walks the stack and finds them in deeper stack frames

0:17 So they're variables that would be captured as closed over locals if you compiled your code referring to them

0:18 But if your local context is being evaluated in a lazy manner, that local context no longer exists, so you can't refer to locals you'd like to be able to - it's really counterintuitive if you don't know what's going on.

0:18 rhg135: Is the flag in your REPL set to CLJS?

0:19 rhg135: The combobox in your REPL toolwindow toolbar

0:20 rhg135: yeah it is

0:20 cfleming: Actually, sorry, I didn't read that closely enough. It has to, right? For macros.

0:23 rhg135: oh right, does it not differentiate between clojure source roots and cljs?

0:23 cfleming: No

0:24 elvis4526: How do I add custom .jar to a lein project ?

0:24 rhg135: ah that explains it

0:24 cfleming: There's a fix I have to make there in that it's not as aware of scopes as it should be

0:25 It's a tricky problem actually, and I'm not 100% sure of how it should work

0:26 Suggestions welcome if it's not behaving how you'd expect :)

0:26 rhg135: elvis4526: a really ugly way is to add it to your reasources path. but if you do that you may get lynched

0:28 (inc cfleming) ; this new repl works great btw

0:28 lazybot: ⇒ 13

0:28 rhg135: loads really fast too

0:28 cfleming: Nice, glad it's working well!

0:28 Yeah, it doesn't have to do the nREPL port pingback dance

0:30 I should be able to get better CLJS completion in it too once I get some time

0:47 justin_smith: between the convo here this evening, and the twitter thread from @meatcomputer, I am going to undertake "the clojure troubleshooting guide" - basically a mapping to weird clojure errors / behaviors / messages / StackTraces etc. to their most common causes and best fixes

0:47 I've been meaning to do something with noisesmith.org

0:53 the idea: make the best guide I can to clojure error (states/messages), and then turn the worst messages into PRs on clojure.core for better messages

0:53 ,(conj {} '[([a] b)])

0:53 clojurebot: #error{:cause "Vector arg to map conj must be a pair", :via [{:type java.lang.IllegalArgumentException, :message "Vector arg to map conj must be a pair", :at [clojure.lang.APersistentMap cons "APersistentMap.java" 35]}], :trace [[clojure.lang.APersistentMap cons "APersistentMap.java" 35] [clojure.lang.RT conj "RT.java" 610] [clojure.core$conj__4067 invoke "core.clj" 85] [sandbox$eval25 invoke "NO_...

0:54 justin_smith: ^one of the offenders

0:55 TEttinger: (inc justin_smith)

0:55 lazybot: ⇒ 225

0:55 justin_smith: the support is appreciated :)

1:04 cfleming: (+ 20 justin_smith)

1:05 Damn

1:05 justin_smith: heh, thanks

1:05 cfleming: (inc justin_smith)

1:05 lazybot: ⇒ 226

1:05 pmonks: (+ justin_smith 20) ; ??

1:05 lazybot: pmonks: Uh, no. Why would you even ask?

1:05 cfleming: I will turn each and every one into an inspection in Cursive

1:05 Well, all the ones that I can determine statically, anyway

1:06 Actually, suggestions in the IDE based on stacktraces would be really nice

1:07 It'll be like clippy all over again: "It looks like you're putting your namespace docstring after a require clause - would you like help with that?"

1:07 amalloy: cfleming: "i noticed you got a stack overflow. maybe stop writing such recursive functions, huh?"

1:07 justin_smith: cfleming: I am thinking an organized layout of the most common messages/behaviors to their most frequent causes could lead to some decent automated heuristics, yeah

1:07 (inc amalloy)

1:07 lazybot: ⇒ 244

1:08 cfleming: You laugh, but more than once I've wished it would highlight the loop in the stacktrace

1:08 justin_smith: cfleming: clippy was derived from microsoft bob, which was implemented in lisp :)

1:08 amalloy: "OutOfMemoryError? Go easy on the Swing, man."

1:08 justin_smith: cfleming: amalloy: we just need a good animated mascott

1:08 cfleming: justin_smith: I shall call him Bob2016

1:08 justin_smith: maybe a rich hickey animation with algorithmically emphatic hair?

1:08 cfleming: justin_smith: a bug of some kind, I guess

1:09 I like it

1:09 A disembodied wig telling you to fix your code

1:16 elvis4526: rhg135: okay ty

1:16 how do you put multiple methods for multiple protocols inside a record ?

1:17 justin_smith: elvis4526: you precede each group of methods by the protocol name

1:17 $grim clojure.core/defrecord

1:17 lazybot: http://grimoire.arrdem.com/1.6.0/clojure.core/defrecord

1:18 elvis4526: ty

1:18 justin_smith: oh, wow, defrecord needs examples of implementing multiple protocols...

1:18 I figured they would be there

1:19 * justin_smith sets that aside as a PR to make soon.

1:30 arrdem: (inc justin_smith_

1:30 rhg135: elvis4526: seriously, don't do that. I was joking. the usual approach is to install that jar to a maven repo

1:30 arrdem: (inc justin_smith)

1:30 lazybot: ⇒ 227

1:32 arrdem: justin_smith: I'd be happy to help throw you articles and link from Grim.

1:32 justin_smith: arrdem: awesome

1:32 I'll definitely be accepting PRs once I have the shell of this up and running

1:33 arrdem: cool.

1:33 I was gonna try and get edit links working this weekend, got stuck doing school work so sorry that didn't happen.

1:33 on the short list for this week.

1:34 justin_smith: if you have that broken down into reasonable sized tasks, I may be able to help, I've done my share of ring stuff

1:34 arrdem: it's just a plumbing problem. I have all the bits built already question is how to wire them together.

1:35 justin_smith: OK

1:35 arrdem: thanks for the offer tho.

1:36 justin_smith: if you do feel like mucking with hiccup, you could take a whack at refactoring the cheatsheeto to use that for HTML generation.

1:36 right now it does old school printf based html generation.

1:37 justin_smith: haha, wow

1:37 I may take a look

1:37 arrdem: I have a branch for that underway... arrdem/clojure-cheatsheet branch bluesky iirc

1:37 probably just gonna throw away all the LaTeX target stuff and make the html stack reasonable.

1:43 justin_smith: I wonder how many people used the latex?

1:46 TEttinger: I'm allergic to latex, I need doctors to use alternate typesetting methods for their gloves

1:47 why is LaTeX capitalized like it was invented by a juggalo?

1:57 opqdonut: TEttinger: because TeX is the ascii spelling of the tex logo (see http://en.wikipedia.org/wiki/TeX)

1:58 and so latex invented their own fancy logo, which is ascii'd as LaTeX

1:58 (see http://en.wikipedia.org/wiki/LaTeX)

2:03 sm0ke: Hello, i have noticed that when you have a common user defined tagged literal in clojure/script the browser repl doesnt take it very well and fails with format exception

2:03 anyone else faced this?

2:05 e.g. a tagged literal for integer lets say

2:08 arrdem: justin_smith: if/when you have a list of articles you'd like to write shoot me a list. I'll be going back through my list of "topic" articles in Grimoire's notes and see if I can get that to you tomorrow.

2:09 elvis4526: why I can't assign a set with def ?

2:09 sm0ke: ,(def a #{})

2:09 amalloy: elvis4526: what makes you think you can't do that?

2:09 clojurebot: #'sandbox/a

2:09 elvis4526: Don't know how to create ISeq from: clojure.lang.Symbol

2:10 sm0ke: im doing exactly this

2:11 uh its working in the repl

2:11 but not when I eval my file with cider

2:11 sm0ke: what is the error?

2:11 elvis4526: Don't know how to create ISeq from: clojure.lang.Symbol

2:12 sm0ke: is there a unwanted `'`

2:12 amalloy: elvis4526: that's an error message that means you have too many ()s somewhere in your file

2:12 sm0ke: ,(concat [1 2 3]

2:12 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

2:12 sm0ke: ,(concat [1 2 3] 'a)

2:12 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>

2:12 amalloy: with just the error message nobody can tell you where; with a full stacktrace, pasted to refheap.com or something, we could give some guidance

2:15 sm0ke: i heard cider got a debugger?

2:15 justin_smith: indeed, inspired by edebug

2:15 stepping debugger that shows return values in the minubuffer

2:15 sm0ke: i guess fireplace will also pick it soon

2:16 justin_smith: allows to put breakpoints?

2:16 the usual stuff?

2:16 justin_smith: it was a very emacs-specific implementation, I don't know if vim has similar infrastructure to hook into

2:16 sm0ke: step into out et

2:16 well vim has mini buffers

2:16 justin_smith: sm0ke: not sure of all the details, I know it at least does breakpoint and step

2:17 sm0ke: interesting!

2:17 justin_smith: sm0ke: yeah, but emacs has a whole "debug mode" with tooling for moving the cursor to follow the debugger etc. all the UI code already written

2:17 sm0ke: step by step debugger for sexps?!

2:17 justin_smith: sm0ke: yeah, it's just like the built in emacs debugger from what I have seen

2:17 sm0ke: may be you are right, only vim experts can tell if its possible

2:18 justin_smith: you press the space bar, it moves to the next form, and shows the return value

2:18 sm0ke: nice

2:19 justin_smith: so if you had (+ (* 10 10) 42) it would show you 10, then 10, then 100, then 142 as the final value before exiting that scope

2:19 which is actually handier than the typical line vs. instruction debugging

2:19 sm0ke: yep

2:20 but how do you set breakpoint inside a form?

2:20 e.g. only in (* 10 10)

2:20 justin_smith: sm0ke: clicking in the trough next to it creates a "stop sign" in the gui emacs

2:20 oh, the breaks are per line I think...

2:20 sm0ke: hurmm

2:20 justin_smith: but not too hard to skip a few forms in

2:21 sm0ke: weird, as there is no cocept of lines in lisp

2:21 justin_smith: because a breakpoint on a line will go to the first/innermost form on that line

2:21 sm0ke: this is how it is with elisp, the details may be somewhat different with cider I guess?

2:22 rhg135: time to learn emacs

2:22 sm0ke: :P

2:29 arrdem: Anyone aware of a prior discussion of the fact that we don't have def- but have defn-?

2:30 justin_smith: arrdem: the set of values that are safe to create at namespace load but unsafe to use from outside the namespace are going to be pretty small, no?

2:30 of course the - can also mean "don't count on this being here in the next release", which that does not address

2:31 arrdem: we have ^:deprecated, defn- is just (defn #^{:private true} ...)

2:32 reaching for it in this case because I have macro generated defs that I don't want to be part of the documented API for a ns.

2:32 justin_smith: ahh

2:32 arrdem: although I suppose lein-grim supports ^:skip-wiki so I don't have to...

2:49 cfleming: arrdem: I dimly remember ancient flamewars about that, but it was before I actually used Clojure much so I didn't understand the details

2:50 arrdem: cfleming: I figure this was debated at some point but a cursory search of clj-dev and jira shows nothing

2:51 cfleming: arrdem: Yeah, can't remember the details sorry - it would have been the mailing list I think

2:51 arrdem: I didn't read JIRA back then

2:52 amalloy: arrdem: defn- was added at a time when adding other metadata (eg ^:private) was harder to do by hand, and private functions were needed more than private other vars

2:52 it's not added now because ^:private is one of only about a zillion things you could want a shorthand for, and there's an exponential explosion if you want to add them all

2:53 eg, what if we wanted def* for ^:dynamic? do we need defn*? defn*-?

2:58 justin_smith: defmuffs

2:59 def-private-muffs

3:20 raspasov_: so if I package a uberjar on JDK 8, I can't run it on JDK 6 or 7, correct?

3:21 justin_smith: no, clojure targets 1.6

3:21 raspasov_: I know about Clojure

3:21 TEttinger: if you have java code used by your clojure, then you might need to set source compatibility levels in lein somehow

3:21 justin_smith: uberjars are just zip files

3:21 raspasov_: so I'm looking to distribute an uberjar, I have the latest, latest version of Java 8

3:22 I run "lein uberjar"

3:22 justin_smith: that puts your clojure files in a zip file

3:22 raspasov_: and when I tried to java -jar etc on JDK 7, it doesn't work

3:22 justin_smith: that is a bug

3:22 that should not happen

3:22 raspasov_: really? are you sure?

3:22 TEttinger: is your project pure clojure, or is there some java code in it?

3:22 justin_smith: absolutely

3:22 raspasov_: there's one Java file

3:22 or actually, three

3:23 so yes there's some :)

3:23 TEttinger: let me check this, I think it's an option in lein

3:23 justin_smith: oh, you may have to set your java target version then, or whatever they call it

3:23 raspasov_: justin_smith: yea, that would be solution to my problem... I was thinking of downgrading java somehow or some other nastiness like that

3:24 TEttinger: add this to lein's project.clj... :javac-options ["-target" "1.6" "-source" "1.6"]

3:24 raspasov_: TEttinger: thanks! I'll try that

3:24 (inc TEttinger)

3:24 lazybot: ⇒ 45

3:24 TEttinger: good luck!

3:24 raspasov_: (inc justin_smith)

3:24 lazybot: ⇒ 228

3:25 raspasov_: TEttinger: that's not as critical, just wondering if you know, do you get better performance by compiling strictly with -target 1.8 for example?

3:26 TEttinger: I think users get better performance by running on java 8 than java 6, but the source compat doesn't matter

3:27 raspasov_: TEttinger: yea that makes sense, thanks again!

3:27 TEttinger: it does if your java code uses java 7 or 8 features, like lambdas from 8 or the diamond thing syntax from 7

3:28 or switch on strings from 7

3:28 raspasov_: TEttinger: yea, no, I don't think I'm into Java fanciness at the moment :)

3:28 TEttinger: which is one of those, "it took you 7 versions to consider this?"

4:56 zot: is there a known limitation using deftype vs. extend-type, wrt "outside" interfaces? in this code, https://gist.github.com/benfleis/ad3324a65e6ed8091546 the latter works, but the former fails, and i don't have a clue why.

4:56 of course, i'm probably just doing it wrong.

4:59 patrkris: zot: are the number of parameters right in both cases?

4:59 shouldn't you take a "this" parameter in the first case also?

4:59 zot: ah, yes, that's true, although fixing that doesn't fix the problem

5:00 patrkris: zot: what kind of failure are you getting?

5:00 zot: interface clojure.lang.ILookup is not a protocol

5:00 so i am reading now to understand if deftype supports interfaces, where extend-type doesn't …

5:00 amalloy: you have to implement interfaces up-front at type definition time

5:01 zot: well, at least that's simple to know.

5:01 Empperi: this is annoying, where can I set indentation rules for clojurescript in Cursive?

5:02 it persists to ident everything with one space

5:02 can't find any settings for this, only for clojure

5:02 cfleming: Empperi: It uses the same settings

5:02 Empperi: What's the indentation issue you're having?

5:08 arossouw: how does one calculate nlogn , with the big O notation?

5:09 Empperi: cfleming: everything is indented by 1 space

5:09 I have set it to 2

5:10 idea 14.1, latest cursive

5:11 cfleming: Empperi: In the General code style settings, do you have "One space list indent" checked?

5:12 Empperi: let's see

5:12 definetly have not set that myself it is

5:14 cfleming: That's an Emacs compatibility setting

5:14 Empperi: couldn't find that setting with find or by browsing through it

5:14 where is it exactly?

5:15 ah there, found it

5:15 no, it's not on

5:15 cfleming: Settings->Editor->Code style->Clojure->General

5:15 You're right, it doesn't come up when you search, I'll fix that.

5:15 Can you send a screenshot?

5:16 Empperi: of indentation settings?

5:16 cfleming: No, of the problem

5:16 Empperi: there is very little to give a screenshot... Everything is indented by one space

5:16 so instead of " " as indentation I get " "

5:16 I can of course press space to get that additional space but it gets annoying really fast

5:17 and breaks code formatting

5:17 cfleming: Man, you get all the weird problems

5:17 :)

5:17 Empperi: :)

5:17 cfleming: One sec

5:17 Empperi: happy to be your tester lol

5:18 arossouw: any thoughts on Hoplon?

5:18 cfleming: Has this suddenly started happening?

5:19 Empperi: cfleming: yeah, updated to idea 14.1 and of course cursive with it to get it working

5:19 after that I've got this behavior

5:20 cfleming: Anything suspicious looking in your log? Any errors popping up?

5:20 Empperi: none

5:20 only error in the log is from this morning about an incompatible plugin which it updated and has nothing to do with cursive

5:21 cfleming: Ok

5:21 Empperi: and with clojure code it indents just fine

5:21 the problem is there only with clojurescript

5:21 cfleming: That's totally bizarre

5:21 The formatting code isn't even aware it's formatting cljs

5:22 Empperi: maybe I'll try to restart Idea

5:22 cfleming: It's identical

5:22 Empperi: one sec

5:22 cfleming: Hang on

5:22 Try File->Invalidate Caches and restart while you're at it

5:22 Clutching at straws here, but you never know

5:23 Empperi: pure restart didn't help, I'll try invaliding caches

5:23 arrdem: cfleming: having fun yet?

5:23 cfleming: arrdem: Empperi's computer is haunted

5:24 Empperi: nope, still indents with one space

5:24 cfleming: He gets the all the schrödinger bugs

5:24 Empperi: there must be something strange with this project

5:24 I'll create a totally empty one and see if changes anything

5:25 cfleming: If you create a new project with lein new mies test-project, and reformat the main... right

5:25 I'm starting to wonder is Empperi is secretly bbatsov messing with me.

5:26 arrdem: pretty sure bbatsov is asleep rn

5:27 cfleming: As should you be, right?

5:27 Empperi: cfleming: heh, created a fresh project from idea itself, wrote (defproject foo "1.0.0") into my project.clj and created wat.cljs into src

5:27 arrdem: who are you, my mother?

5:27 Empperi: right now it idents defn -macro like it doesn't recognize it

5:28 meaning it aligns the indentation with the function name

5:28 cfleming: Sorry, spent too much time around Cursive, I get used to scolding people

5:28 Empperi: that's probably because you don't have cljs added as a dep

5:28 Empperi: true

5:28 I'll add that and see if it changes

5:30 cfleming: Empperi: You'll need your src dir marked as a source root too (folder in blue)

5:31 Although Cursive should now warn you if you don't

5:32 Empperi: cfleming: yeah, it's done

5:32 right now this project is borked somehow which I just created

5:32 It can't load project.clj although lein repl from command line runs just fine

5:32 cfleming: How do you mean it can't load it?

5:33 Empperi: throws exception into log

5:33 cfleming: Can you refheap that?

5:33 Try with lein new mies <project>

5:33 And import

5:33 Empperi: k

5:36 cfleming: that works, but an interesting finding is that if I create a new cljs file it gives me " (ns blergh)"

5:36 note the extra space before (ns

5:37 after that created (defn foo [] <enter here>

5:37 cfleming: Hmm, interesting, I'll fix that. I think it comes from a template, there might be something optional there that's removed but leaves a space.

5:37 Empperi: ended up with " )" on next line, meaning only one space as indentation

5:37 but!

5:37 there is core.cljs generated from the mies template

5:38 there indentation works as expected? o_O

5:38 cfleming: Seriously, are you screwing with me?

5:38 Empperi: no :D

5:38 cfleming: :)

5:38 If you reformat the mies file, that looks ok?

5:38 Empperi: this just has to have something to do with file location

5:39 reformatting mies file ends up with identical look as before

5:39 moved the blergh.cljs to same namespace as the mies file now reformatting it also gives the expected output

5:39 cfleming: So you're creating a cljs file right inside the source root, with a single segment ns?

5:39 Empperi: yeah

5:39 cfleming: One sec

5:39 Empperi: but that is not the case with my real project of course

5:40 in my real project we have src/clj and src/cljs

5:40 and both are source roots, not src

5:40 cfleming: You're right, I can reproduce that

5:40 Wow

5:40 Empperi: how about src/clj and src/cljs scenario?

5:40 that is the more likely one

5:41 cfleming: Happens for Clojure too

5:41 Empperi: well at least that makes sense

5:41 cfleming: It just has to be in the source root

5:41 Interestingly, if you reformat it corrects it

5:42 Empperi: anyway that src/clj src/cljs is the only thing I can think of which could affect this after the finding that source root breaks indentation

5:43 cfleming: In fact, it seems to work correctly in all cases, except that first top-level defn

5:43 If you put an if inside it, like (if :a<caret>) and press enter it does the right thing

5:43 Empperi: do you get the extra space before (ns foo) ?

5:43 cfleming: Yeah

5:43 Empperi: that's wierd too

5:43 cfleming: But that doesn't seem to affect this

5:44 Here's the actual problem, I think

5:45 That only happens when it's the last form in the file

5:45 In fact

5:45 It happened briefly in those two files, and now doesn't any more

5:46 Empperi: Do you see this consistently? I can only reproduce it briefly in new files

5:49 Actually, it looks like I can only reproduce this until I reformat the file, after that it works. I'm going to create a WAT?!?! tag in Github and put it on this puppy

5:49 arrdem: lols

5:50 cfleming: I'm wondering if the new-file template puts some weird whitespace in there or something, and the reformat fixes it.

5:50 Empperi: cfleming: sorry, had a phone call

5:50 cfleming: Anyway, I can debug it now - thanks for the report.

5:50 Empperi: No worries.

5:50 Empperi: but yeah, it's consistent on our project

5:51 cfleming: If you reformat the file, does it continue to happen after that?

5:51 Empperi: also code/reformat code ends up indenting everything with one space

5:51 cfleming: Oh

5:51 I don't see that.

5:52 Empperi: that doesn't happen in my dummy project I just created

5:52 wait no

5:52 cfleming: Ok, I'll take a look at this, since I can reproduce it I can hopefully figure out what's going on

5:52 Empperi: it happens there too

5:52 in source root file that is

5:52 cfleming: The reformat adding one space?

5:53 Empperi: but in non-root it works as expected

5:53 in the dummy project

5:53 in real project it works like it works in the source root in the dummy project

5:53 cfleming: Weird, I don't see that, and in fact after reformatting the indent works as well

5:53 In your real project you see this everywhere, not just in source roots?

5:53 Empperi: I have a hunch that after you fix the bug you see it'll fix the bug I see too

5:53 yeah, everywhere

5:53 cfleming: Yeah, I suspect so

5:53 You're on Windows, right?

5:54 Empperi: oh damn, I think I might have an idea what might be causing it

5:54 one sec

5:55 arrdem: oh good we're having another editor fight in clojure@googlegroups

5:55 cfleming: We are? And I missed it?

5:56 arrdem: bbatsov started a party and you weren't invited lol

5:56 * arrdem 5am tired

5:56 Empperi: bah, didn't work

5:56 cfleming: Ah, I saw that one start, but I hadn't seen it degenerate into a knife fight

5:56 Empperi: but there's definetly now something funky with the project

5:56 :source-paths ["src/clj" "src/js"]

5:56 where it should have been :source-paths ["src/clj" "src/cljs"]

5:57 did that change and was hopeful it would have fixed the problem but no

5:57 source root had been set manually from idea it seems

5:57 and that might break things up now

5:58 Glenjamin: oh wow, 10-point point-by-point rebuttals

5:58 arrdem: really who has time for this shit

5:59 cfleming: Empperi: That's weird, because Cursive would reset the source paths on every sync - src/cljs must be set somewhere in your project.clj

5:59 Glenjamin: i don't have time to configure emacs, let alone tell people how great it is :D

5:59 arrdem: Glenjamin: get me to tar my self-deploying emacs config up for you sometime

5:59 Empperi: cfleming: well it is now set

6:00 Glenjamin: that was a joke, i mostly don't have time for the learning curve, despite wanting to

6:00 i can't bring myself to take the short-term hit

6:00 arrdem: fair. making the transition from vim cost me a Christmas break

6:01 but was totally worth it in terms of tooling qualtiy

6:01 Empperi: cfleming: just found out that only 4 out of 8 modules in our project has "clojure" under their module settings

6:01 the wierd project is one of the missing ones

6:02 cfleming: Empperi: You mean the facet? That actually doesn't do anything any more, but I was warned by JetBrains that they're tricky to remove, for some reason which I don't really understand.

6:02 Empperi: meaning the clojure facet

6:02 yeah

6:02 cfleming: arrdem: I thought you were Emacs 4 Lyfe?

6:02 arrdem: cfleming: I'm a convert as of about a year ago

6:02 cfleming: I still vim on a daily basis

6:02 Empperi: but it does something at least since the module settings are different for projects with the facet

6:03 there is no language level selection or sources/paths/dependencies tabs on modules without the facet

6:03 cfleming: Empperi: Hmm, really? I'll check that, and I'll go back and see if I can actually remove it.

6:03 Empperi: and most importantly can't mark folders, I can only exclude them

6:03 cfleming: Ok, your project has something seriously funky

6:03 None of that is controlled by the facet

6:03 Empperi: might have something to do with Idea 14 -> 14.1 upgrade

6:04 cfleming: Can you send me a screenshot of your module config page for one of the funky modules?

6:05 Empperi: sure

6:05 cfleming: i.e. one without the source/paths/deps etc?

6:05 arrdem: ug I'm out of music. time to take a nap before class.

6:05 g'night yall

6:05 Empperi: sent

6:08 cfleming: Empperi: So I have no idea what's going on, but that module is borked

6:08 Empperi: That's some sort of IntelliJ level problem though

6:09 Empperi: cfleming: guessed that myself too after I found that problem

6:09 gonna fix it and tell you if it affects the indentation problem

6:09 cfleming: Ok, there's definitely something going on with the indentation since I see it too, but much less than you.

6:09 I'll try to reproduce that in v14.

6:09 I'll send you a mail if/when I find something.

6:10 Empperi: cfleming: working module .iml has <module type="JAVA_MODULE" version="4">

6:10 broken module .iml has <module type="WEB_MODULE" version="4">

6:10 quite a difference

6:10 cfleming: That would explain it.

6:10 Empperi: I have zero idea where the hell it has decided to use WEB_MODULE

6:11 fucker

6:11 lol

6:11 cfleming: Yeah, that's pretty bad all right.

6:11 Empperi: guess I'll fix all those .imls by hand in sublime and restart idea

6:11 arrdem: (inc $OTHER_EDITOR)

6:11 lazybot: ⇒ 1

6:11 cfleming: Give that a go and see if it helps

6:12 arrdem: Sorry, I only respond to editor snipes with at least 1000 words and 10 bullet points.

6:12 arrdem: picky motherfucker aren't you

6:12 cfleming: Hey, I'm a busy guy.

6:13 arrdem: > 10000 words

6:13 > busy guy

6:13 right

6:13 cfleming: Which 10000 words?

6:14 TEttinger: &(reduce str "" (repeat 10000 "waaaah "))

6:14 lazybot: ⇒ "waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah ... https://www.refheap.com/99053

6:14 bhajana: hrhr

6:14 cfleming: Sorry, it needs 10 bullet points too.

6:14 Empperi: well that fixed module settings window but indentation... sigh

6:15 cfleming: new cljs file in my project now indents correctly

6:15 cfleming: Empperi: sorry dude. You could try a fresh checkout of your project, and re-import the whole thing into a new intelliJ project, and see if that helps.

6:16 Empperi: wierd, new file works as expected but existing files still are affected by this strange bug

6:16 cfleming: Empperi: You're on Windows, right? I'm wondering if it's a whitespace issue or line endings or something

6:16 TEttinger: &(reduce str "" (for [i (range 1 11)] (concat ["Point Number " i " "] (repeat 999 "waaaah "))))

6:16 lazybot: ⇒ "clojure.lang.LazySeq@c9f20eeaclojure.lang.LazySeq@b06241ebclojure.lang.LazySeq@96d274ecclojure.lang.LazySeq@7d42a7edclojure.lang.LazySeq@63b2daeeclojure.lang.LazySeq@4a230defclojure.lang.LazySeq@309340f0clojure.lang.LazySeq@170373f1clojure.lang.LazySeq@fd73a6f2clojure.lang.LazySeq@e3e3d9f3"

6:16 Empperi: yeah on windows

6:16 TEttinger: gah

6:17 Empperi: I'll check line endings and encodings for those files and the new file

6:17 cfleming: Empperi: Encoding, maybe. That might explain why I see it until I reformat the file - a new file from that template might be funky in some way.

6:17 arrdem: > 2015, still trying to get line encoding right

6:17 TEttinger: &(reduce str "" (reduce str "" (for [i (range 1 11)] (concat ["Point Number " i " "] (repeat 999 "waaaah ")))))

6:17 lazybot: ⇒ "clojure.lang.LazySeq@c9f20eeaclojure.lang.LazySeq@b06241ebclojure.lang.LazySeq@96d274ecclojure.lang.LazySeq@7d42a7edclojure.lang.LazySeq@63b2daeeclojure.lang.LazySeq@4a230defclojure.lang.LazySeq@309340f0clojure.lang.LazySeq@170373f1clojure.lang.LazySeq@fd73a6f2clojure.lang.LazySeq@e3e3d9f3"

6:17 Empperi: cfleming: LF and UTF-8 in both

6:17 cfleming: arrdem: hey, I'm clutching at straws again here.

6:18 Empperi: cfleming: \o/

6:18 TEttinger: &(reduce str "" (reduce str "" (for [i (range 1 11)] (reduce str "" (concat ["Point Number " i ": "] (repeat 999 "waaaah "))))))

6:18 lazybot: ⇒ "Point Number 1: waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaah waaaa... https://www.refheap.com/99055

6:18 Empperi: broken file: select all -> cut -> paste -> reformat code

6:18 indentation with 2 spaces! \o/

6:18 cfleming: this is me right now http://www.ludumdare.com/compo/wp-content/uploads/2013/04/i-have-no-idea-what-im-doing-dog.jpg

6:19 cfleming: arrdem: Besides, weren't you going to bed?

6:19 Empperi: but it fixed it :D

6:19 cfleming: My working theory is something weird with the whitespace.

6:19 Empperi: yeah

6:19 but thanks man, you were a big help

6:19 now I gotta grab some lunch before I starve

6:19 arrdem: status> https://www.youtube.com/watch?v=HmZYgqBp1gI

6:19 cfleming: Time to break out the hex editor on a before/after of that file from the template.

6:19 arrdem: actually bed now

6:20 cfleming: Empperi: No worries, I'll let you know if I find anything more.

6:20 Empperi: thanks

6:21 cfleming: TEttinger: Nice. My response: waaaaah

6:21 TEttinger: hahaha

6:22 night, I'm at least glad you're providing a first-class clojure dev environment, even though I use an extremely dumb text editor

6:23 cfleming: TEttinger: Thanks! There's plenty of room for all :-)

6:23 TEttinger: Besides, what would we complain about online if we all used the same editor?

6:23 TEttinger: ha

6:26 Seylerius: cfleming: What's this about a first-class clojure environment?

6:26 cfleming: Seylerius: https://cursiveclojure.com

6:27 mavbozo: cfleming: we should complain about how clojure culture is so homogenous and bad for its viability

6:27 cfleming: mavbozo: Ha, right

6:28 dysfun: ambrosebs: what's the correct way to use core.typed without forcing that dep on the user of your library?

6:28 Seylerius: cfleming: Neat.

6:28 dysfun: ambrosebs: that is to say i'd like to provide type signatures for it, but perhaps in another module. is that possible?

6:29 Seylerius: Now I'm stuck contemplating how to do all that Shiny in Emacs...

6:29 * Seylerius ponders...

6:29 cfleming: Seylerius: It's still under development, but it basically works well now. I'd say it's as stable as anything else right now.

6:29 Seylerius: Shiny indeed.

6:29 shiranaihito: mavbozo: it's certainly homogenous with regard to Leiningen.. :p

6:29 cfleming: shiranaihito: I have hopes for boot though, and things like shadow-build

6:30 TEttinger: shiranaihito, considering the alternatives are ant and mvn, I'm pretty happy with lein

6:30 dysfun: boot looks nice, but is it a viable replacement for lein yet?

6:30 i really do quite like lein

6:30 shiranaihito: cfleming: i hope it does help somehow

6:31 cfleming: Seylerius: I spoke at the conj about the the shininess if you're interested: https://www.youtube.com/watch?v=vt1y2FbWQMg

6:31 shiranaihito: TEttinger: the *Real* alternative would be to ruthlessly evict all pointless commons-whatever.jar -droppings from Java/Clojure projects

6:31 cfleming: dysfun: I think so, although I haven't used it for anything real yet

6:31 dysfun: It really wins when composing similar things, like all the tasks you want to do based on a file watcher

6:32 dysfun: that's very painful with lein

6:32 dysfun: yeah, i'm just not sure when i'd find that useful :)

6:32 cfleming: dysfun: I guess you don't do cljs :)

6:32 dysfun: no, i don't :)

6:32 om was very nice, but frankly i hate javascript and i hated cljs compile times

6:33 cfleming: Someone wrote to the Cursive ML a while back saying that he always has 6 terminals open, all running some sort of watcher - with boot, he'd only need one

6:33 dysfun: will boot run SASS and all that stuff as well then?

6:34 cfleming: I don't know if boot will ever win for simple projects, but for big complex ones I think it could really shine

6:34 I don't know

6:34 dysfun: see i'm getting to the point where i'm growing to hate big complex projects

6:34 i checked out a rails app last year and then had to follow umpty instructions to fail to get it running because the toolchain setup was broken

6:35 "oh great, grunt"

6:35 cfleming: Yeah, me too. Unfortunately my project is going that way whether I like it or not.

6:35 Boot is the only thing I'd consider migrating to at the moment.

6:37 dysfun: i generally consider leiningen to be the gold standard here. it's perfectly adequate for everything i've needed so far

6:38 arrdem: eh lein has had its fair share of problems...

6:38 including the ongoing nrepl version mess

6:39 cfleming: And don't try to embed it or you'll be sorry.

6:39 (to be fair, they're working on fixing that but it's currently very painful).

6:40 I agree that as a user it's mostly really great.

6:40 But hey, I still build with Ant, so take that for whatever it's worth.

6:40 Glenjamin: part of lein's problem is because it's so user friendly, it's not always obvious what is a clojure feature and what is lein

6:41 when i used me own nrepl server, i was surprised which bits weren't there

6:44 arrdem: thoughts on https://github.com/clojure-grimoire/grimoire/issues/174 ? I'm tempted to throw up my hands on docstring formatting as a lost cause mod "formatting language" metadata being added in the future.

6:44 shiranaihito: TEttinger: so yeah.. lein is basically mvn on steroids, but its main use is the same as maven's: to download vast amounts of jars that actually shouldn't be dependencies to begin with.. no one uses ant because you need mvn to handle all those pointless deps anyway

6:44 arrdem: someone doesn't seem to understand the concept of a reach set...

6:45 mavbozo: arrdem: i thought you were sleeping already :)

6:45 TEttinger: I don't know what a reach set is

6:45 arrdem: yeah yeah I'm gone for real now

6:46 shiranaihito: TEttinger: me neither :p

7:02 the-kenny: What are you people using for (SQL) schema migrations?

7:03 I'm searching for something lightweight, not some heavy SQL DSL

7:04 jesse___: the-kenny: I'm using Ragtime, simple and works well

7:05 shiranaihito: the-kenny: i have some experience with https://en.wikipedia.org/wiki/LiquiBase .. at least it does its job :)

7:15 bja: this might be too generic java of a question, but if I want my uberjar on the class path before anything else can I simply reference my uberjar's location while executing a class out of it so as to avoid mucking around ClassLoader?

7:17 TEttinger: I'm curious what an uberjar would involve if it needs to do something with classpath other than be run with no VM arguments

7:18 normally `java -jar uber.jar` is enough

7:18 bja: this is a "storm is being inconvenient" question

7:19 I need some .clj files in my uberjar on the class path so I can handle storm packaging cli-time for use in its UI and using that same class path for my worker code

7:19 so it'll actually be java -cp storm-jar-dir -jar uber.jar

7:20 so I was considering java -cp my-uberjar-dir:storm-jar-dir -jar uber.jar

7:21 TEttinger: can you uh put them in your project?

7:22 is that a license problem?

7:24 bja: no. the issue is that the classpath that storm sets for my worker code includes an (ancient) copy of clj-time (that is unused by the worker normally, this is a known issue with storm). because storm would normally set its jars on the classpath before mine, whenever I '(require [clj-time.core]) I get the old version instead of the version inside my uberjar

7:25 so it seems like if I just add my uberjar to the classpath ahead of the storm libraries, I might end up being able to get the cli-time that I need

7:28 TEttinger: what I would do in this situation is 1) squawk angrily like a velociraptor, 2) fork storm, 3) remove any references to ancient clj-time, 4) upload the new jar as an unofficial version to clojars, and 5) use that.

7:34 bja: I still want storm-ui, but in the past, I simply had a version of storm to run the UI (which uses clj-time) and a version of storm to do actual work and maintained them both. I guess I can keep on doing that.

7:35 I wish storm-ui wasn't a part of storm-core

8:13 ee_cc: hoi, daft question but I’ve been looking for an naswer for a while

8:14 writing a persistence unit in clojure and am using destructuring on the f argument (it’s a map), but would like to assign a default value on 1 key if not present

8:16 something like (defn create-new [{:keys [username password role :or :user] :as args}] … do stuff) can I do this or do I need to handle the value in the body of the f??

8:16 lazybot: ee_cc: Uh, no. Why would you even ask?

8:18 mavbozo: ee_cc: you can choose between both

8:18 nicferrier: hey folks. I'm missing somethijg basic here.

8:19 I've got a repl running from within my program, using an uberjar.

8:19 but I can't change to the namespace of my program.

8:19 well, I can. but then anything in the namespace appears not to be there.

8:20 my namespace is keg-monitor/core - so I go java -jar myuberjaar.jar -r and it all works (coz I've got clojure.main/repl in my main)

8:20 but then when I go (ns keg-monitor/core) I can't see anything

8:22 oddcully: ee_cc: like this? (let [{:keys [:user :password :role] :or {:role :anon}} {:user :john :password :doe}] role)

8:23 ee_cc: I’ll try, was wondering if the :or also worked with user password being present

8:23 2 sec

8:24 mavbozo: nicferrier: the keg-monitor needs to be loaded first

8:24 nicferrier: mavbozo: even though I'm running the uberjar?

8:24 ok.

8:24 ee_cc: sweet, thanks!

8:24 oddcully: yw

8:24 mavbozo: nicferrier: try require

8:29 nicferrier: what namespace do your repl start?

8:29 paulswilliamses1: hi all.

8:29 nicferrier: mavbozo: it's ok! it worked! thanks!

8:30 bja: nicferrier: it might make slightly more sense if you consider that key-monitor.core is a namespace object and that without require, it hasn't been properly loaded (and is thusly empty)

8:38 paulswilliamses1: Question.. I have a colleague who's suggested that leiningen is a 'pointless build tool clones just to use a different POM syntax'. As a happy leiningen user, I'd appreciate pointers to any objective lists that show value in leinigen other than a maven abstraction? I'd like to prevent FUD before it takes hold.

8:40 mavbozo: easier for clojure beginnners

8:41 TEttinger: paulswilliamses1, wow uh... for one, it provides all of clojure at your disposal should you need complicated builds

8:41 for another, has he actually written one of each?

8:41 pom.xml files are absurdly verbose and have you repeating yourself constantly

8:41 paulswilliamses1: one of each? He's very experienced in maven which prevents him from seeing maven's challenges

8:41 mavbozo: plugins

8:42 TEttinger: yep, plugins too

8:42 lein uberjar is nice from the very outset

8:42 paulswilliamses1: He played with Clojure a year ago, spent 5 mins looking at leiningen and dismissed it.

8:42 TEttinger: ha

8:42 well he can continue to use maven

8:42 mavbozo: built in repl support

8:43 with nrepl

8:43 paulswilliamses1: TEttinger true, this was a sweeping statement on our intranet not aimed directly aimed at leiningen, but with it strongly in mind.

8:44 So if we decided to start a project with lein and maven for difference developers, I can't see that being workable?

8:44 TEttinger: I have published things to maven central, and it's like... if the most bureaucracy-loving politicians from all parties got together, they could not create a more DMV-like piece of software than that site

8:44 mihailp: 4clojure.com expired, site redirected by godaddy.

8:44 TEttinger: mihailp: ???

8:44 lazybot: TEttinger: How could that be wrong?

8:45 mihailp: NOTICE: This domain name expired on 3/29/2015 and is pending renewal or deletion.

8:45 worked several hours ago.

8:45 paulswilliamses1: TEttinger agreed.

8:46 bja: several hours ago was 3/29/2015

8:46 mavbozo: almost 8 hours ago

8:46 mihailp: implementing in picolisp, several tasks left. come on

8:48 old ip


8:48 502 Bad Gateway

8:48 nginx/1.4.6 (Ubuntu)

8:52 TEttinger: mihailp: https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/data_set.clj#L971

8:52 that should be the third-to-last

8:52 no solution thee

8:52 mihailp: indeed

8:52 super, thanks.

8:53 TEttinger: np

8:53 I hope it gets fixed soon... arrdem

8:53 err, he was retweeted on their team twitter, but he isn't on the team, sorry

8:53 Raynes?

8:53 clojurebot: Raynes is an encyclopedia of shit you didn't know Clojure had, bro

8:53 TEttinger: classic

8:53 hyPiRion: lolwut

8:54 TEttinger: hyPiRion, are you able to fix 4clojure's godaddy parkedness?

8:54 $title http://4clojure.com

8:54 hyPiRion: no, but maybe amalloy_ can

8:54 lazybot: Page has no title.

8:55 hyPiRion: They are both sound asleep now though, I guess

8:57 mihailp: see you.

8:58 TEttinger: (inc mihailp) ; I would not have found out about that without him!

8:58 lazybot: ⇒ 1

8:58 TEttinger: well someone would have come online and been confused

9:01 mavbozo: (inc mihailp)

9:01 lazybot: ⇒ 2

9:46 noncom: today i came upon a surprising thing in clojure:

9:46 #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: LinkedList>

9:46 why so?

9:47 why not make nth = .get for this java collection ?

9:49 mavbozo: noncom: how do you make LinkedList?

9:49 hyPiRion: noncom: Because it would break the promise it guarantees.

9:50 Glenjamin: (doc nth)

9:50 clojurebot: "([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."

9:50 hyPiRion: It guarantees O(~1) or O(1) for any non-sequence.

9:51 Glenjamin: i though nth was the watch-out-it-might-be-O(n) one

9:52 hyPiRion: it is, if you use it on a sequence. The promise is kinda weird

9:53 Perhaps the docstring should be updated to reflect on the fact that it doesn't work on Lists in general

9:53 reflect the fact*

9:53 Glenjamin: seems odd to me, if it can be O(n) ever it might as well work on List

9:53 it's not like you can be sure you're getting a seq

9:53 erm, sure you're not getting

9:56 hyPiRion: yeah, it's a strange one

9:57 noncom: mavbozo: umm, well, just (java.util.LinkedList.)

9:58 yeah, very strange... I have turned to LinkedLists instead of clojure []s in my code for speed improvements... all code works fine, except that I had to replace all (nth) with (.get) which is kinda funny, esp considering they have the similar purpose and signature..

9:59 bja: are LinkedLists that much faster than '() for your workload?

9:59 mavbozo: noncom: thx, i do not know most of java

10:00 noncom: mavbozo: well, welcome then to this kingdom of fun! :)

10:02 mavbozo: ,(doto (java.util.LinkedList.) (.add "A") (.add "B"))

10:02 clojurebot: ("A" "B")

10:02 noncom: bja: idk.. i have replaced the core math functions with java-coded static methods, which take and return Lists. inside, these fns work with LinkedLists, so that's the type that was in the error message

10:02 ,(doto (java.util.LinkedList.) (.add "A") (.add "B") (.add 1))

10:02 clojurebot: ("A" "B" 1)

10:03 noncom: here we go

10:03 mavbozo: ,(doto (java.util.LinkedList.) (.add "A") (.add "B") (.get 0))

10:03 clojurebot: ("A" "B")

10:03 bja: if you want nth to work, you can seq it first

10:04 ,(-> (doto (java.util.LinkedList.) (.add "A") (.add "B")) seq (nth 0))

10:04 clojurebot: "A"

10:08 noncom: ,(doc seq)

10:08 clojurebot: "([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable."

10:08 noncom: bja: yeah, but that's just an extra step in the algo, and looks like not the cheapest one..

10:09 bja: seq won't fully realize the list

10:09 noncom: will it add time to each step then?

10:09 Glenjamin: $source seq

10:09 lazybot: seq is http://is.gd/WuKyNd

10:09 noncom: i have like thousands of quaternions to be multiplied..

10:10 Glenjamin: https://github.com/clojure/clojure/blob/clojure-1.7.0-alpha1/src/jvm/clojure/lang/RT.java#L489

10:11 noncom: hmmmm

10:12 bja: I mean, creating that iterator won't be free

10:18 it's also not that different from what j.u.LL.get() does

10:19 http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/util/LinkedList.java#LinkedList.get%28int%29

10:19 the only real win would be if you could guarantee that you're always wanting the head of the list #(nth % 0)

10:20 in which case, j.u.LL has a getFirst() which seems clutch

10:59 muraiki: hi all. if I have a vector of keywords and a vector of values, how can I create a map combining the two? I tried using: (into {} (map #([%1 %2]) foo bar))

11:00 but that gives me "ArityException Wrong number of args (0) passed to: PersistentVector" as I guess it's trying to call the vector as a function?

11:01 Glenjamin: muraiki: either use (fn) or #(vector )

11:01 muraiki: Glenjamin: thank you!

11:01 Glenjamin: actually, you can do ##(into {} (map vector (range 3) (range 3)))

11:01 lazybot: ⇒ {0 0, 1 1, 2 2}

11:02 danlentz: Today I'm distracted from what I should be doing by this new book "Clojure Reactive Programming"

11:02 iwillig: (interleave [1 2 3 4] [1 2 3 4])

11:02 muraiki: danlentz: reactive as in frp or reactive as in reactive manifesto stuff?

11:02 mpenet: ,(doc zipmap)

11:02 clojurebot: "([keys vals]); Returns a map with the keys mapped to the corresponding vals."

11:03 mpenet: muraiki: (zipmap v1 v2)

11:03 muraiki: oh nice!

11:03 mpenet: ,(zipmap [:a :b] [1 2])

11:03 clojurebot: {:a 1, :b 2}

11:03 muraiki: thank you all :)

11:05 Glenjamin: iirc zipmap doesn't use into or transients internally

11:05 $source zipmap

11:05 lazybot: zipmap is http://is.gd/ovU9xB

11:05 danlentz: Sorry took me a moment to grab the link: https://www.packtpub.com/web-development/clojure-reactive-programming

11:06 muraiki: nice, frp

11:06 oddcully: (inc mpenet)

11:06 lazybot: ⇒ 6

11:06 muraiki: danlentz: oh, and it uses reactive extensions. I've played with that in js and found it pretty neat.

11:07 danlentz: I'm familiar with "cells" and hu.dwim.computed-class in common-lisp so this seems to be in the same concepts

11:09 Umm. For sufficiently modest values of "familiar" I mean.

11:09 muraiki: :)

11:10 kaiyin: is there a clojure package similar to this?

11:10 http://projects.haskell.org/diagrams/

11:11 zerokarmaleft: kaiyin: quil perhaps

11:14 kaiyin: zerokarmaleft: that looks nice!

11:39 supersym: How would one represent in FP/idiomatic Clojure overriding of class properties? The thing I'm looking to convert is http://stackoverflow.com/a/24586740 as part of a project but I really have no clue what functional equivalent we have of this concept (the bc var). Even only a fn name would be helpful

11:44 hmm maybe this is the first time I'll be needing reify

11:55 timvisher: I have `test/unit` and `test/integration` in my project. `test/integration` tests do nasty side-effecty things when loaded, so i'd prefer they not be present in my repl when i'm developing the system, but only when i'm running the tests or specifically developing them. I thought I could do this with `lein profiles` where in my `:dev` profile i have `:test-paths ["test/unit"]` but in my `:test` profile i have `:test-paths ["t

11:56 "test/integration"]`. but when i do that, `clojure.tools.namespace.repl/refresh` still pulls in the `integration` tests and none of the tests are able to be evaled because they don't appear to be aware that they're a level deeper in the directory hierarchy now. anyone know if this is possible?

11:56 justin_smith: timvisher: do you need a ^:replace so "test" wouldn't be in the test-paths?

11:57 because I think it's there by default

11:57 timvisher: justin_smith: hadn't heard of `^:replace` before. nothing in the sample project seems to indicate how i would use it in this particular situation?

11:58 it seems to be for Maven artifacts?

11:58 justin_smith: timvisher: oh, you put it before any option in project.clj to replace rather than merge the defaults

11:58 timvisher: ah, i see it now

11:58 justin_smith: sorry, that just hit me :)

11:58 justin_smith: usually seen with :java-options ^:replace ["-server"]

11:58 timvisher: so it's merge by default

11:58 justin_smith: right

12:00 timvisher: fantastic!

12:00 justin_smith: that fixed it?

12:00 timvisher: ok, so now my integration tests are off on their own. unfortunately, my unit tests still don't seem to be able to resolve their `src` ns deps

12:00 justin_smith: almost :)

12:01 mavbozo: ,(doc defn)

12:01 clojurebot: "([name doc-string? attr-map? [params*] prepost-map? ...] [name doc-string? attr-map? ([params*] prepost-map? body) + ...]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the var metadata. prepost-map defines a map with optional keys :pre and :post that contain collections of pre or post conditions."

12:02 timvisher: i guess i might need to also set `source-paths`, but i wouldn't think so since `src` is entirely standard

12:02 justin_smith: timvisher: yeah, that's odd

12:05 timvisher: does `:test-paths ["test/unit"]` do what i think it does? i.e. merges the two ns trees such that `test/unit`'s base is the same as `src`? i don't even know if that makes any sense. i don't understand clojure's classloader all that well...

12:11 isn't there a tool that lets me search open source clojure projects for something?

12:14 anyone know of an open source clojure project that uses `:test-paths`?

12:14 arrdem: https://github.com/search?l=clojure&q=%3Atest-paths&type=Code&utf8=%E2%9C%93

12:14 timvisher: ah, looks like clojurescript does

12:15 justin_smith: timvisher: it puts test/unit/ on the class path during testing, which is exactly how src is made available (src/ is also on the class path)

12:15 timvisher: arrdem: neat search :)

12:15 arrdem: <3 github

12:16 justin_smith: timvisher: crossclj.info does various searches of clojure projects, but I don't know if it tracks project.clj options

12:16 timvisher: justin_smith: not that i saw

12:16 but that's the tool i was thinking of

12:16 arrdem: justin_smith: for text indexing I don't think it does.

12:25 timvisher: interestingly, clojurescript has the source and test dirs mirrored. so `:test-paths ["test/clj"] :source-paths ["src/clj"]`

12:34 arav93: In parse-timestamp in clojure.instant how is the input passed? Because when I pass like this "(t/parse-timestamp 0 1 1 0 0 0 0 -1 0 0 0)", it does not work!

12:35 timvisher: same thing with leiningen (sort of): https://github.com/technomancy/leiningen/blob/ff84da697249184874b528950048981621ac0b61/project.clj#L30 https://github.com/technomancy/leiningen/blob/ff84da697249184874b528950048981621ac0b61/project.clj#L40

12:36 ,(doc clojure.instant)

12:36 arrdem: http://conj.io/store/v0/org.clojure/clojure/1.6.0/clj/clojure.instant/parse-timestamp

12:36 clojurebot: #error{:cause "clojure.instant", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ClassNotFoundException: clojure.instant, compiling:(NO_SOURCE_FILE:0:0)", :at [clojure.lang.Compiler macroexpand1 "Compiler.java" 6636]} {:type java.lang.ClassNotFoundException, :message "clojure.instant", :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}], :trace [[java.net.URLC...

12:36 timvisher: arav93: you need to give it a string https://clojure.github.io/clojure/clojure.instant-api.html

12:37 arav93: Oh, ok thanks timvisher

12:37 timvisher: arav93: you may be interested in clj-time

12:37 ,,clj-time

12:37 clojurebot: #error{:cause "Unable to resolve symbol: clj-time in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: clj-time in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: clj-time in this context",...

12:38 timvisher: however you do that...

12:38 justin_smith: timvisher: are you trying to get a factoid there or?

12:39 timvisher: don't we have a bot that looks up libraries via google or something?

12:39 or am i think of #emacs?

12:40 justin_smith: you must be thinking of #emacs

12:40 we have the grim plugin (thanks arrdem)

12:40 $grim clojure.core/conj

12:40 lazybot: http://grimoire.arrdem.com/1.6.0/clojure.core/conj

12:41 arrdem: which I need to update the hell out of because it's three URL schemes old

12:41 mavbozo: arrdem: you remove the <pre> tag in your latest commit?

12:41 timvisher: $grim clj-time

12:41 i forget how far grimoire fans out

12:42 doesn't appear to capture clj-time

12:42 arrdem: mavbozo: yep. oh see what you're saying. lets see how that shit looks...

12:42 mavbozo: https://cloud.githubusercontent.com/assets/3253772/6901193/e1d34706-d735-11e4-8494-0c3c38547cbb.png

12:42 justin_smith: amalloy_: did you see that 4clojure has the domain expired?

12:42 amalloy_: I forget if you own it or not, but I'm sure you know the one who does

12:43 arrdem: mavbozo: um... that's a bug. I don't do dev on the live site :P

12:43 mavbozo: pls 2 open issue.

12:45 Glenjamin: oh good, some docstrings are formatted nicely, and some arent

12:45 arrdem: yeah

12:46 Glenjamin: \n\n -> <br /><br /> and a max-width on the doc container might be enough

12:49 mavbozo: arrdem: i just used firebug to see what would happened if i delete the <pre> tag

12:55 timvisher: so it's actually looking like it's a bug in clojure.tool.namespace.repl/refresh!

12:55 i removed all my edits and still get hit with it when i call that

12:55 TimMc: Wouldn't be the first one. :-P

12:58 timvisher: what's bizarre is that if i'm understanding the `:reloading ...` message correctly, it _is_ loading the nses in the right order

12:59 but that's good to know that lein isn't the culprit

13:00 anyone else have cider repl history working?

13:00 between sessions that is

13:00 justin_smith: timvisher: you just need to define the history file name

13:00 timvisher: justin_smith: everything i've seen does that globally though

13:01 justin_smith: I don't think cider does local history?

13:01 timvisher: ah! it probably defaults to a file in the project?

13:01 so `nreplhistory` or whatever would be in project root?

13:01 i should try that

13:01 justin_smith: it defaults to no persistence

13:01 and then if you set it, it's the same history for every project

13:01 last I used it

13:02 it's one history for all things, or none

13:03 timvisher: justin_smith: :sad_trombone: :\

13:03 justin_smith: timvisher: it shouldn't be super hard to make a project-specific config

13:03 by making the file a buffer-local and setting it per repl based on where you started the repl from...

13:04 you'd need some fudge factor for when you jack into a port and it doesn't really know where that came from on the fs

13:04 I guess it could do (System/getenv "PWD") and that should be reliable

13:04 totally doable

13:06 timvisher: justin_smith: indeed. but i'm already over time budget for trying to figure out how to get these integration tests off my classpath :)

13:06 justin_smith: heh

13:06 * justin_smith is really bad at time budgeting.

13:09 sobel: i have gotten better at it lately, but that's just in time to see most my spare time get fractured horribly

13:13 timvisher: the other good news is that this appears to be a problem down to nrepl server

13:14 or at least to cider

13:14 because if i `C-c C-l` a file, i get the same behavior

13:14 all of this points to insanity in this project, because all of this behavior works swimmingly outside of it.

13:16 arrdem: how can I make ClojureScript load a file from Clojure? cljs.core/load-file?

13:17 mikerod: What is the reason that clojure.core/*loaded-libs* is a Ref instead of something like an atom?

13:21 Bronsa: mikerod: atoms were not implemented when *load-libs* was added

13:23 mikerod: Bronsa: oh, that is interesting

13:23 history lessons

13:23 (inc Bronsa)

13:23 lazybot: ⇒ 99

13:29 mavbozo: (inc Bronsa)

13:29 lazybot: ⇒ 100

13:29 sobel: (inc -0)

13:29 lazybot: ⇒ 1

13:29 sobel: (inc +0)

13:29 lazybot: ⇒ 1

13:29 sobel: (inc +inf)

13:29 lazybot: ⇒ 1

13:34 kludgecode: ,(defn make-state [best heap] {:best best :heap heap})

13:34 clojurebot: #'sandbox/make-state

13:35 kludgecode: getting error "Parameter declaration fn* should be a vector"

13:35 using emacs + cider

13:37 found it. was using `defn` versus `def` with lambda expression in the next declaration. I guess it reads the file bottom to top sometimes.

13:38 Bronsa: no it doesn't

13:38 TimMc: kludgecode: What's reading code backwards?

13:39 l3dx: are there any good examples of doing one-to-many joins with java.jdbc?

13:40 kludgecode: Two declarations in source file. Both closed as s-expr. Error in syntax of second. Error message refers to line number at start of first. In source file the first is above the one with the error.

13:42 Bronsa: kludgecode: there was a bug in clojure that made it report wrong line info, maybe it's what you're incurring into, next alpha will have this fixed

13:44 kludgecode: Bronsa:

13:45 1. (defn foo [a] {:a a})

13:45 2. (defn bar #({:b %1})

13:45 --> Error compiling <etc> line 1

13:45 --> Parameter declaration fn* should be a vector

13:46 Error in replicating line 2 here; should be another ')'

13:46 Fixed with

13:46 2. (def bar #({:b %1}))

13:47 justin_smith: kludgecode: #({:b %1}) is impossible to use without erroring out

13:48 Bronsa: kludgecode: I don't use cider, I don't know what's going wrong there. I'm aware of two bugs in clojure wrt bad line reporting: CLJ-1568 and CLJ-1561, both have been fixed in the upcoming 1.7.0-alpha6 release

13:49 kludgecode: justin_smith: that's not the actual line I was just trying to be sussinct. It was the comparison function we talked about the other day.

13:49 justin_smith: OK

13:49 kludgecode: sorry.

13:50 justin_smith: oh, np, just making sure - and it's a knee-jerk like response to let someone know when I see a common mistake

13:50 * justin_smith is working on a web site with common clojure mistakes / errors and how to recognize them.

13:51 kludgecode: justin_smith: It's hard to get help debugging code by posting other code with different bugs.

13:52 justin_smith: heh

13:54 JanMan_: Good Day.

13:55 kludgecode: Bronsa: Maybe clj-1561 since it relates to special forms and misusing `defn` caused it.

13:57 JanMan_: Greetings... currently seeking great clojure engineers for an excellent project. http://t.co/btnsyri8I8

14:00 TimMc: Mmm, two levels of link shorteners. Thanks, Twitter.

14:02 TEttinger: JanMan_: it's oddly quiet in here today

14:08 seangrove: Might be a good idea to mention #clojure-beginners early in the channel title

14:08 arrdem: seangrove: I'd tend to agree...

14:09 seangrove: arrdem: Boom. Where do we file the petition?

14:10 arrdem: seangrove: tbh I'd take it to puredanger since tech seems to have resigned his role as op

14:10 seangrove: He was a great op.

14:11 His resignation makes this channel slightly more somber.

14:11 arrdem: indeed I will miss his fingerguns and strange keyboards

14:17 TEttinger: might be a good idea to fix this

14:17 $title http://4clojure.com

14:17 lazybot: "4clojure – Welcome!"

14:17 TEttinger: yaaaaay

14:18 arrdem: yay 4clojure is back

14:18 TEttinger: (inc 4clojure)

14:18 lazybot: ⇒ 4

14:18 arrdem: (inc 4clojure)

14:18 lazybot: ⇒ 5

14:23 justin_smith: (inc 4clojure)

14:23 lazybot: ⇒ 6

14:23 justin_smith: yay

14:26 chouser: Will that do?

14:27 Bronsa: (inc chouser)

14:27 lazybot: ⇒ 20

14:28 oddcully: version to the changes maybe? or is 1.7.0 at the gates?

14:28 justin_smith: oddcully: 1.7 is still alphas only

14:28 TimMc: He didn't make an official goodbye in here, did he? I remember there was a blog post about moving to $country and doing charitable work.

14:29 chouser: That link is to all the changes back to 1.3

14:29 justin_smith: he probably realized he was spending way too much potentially productive time in here. Not that I might be projecting or anything.

14:29 oddcully: chouser: i meant, put "currently at 1.x.x" over to the changelog "block" there

14:30 chouser: oddcully: oh, I see.

14:30 arrdem: chouser: thanks man

14:30 chouser: or should "see also" go at the very end?

14:32 oddcully: it basically falls in the "discussion" category

14:37 BinaryResult: A friendly reminder that Disco Melee is currently hiring Clojure developers, come join our team! https://docs.google.com/document/d/1GvnrSCUbYgbY9XdFs_DUx-0QZG2bIYT8Mbr0zdpTeew/edit?usp=sharing

14:38 irctca: what does the * at the end of function names mean idiomatically?

14:39 arrdem: irctca: typically that it's an implementation detail for which the author had no better name...

14:39 chouser: irctca: probably that there's another var with the same name, but without a *

14:39 TimMc: hahah

14:39 (inc chouser)

14:39 lazybot: ⇒ 21

14:39 TimMc: irctca: Alternate or more "raw" version.

14:40 chouser: the relationship between the two varies. Maybe one's a macro and the other an fn? That's usually why I do it.

14:40 TimMc: irctca: Usually foo is a wrapper around foo*.

14:41 irctca: ah..

14:41 so like an _ prefix

14:42 thanks!

15:03 slipset: short core.async question

15:03 if I have a channel as (chan c 1 (take 20))

15:04 ,(clojure.core.async/chan c 1 (take 20))

15:04 clojurebot: #error{:cause "clojure.core.async", :via [{:type java.lang.ClassNotFoundException, :message "clojure.core.async", :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}], :trace [[java.net.URLClassLoader$1 run "URLClassLoader.java" 366] [java.net.URLClassLoader$1 run "URLClassLoader.java" 355] [java.security.AccessController doPrivileged "AccessController.java" -2] [java.net.URLClassLoader...

15:04 slipset: thanks, clojurebot

15:04 will channel close when it has received 20 things>

15:04 s/>/?/

15:09 amalloy: justin_smith, et al: thanks for notifying me about 4clojure; i presume you've noticed by now that it's back up but letting you know just in case

15:12 kaiyin: is there a straight-forward way to call c code from clojure?

15:13 oddcully: kaiyin: https://github.com/Chouser/clojure-jna/ maybe?

15:15 kaiyin: looks cool

15:15 charlespwd: Any reason why leiningen wouldn't pick up options in my project.clj :profiles map when I call `lein with-profile dev repl`?

15:15 It should boot me in mynamespace.repl, and have append stuff to the source-paths, but it doesn't...

15:16 my environment variables from profiles.clj are picked up though

15:18 mavbozo: that's weird, in your project.clj you have something like {:profiles {:dev ...}} right?

15:23 charlespwd: yep

15:25 mavbozo: charlespwd: so, you have project.clj and profiles.clj in the same dir?

15:25 charlespwd: yes

15:26 mavbozo: and both have :dev ?

15:26 charlespwd: yep

15:26 mavbozo: Remember that if a profile with the same name is specified in multiple locations, only the profile with the highest "priority" is picked – no merging is done. The "priority" is – from highest to lowest – profiles.clj, project.clj, user-wide profiles, and finally system-wide profiles.

15:26 https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md

15:26 charlespwd: There ya go.

15:26 Thanks!

15:34 mavbozo: (inc cider)

15:34 lazybot: ⇒ 1

15:49 alejandrozf: Hi again, need help with leiningen installation please...

15:52 arrdem: what's up?

15:54 alejandrozf: arrdem: I have leiningen.jar on selfs-installs, lein.bat but when I run "lein repl" i cannot got the dependencies... getting many errors

15:55 arrdem: alejandrozf: can you give us a refheap paste of your terminal?

15:55 alejandrozf: arrdem: rigth now...

15:57 arrdem: here, http://pastebin.com/RFBguCNz

16:01 and I have set the proxy env. var ...

16:02 arrdem: Okay that answers my first question...

16:03 alejandrozf: both proxy vars?

16:03 alejandrozf: maybe my connection is too slow ...

16:03 arrdem: https://github.com/technomancy/leiningen/wiki/HTTP-Proxies

16:03 I doubt that. The error is a failure to validate an ssl connection.

16:05 alejandrozf: but I have both vars , the https_proxy too

16:05 exist another way to download lein dependencies?

16:06 ...and tell lein they are local?

16:06 mavbozo: which lein version do you use?

16:07 alejandrozf: mavbozo: 2.5.0

16:08 mavbozo: can you do `lein upgrade` ?

16:09 verma: so if I have a vec of things, and I want to mutate one particular one inside of it, I know I can do a assoc as long as I know the index of it, but it seems like I need to first find the index, is there a function which does "find item with this pred and call this f on it" ?

16:10 alejandrozf: mavbozo: connection failed...with "... ERROR: cannot verify github.com's certificate, etc ..."

16:11 marcoslamuria: hi

16:11 verma: may be I can do it with a split-with, concat, first?

16:12 danlentz: Is it safe at this point to go back to CIDER head? I bailed out for Melpa 0.8.2 a while back.

16:12 alejandrozf: mavbozo: but "lein new app" it works, it's rare..

16:13 can I replace lein with boot

16:13 _

16:13 ?

16:13 mavbozo: alejandrozf: lein new app does not connect to the outside repo

16:14 alejandrozf: or lein is a MUST with clojure?

16:15 tahmid: alejandrozf: lein is not a must with clojure

16:15 mavbozo: alejandrozf: so, you did the original installation by lein? or did you download the jar yourself?

16:15 alejandrozf: mavbozo: no, just the .jar file and lein.bat

16:16 I dowload the jar file

16:17 mavbozo: alejandrozf: you just need to download the lein.bat and executing lein.bat, it will download leiningen jar itself

16:17 alejandrozf: tahmid: what replacements do you recommend me?

16:18 tahmid: alejandrozf: Do not replace leiningen

16:18 alejandrozf: it’s a wonderful build tool

16:18 alejandrozf: you are using windows, right ?

16:18 alejandrozf: tahmid: yes

16:20 tahmid: alejandrozf: How exactly you installed leiningen ?

16:20 mavbozo: tahmid: he did not manage to install leiningen, because ssl certificate validation problem

16:20 tahmid: he's behind proxy

16:20 it could be proxy problem or

16:21 alejandrozf: do you have wget or curl in your PATH ?

16:21 alejandrozf: mavbozo: yes, wget

16:21 mavbozo: try do move it somewhere else first

16:21 and try execute `lein`

16:22 alejandrozf: mavbozo: ok

16:22 arrdem: danlentz: I've been riding head for a while now with no problems

16:23 danlentz: Arrdem: Can I quote you on that?

16:23 arrdem: sure

16:23 danlentz: :)

16:23 alejandrozf: mavbozo: it shows me a options menu equally

16:24 danlentz: I ran into baffling cider-nrepl issue a while back

16:25 mavbozo: alejandrozf: what options are presented?

16:26 xzilend: Is clojure well suited to 3D graphics programming? Looking to learn a LISP while working on my thesis

16:26 alejandrozf: mavbozo: the global options...

16:28 mavbozo: alejandrozf: can you do `lein upgrade` now?

16:29 TEttinger: xzilend, it depends.

16:29 alejandrozf: mavbozo: yes, i'm downloading the latest lein script

16:30 TEttinger: clojure's very good at 2d graphics through quil and play-clj, and quil may also do 3d but I know little about quil

16:30 arrdem: xzilend: sorta kinda. People have done 3d graphics stuff in Clojure, but usually by implemeting game logic in clojure and letting java or native C libraries do the rendering

16:30 mavbozo: alejandrozf: good! you should be downloading leiningen 2.5.1

16:30 danlentz: I'm so poor at emacs I can't even declare bankruptcy for another 7 years.

16:30 TEttinger: if you use CL, you'll just be calling C FFI on 3d libs in C

16:31 arrdem: with mutable state everywhere!

16:31 alejandrozf: mavbozo: uff, no, rigth now in the end my download failed with "curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054 Failed to download https://github.com/technomancy/leiningen/raw/stable/bin/lein. bat"

16:31 sorry for huge msg!

16:31 kaiyin: how come this can compile? https://gist.github.com/kindlychung/efa8ae27afb7386fb163

16:32 mavbozo: alejandrozf: can you try again, it could because network problem

16:32 kaiyin: I used type annotation and the type of param for euler1 is clearly wrong.

16:32 alejandrozf: mavbozo: ok

16:32 xzilend: hmm TEttinger & arrdem, thanks! I'll take that into consideration

16:33 oddcully: alejandrozf: with the space before .bat ?

16:33 alejandrozf: oddcully: course

16:34 sveri: cfleming: ping

16:38 mavbozo: alejandrozf: you skip downloading the newest lein.bat by downloading from your browser here https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat and replace the old lein.bat

16:40 alejandrozf: mavbozo: done

16:40 and now?

16:41 mavbozo: alejandrozf: try `lein repl`

16:42 alejandrozf: it can´t find the 2.5.1 leiningen version and tells me run "lein self-install"

16:42 mavbozo: ok. try `lein self-install`

16:42 arrdem: justin_smith: ping

16:43 alejandrozf: mavbozo: downloading now...

16:43 mavbozo: no ssl error?

16:50 alejandrozf: mavbozo: this zip file contains only the jar file?

16:52 mavbozo: alejandrozf: the jar of leiningen-2.5.1

16:54 alejandrozf: mavbozo: but after the download the script continue setting env vars and things?

16:55 mavbozo: alejandrozf: yes, it sets LEIN_HOME, LEIN_JAR

16:55 alejandrozf: mavbozo: good :)!

16:55 mavbozo: alejandrozf: the leiningen 2.5.1 jar should be in C:\Users\[your-username\.lein\self-installs

16:58 alejandrozf: now, after the installation finished, let's see if you can do `lein repl`

16:59 arrdem: (inc mavbozo)

16:59 lazybot: ⇒ 3

17:00 alejandrozf: mavbozo: I have a clojure.jar (1.6.0) how I should put it on classpath in a way that my lein see it?

17:00 mavbozo: IIRC leiningen comes with clojure 1.6.0 by default

17:00 amalloy: alejandrozf: just delete the clojure.jar you downloaded. you don't need it

17:01 alejandrozf: amalloy: clojure it's "into" leiningen?

17:03 justin_smith: arrdem: pong

17:03 arrdem: justin_smith: can you test some lazybot patches in a minite?

17:04 once I finish generating a new gpg key because I set an expiration date like a fool...

17:05 mavbozo: alejandrozf: can you enter the clojure repl by `lein repl`?

17:05 amalloy: alejandrozf: i don't understand your question, but leiningen comes bundled with one version of clojure to run itself, and automatically downloads any other versions of clojure needed to run your own programs

17:06 justin_smith: arrdem: sure thing, feel free to make a pr against my lazybot fork

17:06 arrdem: thanks

17:11 justin_smith: if you could update your lazybot/master level to Raynes' lazybot/master I can give you a clean pr

17:12 justin_smith: cool deal, I'll ping back when done

17:13 arrdem: done

17:13 arrdem: justin_smith: cheers

17:15 akkad: when building uberjars what is taking the most time? I see a 6 minute delay, but no real cpu or disk io going on during that time.

17:16 justin_smith: arrdem: I'm going to merge it to a branch first, and then pull it into my master after we play with it a bit

17:16 arrdem: justin_smith: sure

17:18 justin_smith: fair warning I haven't pushed that alpha yet due to gpg fun

17:20 justin_smith: arrdem: Could not find artifact org.clojure-grimoire:lib-grimoire:jar:0.9.0-alpha1 in central (https://repo1.maven.org/maven2/)

17:21 oh, that's what you just said

17:21 hah

17:21 arrdem: for now I'll do a download / install

17:22 arrdem: justin_smith: the -SNAPSHOT is up to date with what will be -alpha1

17:24 justin_smith: -alpha1 live

17:25 justin_smith: cool

17:25 arrdem: that depends on the next release of Grimoire so lemme just go do that.

17:25 #codependentprojects

17:25 justin_smith: arrdem: "Unable to resolve symbol: set-ns-index! in this context"

17:26 arrdem: damnit. set-def-index! not set-ns-index! I'll patch

17:26 justin_smith: arrdem: cool, I added your repo as a remote

17:27 arrdem: justin_smith: pr updated

17:27 justin_smith: #clobberation

17:31 arrdem: did you actually change the set-ns-index! thing?

17:31 arrdem: yeah gimme a sec

17:32 https://github.com/arrdem/lazybot/commit/9089bbf1ebf6c5f117606a3bb1000174f6efca55

17:32 oops.

17:32 justin_smith: check grimoire.clj, line 27

17:32 arrdem: https://github.com/arrdem/lazybot/commit/6d8fe844388de211a38bb5838bee9994da389d06

17:32 already done

17:33 justin_smith: hehe, cool

17:33 arrdem: okay chainloading Grimoire redeploy...

17:33 * arrdem crosses fingers

17:34 justin_smith: "Caused by: java.io.IOException: Server returned HTTP response code: 502 for URL: http://conj.io/api/v2/org.clojure?op=artifacts&type=edn"

17:34 does that mean wait and try again?

17:34 arrdem: yeah the new server isn't online yet

17:34 yep

17:34 justin_smith: OK, let me know when to pull the trigger

17:37 arrdem: booting...

17:37 :shipit:?

17:38 justin_smith: fire when ready

17:40 justin_smith: "Caused by: java.lang.IllegalArgumentException: No method in multimethod '-list-platforms' for dispatch value: :grimoire.api.web/Config"

17:40 arrdem: hang on fighting a fire with the server first

17:40 I made datafile changes I forgot to deploy :c

17:40 justin_smith: no biggie

17:41 arrdem: okay got that fixed

17:42 restarting with new datafiles and all should be good

17:45 justin_smith: okay so that's a missing multimethod in lib-grimoire. I should have caught that in my test suite. updates incomming.

17:46 justin_smith: cool deal

17:47 arrdem: okay. -alpha2 live, pr updated

17:48 justin_smith: for now I just have your branch as an upstream, and will continue merging directly from that to local until things look shiny, and then you can make a pr from that?

17:48 arrdem: sounds good

17:49 justin_smith: arrdem: ##anyone, if you want to poke at anybot

17:59 ee_cc: hi, I’m working on cemerik/friend. I don’t seem to get wrap-authorize to work now that I’ve moved the load-user-record fn to a real db query rather than a hardcoded map

18:00 any clue how I can debug this, IE see what friend/authenticate is seeing? (my hunch is that I’m getting the roles keywords wrong

18:12 cfleming: sveri: Pong

18:18 sveri: cfleming: I had some misbehavior today with cursive and wanted to ask if it might be an issue or not, however, inbetween I opened already a new one; https://github.com/cursiveclojure/cursive/issues/815

18:19 cfleming: sveri: Yeah, I saw that, thanks - I'll try to reproduce. I suspect that the issue is the :eval-in-leiningen, since Cursive runs lein in-process

18:19 sveri: So the JVM version is whatever you're using to run IntelliJ, the CWD is wrong, etc

18:20 justin_smith: ee_cc: how are you generating the namespaced keywords?

18:20 cfleming: sveri: For those projects I suspect a remote REPL will be the best solution, but I'm not really familiar with how lein plugins work

18:21 danlentz: arrdem: grimoire is really a great thing

18:22 arrdem: danlentz: thanks but not now I have a broken release live 0.0

18:22 ee_cc: the client posts a string and I’m trying to map these to namespaced keywords, although it may not be such a good idea after all (hardcoding the roles I mean)

18:22 sveri: cfleming: Ok, thank you very much. As this was my first plugin I am not really familiar with it either. Browsing through your issues I saw you got a lot of things to do anyway. I wonder what you are living from inbetween

18:23 cfleming: sveri: Yeah, I have a fair amount to do at any one time :-). There's about 300 open issues in the Cursive tracker right now - the only thing that helps me sleep at night is that I have 500 closed ones!

18:23 danlentz: arrdem: What is this talk of *RELEASE*? Klingons do not *release* our software! Our software *escapes* when it is worthy, leaving a bloody trail of designers and test engineers in its wake!

18:24 sveri: cfleming: Keep on going on, I will definitely buy cursive as soon as it comes out :-)

18:24 cfleming: sveri: Cool, won't be long hopefully!

18:25 sveri: cfleming: Btw. I been streaming clj / cljs development with cursive a few times and there were a few positive responses about an available clojure plugin for intellij...I guess you hit the point with it

18:26 Just wanted to share the motivation :-)

18:26 cfleming: sveri: Thanks, that's good to hear - certainly it's a good addition to the Cursive ecosystem I think, since lots of people are using IntelliJ (or PyCharm/RedMine/WebStorm)

18:38 Manaphy91: Hi! Anyone know a useful method to `import` the same method name from two different files with different types and protocols? Can I aliasing `import' in `ns`?

18:49 justin_smith: did Manaphy91 change nicks or just leave? anyway, you can't import methods

18:51 Bronsa: justin_smith: he quit

18:57 danlentz: justin_smith: when you suggested trampoline yesterday, did you mean something like slingshot or dire?

18:58 justin_smith: danlentz: no, the trampoline function (where your continuations are functions you explicitly create in context capturing the values you need, and you return the continuation you want to resume)

18:58 (doc trampoline)

18:59 clojurebot: "([f] [f & args]); trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if any. If f returns a fn, calls that fn with no arguments, and continues to repeat, until the return value is not a fn, then returns that non-fn value. Note that if you want to return a fn as a final value, you must wrap it in some data structure and unpack it after trampoline returns."

19:00 justin_smith: the tricky part is you would need to return not the continuation to run, but a function that consists of that continuation, provided with an arg representing updated state that it can move forward with (and then itself pass on...))

19:05 danlentz: That is helpful

19:05 Eye opening actually

19:06 justin_smith: trampolining is a classic stack displacing trick

19:06 it's slower because it's abstracted (and the stack isn't), but it also doesn't blow the stack up...

19:07 notfaint: good morning

19:07 justin_smith: also it allows manipulating your stack of execution if you pass around a map representing the various points of continuation

19:07 which is what I would think you would want for that logic programming thing

19:07 notfaint: clojure is not for the faint of heart - it's quite difficult to learn

19:07 Can someone explain to me (for )

19:08 justin_smith: notfaint: it depends - it's a lot simpler than the popular alternatives in many ways (but like anything else it isn't without it's weird corners)

19:08 notfaint: for is a list comprehension, it takes some collections, and then returns a new collection based on them

19:08 notfaint: justin_smith: Its difficult to wrap my head around it for now

19:09 justin_smith: ,(for [a [1 2 3] b [9 10 11]] [a b])

19:09 notfaint: justin_smith: I don't know it that's the doc that make it harder than it is ...

19:09 clojurebot: ([1 9] [1 10] [1 11] [2 9] [2 10] ...)

19:09 justin_smith: for each combination of elements from the collections you provide, it produces one output

19:09 danlentz: notfaint: there's your problem. Wrap parens around it instead.

19:09 justin_smith: (as part of one lazy sequence)

19:09 haha

19:10 notfaint: justin_smith: i see why dont the doc say it -

19:10 justin_smith: the doc is more complicated than it should be - i hate that :)

19:11 justin_smith: notfaint: it does more than that, but that's the important part

19:11 the doc has to describe all the things it can do, not just the primary ones

19:11 notfaint: justin_smith: it doesnt even describe the primary stuff

19:11 look at the examples...

19:11 https://clojuredocs.org/clojure.core/for

19:12 amalloy: notfaint: https://clojuredocs.org/clojure.core/for#example-542692c7c026201cdc326957

19:12 but also, clojuredocs isn't "the docs". it is a community-maintained set of examples by people who recently learned something and want to contribute back. the docs are ##(doc for)

19:12 lazybot: ⇒ "Macro ([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost f... https://www.refheap.com/99079

19:15 notfaint: amalloy: the problem im having is that that definition is too verbose and way too complicated. I don't have a phd in english

19:15 amalloy: I don't understand 99% of the examples except the one you pointed out

19:15 amalloy: the documentation for 'for could definitely be simplified, i agree. but "i don't understand what it's saying about X" is different from "it doesn't say anything about X"

19:16 notfaint: amalloy: i meant both. initially I couldn't find X

19:17 because it was hidden in a sea of $%^*)__)

19:21 justin_smith: notfaint: one thing to remember is that you don't even need to use "for", it's a convenience (and a good one to learn) but you can avoid it until you learn more clojure and start to see where / how it makes sense

19:23 you can do the same things with map or even loop (modulo some laziness of course)

19:24 amalloy: well, mapcat, anyway

19:25 justin_smith: amalloy: well, that's map and concat of course, I didn't say map would be the only thing you'd need (you'd end up using let where in for you would use :let etc. too)

19:29 danlentz: To be fair, that is kind of a formidable docstring

19:30 justin_smith: definitely a dense one, yeah

19:33 danlentz: I never realized until i started clojure how blindly addicted I was to common-lisp LOOP

19:34 justin_smith: ~loop

19:34 clojurebot: loop is https://www.refheap.com/90332

19:34 justin_smith: danlentz: ever make something that crazy ^ ?

19:35 arrdem: justin_smith: 0.9.0 up.

19:35 danlentz: I had a preference for which features I used -- most of those I disliked the if and else

19:36 justin_smith: arrdem: awesome

19:37 danlentz: It was so handy and versatile it became a crutch I would just reach for without necessarily thinking about alternatives

19:41 justin_smith: I think reduce might be in line to become clojure's version of loop in that sense

19:42 except it was added to via reducers, transducers, etc. not by turning reduce into a fully featured aircraft carrier DSL

19:42 turbofail: protoss carrier

19:44 * arrdem spawns more mutas and prays

19:46 * justin_smith translates "The Cathedral and the Bazaar" for a new, hip, video game generation.

19:47 amalloy: justin_smith: reduce never seemed much like cl/loop to me; for feels closer

19:47 justin_smith: amalloy: not similar in flavor, but similar in taking over more and more of the lang - maybe the analogy is too much of a stretch though

19:48 and yeah for/doseq are definitely closest to CL loop in flavor

19:52 SegFaultAX: Ah, good 'ol loop.

19:57 xad: hi, anyone had any luck with seesaw on linux? I can't even run the tutorial from github (unable to resolve symbol etc.....)

19:57 justin_smith: xad: I've done it. Make sure you don't have a "headless" jre

19:58 xad: iirc the default jre for many distros doesn't include any of the GUI stuff

19:59 xad: I've installed sun java 8 but nothing right now I'm installing java 7

20:00 justin_smith: xad: I use java 8

20:01 xad: justin_smith: hmmm so how would i check for the headless jre?

20:02 justin_smith: ,java.awt.Container

20:02 clojurebot: #error{:cause "denied", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ExceptionInInitializerError, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.ExceptionInInitializerError, :message nil, :at [java.awt.Component <clinit> "Component.java" 595]} {:type java.lang.SecurityException, :message "denied", :at [clojur...

20:02 justin_smith: xad you shouldn't get an error for that locally, unless your jre is headless

20:02 if the class exists, you're good

20:04 arrdem: justin_smith: I'm gonna take a now well earned dinner break. I'd appreciate it if you'd put some thought to the <platform>::<ns>/<name> notation I chose and whether we should revise it to something more uri friendly before Raynes takes that PR

20:04 justin_smith: arrdem: OK

20:05 xad: justin_smith: ok, I googled a bit and I think I got it, to be honest I installed using the webupd8 ppa because I was bored to do it manually, now I haveto find out what i've got with it

20:06 justin_smith: xad: got what?

20:06 xad: x11 support ... ?

20:06 justin_smith: ahh, OK

20:07 xad: also, exactly what sort of errors were you getting with seesaw?

20:08 xad: justin_smith: unable to resolve symbol for things like (native!)and frame

20:08 the first few commands of the tutorial on github

20:09 justin_smith: xad: how did you specify your seesaw.core dependency?

20:10 xad: I assume you ran (use 'seesaw.core) https://gist.github.com/daveray/1441520#file-seesaw-repl-tutorial-clj-L30

20:11 xad: justin_smith: In the project.clj :dependencies [[org.clojure/clojure "1.4.0"] [seesaw "1.4.5"]])

20:11 justin_smith: yes exactly

20:11 justin_smith: xad: I meant in the repl, how you pulled in the namespace

20:11 what does (dir seesaw.core) do?

20:11 xad: justin_smith: just a sec...

20:12 Bronsa: TIL about clojure.repl/dir

20:12 (inc justin_smith)

20:12 lazybot: ⇒ 229

20:13 xad: justin_smith: foo nil

20:14 justin_smith: xad: OK, (require 'seesaw.core :reload) and try the dir command again

20:14 it could be you accidentally created the namespace

20:14 and that would make use not work properly

20:15 especially since the only def is "foo", that smells like "created a namespace by accident so the real one did not load"

20:15 arrdem: justin_smith: pls 2 upgrade to lib-grim 0.9.1 so as not to pull in a bunch of unused clojurescript crap

20:15 xad: justin_smith: foo nil again :(

20:16 justin_smith: xad: even after the :reload? do you shadow the seesaw.core namespace in your project?

20:16 arrdem: will do

20:17 xad: justin_smith: the only change i've done so far is to include the dep for seesaw and run the use commands from the tutorial, nothing else...

20:17 justin_smith: xad: what I mean, is if you have a file src/seesaw/core.clj that will get loaded instead of the real seesaw.core. And if that isn't happening, I'm pretty confused as to how this would happen.

20:19 xad: justin_smith: lol, wait a sec, I thing you pointed to the right direction..... I have my project named seesaw....... I feel stupid now......

20:20 justin_smith: xad: no, you aren't stupid, just new to the language and how things work here

20:21 xad: for future reference, it can be helpful to use a naming scheme like org.xad/seesaw which will prevent those conflicts

20:21 xad: justin_smith: thanks a lot for the understanding, I'm trying a new project right now to check if it works

20:22 justin_smith: you can specify a fully qualified project name in lein new

20:22 "lein new org.xad/seesaw" or whathaveyou

20:22 or whatever group should identify you

20:25 xad: justin_smith: it worked! Thanks a lot Justin :)

20:26 justin_smith: glad to hear it

20:33 cfleming: Bronsa: are you still here?

20:33 Bronsa: cfleming: yep

20:34 cfleming: Bronsa: IIRC you mentioned that using t.r, I can set the line/col for a form I'm evaluating, right?

20:34 Bronsa: this is for a CLJS REPL

20:35 Bronsa: cfleming: kinda sorta, you can set the *starting* line/col index for a t.r reader

20:36 cfleming: Bronsa: I think that's all I need. This is for the "Send top form from editor to REPL" action

20:37 Bronsa: So I'd like to be able to say: eval this form, it comes from file xxx at line yyy (and maybe col zzz, not so important though)

20:38 Bronsa: cfleming: sure, you'll just have to invoke the reader-type ctor direclty rather than using the factory functions

20:38 cfleming: e.g. https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader/reader_types.clj#L292

20:38 replace 1 1 with your desired line/col

20:39 cfleming: it's implementation-detailish stuff but I can promise you any of that won't change anytime soon :)

20:40 cfleming: Bronsa: Ok, I see. Thinking about it, I can only do this in some custom REPL, right? I can't send that directly to a CLJS REPL (i.e. over an inferior-lisp type thing).

20:40 Bronsa: So unless CLJS load-file is fixed, that seems impossible.

20:41 Bronsa: cfleming: yeah probably -- I haven't kept up to date with all the new cljs repl stuff though

20:42 cfleming: Bronsa: Ok, thanks for the pointer - I'll be doing my own REPLs soon enough so that will be helpful then, for sure. I'll check with dnolen if there's anything I can do in the meantime.

20:45 dnolen: cfleming: what do you need exactly?

20:51 cfleming: dnolen: I'd like to be able to specify, for a form sent from the editor to the REPL, which line/col it starts at for debugging/stack traces etc

20:52 dnolen: The current hack in clj is to whitespace-pad the form into a file and then use load-file

20:52 dnolen: My understanding is that that doesn't work in cljs because load-file doesn't return the results of the last form

20:53 dnolen: Bronsa gave me the magic incantation to make it work when I develop my own REPLs, but over clojure.main it seems impossible right now

20:57 dnolen: cfleming: cljs.repl can be supplied a :reader option

20:57 cfleming: so it seems to me if tools.reader support setLineColumn you'd be good to go

20:59 cfleming: dnolen: Ok, I'd have to look at how that works. Again, that would only be when Cursive creates the REPL, not when the user does via an init script like in the quick start.

21:00 dnolen: cfleming: yeah a user doing that doesn't really make any sense anyway

21:00 it's purely a tooling thing

21:00 cfleming: dnolen: Yeah, it needs interaction with the tool, right.

21:00 dnolen: And it's still the case that load-file in cljs doesn't return the results of the last eval?

21:01 dnolen: Actually, never mind - it doesn't help me anyway since I can't set the filename

21:01 dnolen: Thanks

21:02 dnolen: cfleming: no and not sure if we should make load-file do that, it just doesn't seem like the right approach for this anyhow

21:02 cfleming: dnolen: No, it's a hack, for sure.

21:02 Bronsa: cfleming: you can set the filename in the reader-type (that will affect what get's attached to the :file form meta) btw, not sure if this is what you were talking about though

21:02 gets*

21:04 cfleming: Bronsa: No, I was thinking about load-file. When I create the REPL and reader myself, there's no issue. I wanted to see if I could do this over a clojure.main REPL or not. In Clojure I can by using Compiler/load, but it's not possible in CLJS.

21:10 dnolen: cfleming: let me know if you encounter any issues trying this w/ 0.0-3165, would like the next big release to wrap up the big REPL issues for everyone.

22:09 joe124: if i have a function (fn myfunc [& args] ) how do i rename the args to coll without using a let

22:17 justin_smith: ,((fn [& [a b c]] c) 1 2 3 4 5 6)

22:17 clojurebot: 3

22:17 justin_smith: joe124: is that what you mean?

22:18 joe124: like putting all the input into one vector and calling it coll

22:18 btw is what you did called destructuring or something?

22:19 justin_smith: ,((fn [& coll] coll) 1 2 3 4)

22:19 clojurebot: (1 2 3 4)

22:19 justin_smith: args is just a conventional name, not a special one

22:19 joe124: oh lol

22:19 thanks

22:19 justin_smith: joe124: yeah, that is called destructuring that I did above

22:42 joe124: justin_smith also how do i do default parameters for a function? like in python myfunc(a=5):

22:43 ive found that any recursive function i try to make would look much better with one

22:43 if i'm using acculumators for example

22:43 TEttinger: joe124: you can define multiple arglists with defn or fn

22:44 ,(defn basics ([] (basics "TEttinger")) ([name] (str "Hello, " name)))

22:44 clojurebot: #'sandbox/basics

22:44 TEttinger: ,(basics)

22:44 clojurebot: "Hello, TEttinger"

22:44 TEttinger: ,(basics joe124)

22:44 clojurebot: #error{:cause "Unable to resolve symbol: joe124 in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: joe124 in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: joe124 in this context", :at [...

22:44 TEttinger: ,(basics "joe124")

22:44 clojurebot: "Hello, joe124"

22:45 TEttinger: ,(def basics2 (fn hello ([] (hello "TEttinger")) ([name] (str "Hello, " name))))

22:45 clojurebot: #'sandbox/basics2

22:45 TEttinger: ,(basics2 "joe124")

22:45 clojurebot: "Hello, joe124"

22:49 joe124: thank you Tettinger, also look at this is this cool or what https://gist.github.com/akbiggs/86f5bd96b7303b5c3882

22:49 TEttinger: that's clever, nice work

22:49 there are keyword args in clojure

22:50 but they need to be defed into the fn to use them as such

22:50 (and I don't know about defaults)

22:51 joe124: yeah i didnt make that macro lol

23:25 can someone help me with my max number finding function http://pastebin.com/ZdB8VSC0

23:26 amalloy: joe124: have you looked at how clojure.core/max is implemented?

23:31 mavbozo: joe124: you can create function with multiple arities

23:32 joe124: yes but if i'm taking in an undetermined amount of ints then they take up all my arities

23:34 mavbozo: joe124: oh, you want to implement max

23:34 Shayanjm: If I want to do a LOT of http requests (say, over 2k) and combine the results, would it be best to kick off all the requests asynchronously (using something like http-kit) and deref the results, or use something like pmap?

23:36 mavbozo: joe124: have you tried destructuring the function args?

23:37 joe124: dont see how i could do that with an undetermined amount of arguments?

23:38 mavbozo: joe124: you want to accept 0 args too?

23:38 joe124: no

23:40 mavbozo: ,((fn [& xs] xs) 1 2 3)

23:40 clojurebot: (1 2 3)

23:41 mavbozo: ,((fn [x & xs] [x xs]) 1 2 3)

23:41 clojurebot: [1 (2 3)]

23:42 joe124: im following

23:42 mavbozo: ,((fn [x & xs] [x xs]) 1)

23:42 clojurebot: [1 nil]

23:47 arrdem: Clojure library you'd like to see on Grimoire? I'm taking suggestions.

23:48 going by my analytics ClojureScript is top on that list, but more hacking is involved before that happens.

23:48 cfleming: arrdem: Yeah, cljs would be up there for sure.

23:48 arrdem: currently doing all of core.typed

23:49 cfleming: arrdem: Check the stats from the state of lein survey, they had data on most-used libraries - I'm guessing ring, compojure et al

23:56 joe124: is recursion ever neccesary or can any problem be solved my using apply and filter and other functions like that

23:56 by*

23:56 because recursion is hard for my brain

23:57 mavbozo: joe124: you can do recursion with loop

23:57 xphillyx: Is there a way to generically destructure a sequence? I know my sequence has 3 elements and I want to "unpack" it in a let binding, but it can be either a list or a vector.

Logging service provided by n01se.net