#clojure logs

2015-03-30

00:04cflemingjustin_smith: I have some interesting things to show about debugging and laziness at my Clojure/West talk too
00:04justin_smithcfleming: awesome, I'll be there with bells on
00:04cflemingWAT?!?! Where's my local context?
00:04cflemingSorry, doesn't exist any more
00:04justin_smithheh
00:07cflemingIt really kills the expression evaluation buxx
00:07cflemings/buxx/buzz/
00:15amalloycfleming: wasn't a compiler flag added to disable locals clearing?
00:15amalloynot that this necessarily solves it; there's a reason locals clearing exists
00:15cflemingamalloy: Yeah, Cursive automatically turns that on when debugging
00:16rhg135cfleming: fond a minor bug, it tries to load clj files in the cljs repl
00:17cflemingthis 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
00:17cflemingSo they're variables that would be captured as closed over locals if you compiled your code referring to them
00:18cflemingBut 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.
00:18cflemingrhg135: Is the flag in your REPL set to CLJS?
00:19cflemingrhg135: The combobox in your REPL toolwindow toolbar
00:20rhg135yeah it is
00:20cflemingActually, sorry, I didn't read that closely enough. It has to, right? For macros.
00:23rhg135oh right, does it not differentiate between clojure source roots and cljs?
00:23cflemingNo
00:24elvis4526How do I add custom .jar to a lein project ?
00:24rhg135ah that explains it
00:24cflemingThere's a fix I have to make there in that it's not as aware of scopes as it should be
00:25cflemingIt's a tricky problem actually, and I'm not 100% sure of how it should work
00:26cflemingSuggestions welcome if it's not behaving how you'd expect :)
00:26rhg135elvis4526: a really ugly way is to add it to your reasources path. but if you do that you may get lynched
00:28rhg135(inc cfleming) ; this new repl works great btw
00:28lazybot⇒ 13
00:28rhg135loads really fast too
00:28cflemingNice, glad it's working well!
00:28cflemingYeah, it doesn't have to do the nREPL port pingback dance
00:30cflemingI should be able to get better CLJS completion in it too once I get some time
00:47justin_smithbetween 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
00:47justin_smithI've been meaning to do something with noisesmith.org
00:53justin_smiththe 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
00:53justin_smith,(conj {} '[([a] b)])
00:53clojurebot#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_...
00:54justin_smith^one of the offenders
00:55TEttinger(inc justin_smith)
00:55lazybot⇒ 225
00:55justin_smiththe support is appreciated :)
01:04cfleming(+ 20 justin_smith)
01:05cflemingDamn
01:05justin_smithheh, thanks
01:05cfleming(inc justin_smith)
01:05lazybot⇒ 226
01:05pmonks(+ justin_smith 20) ; ??
01:05lazybotpmonks: Uh, no. Why would you even ask?
01:05cflemingI will turn each and every one into an inspection in Cursive
01:05cflemingWell, all the ones that I can determine statically, anyway
01:06cflemingActually, suggestions in the IDE based on stacktraces would be really nice
01:07cflemingIt'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?"
01:07amalloycfleming: "i noticed you got a stack overflow. maybe stop writing such recursive functions, huh?"
01:07justin_smithcfleming: 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
01:07justin_smith(inc amalloy)
01:07lazybot⇒ 244
01:08cflemingYou laugh, but more than once I've wished it would highlight the loop in the stacktrace
01:08justin_smithcfleming: clippy was derived from microsoft bob, which was implemented in lisp :)
01:08amalloy"OutOfMemoryError? Go easy on the Swing, man."
01:08justin_smithcfleming: amalloy: we just need a good animated mascott
01:08cflemingjustin_smith: I shall call him Bob2016
01:08justin_smithmaybe a rich hickey animation with algorithmically emphatic hair?
01:08cflemingjustin_smith: a bug of some kind, I guess
01:09cflemingI like it
01:09cflemingA disembodied wig telling you to fix your code
01:16elvis4526rhg135: okay ty
01:16elvis4526how do you put multiple methods for multiple protocols inside a record ?
01:17justin_smithelvis4526: you precede each group of methods by the protocol name
01:17justin_smith$grim clojure.core/defrecord
01:17lazybothttp://grimoire.arrdem.com/1.6.0/clojure.core/defrecord
01:18elvis4526ty
01:18justin_smithoh, wow, defrecord needs examples of implementing multiple protocols...
01:18justin_smithI figured they would be there
01:30arrdem(inc justin_smith_
01:30rhg135elvis4526: seriously, don't do that. I was joking. the usual approach is to install that jar to a maven repo
01:30arrdem(inc justin_smith)
01:30lazybot⇒ 227
01:32arrdemjustin_smith: I'd be happy to help throw you articles and link from Grim.
01:32justin_smitharrdem: awesome
01:32justin_smithI'll definitely be accepting PRs once I have the shell of this up and running
01:33arrdemcool.
01:33arrdemI was gonna try and get edit links working this weekend, got stuck doing school work so sorry that didn't happen.
01:33arrdemon the short list for this week.
01:34justin_smithif you have that broken down into reasonable sized tasks, I may be able to help, I've done my share of ring stuff
01:34arrdemit's just a plumbing problem. I have all the bits built already question is how to wire them together.
01:35justin_smithOK
01:35arrdemthanks for the offer tho.
01:36arrdemjustin_smith: if you do feel like mucking with hiccup, you could take a whack at refactoring the cheatsheeto to use that for HTML generation.
01:36arrdemright now it does old school printf based html generation.
01:37justin_smithhaha, wow
01:37justin_smithI may take a look
01:37arrdemI have a branch for that underway... arrdem/clojure-cheatsheet branch bluesky iirc
01:37arrdemprobably just gonna throw away all the LaTeX target stuff and make the html stack reasonable.
01:43justin_smithI wonder how many people used the latex?
01:46TEttingerI'm allergic to latex, I need doctors to use alternate typesetting methods for their gloves
01:47TEttingerwhy is LaTeX capitalized like it was invented by a juggalo?
01:57opqdonutTEttinger: because TeX is the ascii spelling of the tex logo (see http://en.wikipedia.org/wiki/TeX)
01:58opqdonutand so latex invented their own fancy logo, which is ascii'd as LaTeX
01:58opqdonut(see http://en.wikipedia.org/wiki/LaTeX)
02:03sm0keHello, 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
02:03sm0keanyone else faced this?
02:05sm0kee.g. a tagged literal for integer lets say
02:08arrdemjustin_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.
02:09elvis4526why I can't assign a set with def ?
02:09sm0ke,(def a #{})
02:09amalloyelvis4526: what makes you think you can't do that?
02:09clojurebot#'sandbox/a
02:09elvis4526 Don't know how to create ISeq from: clojure.lang.Symbol
02:10elvis4526sm0ke: im doing exactly this
02:11elvis4526uh its working in the repl
02:11elvis4526but not when I eval my file with cider
02:11sm0kewhat is the error?
02:11elvis4526Don't know how to create ISeq from: clojure.lang.Symbol
02:12sm0keis there a unwanted `'`
02:12amalloyelvis4526: that's an error message that means you have too many ()s somewhere in your file
02:12sm0ke,(concat [1 2 3]
02:12clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
02:12sm0ke,(concat [1 2 3] 'a)
02:12clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
02:12amalloywith just the error message nobody can tell you where; with a full stacktrace, pasted to refheap.com or something, we could give some guidance
02:15sm0kei heard cider got a debugger?
02:15justin_smithindeed, inspired by edebug
02:15justin_smithstepping debugger that shows return values in the minubuffer
02:15sm0kei guess fireplace will also pick it soon
02:16sm0kejustin_smith: allows to put breakpoints?
02:16sm0kethe usual stuff?
02:16justin_smithit was a very emacs-specific implementation, I don't know if vim has similar infrastructure to hook into
02:16sm0kestep into out et
02:16sm0kewell vim has mini buffers
02:16justin_smithsm0ke: not sure of all the details, I know it at least does breakpoint and step
02:17sm0keinteresting!
02:17justin_smithsm0ke: 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
02:17sm0kestep by step debugger for sexps?!
02:17justin_smithsm0ke: yeah, it's just like the built in emacs debugger from what I have seen
02:17sm0kemay be you are right, only vim experts can tell if its possible
02:18justin_smithyou press the space bar, it moves to the next form, and shows the return value
02:18sm0kenice
02:19justin_smithso 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
02:19justin_smithwhich is actually handier than the typical line vs. instruction debugging
02:19sm0keyep
02:20sm0kebut how do you set breakpoint inside a form?
02:20sm0kee.g. only in (* 10 10)
02:20justin_smithsm0ke: clicking in the trough next to it creates a "stop sign" in the gui emacs
02:20justin_smithoh, the breaks are per line I think...
02:20sm0kehurmm
02:20justin_smithbut not too hard to skip a few forms in
02:21sm0keweird, as there is no cocept of lines in lisp
02:21justin_smithbecause a breakpoint on a line will go to the first/innermost form on that line
02:21justin_smithsm0ke: this is how it is with elisp, the details may be somewhat different with cider I guess?
02:22rhg135time to learn emacs
02:22sm0ke:P
02:29arrdemAnyone aware of a prior discussion of the fact that we don't have def- but have defn-?
02:30justin_smitharrdem: 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?
02:30justin_smithof course the - can also mean "don't count on this being here in the next release", which that does not address
02:31arrdemwe have ^:deprecated, defn- is just (defn #^{:private true} ...)
02:32arrdemreaching 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.
02:32justin_smithahh
02:32arrdemalthough I suppose lein-grim supports ^:skip-wiki so I don't have to...
02:49cflemingarrdem: I dimly remember ancient flamewars about that, but it was before I actually used Clojure much so I didn't understand the details
02:50arrdemcfleming: I figure this was debated at some point but a cursory search of clj-dev and jira shows nothing
02:51cflemingarrdem: Yeah, can't remember the details sorry - it would have been the mailing list I think
02:51cflemingarrdem: I didn't read JIRA back then
02:52amalloyarrdem: 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
02:52amalloyit'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
02:53amalloyeg, what if we wanted def* for ^:dynamic? do we need defn*? defn*-?
02:58justin_smithdefmuffs
02:59justin_smithdef-private-muffs
03:20raspasov_so if I package a uberjar on JDK 8, I can't run it on JDK 6 or 7, correct?
03:21justin_smithno, clojure targets 1.6
03:21raspasov_I know about Clojure
03:21TEttingerif you have java code used by your clojure, then you might need to set source compatibility levels in lein somehow
03:21justin_smithuberjars are just zip files
03:21raspasov_so I'm looking to distribute an uberjar, I have the latest, latest version of Java 8
03:22raspasov_I run "lein uberjar"
03:22justin_smiththat puts your clojure files in a zip file
03:22raspasov_and when I tried to java -jar etc on JDK 7, it doesn't work
03:22justin_smiththat is a bug
03:22justin_smiththat should not happen
03:22raspasov_really? are you sure?
03:22TEttingeris your project pure clojure, or is there some java code in it?
03:22justin_smithabsolutely
03:22raspasov_there's one Java file
03:22raspasov_or actually, three
03:23raspasov_so yes there's some :)
03:23TEttingerlet me check this, I think it's an option in lein
03:23justin_smithoh, you may have to set your java target version then, or whatever they call it
03:23raspasov_justin_smith: yea, that would be solution to my problem... I was thinking of downgrading java somehow or some other nastiness like that
03:24TEttingeradd this to lein's project.clj... :javac-options ["-target" "1.6" "-source" "1.6"]
03:24raspasov_TEttinger: thanks! I'll try that
03:24raspasov_(inc TEttinger)
03:24lazybot⇒ 45
03:24TEttingergood luck!
03:24raspasov_(inc justin_smith)
03:24lazybot⇒ 228
03:25raspasov_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?
03:26TEttingerI think users get better performance by running on java 8 than java 6, but the source compat doesn't matter
03:27raspasov_TEttinger: yea that makes sense, thanks again!
03:27TEttingerit does if your java code uses java 7 or 8 features, like lambdas from 8 or the diamond thing syntax from 7
03:28TEttingeror switch on strings from 7
03:28raspasov_TEttinger: yea, no, I don't think I'm into Java fanciness at the moment :)
03:28TEttingerwhich is one of those, "it took you 7 versions to consider this?"
04:56zotis 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.
04:56zotof course, i'm probably just doing it wrong.
04:59patrkriszot: are the number of parameters right in both cases?
04:59patrkrisshouldn't you take a "this" parameter in the first case also?
04:59zotah, yes, that's true, although fixing that doesn't fix the problem
05:00patrkriszot: what kind of failure are you getting?
05:00zotinterface clojure.lang.ILookup is not a protocol
05:00zotso i am reading now to understand if deftype supports interfaces, where extend-type doesn't …
05:00amalloyyou have to implement interfaces up-front at type definition time
05:01zotwell, at least that's simple to know.
05:01Empperithis is annoying, where can I set indentation rules for clojurescript in Cursive?
05:02Empperiit persists to ident everything with one space
05:02Empperican't find any settings for this, only for clojure
05:02cflemingEmpperi: It uses the same settings
05:02cflemingEmpperi: What's the indentation issue you're having?
05:08arossouwhow does one calculate nlogn , with the big O notation?
05:09Emppericfleming: everything is indented by 1 space
05:09EmpperiI have set it to 2
05:10Empperiidea 14.1, latest cursive
05:11cflemingEmpperi: In the General code style settings, do you have "One space list indent" checked?
05:12Empperilet's see
05:12Empperidefinetly have not set that myself it is
05:14cflemingThat's an Emacs compatibility setting
05:14Emppericouldn't find that setting with find or by browsing through it
05:14Empperiwhere is it exactly?
05:15Empperiah there, found it
05:15Empperino, it's not on
05:15cflemingSettings->Editor->Code style->Clojure->General
05:15cflemingYou're right, it doesn't come up when you search, I'll fix that.
05:15cflemingCan you send a screenshot?
05:16Empperiof indentation settings?
05:16cflemingNo, of the problem
05:16Empperithere is very little to give a screenshot... Everything is indented by one space
05:16Empperiso instead of " " as indentation I get " "
05:16EmpperiI can of course press space to get that additional space but it gets annoying really fast
05:17Empperiand breaks code formatting
05:17cflemingMan, you get all the weird problems
05:17cfleming:)
05:17Empperi:)
05:17cflemingOne sec
05:17Empperihappy to be your tester lol
05:18arossouwany thoughts on Hoplon?
05:18cflemingHas this suddenly started happening?
05:19Emppericfleming: yeah, updated to idea 14.1 and of course cursive with it to get it working
05:19Empperiafter that I've got this behavior
05:20cflemingAnything suspicious looking in your log? Any errors popping up?
05:20Empperinone
05:20Empperionly error in the log is from this morning about an incompatible plugin which it updated and has nothing to do with cursive
05:21cflemingOk
05:21Empperiand with clojure code it indents just fine
05:21Empperithe problem is there only with clojurescript
05:21cflemingThat's totally bizarre
05:21cflemingThe formatting code isn't even aware it's formatting cljs
05:22Empperimaybe I'll try to restart Idea
05:22cflemingIt's identical
05:22Empperione sec
05:22cflemingHang on
05:22cflemingTry File->Invalidate Caches and restart while you're at it
05:22cflemingClutching at straws here, but you never know
05:23Empperipure restart didn't help, I'll try invaliding caches
05:23arrdemcfleming: having fun yet?
05:23cflemingarrdem: Empperi's computer is haunted
05:24Empperinope, still indents with one space
05:24cflemingHe gets the all the schrödinger bugs
05:24Empperithere must be something strange with this project
05:24EmpperiI'll create a totally empty one and see if changes anything
05:25cflemingIf you create a new project with lein new mies test-project, and reformat the main... right
05:25cflemingI'm starting to wonder is Empperi is secretly bbatsov messing with me.
05:26arrdempretty sure bbatsov is asleep rn
05:27cflemingAs should you be, right?
05:27Emppericfleming: heh, created a fresh project from idea itself, wrote (defproject foo "1.0.0") into my project.clj and created wat.cljs into src
05:27arrdemwho are you, my mother?
05:27Empperiright now it idents defn -macro like it doesn't recognize it
05:28Empperimeaning it aligns the indentation with the function name
05:28cflemingSorry, spent too much time around Cursive, I get used to scolding people
05:28cflemingEmpperi: that's probably because you don't have cljs added as a dep
05:28Empperitrue
05:28EmpperiI'll add that and see if it changes
05:30cflemingEmpperi: You'll need your src dir marked as a source root too (folder in blue)
05:31cflemingAlthough Cursive should now warn you if you don't
05:32Emppericfleming: yeah, it's done
05:32Empperiright now this project is borked somehow which I just created
05:32EmpperiIt can't load project.clj although lein repl from command line runs just fine
05:32cflemingHow do you mean it can't load it?
05:33Empperithrows exception into log
05:33cflemingCan you refheap that?
05:33cflemingTry with lein new mies <project>
05:33cflemingAnd import
05:33Empperik
05:36Emppericfleming: that works, but an interesting finding is that if I create a new cljs file it gives me " (ns blergh)"
05:36Empperinote the extra space before (ns
05:37Empperiafter that created (defn foo [] <enter here>
05:37cflemingHmm, 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.
05:37Empperiended up with " )" on next line, meaning only one space as indentation
05:37Empperibut!
05:37Empperithere is core.cljs generated from the mies template
05:38Empperithere indentation works as expected? o_O
05:38cflemingSeriously, are you screwing with me?
05:38Empperino :D
05:38cfleming:)
05:38cflemingIf you reformat the mies file, that looks ok?
05:38Empperithis just has to have something to do with file location
05:39Empperireformatting mies file ends up with identical look as before
05:39Empperimoved the blergh.cljs to same namespace as the mies file now reformatting it also gives the expected output
05:39cflemingSo you're creating a cljs file right inside the source root, with a single segment ns?
05:39Empperiyeah
05:39cflemingOne sec
05:39Empperibut that is not the case with my real project of course
05:40Empperiin my real project we have src/clj and src/cljs
05:40Empperiand both are source roots, not src
05:40cflemingYou're right, I can reproduce that
05:40cflemingWow
05:40Empperihow about src/clj and src/cljs scenario?
05:40Empperithat is the more likely one
05:41cflemingHappens for Clojure too
05:41Empperiwell at least that makes sense
05:41cflemingIt just has to be in the source root
05:41cflemingInterestingly, if you reformat it corrects it
05:42Empperianyway 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
05:43cflemingIn fact, it seems to work correctly in all cases, except that first top-level defn
05:43cflemingIf you put an if inside it, like (if :a<caret>) and press enter it does the right thing
05:43Empperido you get the extra space before (ns foo) ?
05:43cflemingYeah
05:43Empperithat's wierd too
05:43cflemingBut that doesn't seem to affect this
05:44cflemingHere's the actual problem, I think
05:45cflemingThat only happens when it's the last form in the file
05:45cflemingIn fact
05:45cflemingIt happened briefly in those two files, and now doesn't any more
05:46cflemingEmpperi: Do you see this consistently? I can only reproduce it briefly in new files
05:49cflemingActually, 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
05:49arrdemlols
05:50cflemingI'm wondering if the new-file template puts some weird whitespace in there or something, and the reformat fixes it.
05:50Emppericfleming: sorry, had a phone call
05:50cflemingAnyway, I can debug it now - thanks for the report.
05:50cflemingEmpperi: No worries.
05:50Empperibut yeah, it's consistent on our project
05:51cflemingIf you reformat the file, does it continue to happen after that?
05:51Empperialso code/reformat code ends up indenting everything with one space
05:51cflemingOh
05:51cflemingI don't see that.
05:52Empperithat doesn't happen in my dummy project I just created
05:52Empperiwait no
05:52cflemingOk, I'll take a look at this, since I can reproduce it I can hopefully figure out what's going on
05:52Empperiit happens there too
05:52Empperiin source root file that is
05:52cflemingThe reformat adding one space?
05:53Empperibut in non-root it works as expected
05:53Empperiin the dummy project
05:53Empperiin real project it works like it works in the source root in the dummy project
05:53cflemingWeird, I don't see that, and in fact after reformatting the indent works as well
05:53cflemingIn your real project you see this everywhere, not just in source roots?
05:53EmpperiI have a hunch that after you fix the bug you see it'll fix the bug I see too
05:53Empperiyeah, everywhere
05:53cflemingYeah, I suspect so
05:53cflemingYou're on Windows, right?
05:54Empperioh damn, I think I might have an idea what might be causing it
05:54Empperione sec
05:55arrdemoh good we're having another editor fight in clojure@googlegroups
05:55cflemingWe are? And I missed it?
05:56arrdembbatsov started a party and you weren't invited lol
05:56Empperibah, didn't work
05:56cflemingAh, I saw that one start, but I hadn't seen it degenerate into a knife fight
05:56Empperibut there's definetly now something funky with the project
05:56Empperi:source-paths ["src/clj" "src/js"]
05:56Empperiwhere it should have been :source-paths ["src/clj" "src/cljs"]
05:57Empperidid that change and was hopeful it would have fixed the problem but no
05:57Empperisource root had been set manually from idea it seems
05:57Empperiand that might break things up now
05:58Glenjaminoh wow, 10-point point-by-point rebuttals
05:58arrdemreally who has time for this shit
05:59cflemingEmpperi: That's weird, because Cursive would reset the source paths on every sync - src/cljs must be set somewhere in your project.clj
05:59Glenjamini don't have time to configure emacs, let alone tell people how great it is :D
05:59arrdemGlenjamin: get me to tar my self-deploying emacs config up for you sometime
05:59Emppericfleming: well it is now set
06:00Glenjaminthat was a joke, i mostly don't have time for the learning curve, despite wanting to
06:00Glenjamini can't bring myself to take the short-term hit
06:00arrdemfair. making the transition from vim cost me a Christmas break
06:01arrdembut was totally worth it in terms of tooling qualtiy
06:01Emppericfleming: just found out that only 4 out of 8 modules in our project has "clojure" under their module settings
06:01Empperithe wierd project is one of the missing ones
06:02cflemingEmpperi: 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.
06:02Empperimeaning the clojure facet
06:02Empperiyeah
06:02cflemingarrdem: I thought you were Emacs 4 Lyfe?
06:02arrdemcfleming: I'm a convert as of about a year ago
06:02arrdemcfleming: I still vim on a daily basis
06:02Empperibut it does something at least since the module settings are different for projects with the facet
06:03Empperithere is no language level selection or sources/paths/dependencies tabs on modules without the facet
06:03cflemingEmpperi: Hmm, really? I'll check that, and I'll go back and see if I can actually remove it.
06:03Empperiand most importantly can't mark folders, I can only exclude them
06:03cflemingOk, your project has something seriously funky
06:03cflemingNone of that is controlled by the facet
06:03Empperimight have something to do with Idea 14 -> 14.1 upgrade
06:04cflemingCan you send me a screenshot of your module config page for one of the funky modules?
06:05Empperisure
06:05cflemingi.e. one without the source/paths/deps etc?
06:05arrdemug I'm out of music. time to take a nap before class.
06:05arrdemg'night yall
06:05Empperisent
06:08cflemingEmpperi: So I have no idea what's going on, but that module is borked
06:08cflemingEmpperi: That's some sort of IntelliJ level problem though
06:09Emppericfleming: guessed that myself too after I found that problem
06:09Empperigonna fix it and tell you if it affects the indentation problem
06:09cflemingOk, there's definitely something going on with the indentation since I see it too, but much less than you.
06:09cflemingI'll try to reproduce that in v14.
06:09cflemingI'll send you a mail if/when I find something.
06:10Emppericfleming: working module .iml has <module type="JAVA_MODULE" version="4">
06:10Empperibroken module .iml has <module type="WEB_MODULE" version="4">
06:10Empperiquite a difference
06:10cflemingThat would explain it.
06:10EmpperiI have zero idea where the hell it has decided to use WEB_MODULE
06:11Empperifucker
06:11Empperilol
06:11cflemingYeah, that's pretty bad all right.
06:11Empperiguess I'll fix all those .imls by hand in sublime and restart idea
06:11arrdem(inc $OTHER_EDITOR)
06:11lazybot⇒ 1
06:11cflemingGive that a go and see if it helps
06:12cflemingarrdem: Sorry, I only respond to editor snipes with at least 1000 words and 10 bullet points.
06:12arrdempicky motherfucker aren't you
06:12cflemingHey, I'm a busy guy.
06:13arrdem> 10000 words
06:13arrdem> busy guy
06:13arrdemright
06:13cflemingWhich 10000 words?
06:14TEttinger&(reduce str "" (repeat 10000 "waaaah "))
06:14lazybot⇒ "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
06:14bhajanahrhr
06:14cflemingSorry, it needs 10 bullet points too.
06:14Empperiwell that fixed module settings window but indentation... sigh
06:15Emppericfleming: new cljs file in my project now indents correctly
06:15cflemingEmpperi: 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.
06:16Empperiwierd, new file works as expected but existing files still are affected by this strange bug
06:16cflemingEmpperi: You're on Windows, right? I'm wondering if it's a whitespace issue or line endings or something
06:16TEttinger&(reduce str "" (for [i (range 1 11)] (concat ["Point Number " i " "] (repeat 999 "waaaah "))))
06:16lazybot⇒ "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"
06:16Empperiyeah on windows
06:16TEttingergah
06:17EmpperiI'll check line endings and encodings for those files and the new file
06:17cflemingEmpperi: 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.
06:17arrdem> 2015, still trying to get line encoding right
06:17TEttinger&(reduce str "" (reduce str "" (for [i (range 1 11)] (concat ["Point Number " i " "] (repeat 999 "waaaah ")))))
06:17lazybot⇒ "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"
06:17Emppericfleming: LF and UTF-8 in both
06:17cflemingarrdem: hey, I'm clutching at straws again here.
06:18Emppericfleming: \o/
06:18TEttinger&(reduce str "" (reduce str "" (for [i (range 1 11)] (reduce str "" (concat ["Point Number " i ": "] (repeat 999 "waaaah "))))))
06:18lazybot⇒ "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
06:18Empperibroken file: select all -> cut -> paste -> reformat code
06:18Empperiindentation with 2 spaces! \o/
06:18Emppericfleming: this is me right now http://www.ludumdare.com/compo/wp-content/uploads/2013/04/i-have-no-idea-what-im-doing-dog.jpg
06:19cflemingarrdem: Besides, weren't you going to bed?
06:19Empperibut it fixed it :D
06:19cflemingMy working theory is something weird with the whitespace.
06:19Empperiyeah
06:19Empperibut thanks man, you were a big help
06:19Empperinow I gotta grab some lunch before I starve
06:19arrdemstatus> https://www.youtube.com/watch?v=HmZYgqBp1gI
06:19cflemingTime to break out the hex editor on a before/after of that file from the template.
06:19arrdemactually bed now
06:20cflemingEmpperi: No worries, I'll let you know if I find anything more.
06:20Empperithanks
06:21cflemingTEttinger: Nice. My response: waaaaah
06:21TEttingerhahaha
06:22TEttingernight, I'm at least glad you're providing a first-class clojure dev environment, even though I use an extremely dumb text editor
06:23cflemingTEttinger: Thanks! There's plenty of room for all :-)
06:23cflemingTEttinger: Besides, what would we complain about online if we all used the same editor?
06:23TEttingerha
06:26Seyleriuscfleming: What's this about a first-class clojure environment?
06:26cflemingSeylerius: https://cursiveclojure.com
06:27mavbozocfleming: we should complain about how clojure culture is so homogenous and bad for its viability
06:27cflemingmavbozo: Ha, right
06:28dysfunambrosebs: what's the correct way to use core.typed without forcing that dep on the user of your library?
06:28Seyleriuscfleming: Neat.
06:28dysfunambrosebs: that is to say i'd like to provide type signatures for it, but perhaps in another module. is that possible?
06:29SeyleriusNow I'm stuck contemplating how to do all that Shiny in Emacs...
06:29cflemingSeylerius: It's still under development, but it basically works well now. I'd say it's as stable as anything else right now.
06:29SeyleriusShiny indeed.
06:29shiranaihitomavbozo: it's certainly homogenous with regard to Leiningen.. :p
06:29cflemingshiranaihito: I have hopes for boot though, and things like shadow-build
06:30TEttingershiranaihito, considering the alternatives are ant and mvn, I'm pretty happy with lein
06:30dysfunboot looks nice, but is it a viable replacement for lein yet?
06:30dysfuni really do quite like lein
06:30shiranaihitocfleming: i hope it does help somehow
06:31cflemingSeylerius: I spoke at the conj about the the shininess if you're interested: https://www.youtube.com/watch?v=vt1y2FbWQMg
06:31shiranaihitoTEttinger: the *Real* alternative would be to ruthlessly evict all pointless commons-whatever.jar -droppings from Java/Clojure projects
06:31cflemingdysfun: I think so, although I haven't used it for anything real yet
06:31cflemingdysfun: It really wins when composing similar things, like all the tasks you want to do based on a file watcher
06:32cflemingdysfun: that's very painful with lein
06:32dysfunyeah, i'm just not sure when i'd find that useful :)
06:32cflemingdysfun: I guess you don't do cljs :)
06:32dysfunno, i don't :)
06:32dysfunom was very nice, but frankly i hate javascript and i hated cljs compile times
06:33cflemingSomeone 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
06:33dysfunwill boot run SASS and all that stuff as well then?
06:34cflemingI don't know if boot will ever win for simple projects, but for big complex ones I think it could really shine
06:34cflemingI don't know
06:34dysfunsee i'm getting to the point where i'm growing to hate big complex projects
06:34dysfuni 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
06:35dysfun"oh great, grunt"
06:35cflemingYeah, me too. Unfortunately my project is going that way whether I like it or not.
06:35cflemingBoot is the only thing I'd consider migrating to at the moment.
06:37dysfuni generally consider leiningen to be the gold standard here. it's perfectly adequate for everything i've needed so far
06:38arrdemeh lein has had its fair share of problems...
06:38arrdemincluding the ongoing nrepl version mess
06:39cflemingAnd don't try to embed it or you'll be sorry.
06:39cfleming(to be fair, they're working on fixing that but it's currently very painful).
06:40cflemingI agree that as a user it's mostly really great.
06:40cflemingBut hey, I still build with Ant, so take that for whatever it's worth.
06:40Glenjaminpart 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
06:41Glenjaminwhen i used me own nrepl server, i was surprised which bits weren't there
06:44arrdemthoughts 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.
06:44shiranaihitoTEttinger: 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
06:44arrdemsomeone doesn't seem to understand the concept of a reach set...
06:45mavbozoarrdem: i thought you were sleeping already :)
06:45TEttingerI don't know what a reach set is
06:45arrdemyeah yeah I'm gone for real now
06:46shiranaihitoTEttinger: me neither :p
07:02the-kennyWhat are you people using for (SQL) schema migrations?
07:03the-kennyI'm searching for something lightweight, not some heavy SQL DSL
07:04jesse___the-kenny: I'm using Ragtime, simple and works well
07:05shiranaihitothe-kenny: i have some experience with https://en.wikipedia.org/wiki/LiquiBase .. at least it does its job :)
07:15bjathis 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?
07:17TEttingerI'm curious what an uberjar would involve if it needs to do something with classpath other than be run with no VM arguments
07:18TEttingernormally `java -jar uber.jar` is enough
07:18bjathis is a "storm is being inconvenient" question
07:19bjaI 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
07:19bjaso it'll actually be java -cp storm-jar-dir -jar uber.jar
07:20bjaso I was considering java -cp my-uberjar-dir:storm-jar-dir -jar uber.jar
07:21TEttingercan you uh put them in your project?
07:22TEttingeris that a license problem?
07:24bjano. 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
07:25bjaso 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
07:28TEttingerwhat 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.
07:34bjaI 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.
07:35bjaI wish storm-ui wasn't a part of storm-core
08:13ee_cchoi, daft question but I’ve been looking for an naswer for a while
08:14ee_ccwriting 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
08:16ee_ccsomething 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??
08:16lazybotee_cc: Uh, no. Why would you even ask?
08:18mavbozoee_cc: you can choose between both
08:18nicferrierhey folks. I'm missing somethijg basic here.
08:19nicferrierI've got a repl running from within my program, using an uberjar.
08:19nicferrierbut I can't change to the namespace of my program.
08:19nicferrierwell, I can. but then anything in the namespace appears not to be there.
08:20nicferriermy 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)
08:20nicferrierbut then when I go (ns keg-monitor/core) I can't see anything
08:22oddcullyee_cc: like this? (let [{:keys [:user :password :role] :or {:role :anon}} {:user :john :password :doe}] role)
08:23ee_ccI’ll try, was wondering if the :or also worked with user password being present
08:23ee_cc2 sec
08:24mavbozonicferrier: the keg-monitor needs to be loaded first
08:24nicferriermavbozo: even though I'm running the uberjar?
08:24nicferrierok.
08:24ee_ccsweet, thanks!
08:24oddcullyyw
08:24mavbozonicferrier: try require
08:29mavbozonicferrier: what namespace do your repl start?
08:29paulswilliamses1hi all.
08:29nicferriermavbozo: it's ok! it worked! thanks!
08:30bjanicferrier: 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)
08:38paulswilliamses1Question.. 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.
08:40mavbozoeasier for clojure beginnners
08:41TEttingerpaulswilliamses1, wow uh... for one, it provides all of clojure at your disposal should you need complicated builds
08:41TEttingerfor another, has he actually written one of each?
08:41TEttingerpom.xml files are absurdly verbose and have you repeating yourself constantly
08:41paulswilliamses1one of each? He's very experienced in maven which prevents him from seeing maven's challenges
08:41mavbozoplugins
08:42TEttingeryep, plugins too
08:42TEttingerlein uberjar is nice from the very outset
08:42paulswilliamses1He played with Clojure a year ago, spent 5 mins looking at leiningen and dismissed it.
08:42TEttingerha
08:42TEttingerwell he can continue to use maven
08:42mavbozobuilt in repl support
08:43mavbozowith nrepl
08:43paulswilliamses1TEttinger true, this was a sweeping statement on our intranet not aimed directly aimed at leiningen, but with it strongly in mind.
08:44paulswilliamses1So if we decided to start a project with lein and maven for difference developers, I can't see that being workable?
08:44TEttingerI 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
08:44mihailp4clojure.com expired, site redirected by godaddy.
08:44TEttingermihailp: ???
08:44lazybotTEttinger: How could that be wrong?
08:45mihailpNOTICE: This domain name expired on 3/29/2015 and is pending renewal or deletion.
08:45mihailpworked several hours ago.
08:45paulswilliamses1TEttinger agreed.
08:46bjaseveral hours ago was 3/29/2015
08:46mavbozoalmost 8 hours ago
08:46mihailpimplementing in picolisp, several tasks left. come on
08:48mihailpold ip
08:48mihailphttp://173.255.221.96/
08:48mihailp502 Bad Gateway
08:48mihailpnginx/1.4.6 (Ubuntu)
08:52TEttingermihailp: https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/data_set.clj#L971
08:52TEttingerthat should be the third-to-last
08:52TEttingerno solution thee
08:52mihailpindeed
08:52mihailpsuper, thanks.
08:53TEttingernp
08:53TEttingerI hope it gets fixed soon... arrdem
08:53TEttingererr, he was retweeted on their team twitter, but he isn't on the team, sorry
08:53TEttingerRaynes?
08:53clojurebotRaynes is an encyclopedia of shit you didn't know Clojure had, bro
08:53TEttingerclassic
08:53hyPiRionlolwut
08:54TEttingerhyPiRion, are you able to fix 4clojure's godaddy parkedness?
08:54TEttinger$title http://4clojure.com
08:54hyPiRionno, but maybe amalloy_ can
08:54lazybotPage has no title.
08:55hyPiRionThey are both sound asleep now though, I guess
08:57mihailpsee you.
08:58TEttinger(inc mihailp) ; I would not have found out about that without him!
08:58lazybot⇒ 1
08:58TEttingerwell someone would have come online and been confused
09:01mavbozo(inc mihailp)
09:01lazybot⇒ 2
09:46noncomtoday i came upon a surprising thing in clojure:
09:46noncom#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: LinkedList>
09:46noncomwhy so?
09:47noncomwhy not make nth = .get for this java collection ?
09:49mavbozononcom: how do you make LinkedList?
09:49hyPiRionnoncom: Because it would break the promise it guarantees.
09:50Glenjamin(doc nth)
09:50clojurebot"([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."
09:50hyPiRionIt guarantees O(~1) or O(1) for any non-sequence.
09:51Glenjamini though nth was the watch-out-it-might-be-O(n) one
09:52hyPiRionit is, if you use it on a sequence. The promise is kinda weird
09:53hyPiRionPerhaps the docstring should be updated to reflect on the fact that it doesn't work on Lists in general
09:53hyPiRionreflect the fact*
09:53Glenjaminseems odd to me, if it can be O(n) ever it might as well work on List
09:53Glenjaminit's not like you can be sure you're getting a seq
09:53Glenjaminerm, sure you're not getting
09:56hyPiRionyeah, it's a strange one
09:57noncommavbozo: umm, well, just (java.util.LinkedList.)
09:58noncomyeah, 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..
09:59bjaare LinkedLists that much faster than '() for your workload?
09:59mavbozononcom: thx, i do not know most of java
10:00noncommavbozo: well, welcome then to this kingdom of fun! :)
10:02mavbozo,(doto (java.util.LinkedList.) (.add "A") (.add "B"))
10:02clojurebot("A" "B")
10:02noncombja: 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:02noncom,(doto (java.util.LinkedList.) (.add "A") (.add "B") (.add 1))
10:02clojurebot("A" "B" 1)
10:03noncomhere we go
10:03mavbozo,(doto (java.util.LinkedList.) (.add "A") (.add "B") (.get 0))
10:03clojurebot("A" "B")
10:03bjaif you want nth to work, you can seq it first
10:04bja,(-> (doto (java.util.LinkedList.) (.add "A") (.add "B")) seq (nth 0))
10:04clojurebot"A"
10:08noncom,(doc seq)
10:08clojurebot"([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:08noncombja: yeah, but that's just an extra step in the algo, and looks like not the cheapest one..
10:09bjaseq won't fully realize the list
10:09noncomwill it add time to each step then?
10:09Glenjamin$source seq
10:09lazybotseq is http://is.gd/WuKyNd
10:09noncomi have like thousands of quaternions to be multiplied..
10:10Glenjaminhttps://github.com/clojure/clojure/blob/clojure-1.7.0-alpha1/src/jvm/clojure/lang/RT.java#L489
10:11noncomhmmmm
10:12bjaI mean, creating that iterator won't be free
10:18bjait's also not that different from what j.u.LL.get() does
10:19bjahttp://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/util/LinkedList.java#LinkedList.get%28int%29
10:19bjathe only real win would be if you could guarantee that you're always wanting the head of the list #(nth % 0)
10:20bjain which case, j.u.LL has a getFirst() which seems clutch
10:59muraikihi 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:00muraikibut 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:01Glenjaminmuraiki: either use (fn) or #(vector )
11:01muraikiGlenjamin: thank you!
11:01Glenjaminactually, you can do ##(into {} (map vector (range 3) (range 3)))
11:01lazybot⇒ {0 0, 1 1, 2 2}
11:02danlentzToday I'm distracted from what I should be doing by this new book "Clojure Reactive Programming"
11:02iwillig(interleave [1 2 3 4] [1 2 3 4])
11:02muraikidanlentz: reactive as in frp or reactive as in reactive manifesto stuff?
11:02mpenet,(doc zipmap)
11:02clojurebot"([keys vals]); Returns a map with the keys mapped to the corresponding vals."
11:03mpenetmuraiki: (zipmap v1 v2)
11:03muraikioh nice!
11:03mpenet,(zipmap [:a :b] [1 2])
11:03clojurebot{:a 1, :b 2}
11:03muraikithank you all :)
11:05Glenjaminiirc zipmap doesn't use into or transients internally
11:05Glenjamin$source zipmap
11:05lazybotzipmap is http://is.gd/ovU9xB
11:05danlentzSorry took me a moment to grab the link: https://www.packtpub.com/web-development/clojure-reactive-programming
11:06muraikinice, frp
11:06oddcully(inc mpenet)
11:06lazybot⇒ 6
11:06muraikidanlentz: oh, and it uses reactive extensions. I've played with that in js and found it pretty neat.
11:07danlentzI'm familiar with "cells" and hu.dwim.computed-class in common-lisp so this seems to be in the same concepts
11:09danlentzUmm. For sufficiently modest values of "familiar" I mean.
11:09muraiki:)
11:10kaiyinis there a clojure package similar to this?
11:10kaiyinhttp://projects.haskell.org/diagrams/
11:11zerokarmaleftkaiyin: quil perhaps
11:14kaiyinzerokarmaleft: that looks nice!
11:39supersymHow 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:44supersymhmm maybe this is the first time I'll be needing reify
11:55timvisherI 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:56timvisher"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:56justin_smithtimvisher: do you need a ^:replace so "test" wouldn't be in the test-paths?
11:57justin_smithbecause I think it's there by default
11:57timvisherjustin_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:58timvisherit seems to be for Maven artifacts?
11:58justin_smithtimvisher: oh, you put it before any option in project.clj to replace rather than merge the defaults
11:58timvisherah, i see it now
11:58timvisherjustin_smith: sorry, that just hit me :)
11:58justin_smithusually seen with :java-options ^:replace ["-server"]
11:58timvisherso it's merge by default
11:58justin_smithright
12:00timvisherfantastic!
12:00justin_smiththat fixed it?
12:00timvisherok, 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:00timvisherjustin_smith: almost :)
12:01mavbozo,(doc defn)
12:01clojurebot"([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:02timvisheri guess i might need to also set `source-paths`, but i wouldn't think so since `src` is entirely standard
12:02justin_smithtimvisher: yeah, that's odd
12:05timvisherdoes `: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:11timvisherisn't there a tool that lets me search open source clojure projects for something?
12:14timvisheranyone know of an open source clojure project that uses `:test-paths`?
12:14arrdemhttps://github.com/search?l=clojure&amp;q=%3Atest-paths&amp;type=Code&amp;utf8=%E2%9C%93
12:14timvisherah, looks like clojurescript does
12:15justin_smithtimvisher: 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:15timvisherarrdem: neat search :)
12:15arrdem<3 github
12:16justin_smithtimvisher: crossclj.info does various searches of clojure projects, but I don't know if it tracks project.clj options
12:16timvisherjustin_smith: not that i saw
12:16timvisherbut that's the tool i was thinking of
12:16arrdemjustin_smith: for text indexing I don't think it does.
12:25timvisherinterestingly, clojurescript has the source and test dirs mirrored. so `:test-paths ["test/clj"] :source-paths ["src/clj"]`
12:34arav93In 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:35timvishersame 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:36timvisher,(doc clojure.instant)
12:36arrdemhttp://conj.io/store/v0/org.clojure/clojure/1.6.0/clj/clojure.instant/parse-timestamp
12:36clojurebot#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:36timvisherarav93: you need to give it a string https://clojure.github.io/clojure/clojure.instant-api.html
12:37arav93Oh, ok thanks timvisher
12:37timvisherarav93: you may be interested in clj-time
12:37timvisher,,clj-time
12:37clojurebot#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:38timvisherhowever you do that...
12:38justin_smithtimvisher: are you trying to get a factoid there or?
12:39timvisherdon't we have a bot that looks up libraries via google or something?
12:39timvisheror am i think of #emacs?
12:40justin_smithyou must be thinking of #emacs
12:40justin_smithwe have the grim plugin (thanks arrdem)
12:40justin_smith$grim clojure.core/conj
12:40lazybothttp://grimoire.arrdem.com/1.6.0/clojure.core/conj
12:41arrdemwhich I need to update the hell out of because it's three URL schemes old
12:41mavbozoarrdem: you remove the <pre> tag in your latest commit?
12:41timvisher$grim clj-time
12:41timvisheri forget how far grimoire fans out
12:42timvisherdoesn't appear to capture clj-time
12:42arrdemmavbozo: yep. oh see what you're saying. lets see how that shit looks...
12:42mavbozohttps://cloud.githubusercontent.com/assets/3253772/6901193/e1d34706-d735-11e4-8494-0c3c38547cbb.png
12:42justin_smithamalloy_: did you see that 4clojure has the domain expired?
12:42justin_smithamalloy_: I forget if you own it or not, but I'm sure you know the one who does
12:43arrdemmavbozo: um... that's a bug. I don't do dev on the live site :P
12:43arrdemmavbozo: pls 2 open issue.
12:45Glenjaminoh good, some docstrings are formatted nicely, and some arent
12:45arrdemyeah
12:46Glenjamin\n\n -> <br /><br /> and a max-width on the doc container might be enough
12:49mavbozoarrdem: i just used firebug to see what would happened if i delete the <pre> tag
12:55timvisherso it's actually looking like it's a bug in clojure.tool.namespace.repl/refresh!
12:55timvisheri removed all my edits and still get hit with it when i call that
12:55TimMcWouldn't be the first one. :-P
12:58timvisherwhat's bizarre is that if i'm understanding the `:reloading ...` message correctly, it _is_ loading the nses in the right order
12:59timvisherbut that's good to know that lein isn't the culprit
13:00timvisheranyone else have cider repl history working?
13:00timvisherbetween sessions that is
13:00justin_smithtimvisher: you just need to define the history file name
13:00timvisherjustin_smith: everything i've seen does that globally though
13:01justin_smithI don't think cider does local history?
13:01timvisherah! it probably defaults to a file in the project?
13:01timvisherso `nreplhistory` or whatever would be in project root?
13:01timvisheri should try that
13:01justin_smithit defaults to no persistence
13:01justin_smithand then if you set it, it's the same history for every project
13:01justin_smithlast I used it
13:02justin_smithit's one history for all things, or none
13:03timvisherjustin_smith: :sad_trombone: :\
13:03justin_smithtimvisher: it shouldn't be super hard to make a project-specific config
13:03justin_smithby making the file a buffer-local and setting it per repl based on where you started the repl from...
13:04justin_smithyou'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:04justin_smithI guess it could do (System/getenv "PWD") and that should be reliable
13:04justin_smithtotally doable
13:06timvisherjustin_smith: indeed. but i'm already over time budget for trying to figure out how to get these integration tests off my classpath :)
13:06justin_smithheh
13:09sobeli have gotten better at it lately, but that's just in time to see most my spare time get fractured horribly
13:13timvisherthe other good news is that this appears to be a problem down to nrepl server
13:14timvisheror at least to cider
13:14timvisherbecause if i `C-c C-l` a file, i get the same behavior
13:14timvisherall of this points to insanity in this project, because all of this behavior works swimmingly outside of it.
13:16arrdemhow can I make ClojureScript load a file from Clojure? cljs.core/load-file?
13:17mikerodWhat is the reason that clojure.core/*loaded-libs* is a Ref instead of something like an atom?
13:21Bronsamikerod: atoms were not implemented when *load-libs* was added
13:23mikerodBronsa: oh, that is interesting
13:23mikerodhistory lessons
13:23mikerod(inc Bronsa)
13:23lazybot⇒ 99
13:29mavbozo(inc Bronsa)
13:29lazybot⇒ 100
13:29sobel(inc -0)
13:29lazybot⇒ 1
13:29sobel(inc +0)
13:29lazybot⇒ 1
13:29sobel(inc +inf)
13:29lazybot⇒ 1
13:34kludgecode,(defn make-state [best heap] {:best best :heap heap})
13:34clojurebot#'sandbox/make-state
13:35kludgecodegetting error "Parameter declaration fn* should be a vector"
13:35kludgecodeusing emacs + cider
13:37kludgecodefound it. was using `defn` versus `def` with lambda expression in the next declaration. I guess it reads the file bottom to top sometimes.
13:38Bronsano it doesn't
13:38TimMckludgecode: What's reading code backwards?
13:39l3dxare there any good examples of doing one-to-many joins with java.jdbc?
13:40kludgecodeTwo 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:42Bronsakludgecode: 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:44kludgecodeBronsa:
13:45kludgecode1. (defn foo [a] {:a a})
13:45kludgecode2. (defn bar #({:b %1})
13:45kludgecode--> Error compiling <etc> line 1
13:45kludgecode--> Parameter declaration fn* should be a vector
13:46kludgecodeError in replicating line 2 here; should be another ')'
13:46kludgecodeFixed with
13:46kludgecode2. (def bar #({:b %1}))
13:47justin_smithkludgecode: #({:b %1}) is impossible to use without erroring out
13:48Bronsakludgecode: 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:49kludgecodejustin_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:49justin_smithOK
13:49kludgecodesorry.
13:50justin_smithoh, np, just making sure - and it's a knee-jerk like response to let someone know when I see a common mistake
13:51kludgecodejustin_smith: It's hard to get help debugging code by posting other code with different bugs.
13:52justin_smithheh
13:54JanMan_Good Day.
13:55kludgecodeBronsa: Maybe clj-1561 since it relates to special forms and misusing `defn` caused it.
13:57JanMan_Greetings... currently seeking great clojure engineers for an excellent project. http://t.co/btnsyri8I8
14:00TimMcMmm, two levels of link shorteners. Thanks, Twitter.
14:02TEttingerJanMan_: it's oddly quiet in here today
14:08seangroveMight be a good idea to mention #clojure-beginners early in the channel title
14:08arrdemseangrove: I'd tend to agree...
14:09seangrovearrdem: Boom. Where do we file the petition?
14:10arrdemseangrove: tbh I'd take it to puredanger since tech seems to have resigned his role as op
14:10seangroveHe was a great op.
14:11seangroveHis resignation makes this channel slightly more somber.
14:11arrdemindeed I will miss his fingerguns and strange keyboards
14:17TEttingermight be a good idea to fix this
14:17TEttinger$title http://4clojure.com
14:17lazybot"4clojure – Welcome!"
14:17TEttingeryaaaaay
14:18arrdemyay 4clojure is back
14:18TEttinger(inc 4clojure)
14:18lazybot⇒ 4
14:18arrdem(inc 4clojure)
14:18lazybot⇒ 5
14:23justin_smith(inc 4clojure)
14:23lazybot⇒ 6
14:23justin_smithyay
14:26@chouserWill that do?
14:27Bronsa(inc chouser)
14:27lazybot⇒ 20
14:28oddcullyversion to the changes maybe? or is 1.7.0 at the gates?
14:28justin_smithoddcully: 1.7 is still alphas only
14:28TimMcHe 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@chouserThat link is to all the changes back to 1.3
14:29justin_smithhe probably realized he was spending way too much potentially productive time in here. Not that I might be projecting or anything.
14:29oddcullychouser: i meant, put "currently at 1.x.x" over to the changelog "block" there
14:30chouseroddcully: oh, I see.
14:30arrdemchouser: thanks man
14:30@chouseror should "see also" go at the very end?
14:32oddcullyit basically falls in the "discussion" category
14:37BinaryResultA 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:38irctcawhat does the * at the end of function names mean idiomatically?
14:39arrdemirctca: typically that it's an implementation detail for which the author had no better name...
14:39chouserirctca: probably that there's another var with the same name, but without a *
14:39TimMchahah
14:39TimMc(inc chouser)
14:39lazybot⇒ 21
14:39TimMcirctca: Alternate or more "raw" version.
14:40chouserthe relationship between the two varies. Maybe one's a macro and the other an fn? That's usually why I do it.
14:40TimMcirctca: Usually foo is a wrapper around foo*.
14:41irctcaah..
14:41irctcaso like an _ prefix
14:42irctcathanks!
15:03slipsetshort core.async question
15:03slipsetif I have a channel as (chan c 1 (take 20))
15:04slipset,(clojure.core.async/chan c 1 (take 20))
15:04clojurebot#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:04slipsetthanks, clojurebot
15:04slipsetwill channel close when it has received 20 things>
15:04slipsets/>/?/
15:09amalloyjustin_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:12kaiyinis there a straight-forward way to call c code from clojure?
15:13oddcullykaiyin: https://github.com/Chouser/clojure-jna/ maybe?
15:15kaiyinlooks cool
15:15charlespwdAny reason why leiningen wouldn't pick up options in my project.clj :profiles map when I call `lein with-profile dev repl`?
15:15charlespwdIt should boot me in mynamespace.repl, and have append stuff to the source-paths, but it doesn't...
15:16charlespwdmy environment variables from profiles.clj are picked up though
15:18mavbozothat's weird, in your project.clj you have something like {:profiles {:dev ...}} right?
15:23charlespwdyep
15:25mavbozocharlespwd: so, you have project.clj and profiles.clj in the same dir?
15:25charlespwdyes
15:26mavbozoand both have :dev ?
15:26charlespwdyep
15:26mavbozoRemember 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:26mavbozohttps://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md
15:26charlespwdThere ya go.
15:26charlespwdThanks!
15:34mavbozo(inc cider)
15:34lazybot⇒ 1
15:49alejandrozfHi again, need help with leiningen installation please...
15:52arrdemwhat's up?
15:54alejandrozfarrdem: I have leiningen.jar on selfs-installs, lein.bat but when I run "lein repl" i cannot got the dependencies... getting many errors
15:55arrdemalejandrozf: can you give us a refheap paste of your terminal?
15:55alejandrozfarrdem: rigth now...
15:57alejandrozfarrdem: here, http://pastebin.com/RFBguCNz
16:01alejandrozfand I have set the proxy env. var ...
16:02arrdemOkay that answers my first question...
16:03arrdemalejandrozf: both proxy vars?
16:03alejandrozfmaybe my connection is too slow ...
16:03arrdemhttps://github.com/technomancy/leiningen/wiki/HTTP-Proxies
16:03arrdemI doubt that. The error is a failure to validate an ssl connection.
16:05alejandrozfbut I have both vars , the https_proxy too
16:05alejandrozfexist another way to download lein dependencies?
16:06alejandrozf...and tell lein they are local?
16:06mavbozowhich lein version do you use?
16:07alejandrozfmavbozo: 2.5.0
16:08mavbozocan you do `lein upgrade` ?
16:09vermaso 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:10alejandrozfmavbozo: connection failed...with "... ERROR: cannot verify github.com's certificate, etc ..."
16:11marcoslamuriahi
16:11vermamay be I can do it with a split-with, concat, first?
16:12danlentzIs it safe at this point to go back to CIDER head? I bailed out for Melpa 0.8.2 a while back.
16:12alejandrozfmavbozo: but "lein new app" it works, it's rare..
16:13alejandrozfcan I replace lein with boot
16:13alejandrozf_
16:13alejandrozf?
16:13mavbozoalejandrozf: lein new app does not connect to the outside repo
16:14alejandrozfor lein is a MUST with clojure?
16:15tahmidalejandrozf: lein is not a must with clojure
16:15mavbozoalejandrozf: so, you did the original installation by lein? or did you download the jar yourself?
16:15alejandrozfmavbozo: no, just the .jar file and lein.bat
16:16alejandrozfI dowload the jar file
16:17mavbozoalejandrozf: you just need to download the lein.bat and executing lein.bat, it will download leiningen jar itself
16:17alejandrozftahmid: what replacements do you recommend me?
16:18tahmidalejandrozf: Do not replace leiningen
16:18tahmidalejandrozf: it’s a wonderful build tool
16:18tahmidalejandrozf: you are using windows, right ?
16:18alejandrozftahmid: yes
16:20tahmidalejandrozf: How exactly you installed leiningen ?
16:20mavbozotahmid: he did not manage to install leiningen, because ssl certificate validation problem
16:20mavbozotahmid: he's behind proxy
16:20mavbozoit could be proxy problem or
16:21mavbozoalejandrozf: do you have wget or curl in your PATH ?
16:21alejandrozfmavbozo: yes, wget
16:21mavbozotry do move it somewhere else first
16:21mavbozoand try execute `lein`
16:22alejandrozfmavbozo: ok
16:22arrdemdanlentz: I've been riding head for a while now with no problems
16:23danlentzArrdem: Can I quote you on that?
16:23arrdemsure
16:23danlentz:)
16:23alejandrozfmavbozo: it shows me a options menu equally
16:24danlentzI ran into baffling cider-nrepl issue a while back
16:25mavbozoalejandrozf: what options are presented?
16:26xzilendIs clojure well suited to 3D graphics programming? Looking to learn a LISP while working on my thesis
16:26alejandrozfmavbozo: the global options...
16:28mavbozoalejandrozf: can you do `lein upgrade` now?
16:29TEttingerxzilend, it depends.
16:29alejandrozfmavbozo: yes, i'm downloading the latest lein script
16:30TEttingerclojure's very good at 2d graphics through quil and play-clj, and quil may also do 3d but I know little about quil
16:30arrdemxzilend: 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:30mavbozoalejandrozf: good! you should be downloading leiningen 2.5.1
16:30danlentzI'm so poor at emacs I can't even declare bankruptcy for another 7 years.
16:30TEttingerif you use CL, you'll just be calling C FFI on 3d libs in C
16:31arrdemwith mutable state everywhere!
16:31alejandrozfmavbozo: 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:31alejandrozfsorry for huge msg!
16:31kaiyinhow come this can compile? https://gist.github.com/kindlychung/efa8ae27afb7386fb163
16:32mavbozoalejandrozf: can you try again, it could because network problem
16:32kaiyinI used type annotation and the type of param for euler1 is clearly wrong.
16:32alejandrozfmavbozo: ok
16:32xzilendhmm TEttinger & arrdem, thanks! I'll take that into consideration
16:33oddcullyalejandrozf: with the space before .bat ?
16:33alejandrozfoddcully: course
16:34svericfleming: ping
16:38mavbozoalejandrozf: 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:40alejandrozfmavbozo: done
16:40alejandrozfand now?
16:41mavbozoalejandrozf: try `lein repl`
16:42alejandrozfit can´t find the 2.5.1 leiningen version and tells me run "lein self-install"
16:42mavbozook. try `lein self-install`
16:42arrdemjustin_smith: ping
16:43alejandrozfmavbozo: downloading now...
16:43mavbozono ssl error?
16:50alejandrozfmavbozo: this zip file contains only the jar file?
16:52mavbozoalejandrozf: the jar of leiningen-2.5.1
16:54alejandrozfmavbozo: but after the download the script continue setting env vars and things?
16:55mavbozoalejandrozf: yes, it sets LEIN_HOME, LEIN_JAR
16:55alejandrozfmavbozo: good :)!
16:55mavbozoalejandrozf: the leiningen 2.5.1 jar should be in C:\Users\[your-username\.lein\self-installs
16:58mavbozoalejandrozf: now, after the installation finished, let's see if you can do `lein repl`
16:59arrdem(inc mavbozo)
16:59lazybot⇒ 3
17:00alejandrozfmavbozo: I have a clojure.jar (1.6.0) how I should put it on classpath in a way that my lein see it?
17:00mavbozoIIRC leiningen comes with clojure 1.6.0 by default
17:00amalloyalejandrozf: just delete the clojure.jar you downloaded. you don't need it
17:01alejandrozfamalloy: clojure it's "into" leiningen?
17:03justin_smitharrdem: pong
17:03arrdemjustin_smith: can you test some lazybot patches in a minite?
17:04arrdemonce I finish generating a new gpg key because I set an expiration date like a fool...
17:05mavbozoalejandrozf: can you enter the clojure repl by `lein repl`?
17:05amalloyalejandrozf: 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:06justin_smitharrdem: sure thing, feel free to make a pr against my lazybot fork
17:06arrdemthanks
17:11arrdemjustin_smith: if you could update your lazybot/master level to Raynes' lazybot/master I can give you a clean pr
17:12justin_smithcool deal, I'll ping back when done
17:13justin_smitharrdem: done
17:13arrdemjustin_smith: cheers
17:15akkadwhen 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:16justin_smitharrdem: 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:16arrdemjustin_smith: sure
17:18arrdemjustin_smith: fair warning I haven't pushed that alpha yet due to gpg fun
17:20justin_smitharrdem: Could not find artifact org.clojure-grimoire:lib-grimoire:jar:0.9.0-alpha1 in central (https://repo1.maven.org/maven2/)
17:21justin_smithoh, that's what you just said
17:21justin_smithhah
17:21justin_smitharrdem: for now I'll do a download / install
17:22arrdemjustin_smith: the -SNAPSHOT is up to date with what will be -alpha1
17:24arrdemjustin_smith: -alpha1 live
17:25justin_smithcool
17:25arrdemthat depends on the next release of Grimoire so lemme just go do that.
17:25arrdem#codependentprojects
17:25justin_smitharrdem: "Unable to resolve symbol: set-ns-index! in this context"
17:26arrdemdamnit. set-def-index! not set-ns-index! I'll patch
17:26justin_smitharrdem: cool, I added your repo as a remote
17:27arrdemjustin_smith: pr updated
17:27justin_smith#clobberation
17:31justin_smitharrdem: did you actually change the set-ns-index! thing?
17:31arrdemyeah gimme a sec
17:32arrdemhttps://github.com/arrdem/lazybot/commit/9089bbf1ebf6c5f117606a3bb1000174f6efca55
17:32arrdemoops.
17:32justin_smithcheck grimoire.clj, line 27
17:32arrdemhttps://github.com/arrdem/lazybot/commit/6d8fe844388de211a38bb5838bee9994da389d06
17:32arrdemalready done
17:33justin_smithhehe, cool
17:33arrdemokay chainloading Grimoire redeploy...
17:34justin_smith"Caused by: java.io.IOException: Server returned HTTP response code: 502 for URL: http://conj.io/api/v2/org.clojure?op=artifacts&amp;type=edn&quot;
17:34justin_smithdoes that mean wait and try again?
17:34arrdemyeah the new server isn't online yet
17:34arrdemyep
17:34justin_smithOK, let me know when to pull the trigger
17:37arrdembooting...
17:37arrdem:shipit:?
17:38arrdemjustin_smith: fire when ready
17:40justin_smith"Caused by: java.lang.IllegalArgumentException: No method in multimethod '-list-platforms' for dispatch value: :grimoire.api.web/Config"
17:40arrdemhang on fighting a fire with the server first
17:40arrdemI made datafile changes I forgot to deploy :c
17:40justin_smithno biggie
17:41arrdemokay got that fixed
17:42arrdemrestarting with new datafiles and all should be good
17:45arrdemjustin_smith: okay so that's a missing multimethod in lib-grimoire. I should have caught that in my test suite. updates incomming.
17:46justin_smithcool deal
17:47arrdemokay. -alpha2 live, pr updated
17:48justin_smithfor 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:48arrdemsounds good
17:49justin_smitharrdem: ##anyone, if you want to poke at anybot
17:59ee_cchi, 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:00ee_ccany 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:12cflemingsveri: Pong
18:18svericfleming: 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:19cflemingsveri: 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:19cflemingsveri: So the JVM version is whatever you're using to run IntelliJ, the CWD is wrong, etc
18:20justin_smithee_cc: how are you generating the namespaced keywords?
18:20cflemingsveri: 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:21danlentzarrdem: grimoire is really a great thing
18:22arrdemdanlentz: thanks but not now I have a broken release live 0.0
18:22ee_ccthe 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:22svericfleming: 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:23cflemingsveri: 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:23danlentzarrdem: 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:24svericfleming: Keep on going on, I will definitely buy cursive as soon as it comes out :-)
18:24cflemingsveri: Cool, won't be long hopefully!
18:25svericfleming: 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:26sveriJust wanted to share the motivation :-)
18:26cflemingsveri: 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:38Manaphy91Hi! 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:49justin_smithdid Manaphy91 change nicks or just leave? anyway, you can't import methods
18:51Bronsajustin_smith: he quit
18:57danlentzjustin_smith: when you suggested trampoline yesterday, did you mean something like slingshot or dire?
18:58justin_smithdanlentz: 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:58justin_smith(doc trampoline)
18:59clojurebot"([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:00justin_smiththe 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:05danlentzThat is helpful
19:05danlentzEye opening actually
19:06justin_smithtrampolining is a classic stack displacing trick
19:06justin_smithit's slower because it's abstracted (and the stack isn't), but it also doesn't blow the stack up...
19:07notfaintgood morning
19:07justin_smithalso it allows manipulating your stack of execution if you pass around a map representing the various points of continuation
19:07justin_smithwhich is what I would think you would want for that logic programming thing
19:07notfaintclojure is not for the faint of heart - it's quite difficult to learn
19:07notfaintCan someone explain to me (for )
19:08justin_smithnotfaint: 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:08justin_smithnotfaint: for is a list comprehension, it takes some collections, and then returns a new collection based on them
19:08notfaintjustin_smith: Its difficult to wrap my head around it for now
19:09justin_smith,(for [a [1 2 3] b [9 10 11]] [a b])
19:09notfaintjustin_smith: I don't know it that's the doc that make it harder than it is ...
19:09clojurebot([1 9] [1 10] [1 11] [2 9] [2 10] ...)
19:09justin_smithfor each combination of elements from the collections you provide, it produces one output
19:09danlentznotfaint: there's your problem. Wrap parens around it instead.
19:09justin_smith(as part of one lazy sequence)
19:09justin_smithhaha
19:10notfaintjustin_smith: i see why dont the doc say it -
19:10notfaintjustin_smith: the doc is more complicated than it should be - i hate that :)
19:11justin_smithnotfaint: it does more than that, but that's the important part
19:11justin_smiththe doc has to describe all the things it can do, not just the primary ones
19:11notfaintjustin_smith: it doesnt even describe the primary stuff
19:11notfaintlook at the examples...
19:11notfainthttps://clojuredocs.org/clojure.core/for
19:12amalloynotfaint: https://clojuredocs.org/clojure.core/for#example-542692c7c026201cdc326957
19:12amalloybut 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:12lazybot⇒ "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:15notfaintamalloy: the problem im having is that that definition is too verbose and way too complicated. I don't have a phd in english
19:15notfaintamalloy: I don't understand 99% of the examples except the one you pointed out
19:15amalloythe 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:16notfaintamalloy: i meant both. initially I couldn't find X
19:17notfaintbecause it was hidden in a sea of $%^*)__)
19:21justin_smithnotfaint: 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:23justin_smithyou can do the same things with map or even loop (modulo some laziness of course)
19:24amalloywell, mapcat, anyway
19:25justin_smithamalloy: 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:29danlentzTo be fair, that is kind of a formidable docstring
19:30justin_smithdefinitely a dense one, yeah
19:33danlentz I never realized until i started clojure how blindly addicted I was to common-lisp LOOP
19:34justin_smith~loop
19:34clojurebotloop is https://www.refheap.com/90332
19:34justin_smithdanlentz: ever make something that crazy ^ ?
19:35arrdemjustin_smith: 0.9.0 up.
19:35danlentzI had a preference for which features I used -- most of those I disliked the if and else
19:36justin_smitharrdem: awesome
19:37danlentzIt was so handy and versatile it became a crutch I would just reach for without necessarily thinking about alternatives
19:41justin_smithI think reduce might be in line to become clojure's version of loop in that sense
19:42justin_smithexcept it was added to via reducers, transducers, etc. not by turning reduce into a fully featured aircraft carrier DSL
19:42turbofailprotoss carrier
19:47amalloyjustin_smith: reduce never seemed much like cl/loop to me; for feels closer
19:47justin_smithamalloy: 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:48justin_smithand yeah for/doseq are definitely closest to CL loop in flavor
19:52SegFaultAXAh, good 'ol loop.
19:57xadhi, anyone had any luck with seesaw on linux? I can't even run the tutorial from github (unable to resolve symbol etc.....)
19:57justin_smithxad: I've done it. Make sure you don't have a "headless" jre
19:58justin_smithxad: iirc the default jre for many distros doesn't include any of the GUI stuff
19:59xadI've installed sun java 8 but nothing right now I'm installing java 7
20:00justin_smithxad: I use java 8
20:01xadjustin_smith: hmmm so how would i check for the headless jre?
20:02justin_smith,java.awt.Container
20:02clojurebot#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:02justin_smithxad you shouldn't get an error for that locally, unless your jre is headless
20:02justin_smithif the class exists, you're good
20:04arrdemjustin_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:04justin_smitharrdem: OK
20:05xadjustin_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:06justin_smithxad: got what?
20:06xadx11 support ... ?
20:06justin_smithahh, OK
20:07justin_smithxad: also, exactly what sort of errors were you getting with seesaw?
20:08xadjustin_smith: unable to resolve symbol for things like (native!)and frame
20:08xadthe first few commands of the tutorial on github
20:09justin_smithxad: how did you specify your seesaw.core dependency?
20:10justin_smithxad: I assume you ran (use 'seesaw.core) https://gist.github.com/daveray/1441520#file-seesaw-repl-tutorial-clj-L30
20:11xadjustin_smith: In the project.clj :dependencies [[org.clojure/clojure "1.4.0"] [seesaw "1.4.5"]])
20:11xadjustin_smith: yes exactly
20:11justin_smithxad: I meant in the repl, how you pulled in the namespace
20:11justin_smithwhat does (dir seesaw.core) do?
20:11xadjustin_smith: just a sec...
20:12BronsaTIL about clojure.repl/dir
20:12Bronsa(inc justin_smith)
20:12lazybot⇒ 229
20:13xadjustin_smith: foo nil
20:14justin_smithxad: OK, (require 'seesaw.core :reload) and try the dir command again
20:14justin_smithit could be you accidentally created the namespace
20:14justin_smithand that would make use not work properly
20:15justin_smithespecially since the only def is "foo", that smells like "created a namespace by accident so the real one did not load"
20:15arrdemjustin_smith: pls 2 upgrade to lib-grim 0.9.1 so as not to pull in a bunch of unused clojurescript crap
20:15xadjustin_smith: foo nil again :(
20:16justin_smithxad: even after the :reload? do you shadow the seesaw.core namespace in your project?
20:16justin_smitharrdem: will do
20:17xadjustin_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:17justin_smithxad: 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:19xadjustin_smith: lol, wait a sec, I thing you pointed to the right direction..... I have my project named seesaw....... I feel stupid now......
20:20justin_smithxad: no, you aren't stupid, just new to the language and how things work here
20:21justin_smithxad: for future reference, it can be helpful to use a naming scheme like org.xad/seesaw which will prevent those conflicts
20:21xadjustin_smith: thanks a lot for the understanding, I'm trying a new project right now to check if it works
20:22justin_smithyou can specify a fully qualified project name in lein new
20:22justin_smith"lein new org.xad/seesaw" or whathaveyou
20:22justin_smithor whatever group should identify you
20:25xadjustin_smith: it worked! Thanks a lot Justin :)
20:26justin_smithglad to hear it
20:33cflemingBronsa: are you still here?
20:33Bronsacfleming: yep
20:34cflemingBronsa: IIRC you mentioned that using t.r, I can set the line/col for a form I'm evaluating, right?
20:34cflemingBronsa: this is for a CLJS REPL
20:35Bronsacfleming: kinda sorta, you can set the *starting* line/col index for a t.r reader
20:36cflemingBronsa: I think that's all I need. This is for the "Send top form from editor to REPL" action
20:37cflemingBronsa: 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:38Bronsacfleming: sure, you'll just have to invoke the reader-type ctor direclty rather than using the factory functions
20:38Bronsacfleming: e.g. https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader/reader_types.clj#L292
20:38Bronsareplace 1 1 with your desired line/col
20:39Bronsacfleming: it's implementation-detailish stuff but I can promise you any of that won't change anytime soon :)
20:40cflemingBronsa: 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:40cflemingBronsa: So unless CLJS load-file is fixed, that seems impossible.
20:41Bronsacfleming: yeah probably -- I haven't kept up to date with all the new cljs repl stuff though
20:42cflemingBronsa: 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:45dnolencfleming: what do you need exactly?
20:51cflemingdnolen: 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:52cflemingdnolen: The current hack in clj is to whitespace-pad the form into a file and then use load-file
20:52cflemingdnolen: My understanding is that that doesn't work in cljs because load-file doesn't return the results of the last form
20:53cflemingdnolen: 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:57dnolencfleming: cljs.repl can be supplied a :reader option
20:57dnolencfleming: so it seems to me if tools.reader support setLineColumn you'd be good to go
20:59cflemingdnolen: 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:00dnolencfleming: yeah a user doing that doesn't really make any sense anyway
21:00dnolenit's purely a tooling thing
21:00cflemingdnolen: Yeah, it needs interaction with the tool, right.
21:00cflemingdnolen: And it's still the case that load-file in cljs doesn't return the results of the last eval?
21:01cflemingdnolen: Actually, never mind - it doesn't help me anyway since I can't set the filename
21:01cflemingdnolen: Thanks
21:02dnolencfleming: 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:02cflemingdnolen: No, it's a hack, for sure.
21:02Bronsacfleming: 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:02Bronsagets*
21:04cflemingBronsa: 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:10dnolencfleming: 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:09joe124if i have a function (fn myfunc [& args] ) how do i rename the args to coll without using a let
22:17justin_smith,((fn [& [a b c]] c) 1 2 3 4 5 6)
22:17clojurebot3
22:17justin_smithjoe124: is that what you mean?
22:18joe124like putting all the input into one vector and calling it coll
22:18joe124btw is what you did called destructuring or something?
22:19justin_smith,((fn [& coll] coll) 1 2 3 4)
22:19clojurebot(1 2 3 4)
22:19justin_smithargs is just a conventional name, not a special one
22:19joe124oh lol
22:19joe124thanks
22:19justin_smithjoe124: yeah, that is called destructuring that I did above
22:42joe124justin_smith also how do i do default parameters for a function? like in python myfunc(a=5):
22:43joe124ive found that any recursive function i try to make would look much better with one
22:43joe124if i'm using acculumators for example
22:43TEttingerjoe124: you can define multiple arglists with defn or fn
22:44TEttinger,(defn basics ([] (basics "TEttinger")) ([name] (str "Hello, " name)))
22:44clojurebot#'sandbox/basics
22:44TEttinger,(basics)
22:44clojurebot"Hello, TEttinger"
22:44TEttinger,(basics joe124)
22:44clojurebot#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:44TEttinger,(basics "joe124")
22:44clojurebot"Hello, joe124"
22:45TEttinger,(def basics2 (fn hello ([] (hello "TEttinger")) ([name] (str "Hello, " name))))
22:45clojurebot#'sandbox/basics2
22:45TEttinger,(basics2 "joe124")
22:45clojurebot"Hello, joe124"
22:49joe124thank you Tettinger, also look at this is this cool or what https://gist.github.com/akbiggs/86f5bd96b7303b5c3882
22:49TEttingerthat's clever, nice work
22:49TEttingerthere are keyword args in clojure
22:50TEttingerbut they need to be defed into the fn to use them as such
22:50TEttinger(and I don't know about defaults)
22:51joe124yeah i didnt make that macro lol
23:25joe124can someone help me with my max number finding function http://pastebin.com/ZdB8VSC0
23:26amalloyjoe124: have you looked at how clojure.core/max is implemented?
23:31mavbozojoe124: you can create function with multiple arities
23:32joe124yes but if i'm taking in an undetermined amount of ints then they take up all my arities
23:34mavbozojoe124: oh, you want to implement max
23:34ShayanjmIf 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:36mavbozojoe124: have you tried destructuring the function args?
23:37joe124dont see how i could do that with an undetermined amount of arguments?
23:38mavbozojoe124: you want to accept 0 args too?
23:38joe124no
23:40mavbozo,((fn [& xs] xs) 1 2 3)
23:40clojurebot(1 2 3)
23:41mavbozo,((fn [x & xs] [x xs]) 1 2 3)
23:41clojurebot[1 (2 3)]
23:42joe124im following
23:42mavbozo,((fn [x & xs] [x xs]) 1)
23:42clojurebot[1 nil]
23:47arrdemClojure library you'd like to see on Grimoire? I'm taking suggestions.
23:48arrdemgoing by my analytics ClojureScript is top on that list, but more hacking is involved before that happens.
23:48cflemingarrdem: Yeah, cljs would be up there for sure.
23:48arrdemcurrently doing all of core.typed
23:49cflemingarrdem: Check the stats from the state of lein survey, they had data on most-used libraries - I'm guessing ring, compojure et al
23:56joe124is recursion ever neccesary or can any problem be solved my using apply and filter and other functions like that
23:56joe124by*
23:56joe124because recursion is hard for my brain
23:57mavbozojoe124: you can do recursion with loop
23:57xphillyxIs 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.