#clojure logs

2013-08-13

00:00callenbrehaut: definitely sold me on trying out Instaparse.
00:00nopromptPhil_D: what lib are you using to talk to Mongo?
00:00brehautcallen: i had success with instaparse on a little project recently; its certainly nice
00:01callenPhil_D: no but seriously, are you using Clang to integrate CLJS with Angular? Because if you aren't, I'm surprised your code is working.
00:01callenbrehaut: pros/cons, error messages?
00:02brehautcallen: error messages seem reasonable? i didnt dig into them much though; you get a 'failure' that tells you where and what it expected
00:02nopromptcallen: i had some trouble with clang. i kept getting weird error messages about add-watch or something.
00:02callenbrehaut: cool :)\
00:02brehautcallen: i need to try out its combinator notation
00:02callennoprompt: good to know.
00:02`cbpmaybe we could get some line info on the errors if we use that? it seems hard to add to selmer atm with the precompilation stuff. Also the errors could tell us which template it happened on :p
00:02brehautbefore i can fairly judge it
00:02nopromptcallen: maybe tomorrow i'll hit you up about it if you are around.
00:03callennoprompt: I will mostly be looking for a repro/github issue.
00:03callenfair warning
00:03nopromptcallen: i will mostly be sending you a gist.
00:03callenfine
00:04nopromptcallen: the customer is always right.
00:04Phil_Dnoprompt: I'm using Monger.
00:04Phil_Dcallen: I'm using purnam. It's killer: https://github.com/zcaudate/purnam
00:04callenPhil_D: nifty, thanks.
00:05Phil_Dcallen: It integrates seamlessly with Jasmine testing as well. I'm so happy it's around. :D
00:05callenthe jasmine testing bit is important.
00:05nopromptPhil_D: interesting. i use monger/cheshire in app at work and haven't run in to that problem. did you require monger.json, etc.?
00:06Phil_Dnoprompt: I was about to update everyone, actually. I was using cheshire.core and cheshire.generate instead of monger.json. My problem's solved now. :P
00:06nopromptPhil_D: good deal then. :)
00:07dnolenPhil_D: ;)
00:09Phil_DGotta run, everyone. Thanks for the help! I'll be around often. Clojure's been the most challenging programming language I've encountered, but the raw power (and I say power as in the way Darth Vader says it while clenching his fist) of it doesn't cease to blow my mind. I want to make it my goto language because it's totally expanded my way of thinking about programming.
00:12nopromptgetting close to a 1.0.0 for garden. gonna break some stuff and smash some things.
00:12callennoprompt: if you were being trolled, I'd be showing you my menagerie of macros.
00:13nopromptcallen: ever heard of autoit?
00:13nopromptcallen: don't google it, just say yes or no.
00:14callenit sounds familiar, don't recall precisely.
00:14callenWhy?
00:14clojurebothttp://clojure.org/rationale
00:14callen...thank you bot.
00:14Apage43callen: right now I'm just surfacing the standard instaparse error to the UI.
00:15dnolencore.async folks, what do you all think about take-until and siphon? http://gist.github.com/swannodette/6217767, seems like it could eliminate the redundancy from bhauman's post earlier today
00:15nopromptcallen: i guess some kid in a forum brought up this gist https://gist.github.com/noprompt/6106573 and apparently people were trying to use it from autoit.
00:15callenApage43: well, my point is that if the instaparse message is human friendly enough and comes with enough metadata, I could re-render that into a nice error page for my users.
00:15Apage43callen: https://www.youtube.com/watch?v=KIaoQhfpMPg video
00:15nopromptcallen: of course, it failed because they're trying to use a regular expression that's 1.5M.
00:16Apage43callen: it has quite a bit of metadata, so I could easily use it to build my own error message that was a bit friendlier
00:16callennoprompt: that is absurd.
00:16Apage43(or, end goal, highlight their error)
00:16callenApage43: oh yeah, that works for me.
00:16callennow I'm *REALLY* excited.
00:16nopromptcallen: yes. one even said it was hoax.
00:17nopromptah, "The Great Regular Expression Hoax of 2013", it'll go down in history.
00:19nopromptcallen: so i move in to my new house this month. you and Raynes should come visit me. we were supposed to have that bacon tournament of destiny or whatever.
00:19callenI mean, it's just breaking the words into parts and OR'ing into an existential qualifier for a population right?
00:19callenand conflating redundant cases
00:20nopromptcallen: pretty much. just a trie and a few functions for converting it in to a regex.
00:20Raynesnoprompt: I need to spend all my money on gas getting to Santa Barbara this month. Perhaps in a month or two I can hop up to Fresno.
00:20RaynesOr, near Fresno.
00:20RaynesWherever the hell you live.
00:20Raynes:p
00:20nopromptcallen: i still have a few more kinds to work out.
00:21callenI like that you turned the trie into something much slower.
00:21callenthe mark of a pro.
00:21nopromptcallen: but the regexes are good. they minimize backtracking and have efficient state tables under the hood.
00:22callenyou still turned a trie into a regex.
00:22nopromptcallen: well i had a good reason too.
00:22nopromptcallen: click the link under the "Why?" section.
00:23nopromptRaynes: yes, fresno. lol.
00:23callennoprompt: I liked ztellman's response to you on twitter.
00:23nopromptcallen: he responded to me on twitter?
00:24callenmaybe not directly, h/o
00:24callenhe responded to the regex
00:24nopromptlink?
00:24clojurebotunlink: and constantly is just a function that takes any arguments and returns whatever argument is given
00:24callennoprompt: https://twitter.com/ztellman/status/366721010982060032
00:25noprompthaha!
00:26callennoprompt: oh christ @ vimclojure
00:27noprompti need to follow these people.
00:27nopromptshit. i guess i need to open twitter more than once a week too.
00:27callennoprompt: Twitter for Clojurians is pretty great.
00:27Apage43buh
00:27Apage43the next part may or may not be fun
00:28nopromptcallen: yeah. i'm pretty proud of the work guns and i did on vims regex highlighting.
00:28Apage43which is resurrecting a Clojure <-> Erlang JInterface binding I wrote years ago
00:28nopromptcallen: i challenge you to find another syntax file for vim with a more thorough and accuate treatment of regular expressions.
00:29nopromptyou hear that? i *challenge* you.
00:30nopromptactually, it'd b awesome if that could some how get hooked up to clojure-mode.el.
00:30nopromptgood regex highlighting turns out to be pretty frak useful. *buh-dum-tsh*
00:30callennoprompt: o_O
00:30callenyou clearly have not seen my todo.txt backlog.
00:31callensorry, todo.org
00:31callenbecause I am a civilized human being
00:33nopromptcallen: is that in your dotfiles?
00:33callenno, but I guess it should be. not like it's private.
00:34noprompttodo lists... god i hate them.
00:35callennoprompt: I like having a list of nifty ideas to implement.
00:35callensome being more OSS focused, some more side projecty..
00:35callens/\.\./\./g
00:36nopromptcallen: i find the ideas i'm most interested in tend to stick in my mind and bug me until i do something about them. my todo lists always end up in the trash.
00:37callennoprompt: that's sorta true for the larger ones, but I have to evaluate and optimize how I spend my time on an ongoing baiss.
00:37noprompti'm a terrible person.
00:37callenbasis*
00:37omnisiscan someone help me transform a non tail recursive clojure function into a version that doesn't eat up the stack? Unfortunately, it's not a straightforward loop/recur issue?
00:37callenI have a lot of small and medium sized ideas that will help support larger ones later.
00:37nopromptcallen: oh, well there i agree with you. yeah, i tend to write stuff down when i've solidified what i want to do. it's much easier to manage at that point.
00:38callenI have maybe 2 or 3 long term goals that I'm not really well positioned to work on yet
00:38callenbut a lot of still very important and useful intermediate work that will support the later effort
00:38callenso I like to shuffle my todo list around in response to new data and what seems to have worked and not worked.
00:39nopromptomnisis: do you have gist?
00:39omnisisI have a pastebin here: http://pastebin.com/WM9gknX9
00:40omnisisthe fn is calc-max-value
00:41nopromptomnisis: one tip is use dec instead of (- i 1)
00:41noprompt,(doc dec)
00:41clojurebot"([x]); Returns a number one less than num. Does not auto-promote longs, will throw on overflow. See also: dec'"
00:41omnisisahh nice...that'll def make it easier to read
00:42omnisisthe main issue is that recursive calls are made early and used in following if exprs
00:45amalloyomnisis: this algorithm uses 2^n time and space, doesn't it? you can move that space from stack to heap, but it's not going to get fundamentally better
00:46omnisisso i tried to memoize it outside the fn, i think a better approach is to store the memo table in an accumulating paramter...it's a dynamic programming algorithm, it's suppossed to use space on the order of i*w
00:48omnisisthis was a quick hack at trying to translate an iterative solution into something vaguely functional..i am very new to clojure so it's prolly not very idiomatic
00:48amalloyomnisis: i think you'll find things easier if you don't try to do it tail-recursively but instead lazily
00:49amalloyproduce a lazy sequence of candidate solutions, and walk over them to find the best one
00:55TEttingeromnisis: is the goal of this code explained somewhere? I'm not sure what knapsack is, and I guess it is a vector of hashmaps?
00:56omnisispage 3 of this PDF has the orginal code: http://cse.unl.edu/~goddard/Courses/CSCE310J/Lectures/Lecture8-DynamicProgramming.pdf
00:57omnisisit essentially tries to build up a 2d array and then uses that array to find a solution to the problem
00:57omnisisthe code is basically a nested for loop that builds up a 2d structure
00:59omnisisi guess i could bust out a javaish 2d-array soln in clojure but i was trying to do it more functionally
01:00nopromptomnisis: do what makes your program work.
01:11TEttingeromnisis, the 2d array of all combinations of 2 items (including duplicates) could be done with ##(let [items [1 2 3 4 5 6 7]] (for [x items, y items] (str x ", " y " ")))
01:11lazybot⇒ ("1, 1 " "1, 2 " "1, 3 " "1, 4 " "1, 5 " "1, 6 " "1, 7 " "2, 1 " "2, 2 " "2, 3 " "2, 4 " "2, 5 " "2, 6 " "2, 7 " "3, 1 " "3, 2 " "3, 3 " "3, 4 " "3, 5 " "3, 6 " "3, 7 " "4, 1 " "4, 2 " "4, 3 " "4, 4 " "4, 5 " "4, 6 " "4, 7 " "5, 1 " "5, 2... https://www.refheap.com/17553
01:11TEttingerthat also shows you the order it would work in
01:12TEttingererr
01:13TEttingernot a 2d array, but you could make a similar structure with that. it does combine all rows and columns
01:14omnisissince the algo is basically just a nested for loop i think i can just use the for comprehension with the proper bounds
01:14omnisisgonna try this
01:14TEttingeromnisis, be advised, that could be the brute force solution? it might be the really slow version I suggested D:
01:16omnisisthe solution is basically O(i*w) which are the two parameters to the function....without memoizing the values its O(2^n)... in my case i and w will be small (hundreds at most) so it's okay
01:50TEttingeromnisis, I see a possible problem with the for comprehension approach -- I don't think it can look back
01:51omnisisi am using aset/aget with the for
01:51TEttingerI think the lazy seq solution may be better and more FP
01:51TEttingeragh
01:51omnisisyeah i know
01:51omnisis;-)
01:51TEttingerfor doesn't generate an array though
01:51TEttingerit generates a seq
01:52omnisisyou can do (make-array Integer/Type x y) in a let over the for
01:52TEttingeryeah, but... I guess that will let you read what you already wrote, since arrays are mutable...
01:52omnisiscode looks very imperative but it's tricky anyhow and I can't wrap my head around a completly fp solution with memoization right now
01:53TEttingeramalloy, which function does the lazy walking? I don't think I've used it
01:56omnisisyes arrays are very much mutable...i will say that the :let expression inside the for form is kinda nice...saves you from a nested let in the for
01:57TEttingerand you can use :when (>= W whatever weight is calculated)
01:57TEttingerthen if you know weight is higher than W you don't calculate the rest
02:00omnisisi saw that but the array mutation version has to do an aset no matter what ...
03:11nonubystruggling with good approach to allow nrepl based inspection without putting everything into globally accessible atoms
03:49nonubya better more/idiomatic way when dealing with a code that matches a pattern like this https://www.refheap.com/17556?
04:41TEttingernonuby, that's at least clear. anything with more functions would only obfuscate the odd bits, like the call to some-fn with one arg and another with 2
05:08mpenetanyone is having issues with eldoc arglist view in the minibuffer (it disapeared for me) using the latest nrepl?
05:38turbopapeis it possible to use a record as a function of its fields (and the other way around) or no ? I think this was not possible in older versions,... Am I right ?
05:40Anderkentturbopape: I think the only way to access records fields is with host access: (.field record-instance)
05:40Anderkentactually
05:41Anderkentturbopape: (:field-name record-instance) works too
05:43turbopapeAnderkent, Thank you. In deed, this was not possible in older versions.
05:44turbopapeI mean for (:field record)
06:18clgvturbopape: this was possible since at least 1.2
07:12shafirehi
07:24magmaghola, what is the 'goto' clojure css generator (im looking for something similar to sass)
07:26ordnungswidrigmagmag: what's wrong with sass?
07:26magmagnothing, i just like clojure
07:27supersymmagmag: garden is pretty nice
07:27supersymhttps://github.com/noprompt/garden
07:27magmagthank-you, I'll take a look
07:29ordnungswidrigah, garden looks nice
07:29magmagit does
07:29supersymI agree on the 'clojure for css part', I guess... wrote nice functions in stylus, doing sweet tricks, then realized I could do even more if I wasn't constrained by stylus JS :P
07:29ordnungswidrigah
07:30magmagi like stylus too
07:30magmagi just want something in clojure
07:30magmaggarden looks good
07:30supersymplus the fact that it had some serious bugs and obfuscated a whole bunch of stuff
07:30ordnungswidrigthat looks like fun: (+ 20 (c/hsl 0 0 0) 1 (c/rgb 255 0 0))
07:30ordnungswidrig=> #ff1515
07:30supersym:)
07:30ordnungswidrigparametric stylesheets!
07:30magmag:)
07:31supersymnoprompt also rewrote semantic.gs to garden for me :P
07:31supersymhttps://gist.github.com/noprompt/5873715
07:31magmagoooh
07:31magmagi like that
07:31supersymclj grid ;)
07:31supersymyeah its sweet
07:32ordnungswidriguuh
07:32ordnungswidrigcrazy shit
07:32magmaghaha
07:33supersymhehe, enjoy playtime
07:34antares__European Clojure folks: there will be an 2 day Clojure workshop in Munich in October, just 35 EUR/person. Please spread the word: https://twitter.com/ClojureWerkz/status/367239501388992512
07:38ordnungswidrig/whois antares__
07:38clgvantares__: the payment information is missing on the website clojureworkshop.de
07:39clgvantares_: ah it shows up under "register" ..
07:39antares__clgv: I asked someone who maintains the site to make it more visible
07:40shafiredo you program clojure with sublime?
07:41antares__ordnungswidrig: I am @michaelklishin everywhere :)
07:41shafireantares__: hotel costs?
07:42ordnungswidrigantares__: ah, my irc-xmpp gateway plays tricks on me
07:42antares__shafire: I don't think the organizers have any offerings for accommodation, so it's up to you
07:42antares__mid-October is not really a high season in Munich, though
07:43antares__I believe Oktoberfest is in late September, ending in early October
07:43shafireMotel One maybe :)
07:43shafireI read on the page that they use sublime, do you have any howto how they do that?
07:44clgvantares__: I spread the news in our working group ;)
07:45shafireIf anyone have a clojure job for me, I am happy to do it. anywhere in the world expect USA
07:45shafireexcept*
07:48openbotnetDoing (clojure.pprint/pprint (ns-map *ns*)) crashes emacs when run inside emacs nrepl session (created using M-x nrepl). It's not a problem in command line nrepl.
07:49antares__clgv: thank you!
07:51drguildocould somebody please explain why (re-find #"\\d+" "abc123def") is not returning any matches?
07:52ordnungswidrig,(re-find #"\d+" "abc123def")
07:52clojurebot"123"
07:54drguildosomething very strange is going on
07:54drguildoor i'm being very dumb
07:54drguildohttp://puu.sh/40WWS.png
07:55squidz_what is the best strategy to build a string url out of parts using clojure. I am using clojurescript so using libraries like ring probably aren't applicable
07:55drguildoi guess i pasted using an encoding it doesn't like?
07:58squidz_I though of using a cond/condp to test whether certain 'parts' of the url should be appended but there is some state needed to keep the previously added parts in the URL
08:00katratxosquidz_: https://github.com/cemerick/url ?
08:02squidz_katratxo: hm this is kind of a one time deal, so i'm not sure I need an additional library. I was looking more for a strategy on how to build it myself
08:04Anderkentsquidz_: if you don't need validation or anything.. just (URL. (apply str parts)) :P Otherwise pull in the library - it's trivial with lein
08:05squidz_Anderkent: yeah I just thought of the (apply str ....). Thanks
08:25AnderkentWhat's the easiest way to run a clojure 'script' - i.e. one main file with no dependencies except the core, prefferably without needing any scaffolding around it (no lein project etc)
08:27tbaldridgeAnderkent: use lein uberjar, and then java -jar jarfile.jar
08:28Anderkentthat means I need a project
08:28Anderkentlein-exec seems like what I want
08:35ziltiDoes someone in here use the most recent (as in marmalade-repo) versions of nrepl.el and auto-indent-mode? On my PC they refuse to work together
08:42AnderkentAnyone know a nice way of constructing multiline strings? If join was vararged, I could just do (join "\n" \n "First string line." \n "Second string line."), but it's not. Wrapping it in a vector looks awkward
08:43llasramAnderkent: What about?: ##(str "First line" \n "Second line" \n)
08:43lazybot⇒ "First linenSecond linen"
08:43llasramhah
08:44llasram&(str "First line" \newline "Second line" \newline)
08:44lazybot⇒ "First line\nSecond line\n"
08:44llasramYeah -- kind of verbose
08:45llasramAnderkent: Actually, what are you trying to do exactly? You can include literal newlines in strings
08:45AnderkentAs in multiline strings or just \n
08:45AnderkentI'm trying to write an usage string in a way that reads easily
08:45Anderkentboth in code and when printed out
08:46llasramAnd including a literal newline in the string doesn't achieve what you want?
08:47Anderkenthah. Didn't know that worked!
08:48ziltiDoes someone in here use the most recent (as in marmalade-repo) versions of nrepl.el and auto-indent-mode? On my PC they refuse to work together
08:49llasramzilti: Not using auto-indent-mode, I'm afraid
08:50ToxicFrogSo when I run 'lein repl' in a readonly directory, I get a two page stack trace about how it can't open/create target/repl-port
08:50ziltiOh no :( Are there alternatives? Not using any indentation-mode will drive me nuts...
08:50llasram?
08:50ToxicFrog(although it appears to work fine anyways)
08:50mdrogaliszilti: I recall auto-indent mode got yanked out of there.
08:50ToxicFrogShouldn't that go in /tmp, not .?
08:50mdrogaliszilti: I'm pretty sure I hacked it back in. :P
08:50llasramzilti: Is just using newline-and-indent or paredit-newline not enough?
08:51ziltiNewline-and-indent? Gotta try that.
08:51llasramIt's a builtin command
08:51ziltimdrogalis: Who fixed what where with auto-indent-mode?
08:51llasramUsually bound to C-j by default
08:52Anderkentllasram: geh, but with literal newlines the indentation gets messier. Guess I just need to def it at top level :P
08:52mdrogaliszilti: One moment. Searching for it.
08:52mdrogaliszilti: https://groups.google.com/forum/#!topic/clojure/YI4IfthcycU
08:52ziltillasram: Well, I got quite used to auto-indenting a whole block and stuff
08:52mdrogalisI literally put that line back in myself.
08:53llasramzilti: Are you using paredit? Just hit Meta-q within a form
08:53ziltimdrogalis: My problem is that having (require 'nrepl) somewhere in the code breaks C-y as soon as I open a file that loads auto-indent-mode, even if it is not a clojure file
08:54llasrammdrogalis: I believe zilti is talking about an externally packaged minor mode named `auto-indent-mode`
08:54ziltiyes, llasram
08:55ziltiThe point is that I use emacs for other stuff than just clojure, and auto-indent-mode has proven to be very reliable and to do everything the way I want it
08:56mdrogalisllasram & zilti: Ah, my bad. Sorry.
08:57llasramzilti: That's fair. I wasn't sure how experienced you were with Emacs -- I thought perhaps you were using auto-indent-mode because you didn't know about the whole C-m vs C-j (newline vs newline-and-indent) thing
08:58ziltillasram: Actually not that experienced, I know where to look stuff up when I need to know something, and I know some elisp, that's it :) I indeed didn't know about C-m / C-j.
08:58ziltiWell, I guess I'll be looking at some elisp source code this afternoon.
08:59llasramBest of luck to you
09:01ziltillasram: Thanks, I'll need it
09:02ToxicFrogOH what the hell is this, I've got like a dozen empty target/classes directories lying around the system from my habit of running 'lein repl' when I want a clojure REPL
09:03AnderkentToxicFrog: I know your pain :(
09:04clgvAnderkent: ToxicFrog: file an issue?
09:05AnderkentI think the right solution is to get it to run via nailgun somehow :P
09:05hyPiRionoh, the target directory is back? Dang.
09:05Anderkentclgv: too shy! :P
09:05Anderkent(also usually I notice it, groan, then forget about it immediately)
09:05hyPiRionRight. That little bugger managed to get back in.
09:05ToxicFrogHmm. Looks like it gets it from (defaults :target-path) in leiningen/core/project.clj
09:06ToxicFrogWhich is "target/%s"
09:06ToxicFrogSo if you run it without a project.clj, it cheerfully vomits stuff all over .
09:06ToxicFroghyPiRion: it was out at some point?
09:07hyPiRionToxicFrog: it happened before, then it was fixed. I can reproduce, so it's obviously back now
09:07Anderkentbisect to the rescue!
09:07hyPiRionI think I already know how to fix it.
09:08Anderkentoh well. Move on, bisect, nothing to see here.
09:08ToxicFrogAwesome
09:08hyPiRionleiningen.core.main generates an empty project, if one can make an empty/nil :target-path, it should be resolved
09:09hyPiRionotherwise it takes the default "target/%s" one
09:09hyPiRionanyhow I'll put up an issue, so I don't forget it
09:10ToxicFrogThanks.
09:11hyPiRionToxicFrog: wait, you're on 2.3.1?
09:11hyPiRioncheck if it's fixed there. It seems like it is.
09:12ToxicFrog2.1.2, which is what "lein upgrade" gave me yesterday.
09:12mdrogalisIs it possible to solve things like Puzzle #1 with logic programming? http://www.brainbashers.com/showpuzzles.asp?formpost=Y&amp;field=ctop10a&amp;page=1&amp;puzzletext=A
09:13mdrogalisIt seems like the uniqueness constraint is problematic, maybe.
09:13hyPiRionYeah, we fixed some a critical bug in 2.3.0 yesterday, so `lein upgrade 2.3.1` should give you the latest
09:13hyPiRion("we" meaning technomancy and not me)
09:14ToxicFrogSuccess! Tahnks.
09:14hyPiRiongreat!
09:14ordnungswidrighypirion: just make sure the access rights to the download location are correct :)
09:15hyPiRionordnungswidrig: haha, we're doing "pairing" to ensure that doesn't happen again
09:16hyPiRionAmazing how much trouble you can produce with some wrongly configured ACL.
09:20xeqiyep, beware as I now know how to make a lein release
09:20hyPiRionThat's good though. Imagine if Phil was hit by a bus and noone could release an official Leiningen version again, ever.
09:21Anderkent./script/release ? :P
09:21Anderkentone can dream ^^
09:21xeqiAnderkent: mostly right
09:21xeqi+/- performance testing, and correct credentials
09:22xeqioh, and news updates
09:24ziltiI "fixed" auto-indent-mode. I just commented out the code that modifies yank and yank-pop.
09:24hyPiRionBut you didn't learn the hardest part: how to get back to snapshot.
09:25ToxicFrogWhat is the naming convention for clojure applications? ca.ancilla.appname, or just appname?
09:25Anderkentappname usually
09:25xeqiToxicFrog: there are people in both camps
09:25ToxicFrogI know libraries are meant to be fully qualified, not sure about apps.
09:26AnderkentToxicFrog: if you feel like you need to fully qualify, you can use the groupname. But it's common practice to just have the groupname and artifact names be 'appname'
09:26ToxicFrogAlright.
09:27Anderkentmost clojure libs use that convention, which is why you can just say [clj-time "version"] instead of [clj-time/clj-time "version"] in lein project config
09:27Anderkentgood lucl :)
09:27Anderkent*luck
09:29ToxicFrogAnderkent: just having an http library that supports multipart/form-encoded POST will make it a lot cleaner~
09:32Anderkentuhoh. Welcome to logging hell :P
09:39ambrosebscore.typed now accepts var annotations in `def` metadata. This may please some of you https://groups.google.com/forum/?fromgroups#!topic/clojure-core-typed/qM4Fc1Quqd0
09:40mpenetvery nice
09:42ambrosebsIf there is anywhere else you'd like to squeeze annotations into metadata, I'm all ears.
10:04Ember-hmm, I have a strange problem.
10:04Ember-trying out clojurescript for the very first time and for some strange reason my dependencies don't end up as part of the generated javascript file
10:05Ember-leiningen finds the dependency, downloads it no problemo and the clojurescript build succeeds
10:05Ember-but when it is ran I get an error from google closure require
10:06Ember-and just checked the (gigantic) javascript and there's no such library
10:10cmdrdatshey guys, is there a way to destructure metadata out? something like: (let [^{foo :foo} {bar :bar} ^{:foo 1} {:bar 2}] (str foo ":" bar))
10:10dnolenEmber-: what library are you trying to use?
10:11Ember-dnolen: domina
10:11Ember-I did everything the way I'd do it with Clojure
10:12Ember-so, am I missing some critical stage or what?
10:12dnolenEmber-: paste your namespace form.
10:13hyPiRioncmdrdats: Closest I can imagine is ##(let [input ^{:foo :bar} {:a 1}] (let [{a :a} input, {foo :foo} (meta input)] (str foo \: a)))
10:13lazybot⇒ ":1"
10:13hyPiRionhrmph.
10:13hyPiRionwell, you get the idea
10:13Ember-dnolen: https://www.refheap.com/3f82cd9888aba9845384a1d4b
10:14ziltiEmber-: :use-macros, not :use, sel is a macro
10:14cmdrdatshypirion: thanks - I thought I'd have to (meta)
10:14Ember-and oops, todoapp.cljs, not .clj
10:14Ember-zilti: oh, that explains it
10:15asalehhi, I seem to have problem \w traversing xml-zip with clojure.zip/next
10:15jtoyhi
10:15ziltiBtw, you probably want to use dommy instead of domina? Last time I looked it seemed that dommy is the successor.
10:16dnolenzilti: they are unrelated similar libs as far as I know
10:17Ember-no, it's not a macro but it's domina.css namespace
10:17Ember-it seems
10:17ziltiEmber-: Hmm ok. I guess I mixed it up with dommy's sel then
10:18ziltiOh wow. My post about clojurescript testing got 2.3k views... Impressive.
10:18Ember-and stuff started to work
10:18Ember-nice, thanks
10:19Ember-I'm suprised the build didn't complain though
10:20ziltiEmber- not even a warning?
10:20asalehI try to use clojure.zip/next to traverse my xml tree (of a parsed html page), but instead of sequence of visited nodes {:tag :span, :attrs {:id "experimental_indicator"}, :content ["\nexperimental\n"]} -> :span -> {:id "experimental_indicator"} -> ["\nexperimental\n"] ... I only get ... {:tag :span, :attrs {:id "experimental_indicator"}, :content ["\nexperimental\n"]} -> "\nexperimental\n" ... any hints how to fix this?
10:20clgvzilti: link?
10:20Ember-zilti: nothing
10:20Ember-"Successfully compiled" and so forth
10:20zilticlgv: https://coderwall.com/p/-sawaa
10:21ziltiEmber- That's kinda weird. I usually get a warning that I'm using an undeclared function/var when I'm missing an import
10:21ziltiI guess since it was part of the ns form that was enough for it not to notice
10:22Ember-yeah, I guess so
10:22Ember-so I just happened to stumble in a rare landmine with my first ever clojurescript import
10:22tbaldridgezilti: Ember-: the cljs compiler only looks at a single ns
10:22Ember-:)
10:22tbaldridgeso if you say (:require [foo.bar :refer [baz]]) it won't complain when you use baz
10:23Ember-even if baz doesn't exist in the first place in foo.bar?
10:23tbaldridgethe compiler basically says "errmmmm....okay, you said baz comes from foo.bar so if it's not there, that's your bad.
10:23ziltiyes, that's what I meant. If it's in the ns form, it doesn't complain, even if it refers into nothingness
10:23tbaldridgeyep
10:23Ember-that sucks
10:23tbaldridgethe CLJS compiler operates on single files
10:23tbaldridgenow you should have seen an error in your JS console
10:23tbaldridgein the browser
10:23Ember-I did see it
10:23ziltiOnly happened once to me, though. Took me half an hour to figure out
10:24Ember-oh well, life goes on and so forth
10:24Ember-good to know that one though
10:24tbaldridgeOne of the good things about doing it that way though, is that stuff like lein cljsbuild auto is super fast. Some of my stuff compiles in < 1sec
10:24tbaldridgeafter the compiler's jit is warmed up
10:25ziltiIt's impressive how fast it is even for the initial build, considering how many thousand lines of js code it has to write
10:26Ember-tbaldridge: yeah, I kinda guessed already why it is the way it is
10:30dnolenTimMc: tbaldridge: that's a bug and I made a ticket for it a while back
10:30dnolenEmber-: oops that was for you ^
10:31dnolenwe actually analyze all required libs first otherwise we can optimize calls - easy to confirm that :refers exists
10:31dnolen"otherwise we cannot optimize calls"
10:31tbaldridgeeh, cool, learn something new every day
10:32dnolentbaldridge: yeah I added dependency analysis back when I optimized function invokes
10:35jasonbrayI'm writing a function that instantiates a protocol buffer from a clojure map, with the possibility of nested maps should there be nested messages in the protocol buffer. I need to use reflection to instantiate the nested message builders, as I don't know what the classes will be at runtime. I can inspect the protocol buffer type to find the name of the message, but all it gives me is the inner classname of the message.
10:35jasonbray It appears that you need to use outer$inner semantics with clojure.lang.Reflector/invokeStaticMethod - any thoughts on how I can pull this off? A user of the function will import the required classes, but afaik there is no way to make an inner classname "first class" in import.
10:47llasramjasonbray: Why do you need to make it "first class"? The actual JVM class name of the inner class is `outer$inner`
10:48jasonbrayit's almost like I need an :as on import.. it seems so hokey regardless
10:48ziltiWhat is the core.logic equivalent of minikanren's _ lvar?
10:48llasramjasonbray: You can always `def` vars which hold Class objects
10:51jasonbrayllasram thanks, perhaps I'll go that route.. every solution seems to smell a bit bad, but it may be the nature of the beast
10:52llasramjasonbray: There might be a better solution though... Do you have more details on what you're trying to do at a higher level? If this is iterop between protobuf gen'd classes and Cljure maps, why do users ever need to see the classes?
10:53wakeup``Hi all, is there a lein plugin that gives me a task for compiling
10:53wakeup``HTML documentation based on my docstrings?
10:53llasramjasonbray: Or if you're not completely tied to protobufs, you might consider Avro instead :-D https://github.com/damballa/abracad
10:53hyPiRionwakeup``: yes, it's named codox
10:53hyPiRion$google weavejester codox
10:53lazybot[weavejester/codox · GitHub] https://github.com/weavejester/codox
10:53ziltiwakeup`` there's more than one. https://github.com/technomancy/leiningen/wiki/Plugins#documentation
10:54ziltiwakeup`` Though I don't think that list is complete, e.g. codox isn't on that list
10:54wakeup``which would you recommend?
10:55jasonbrayllasram love the embedded schema in avro, probably much easier to use here.. I'm introducing clojure into an existing architecture and atm trying to create a data simulator
10:55jasonbrayllasram have to step away, thanks for the convo
10:55wakeup``zilti: I would prefer something as minimal as possible.
10:56hyPiRionzilti: heh, I added it in.
10:56marshalizationHas anyone tried using Clojure for stock simulations? Encounter a blogpost on use Clojure for simulation and found it interesting
10:57ziltiI'm a fan of marginalia, though it's a little unconventional (Shows 2 columns, documentation on the left and code on the right). Codox is nice and minimal too
10:57ziltiwakeup`` ^^
10:58ziltiwakeup`` Marginalia looks like this: http://fogus.github.io/marginalia/ Codox looks like this: http://weavejester.github.io/compojure/
10:59wakeup``zilti: both awful imho, trying lein-html5-docs right now
11:00wakeup``http://mr.gy/software/riff-wave/api.html <- this is my taste ;)
11:01ziltiwakeup`` really? Not exactly mine, but to each his own
11:02wakeup``true
11:02ziltiwakeup`` has this been generated with lein-html5-docs?
11:02wakeup``no
11:02wakeup``this is my own CL doc util
11:06wakeup``when I do 'lein licenses' I get: clojure-complete - 0.2.3 - Unknown
11:06wakeup``Any ideas what that is?
11:07ziltiWhat is the core.logic equivalent of minikanren's _ lvar?
11:07llasramwakeup``: What the dependency is, or what it's license is?
11:08wakeup``llasram: Both?
11:09llasramwakeup``: It's a dependency Leiningen injects for completion in REPLs. Not sure why it's leaking at that point though -- what version of Leiningen are you using?
11:09llasramwakeup``: And looks to be EPL: https://github.com/ninjudd/clojure-complete/blob/master/LICENSE
11:09wakeup``thank you
11:10kastermazilti: https://github.com/clojure/core.logic/search?q=lvar%3F&amp;ref=cmdform suggests maybe it is lvar?
11:10wakeup``llasram: Leiningen 2.2.0 on Java 1.7.0_25 Java HotSpot(TM) Client VM
11:11hyPiRionmost likely is it peeking on the dev dependencies too, for some reason.
11:12ziltikasterma: You misunderstood me. In minikanren there's _ which does essentially the same as _ in clojure argument vectors: It just states "it doesn't matter what's here".
11:14kastermazilti: I see a fair number of _ in my core.logic files. What makes you think that doesn't work?
11:15tbaldridgekasterma: _ in logic programs is way different from _ in functional code
11:15tbaldridgeif you used _ you'd have to bind it to something, and if you bound it to a fresh lvar it would unify all the uses of _
11:16ziltikasterma: The "CompilerException java.lang.RuntimeException: Unable to resolve symbol: _ in this context" message
11:16kastermaI guess my use is in matching. Maybe ask in #minikanren.
11:16tbaldridgejust ping dnolen
11:16ziltidnolen: ping
11:17ziltiIt anyway seems that there's not much documentation for both minikanren and core.logic :(
11:18dnolenzilti: paste
11:18dnolenzilti: _ is not really the same as in Clojure
11:19dnolenclose but not quite
11:19ziltidnolen: I tried to write this: (& q ["When" | _]) in clojure
11:19ziltiI understand that it's not exactly the same
11:19ziltidnolen: I'm working through http://www.intensivesystems.net/tutorials/logic_prog.html
11:20dnolenzilti: yeah that's not miniKanren, that another miniKanren port, mK doesn't have _
11:20clojurebothelphelp |is| <reply>A bug report (or other request for help) |has| three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it is awfully hard to help you.
11:20dnolenzilti: if you need _, just use (lvar)
11:20dnolenzilti: or use tools.macros.symbol-macrolet
11:20ziltidnolen thanks!
11:21dnolenbbiab
11:21zilti(inc dnolen)
11:21lazybot⇒ 12
11:23ziltidnolen Do you by any chance know other minikanren tutorials?
11:27degcemerick: you back online?
11:57wakeup``So I have built a jar using uberjar, how do I run it with command line arguments?
11:58mpenetjava -jar foo.jar
11:58wakeup``and the arguments go where?
11:58mpenetjava -jar foo.jar x y z I think for the args
11:58mpenetwell I am sure actually
12:00TimMc(dec /usr/bin/java)
12:00lazybot⇒ -1
12:01wakeup``good
12:01TimMcI mean, it's the right answer here, but it doesn't seem to have a way of saying "OK none of the remaining args are options to me"
12:02mpenetthere was a contrib lib for that
12:02mpenettools.cli or something
12:02mpenetunless I am misunderstanding what you mean
12:03dnolenzilti: there's a few on the core.logic wiki
12:04dnolenzilti: also worth picking up a copy of The Reasoned Schemer
12:04noncomi have a collection "coll", what is the fastest way to realize a many-to-many relationship within that collection? in particular what is the best way to avoid self-crossing for every element?
12:04noncomsay, the collection is of type []
12:10justin_smithI see a weird nrepl bug, both using the latest git and marmalade, in the ubuntu emacs version and built from the latest gnu.org source
12:10justin_smithI connect via M-x nrepl and I just get an empty window with no prompt
12:11justin_smithit gives me a "connected" message in the minibuffer but sends nothing I type to the repl
12:11llasramnoncom: Can you give a more complete example?
12:12upwardindexIf I include my js compiled file in the <head> nrepl won't work but if I include it in <body> it does, huh?
12:12upwardindexbrepl sorry
12:14justin_smithif I try to evaluate a region via nrepl I get "wrong type argument, stringp, nil" but no elisp stack trace (I have debug-on-error turned on for elisp)
12:15noncomllasram: here is my current code: https://www.refheap.com/17583
12:15noncomllasram: now i wonder for speed and footprint optimisations
12:17mmitchellanyone know if it's possible to create a route (using compojure) that responds only to https?
12:17dnolenupwardindex: we follow the Closure notion that putting stuff in head just slows down loading the page.
12:19noncomllasram: at the end i want to have a collection of collections of results of interaction of every element of the original collection with every other element of that collection... maybe that sounds stray, but the idea is very simple and found everywhere.. i'm sure you know
12:19upwardindexdnolen: oh, I wasn't aware of that, many sites mention to put code in head for various reasons. Is the end of body the right place to import my js?
12:20Fer`noncom: does the order of the arguments matter?
12:20dnolenupwardindex: yes, putting stuff in the foot is just as common as the head
12:20noncomFer`: no
12:20Fer`noncom: like (f c1 c2) != (f c2 c1) ?
12:20llasramnoncom: Then I don't really see how you can do any better than what you already have
12:21upwardindexdnolen: thank you!
12:21noncomFer`: oh that may matter sometimes. there can be two kinds of cases i think... depends on f. i could pick the right one each time if that would speed up things some
12:21llasramO(n^2), but if that's your requirement....
12:21Fer`noncom: you could at least make sure your collections are sets
12:21Fer`and use disj instead of filter
12:22noncomFer`: they are sets for sure
12:22noncomso i better use #{} instead of []?
12:23noncomllasram: i thought that (filter) may slow down things and maybe tehre is a more effective way for that stuff... ? sure maybe not..
12:23Fer`you should reduce + conj over a set instead of mapv
12:23Fer`noncom: (disj my-set c) is better than (filter #(not= c %) coll)
12:25noncomFer`: so it is a general recommendation to use sets where possible? like i have a particles simulation which calculates forces of interaction, and the particles are always unique
12:25Fer`noncom: if you're doing relational algebra it's best to use sets
12:25Fer`noncom: if you know theyre unique then yeah use sets
12:26noncomFer`: cool! do you know about costs of vector->set and set->vector transformations?
12:26noncomjust thought i ask you if you know..
12:27Fer`noncom: i think its constant time
12:27noncomok then! thanks, people!
12:28llasramIt's O(n)
12:28Fer`oh
12:29noncomwell, anyway, it is good to know..
12:41seangroveIs there a quick way to map slurp over all files in a directory?
12:42TimMc(map slurp (.listFiles d)) or whatever isn't good enough?
12:43seangroveYeah, that works well, I was trying to use file-seq, but that included the directory itself
12:43seangroveThanks TimMc
12:44TimMcI don't know what your needs are regarding symlink and directory exclusion, or ordering.
12:45seangroveNothing in particular, .listFiles works well enough for this toy project
12:45wakeup``So I am building a standalone jar using lein uberjar, I am using clojure.tools.logging with log4j. I am wondering how I can make log4j output the logs to *err*.
12:45wakeup``any ideas?
12:47justin_smithwakeup``: there is some magic xml config file, iirc. There is clj-logging-config or something like that for specifying log behavior from clojure code, but I found it flaky
12:48wakeup``-.-
12:48justin_smithI gave up on java logging libs because I don't like configuring with xml files
12:49wakeup``Alternative tools.logging backends?
12:49justin_smithhttps://github.com/ptaoussanis/timbre
12:50justin_smitheven has an irc appender (log to an irc channel)
12:52tbaldridgewakeup``: I also like pedestal's logger: https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/service/log.clj
12:52tbaldridgeit stores logs as hashmaps, so post-processing of logs is super easy
12:52tbaldridgeand it's macro based, so you can re-compile without logging and all the log exprs are removed from the code.
12:53hiredmanwakeup``: the thing is, how many times do you reconfiguring your logging backend?
12:53wakeup``timbre looks promising
12:53wakeup``I need runtime configurable logging to file
12:55wakeup``btw, is there something like with-input-from-string in clojure?
12:55wakeup``would save my ass right now
12:56tbaldridgehttp://clojuredocs.org/clojure_core/clojure.core/with-in-str
12:56justin_smith,(with-in-str "1" (read))
12:56clojurebot1
12:56wakeup``thank you!
12:57glosoli`(books)
12:57glosoliis there some sort of list of books ? :D
13:03noncomhow do i do something for all elems of a set? like (map) for vectors?
13:03justin_smithglosoli: http://clojure.org/books
13:03justin_smithnoncom: you can map on a set
13:04noncomoh thanks
13:04justin_smith,(map (partial + 2) #{0 1 3})
13:04clojurebot(2 3 5)
13:04shafire,(map (partial * 3) #{0 1 3})
13:04clojurebot(0 3 9)
13:05shafire,(map (partial ** 2) #{0 1 3})
13:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ** in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:05justin_smithof course, input being a set, the order is arbitrary
13:05shafire,(map (partial ^ 2) #{0 1 3})
13:05clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Metadata must be Symbol,Keyword,String or Map>
13:06justin_smith(defn ** [x y] (Math/pow x y))
13:06justin_smithclojurebot won't let you defn, but anyway
13:09justin_smithto get multi-arity the way you get with other clojure math functions: (defn ** [arg & args] (reduce #(Math/pow %1 %2) arg args))
13:11noncomis disj on sets constant-time?
13:12hyPiRionnoncom: almost constant-time
13:12hyPiRionlog32 n
13:12hyPiRionthat's for hash-sets though. For sorted-sets, that may be log n only.
13:13rkneufeldtbaldridge: we've actually run into some trouble with the way the current logger is written. It's really difficult to programmatically do certain things with it.
13:13justin_smith,(do (time (disj (set (range 1000)) 88)) nil)
13:13clojurebot"Elapsed time: 5.764852 msecs"\n
13:13justin_smith,(do (time (disj (set (range 10000)) 88)) nil)
13:13clojurebot"Elapsed time: 18.555542 msecs"\n
13:14justin_smithetc.
13:14noncomright
13:15tbaldridgerkneufeld: I know, but I still prefer the syntax/output to any other logger I've used. :-P
13:15rkneufeldtbaldridge: I'm interested in playing with Timbre <https://github.com/ptaoussanis/timbre&gt;
13:15justin_smithnoncom: though I guess that does not account for the extra time for making the larger and larger sets
13:16noncombut that'd work ok with pre-made sets
13:16justin_smithyeah
13:24silasdavishow can I dispatch on the value of a destructured list
13:24silasdavislike
13:25silasdavis(fn ([[x & xs] tail) ([[x & nil]] "foo"))
13:25silasdavisI know that doesn't work, but if I had pattern matching I might do it that way
13:25silasdavisI'm just trying to return a base case for a list of a single element
13:25dnolennot possible
13:26silasdavisso how would you achieve the same effect in clojure
13:26dnolensilasdavis: I've been hoping someone would add fn support to core.match, but it would need to be comprehensive
13:26Fer`no pattern matching in here :P
13:26silasdaviswhat would be the idiomatic way to return a base case in a a recursive function then, just put an if in?
13:26dnolensilasdavis: it cannot be done at the fn level in Clojure out of the box, you could augment core.match to do this.
13:27dnolensilasdavis: you can of course do that easily inside of your fn body w/ core.match
13:27dnolentoday
13:28silasdavisok thanks
13:29ziltisilasdavis: you could also use multimethods
13:32tbaldridgebbloom: I think what Eff is doing is possible with the core.async IOC macros. I'm going to think on this one for a bit, but I like the design
13:34bbloomtbaldridge: yeah, i'm experimenting with it. i've got two sets of terminators for two mutually recursive state machines: the handlers & a "computation"
13:34bbloomthe handlers have 'continue and :Return, and the computations have 'effect, 'value, and :Return
13:35bbloomthe processes will be mutually recursive with a pair of state machine stacks
13:35bbloomtrying to figure out how to get that to work nicely
13:35tbaldridgebbloom: yeah and I think with a few small changes to the ioc macros we could make that tied to var metadata, so it would know that <! is a member of a handler.
13:35bbloomi want to implement most/all of the examples in the paper, just as a proof of concept
13:36bbloomtbaldridge: yeah, i haven't thought that far yet. my plan was to just have a general purpose "effect" function with a keyword arg, like (effect c :decide)
13:36bbloomat least for the first attempt
13:36tbaldridgeyeah, that's the way it should be for a POC
13:37bbloomi'll make some progress on it today & then push that up to github & add you as a contributor :-)
13:39callenRaynes: that mailing list really makes me appreciate Clojure.
13:39m0smithmorning, anyone familiar with nrepl-inspect?
13:44shiranaihitoshould i worry about these: "Reflection warning, ring/util/response.clj:95:15 - reference to field getFile can't be resolved." .. ?
13:44shiranaihito(a warning from Lein)
13:44technomancyshiranaihito: not unless your profiling
13:44tbaldridgeshiranaihito: in the rare case, no. It's a fairly massive perf loss, but if you only call that fn once every 10 minutes you may not care
13:45tbaldridgein the rare case = when you rarely call the fn
13:45shiranaihitohm..
13:45technomancyarg; you're
13:45shiranaihitowell, how do i know which of those warnings are a problem? you seem to be saying the idea is that reflection is slow (is it, anymore?), and that might be a problem?
13:46shiranaihitoit's been a while since i was up-to-date with Java
13:46shiranaihitobut iirc reflection stopped being a perf problem at some point.. ? :)
13:46technomancyshiranaihito: is your code unacceptably slow?
13:47shiranaihitotechnomancy: nah.. i'm just trying to get to grips with clojure.. just starting out, basically..
13:47shiranaihitoi've just run "lein deps"
13:47technomancycool; you should probably turn off reflection warnings then
13:47shiranaihitooh erm.. "lein run", actually
13:47shiranaihitook
13:47shiranaihitoso there's a warning any time reflection is done?
13:48technomancyany time you compile code that will result in reflection when run iirc
13:48technomancyif you have the warnings turned on
13:48shiranaihitowell then.. time for the next mystery.. why does "lein run" work fine, but "lein uberjar" crashes with: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)" ?
13:48shiranaihitoalright, i'll turn the warnings off
13:49shiranaihitodo i need to set "aot" on or something.. or is that a thing of the past?
13:50tbaldridgeshiranaihito: you need to typehint some args/locals to get rid of the reflection warning.
13:50technomancyuberjars need :aot :all and :main my.namespace in project.clj, and (:gen-class) in the ns form of the main namspace
13:50shiranaihitotbaldridge: well, ring is not my code, so i probably shouldn't fiddle with it
13:50technomancyyeah, don't get rid of the reflection
13:50Anderkenttechnomancy: what? why do you need :aot :all for uberjars? Clojure can compile .clj files from jars no problem
13:51technomancyAnderkent: eh; it's not strictly needed, but still a good idea
13:52shiranaihitotechnomancy: but i read somewhere that using "aot" is somehow a bad idea or whatever..
13:52Anderkentshiranaihito: if you're doing :aot :all on a larger project, you probably want to build on a ramdisk. My aot-compilation went from 3 minutes to 0.5s just by putting target/classes under /dev/shm
13:52technomancyshiranaihito: it's a bad idea for libraries. it's a great idea for uberjars
13:52TimMc~aot
13:52clojurebothttp://i.qkme.me/3vb225.jpg
13:52technomancyactually... try this: :profiles {:uberjar {:aot :all}}
13:52TimMc^ how I explain all transient weird bugs
13:53Anderkent:D
13:53shiranaihitoTimMc: that aot stuff causes weird bugs?
13:53Anderkentsometimes
13:53Anderkentesp with protocols and other deftypes
13:53callentechnomancy: what did you use to generate Racket binaries? Raco?
13:53technomancycallen: yeah
13:54shiranaihitothis stuff is making me a bit hesitant to use clojure for real :/
13:54TimMcshiranaihito: Just avoid AOT. :-)
13:54Anderkentshiranaihito: it's all stuff that you don't need most of the time
13:54shiranaihitoTimMc: but i need it on for the uberjar.. ? :p
13:54shiranaihitouberjar seems handy for deployments
13:54Anderkentno you shouldn't. I think that's not your problem with uberjar
13:54technomancyif you put it in the :uberjar profile you'll only have it when producing the uberjar but it won't affect development
13:54TimMcshiranaihito: Take a look at lein-otf.
13:54AnderkentI think your :main declaration is not correct :P
13:55darth10ok a really noob question ... but why do i get "FileNotFoundException Could not locate incanter__init.class or incanter.clj on classpath: clojure.lang.RT.load (RT.java:443)" when i load a file that uses incanter in emacs?
13:55shiranaihitothough a several megabyte jar with various commons-whatever.jar turdnuggets is somewhat disgusting
13:55technomancyif you're using lein 2.3.1 the AOT classes will be completely isolated
13:55Anderkentshiranaihito: try a 70mb jar :D
13:55darth10i saw the github issue .. this issue was fixed LONG ago too >.<
13:55shiranaihitoAnderkent: yeah.. yuck.. :(
13:55TimMcshiranaihito: AOT mostly interacts badly with 1) interactive development, and 2) advanced langauge features that involve bytecode generation.
13:55shiranaihitotechnomancy: isolated? does that mean "AOT" is no longer a problem? :P
13:56technomancyshiranaihito: yeah
13:56Anderkentit's ok, the worst thing that can happen is that heroku doesn't clean the git repo we use for deploy.. .Oh wait.
13:56Anderkent(heroku-push to the rescue :P)
13:56TimMctechnomancy: Non-transitive AOT? Can this be true?
13:56shiranaihitotechnomancy: well, i've got 2.2.0 now
13:56Anderkenttechnomancy: non-transitive aot is in?
13:56technomancyTimMc: not non-transitive, just isolated from everyday work
13:56Anderkentah.
13:56TimMcOh.
13:56technomancyeach profile gets its own :target-path
13:57shiranaihitowhat exactly are "profiles" in lein, btw?
13:57technomancyso it's impossible for dev/user deps to affect uberjars, and it's impossible for uberjar AOT to affect development
13:57Anderkentshiranaihito: config changes that are applied conditionally
13:57shiranaihitoi'm imagining something like.. "settings bundles" or ..
13:57shiranaihitohmm
13:57Anderkentthe :dev profile is active (i.e. merged into main config) when you're doing stuff like test, but not when you're packaging, etc.
13:57technomancyshiranaihito: your project is a map. profiles are just other maps that get merged in for certain situations
13:58shiranaihitoand judging by your ":profiles {:uberjar {:aot :all}}".. a profile is chosen based on the lein "target" or "command", like "uberjar" etc.. ?
13:58technomancyshiranaihito: yeah, exactly
13:59technomancyonly applied when generating uberjars
13:59callentechnomancy: http://learnxinyminutes.com/ this needs OCaml :)
13:59technomancycallen: not bad
14:00seangroveWhat's the cleanest way of turning this blob of text into a hashmap with lower-cased keywords as keys? https://www.refheap.com/f16c60dba32f407cc5d0fc3fa
14:00technomancyshiranaihito: if you want the extended edition you can run `lein help profiles` but it'd probably be more fun to just smile and nod and get to the coding
14:00shiranaihito:P:P
14:00shiranaihitoyeah well.. i've been getting a bit worried that clojure might be too complicated
14:01callenseangrove: split-by separator, split each subsection by :, sequence of left and right hand seqs into map.
14:01callenoh and string/lower the left-hand side before (keyword ...)
14:01Anderkent(and get confused when there's a : in X-Folder ;D)
14:01technomancyshiranaihito: compiling is complicated. you can use tools that hide it from you, or you can have transparency.
14:01callenAnderkent: not my fault his format is fucked.
14:01darth10shiranaihito: well the road is long :) but the truth is that clojure is in fact one of the most simple langauages out there
14:01technomancythat is to say, deployment is complicated
14:02m0smithI have been trying to get nrepl-inspect to work in emacs and I just get a blank buffer. Any ideas?
14:02darth10ugh... redundancy
14:02shiranaihitotechnomancy: say i've got a "main.clj" in a directory called "application".. do i then put "(ns application.main .." inside the "main.clj"? that doesn't seem to be working (except for running the damn thing)
14:02seangrovecallen: You're saying your not responsible for this?
14:02seangroveHeh, I blame technomancy for the second misuse of your in under 5 minutes
14:02technomancyworrying about uberjars at this point is like trying to figure out bundler before writing any code; it's enough to scare anyone away
14:02clojurebotc'est bon!
14:03shiranaihito:P
14:03mgaareshiranaihito: if you want simple, you could always go to a ruby stack and enjoy the simplicity of puppet... or a straight-on java stack and benefit from the simplicity of multi-megabyte xml files ;)
14:03darth10mgaare: or common lisp... nothing like lein in CL
14:03shiranaihitomgaare: well, i've got a java background, but lately i've been reasonably happily using python.. i'm looking to move over to clojure for performance and async stuff
14:04shiranaihitoi imagine clojure is a good fit for websockets, for example.. ?
14:04darth10shiranaihito: clojure is good for almost everything these days
14:04darth10but the new core.async lib sure helps for websockets
14:04mgaareshiranaihito: Well, the point I was making was that almost everything has a somewhat complicated deployment story
14:05shiranaihitodarth10: yeah, it looks cool.. but i'm not sure it's necessary for working with websockets?
14:05mgaarebut clojure's is really quite nice
14:05darth10not at all
14:05darth10but u can useclojurescript :)
14:05darth10use clojurescript
14:05ziltiHuh? What's complicated about Clojure compilation and deployment?
14:05shiranaihitomgaare: i guess.. but python is relatively easy to deploy.. "pip install whatever-you-need" and you're good to go.. except when you sometimes need to fight with some C-extensions that don't want to build nicely etc :P but yeah, mostly it's smooth sailing
14:06darth10zilti: nothing, people just havent looked at how awesome CL is and how bad managing packages in CL is
14:06technomancyno no no
14:06rasmusto:o
14:06technomancyperforming dependency resolution on the actual node is wrong
14:06ziltidarth10: I never looked at CL. I don't like that functions and variables aren't in the same namespace.
14:06xeqitechnomancy: vendor everything
14:07shiranaihitotechnomancy: huh? :P
14:07callendarth10: you didn't need core.async for websockets...aleph and http-kit exist...
14:07callenyou don't need deep magic like core.async, as cool as it is, for that.
14:07darth10well the older names dont easily come to mind callen :)
14:07zilti[19:43] <technomancy> that is to say, deployment is complicated
14:07callendarth10: you just don't use them.
14:07shiranaihitocallen: yeah, i've been planning to use http-kit for websockets
14:08technomancyzilti: just the fact that AOT is a mess during development but helpful for deployment
14:08ziltishiranaihito: I'm using http-kit for web sockets right now, it's great
14:08darth10callen: well it was just an example
14:08shiranaihitozilti: sweet :)
14:09mgaareshiranaihito: that seems an unfair comparison, since you could can do `lein deps` in deployment and you're good to go with clojure too. However, that's not generally considered a good practice for the same reason that pip install on a production server
14:09darth10nomancy> so it's impossible for dev/user deps to affect uberjars, and
14:09darth10
14:10shiranaihitomgaare: i'm still unclear on why it's a bad thing
14:12mgaareshiranaihito: well that's honestly more a devops concern and may be outside the scope of this kind of discussion... the point is though that it's an unfair comparison of python pip and clojure advanced options uberjar compiling
14:12mgaare;)
14:12darth10zilti: on the client side, websockets are available in goog.ns if I'm not wrong
14:12shiranaihitomgaare: i'm sure it could be summed up in a sentence or two :P
14:12darth10a little messy... but gets the job done ... lots of examples out there too
14:12ziltidarth10: Oh I didn't even bother to use any API stuff. I just used plain websockets and send serialized clojure data structures over it
14:13llasramshiranaihito: It increases the complexity of deployment, increases the number of dependencies required on deplolyment systems, increases the risk of deployment non-determinism, and all while providing no benefits
14:13technomancyshiranaihito: basically it's a repeatability concern; if you can't spin up a new node guaranteeing it's running the exact same bytes all the way up the dependency tree, you're in trouble
14:14shiranaihitoso what's wrong with this: https://www.refheap.com/17590 .. "lein run" works, but "lein uberjar" crashes saying: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"
14:14technomancyyou need to resolve all your dependencies a total of once per deployment
14:14llasram(inc technomancy)
14:14lazybot⇒ 66
14:15shiranaihitotechnomancy: well, by default, pip installs stuff globally.. once it's installed, it's there, and usable for future deployments too, right?
14:15technomancyshiranaihito: not if you have multiple servers
14:15shiranaihitollasram: .. and you can give pip the exact version numbers of the libs you want
14:16technomancyremote repositories can go down or serve up corrupted checksums
14:16shiranaihitotechnomancy: well yeah, pip can't install stuff on all of your servers at the same time.. you kind of have to run it separately on each :P
14:17shiranaihitobut can someone see something wrong with this: https://www.refheap.com/17590 .. "lein run" works, but "lein uberjar" crashes saying: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"
14:17technomancyshiranaihito: something's wrong with the project layout
14:17shiranaihito"lein jar" crashes the same way
14:17technomancytry `lein new app myapp`
14:18shiranaihitoi've been scraping up a lein template of my own
14:18shiranaihitobut really, why would "run" find "application.main" just fine, but other targets not?
14:18hyPiRionshiranaihito: Are you on 2.3.0?
14:18shiranaihito2.2.0
14:18shiranaihitois there an easy way to upgrade?
14:18hyPiRion`lein upgrade 2.3.1`
14:19hyPiRionor just `lein upgrade`
14:19hyPiRionanyway, the 2.3.0 had some AOT compilation issues, that's why I asked.
14:22shiranaihitowell, lein seems to have broken itself now :P
14:22shiranaihitoi originally installed from Homebrew
14:22technomancyhomebrew =\
14:22shiranaihitotechnomancy: it's great! :P
14:22technomancyI told them to disable upgrade function
14:22darth10hah
14:22hyPiRionheh
14:23shiranaihitowell then.. i guess i need a separate install :p
14:24shiranaihitowould running "/.lein/self-installs/leiningen-2.3.1-standalone.jar" work?
14:24dobry-denRight now I have 5 clojure apps running on one server. each one sits behind nginx on a port. each one is run with `java -jar <appname>.jar` in its own tmux tab. i like being about to ssh into the server, `tmux attach`, and see realtime log output for each website. -- But obvious if the VPS reboots or a jar fails somehow, it doesn't restart. What's the next step?
14:25hyPiRionshiranaihito: not without the script, no
14:25shiranaihitohm
14:25technomancydobry-den: clojars uses upstart for that
14:25dobry-denthanks
14:25technomancydobry-den: good for simple things: https://github.com/ato/clojars-web/blob/master/SYSADMIN.md
14:25shiranaihitodobry-den: this might be interesting too: http://www.skarnet.org/software/s6/
14:25technomancybetter than tmux =)
14:27hyPiRionman, that diagram. I bet it's made with OmniGraffle, which is not available for linux. =(
14:28dobry-denthat diagram is hot
14:30bbloomi impulse purchased omnigraffle not too long ago
14:30bbloomgreat software, but expensive as hell
14:30bbloomi'd have impulse purchased it many years earlier if it was a bit cheaper
14:31ziltidamn. http-kit stopped working.
14:31eric_normanddobry-den: I use supervisord
14:31shiranaihitoso how do i find out what the latest version for a lib is? is there a lein command for that?
14:32nDuffshiranaihito: there's a lein plugin which adds a command for it, yes
14:32hyPiRion$latest ring
14:32lazybot[ring "1.2.0"] -- https://clojars.org/ring
14:32ziltishiranaihito: lein-ancient
14:32shiranaihitolein seems unhappy about using "LATEST" for a version number
14:32nDuffshiranaihito: https://github.com/xsc/lein-ancient
14:32nDuffahh.
14:32nDuffshiftyeyes: ...indeed; using "LATEST" is not a way to get reproducible builds.
14:33hiredmanshiranaihito: don't do that
14:33shiranaihitonDuff: well, i just wanted the latest stuff for now
14:33xeqishiranaihito: does it fail to resolve, or just warn?
14:33shiranaihitoyes yes.. i'm aware of the dangers :p
14:33rasmustonDuff: shiranaihito ^^^
14:33shiranaihitoit says "Aborting due to version ranges."
14:34shiranaihito$latest http-kit
14:34lazybot[http-kit "2.1.8"] -- https://clojars.org/http-kit
14:34shiranaihitoi guess i can expect ring-<something> to be at 1.2.0 too.. ? :p
14:35xeqishiranaihito: do you have :pedantic :abort set?
14:35shiranaihitoxeqi: yeah, it's set, actually
14:35xeqitry removing that temporarily
14:36shiranaihitowell, now that i set specific version numbers, it moved forward.. oh.. well, apparently ring-something has a different ver number from plain ring
14:36shiranaihitoalrighty.. :P
14:36shiranaihito$latest ring-devel
14:36lazybotNo project by this name exists on clojars.
14:36xeqi$latest ring/ring-devel
14:36lazybot[ring/ring-devel "1.2.0"] -- https://clojars.org/ring/ring-devel
14:37shiranaihito$latest ring-cors
14:37lazybot[ring-cors "0.1.0"] -- https://clojars.org/ring-cors
14:37shiranaihitoah..
14:37shiranaihito$latest ring/ring-json
14:37lazybot[ring/ring-json "0.2.0"] -- https://clojars.org/ring/ring-json
14:37nDuffshiranaihito: ...you could, you know, use the lein-ancient plugin instead of asking the bot in here all the time. :)
14:37ziltihttp-kit just fails to start with "lein run". It only works from the REPL, what could be the reason?
14:37shiranaihitowell, this kind of stuff is why i'd just rather say "LATEST" and be done with it (until i deploy "properly" and set the specific version numbers etc :p)
14:38shiranaihitonDuff: sure, but how do i install a plugin? :P
14:38hyPiRionyou can also message lazybot privately
14:38rasmustoshiranaihito: you lose tracability if you do that
14:38nDuffshiranaihito: ...by following the directions on the plugin's homepage, which you were linked to? :)
14:38kmicuNEVER "LATEST" NEVER
14:38hyPiRionoh, I know what I shall create now
14:38ziltishiranaihito: :plugins [[lein-ancient "0.4.4"]] inside your project file, or :profiles {:user {:plugins [[lein-ancient "0.4.4"]]}}
14:38hyPiRionA plugin which accepts the keyword "LATEST", just to make people angry.
14:39kmicu;]
14:39llasramHighly focused trolling is the best trolling
14:39shiranaihito:p
14:39shiranaihitollasram: i'm not trolling btw, if that's what you're implying
14:39xeqihyPiRion: LATEST should already be accepted, the template system uses it
14:39llasramshiranaihito: oh, no -- commenting on hyPiRion's joke
14:39xeqior was that RELEASE...
14:39hyPiRionxeqi: really? That's awful news, now I can't make my new obscure lein plugin
14:40xeqilein-obscure? for obfuscating your clojure code?
14:40Phil_DQuick question: I'm using LiveReload (http://livereload.com/) for reloading CSS/JS changes in the browser automatically. Is there a way to detect .clj file changes since Compojure "reloads" the server?
14:40shiranaihitohm.. it seems ring-json wants an older ring-core
14:41shiranaihitoweird
14:41hyPiRionxeqi: no, that's lein-swearjurize
14:41hyPiRionI'm not completely done with that one yet
14:41llasramhyPiRion: Or you could make it accept WHATEVER instead, which picks the most recent version, but with a <p> probability of picking a different version
14:41shiranaihitocan i make my own lein "targets" like with Ant back in the day? :p
14:41hyPiRionllasram: and with a probability to not include it at all too
14:41shiranaihitoi mean, something else than a lein template etc
14:41llasramhyPiRion: Perfect!
14:41hyPiRionman, this sounds like an awesome plugin.
14:42dobry-denDoes anyone know anything about mmcgrana? He seems to be a machine. Created projects like Ring a few years ago and simply seems to have moved on.
14:42llasramshiranaihito: Check out aliasing in the lein doco -- aliasing to `run` is what you need like 90% of the time. For the rest, you can write plugins trivially
14:42dobry-denBaller.com
14:43TimMc"Programming not frustrating enough? (hyPiRion inc) has just the toolchain for you!"
14:43shiranaihito:P
14:44ziltiWhat's the best way to prevent an application main thread from terminating? http-kit seems to put itself into the background, and then the -main method terminates.
14:44hyPiRionTimMc: Actually I'm wondering about calling my own firm "'); DROP DATABASE companies;-- Olympos AS" because it's technically legal in Norway
14:45ziltihyPiRion: Just for that http://xkcd.com/327/ short moment?
14:45pjstadighyPiRion: i approve
14:46TimMcYou might need to register a few companies with slightly different names just to be sure.
14:47hyPiRionzilti: Well, almost. My last name is L'orange (with an apostrophe), so I'm always a bit annoyed that I can't register stuff online from time to time.
14:47hyPiRionIt's more like revenge, I guees.
14:47seangroveWouldn't be too bad an idea - you'd have a chance at helping all the companies scraping the listings to improve their code a bit
14:48shiranaihitooh. my. fucking. god.. this is starting to feel like fighting with Maven
14:48seangroveI especially like the idea that everyone who spammed me after creating a company in the US having to rebuild their dbs
14:48ziltishiranaihito: What kind of obscure dependencies do you mess with?
14:48shiranaihitozilti: none, as far as i know..
14:48TimMc$ curl -I http://www.reddit.com/
14:49TimMcServer: '; DROP TABLE servertypes; --
14:49xeqizilti: the jvm should stay alive as long there is a non-Daemon thread
14:49shiranaihitozilti: https://www.refheap.com/17594
14:49shiranaihitothat's about it..
14:49ziltixeqi: It doesn't for me.
14:49shiranaihitoaaand now: "[lein-ancient "0.4.4"] -> [ancient-clj "0.1.3"] -> [clj-aws-s3 "0.3.6"] -> [com.amazonaws/aws-java-sdk "1.4.2.1"] -> [commons-codec "1.3"]" ..
14:50shiranaihito.. the glorious plugin i just installed(?) as per someone's recommendation here :P
14:50ziltishiranaihito: ...and where's the problem?
14:50ziltiRunning out of HDD space?
14:50shiranaihitonow it's unhappy about whatever
14:50shiranaihitonah
14:50shiranaihitoplenty of space
14:50seangroveTimMc: interesting, any idea why it's there?
14:50hyPiRionyou can never be sure when downloading jar dependencies.
14:51ziltixeqi: For me it doesn't. It terminates right away.
14:51shiranaihitohyPiRion: well, i guess the main point of Lein is still to avoid having to mess with dozens and dozens of shitty, pointless little jars.. just like Maven's point was back in the day
14:52shiranaihitobut sadly, it seems Clojure carries on Java's legacy in this area
14:52TimMcseangrove: Presumably it's an executable message to script kiddies.
14:52shiranaihitoanyone remember working on java projects where you'd have a "lib" directory for the project and then just pour _eeeveeerryyytthhiiingg_ in there, to avoid having to deal with the damn mess of what jars are _actually_ needed? :P
14:52ziltiI've never had any build system as effortless and simple as Leiningen. Not even simple-build-tool (lol)
14:54shiranaihitoi was perfectly content working with Ant, and making sure i only had the necessary jars in my projects.. but then people adopted Maven, which happily downloaded half the fucking world every time you built your project :p
14:54hyPiRionshiranaihito: it just seems you've had a bad experience with some bad dependencies, really.
14:54shiranaihitohyPiRion: yes :P
14:54shiranaihitoi have
14:54darth10zilti: scala's sbt turned out to be NOT so simple after all
14:54shiranaihitobut i'm having a bad experience now, again
14:54shiranaihito"The Java Way" rears its ugly head again
14:55shiranaihitoit's seriously weird how people keep having their projects depend on various useless commons-jars etc
14:55tbaldridgewe should all adopt the Go lang model. Put repo urls in your project and pull master on every compile
14:55tbaldridge</sarcasm>
14:56ziltishiranaihito: Rather reinvent the wheel each time?
14:56clojurebotmultimethods is http://clojure.org/multimethods
14:56shiranaihitothe java world had a mentality of overzealous re-use, basically.. if there was a jar for something somewhere, it should be used.. and that's how all those silly commons jars got included in everything
14:57shiranaihitozilti: yes, i would have.. it's silly to bring in a dependency for some small thing you could write yourself in like 10 mins or whatever
14:57ziltiWhat's the best way to prevent an application main thread from terminating? http-kit seems to put itself into the background, and then the -main method terminates. I can only keep it running right now from the REPL
14:59shiranaihitozilti: is there a setting in http-kit for that?
15:01ziltishiranaihito: No, or at least I didn't find anything
15:01shiranaihitoaww :x
15:02shiranaihitoweeell.. now i've got "lein run" and "lein jar" working, but "lein uberjar" still says: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"
15:02shiranaihito"lein jar" working is a step up from lein 2.2.0, apparently :p
15:02llasramshiranaihito: It sound like your `project.clj` has something like `:main application.main` in it w/o that namespace (and file) existing
15:02arohnerwhat is the best way to generate EDN data? pr-str can generate strings that can't be read
15:03hyPiRionshiranaihito: I'd have a guess that main.clj is not within the src/application/ folder
15:03ziltiarohner: str
15:03amalloyzilti: he said best, not worst
15:03shiranaihitollasram: yes, it's got: ":main application.main" .. and then i have a "source" folder (:source-paths ["source"]), with a folder called "application" inside it, and a "main.clj" in that
15:03tbaldridgearohner: use clojure.edn
15:04shiranaihitollasram: but isn't it weird how "run" and "jar" find it just fine, but "uberjar" doesn't?
15:04Raynestbaldridge: clojure.edn doesn't have generating functions
15:04arohnertbaldridge: I'm asking about *generating* EDN that can be read by clojure.edn
15:04tbaldridgearohner: eh, my bad
15:04mdrogalisarohner: What's it generating that can be read back?
15:04TimMcA printer that freaks out when the output won't be EDN?
15:04arohnerTimMc: yes
15:04hyPiRionshiranaihito: is the namespace of that file application.main ?
15:04arohner,(clojure.edn/read-string (pr-str (ref 1)))
15:05clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.edn>
15:05llasramshiranaihito: Not a fan of the defaults, are you? :-) I was just thinking about `jar`. `lein run` w/o specifying a namespace/function works?
15:05hyPiRionand more importantly, is it a gen-class file?
15:05Raynesarohner: I'm not sure what you'd expect to happen.
15:05Raynesarohner: What printing function could print that?
15:05RaynesYou're probably just going to have to make sure you don't give it unreadable/printable data.
15:05arohnerRaynes: I'd like an exception for "this can't be read as EDN", at print time, rather than read time
15:05amalloyarohner: i think such a printing function is #(doto (pr-str %) read-string)
15:05shiranaihitohyPiRion: https://www.refheap.com/17595
15:06mdrogalisamalloy: Aha. :D
15:06shiranaihitohyPiRion: see a problem?
15:06shiranaihitollasram: yeah, i feel like having a "main.clj" instead of "core.clj" :P
15:07shiranaihitoit's just more.. "zen" :P
15:07hyPiRionwell, I guess ring.middleware.cors should be ring.middleware.core, but other than that, not really
15:07llasramshiranaihito: I was mostly thinking of "source" vs "src", but that too
15:07shiranaihitollasram: yeah, that too.. but it should be fine, right? :P lein should be possible use even like this, yes? :P
15:07llasramhyPiRion, shiranaihito: Oh good catch -- which would make it unlikely that `lein run` was working to run this ns either
15:07amalloyhyPiRion: i imagine he's using the cors middleware
15:07llasramOH, nm
15:07shiranaihitoyes there's that ring-cors thing
15:07llasramblorp
15:08hyPiRionamalloy: at least I said it was a guess.
15:08shiranaihitobut "lein run" works
15:08llasramshiranaihito: Yeah, it should work. It just seems like kind of a difference just to be different sort of thing
15:08shiranaihitollasram: well, it's not like i'm a teen-goth or anything :P
15:09llasramshiranaihito: Are you *sure*? You should double-check
15:09shiranaihito:p
15:09shiranaihitono but seriously
15:09hyPiRionsounds like you've managed to do something very strange at least
15:09hyPiRionor that you've found a very strange lein bug
15:09shiranaihitoit shoudn't be difficult to use lein with this kind of small variations in settings, right?
15:09hyPiRionlein clean, does that work?
15:09shiranaihitoit does
15:10hyPiRionthen lein uberjar?
15:11mdrogalisshiranaihito: What exactly are you trying to do? Can you describe it if it's that small in terms of pertinent variations?
15:11shiranaihitouberjar doesn't work
15:11shiranaihitomdrogalis: huh? i'm trying to run "lein uberjar" but it crashes: "java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"
15:11llasramshiranaihito: Could you push up a git repo / tarball of the whole project-thus-far?
15:11shiranaihitohmm
15:12shiranaihitoi guess, but i wonder what the most effortless way to publish this would be
15:12mdrogalisOr at least show your project.clj and main.clj
15:13llasramshiranaihito: You can do a multi-file gist
15:13shiranaihitoproject.clj: https://www.refheap.com/17596
15:14shiranaihitomain: https://www.refheap.com/17595
15:14llasramwhoa
15:15mdrogalisHaha.
15:15hyPiRionthat project.clj is probably the issue
15:15mdrogalisYeah, I'm gonna say this is more than a little variation :)
15:15shiranaihitohm?
15:15clojurebotbenchmarking is https://github.com/hugoduncan/criterium
15:15llasramThis at least is especially suspect: `:eval-in :leiningen`
15:15xeqihaha, :test-paths []
15:15shiranaihitomdrogalis: well, i've just taken the sample project file from the lein website and modified it
15:16llasramshiranaihito: It's about 5-10x as long as most project.cljs :-)
15:16shiranaihitoi do realize it contains more settings than necessary
15:16shiranaihitoyes
15:16shiranaihitobut i just left them there kind of like as a reminder of what settings are available, in case i'd want to change some of them later on
15:16mdrogalisrm the unnecessary ones until you find the problem.
15:16xeqiyeah, :eval-in :lieningen is def
15:16mdrogalisOr comment them.
15:16xeqiblah
15:17bbloomtbaldridge: here's what i've got so far: https://github.com/brandonbloom/cleff/blob/master/src/cleff/core.clj -- that's just the shape of it. gonna try to fill in the implementation now
15:17shiranaihitoxeqi: wow.. that was it :P
15:17xeqi:eval-in :leiningen is usually for plugins
15:17xeqimeans eval in the leiningen jvm instead of the project one
15:18xeqiand :bootclasspath false is probably slowing your invocations down
15:18shiranaihitowell then.. it would be interesting to know why Lein's sample project file would be "broken" like this.. :p
15:18hyPiRionI'm not even sure what uberjar would do in such a situation. That's something I'll have to look at.
15:18brianwonghey guys, i have a feeling that I can DRY up this code snippet even more but I cant quite figure out how. I may be way off, but basically the 'then' part of my 'if' is a 'let' binding. Though I want to use the 'let' binding in my 'else' form. How can I rewrite the the following code snippet where the 'let' binding is not out of scope for the 'else'? https://www.refheap.com/17598
15:19hyPiRionshiranaihito: as it says in the header, it shouldn't be considered a representative configuration.
15:19shiranaihitoa sample should contain safe & sane defaults, right?
15:19shiranaihitono, not "representative", sure.. but how about "not broken"? :P
15:19xeqishiranaihito: you mean like the one created by `lein new`?
15:19hyPiRionHm, perhaps we should be even more explicit about it.
15:20mattmossbrianwong: Aren't you being contradictory? You want, in the else clause, to use something that will only work if the if test passes.
15:20shiranaihitoxeqi: no, i mean the sample file: https://github.com/technomancy/leiningen/blob/master/sample.project.clj
15:20xeqishiranaihito: the "not broken" part
15:20shiranaihitoxeqi: well, i was talking about that sample file over there.. it's something a new user might find, and then decide to use as a "template" for his project files
15:20shiranaihito.. and then he'd be fucked
15:21shiranaihito.. and left wondering why
15:21shiranaihitoit's not unreasonable to expect a sample file to work
15:21brianwongmattmoss: i tried to make it generic, but say the test was something like (seq coll), i then run a function that does something with part of the collection, but would like to use the result in both the 'then' and the 'else', depending on the test. So I want to make the 'let' binding the "parent" of the 'if', but that wont work because i need the test first
15:22llasramshiranaihito: Except for the comment at the top. I agree I can see some potential for confusion, but in practice it seems to have been pretty small so far
15:23shiranaihitollasram: well this would be the relevant bit: "it shouldn't be considered a representative configuration" -- but we've already covered this.. i know this is not a representative file, but i did expect it to not be broken and send me off to a wild goose chase for a couple of days
15:24shiranaihitoi even saw and noted that before i copied the file, but didn't expect it to be broken
15:24mattmossbrianwong: Can you provide sample? What you're saying doesn't make sense to me.
15:24llasramIt's not exactly broken - it'd work great for a project which was a plugin (and needed all the other wacky settings)
15:24brianwongmattmoss: here is the specific problem. i just made a simple infix calculator as per the 4clojure problem. It may not be efficient or the best solution, but it demonstrates my scoping issue. https://www.refheap.com/17599
15:24ziltiit should be pretty clear that this file is for explanation purposes, not usage...
15:25brianwongthe 4clojure problem is http://www.4clojure.com/problem/135
15:25llasramshiranaihito: If you've got an idea how to improve things to prevent the problems you ran into, the project is very open to PRs
15:25llasramb
15:25llasramhah
15:25shiranaihitollasram: it says nothing about making a plugin though
15:25shiranaihito(in the beginning notice anyway)
15:26mattmossbrianwong: How can you be sure that ((second args) (first args) (nth args 2)) is safe if (> (count args) 3) fails?
15:26llasramshiranaihito: That's true, but is called out in the comment by the relevant `:eval-in` option
15:26mattmossOr maybe "safe" isn't right word, but "reasonable."
15:26ordnungswidrigbrianwong: you're missing recursion, right?
15:27ordnungswidrigbrianwong: oh, sorry
15:27ordnungswidrigbrianwong: why do you need result there?
15:28degcemerick: you back online?
15:28brianwongmattmoss: i cant, but arguments to an infix calculator must be a sane number of args
15:28shiranaihitollasram: there's no warning about setting it to :leiningen breaking uberjar though
15:28cemerickdeg: eh, marginally
15:28brianwongthis function assumes that you gave the correct number
15:28mattmossbrianwong: Do you see what I'm getting at? Either it's safe or it isn't. If it's safe, then you can pull that part out of the (let outside of the (if
15:29shiranaihitowow.. oh well.. life goes on.. maybe i can finally actually do something with clojure now
15:29boblarrickI'm doing some java interop and have a instance of a java class, is there something equivalent to ruby's ".methods" method that I can use in clojure to see what I can do with this java object?
15:29cemerickCurrently trying to get the macbook air's fans to settle down, of all things. :-P
15:29brianwongordnungswidrig: i just feel i dont have to repeat myself
15:29brianwongmattmoss: i see your point now
15:29degcemerick: ok. Just wanted to give you a heads-up that my problem earlier (w/ pprng) was a total red herring. I had put the :libs [""] one level too high in the map (under each build, not inside :compiler).
15:30cemerickdeg: oh, good to know :-)
15:30degTook me embarassingly too long to find the typo, but all's good now.
15:31llasramboblarrick: check out the `clojure.reflect` namespace
15:31xeqi&(-> "instance" .class .getMethods)
15:31lazybotjava.lang.IllegalArgumentException: No matching field found: class for class java.lang.String
15:31brianwongmattmoss: i am still unsure how to approach the test or rewrite this then. if i pull the 'let' out and make it the parent of the test, i am guessing it will only fail near the end of the recursion
15:32brianwongill have to give it more though
15:32brianwongthought
15:32brianwongapproach the problem again
15:33xeqi&(-> "instance" class .getMethods seq)
15:33lazybot⇒ (#<Method public boolean java.lang.String.equals(java.lang.Object)> #<Method public java.lang.String java.lang.String.toString()> #<Method public int java.lang.String.hashCode()> #<Method public int java.lang.String.compareTo(java.lang.String)> #<Method public int ja... https://www.refheap.com/17602
15:33xeqiboblarrick: ^
15:33mattmossbrianwong: Check https://www.refheap.com/17603
15:34mattmossbrianwong: If we asssume that your result calc is safe, then moving it out of the (if looks like the second expression.
15:34mattmossexcusing bad spacing
15:36boblarrick@xeqi and @llasram thanks, those are both helpful
15:37cemerickdeg: no worries
15:37cemerickglad it worked out
15:42mabeseldoc has stopped working for me w/nrepl so I've paired my init.el down to these 20 lines and it still is not working: https://gist.github.com/bmabey/22efcee4d204da36d0fb
15:42mabesany ideas on what I'm doing wrong? ^
15:42jcromartiesomething's not right here: http://imgur.com/J8HV3B1
15:47tbaldridgejcromartie: something left in the stencil buffer?
15:47brianwongthanks mattmoss, i am not completely sure this is the best way yet, but I understand that if I make the assumption of the args being safe after the 'if', it doesnt make much difference that I assume it is safe outside the if. I still have this feeling that there is a better way to approach this that is safer and more concise. Thanks for your help
15:47jcromartietbaldridge: not sure, it's someone else's LWJGL example
15:48jcromartiebut looking into it
15:49swarthyjcromartie: tbaldridge: is that a clojure LWJGL lib like Penumbra you are using or something new, or just plain Java? I got curious for such thing recently and was wondering what was out there.
15:49jcromartieswarthy: I'm digging into this stuff now. Penumbra was last updated a year ago, and it is pretty decent.
15:50jcromartiebut that's about it
15:50swarthyjcromartie: Yeah that is what I found. I haven't looked into Penumbra enough to see how much functionality it has with in it.
15:50swarthyFor the time my hobbyist game stuff is staying in Love2D, though that is not as exciting.
15:51jcromartieI'm a fan of Lua, but I'd rather just use SDL and host Lua itself from C code.
15:51SegFaultAXI thought penumbra was dead.
15:51jcromartieit's basically dead
15:51SegFaultAXI mean officially dead.
15:51jcromartieys
15:51swarthyjcromartie: is that not what Love2D is doing?
15:51ToxicFrogswarthy: C++, but yes.
15:51jcromartieswarthy: it wants you do to everything in Lua
15:51SegFaultAXAs in the maintainer has decided to stop working on it permanently.
15:51jcromartieSegFaultAX: yes, it's ztellman's
15:52jcromartie"Penumbra is not under active development. However, it’s still a fun way to play around with OpenGL and Clojure. Bugs will be fixed, time permitting, but new features are unlikely."
15:52SegFaultAXIt's easy to extend love2d.
15:52swarthyToxicFrog: jcromartie: ah I see. Yeah it works for me at the moment as that stuff is a bit above my head. But I would like to learn more about hosting lua in another language.
15:53SegFaultAXswarthy: Join #lua
15:53SegFaultAXLua is /very/ easy to embed.
15:53swarthySegFaultAX: haha, probably a good place to start.
15:53jcromartieSegFaultAX: extend it with C? or Lua?
15:54ToxicFrogswarthy: yes, that. And #lua is pretty friendly.
15:54jcromartieI did Lua full-time for like a year
15:54SegFaultAXjcromartie: Yes.
15:54ToxicFrogjcromartie: with either, although of course you'll have to work from source to do the former.
15:54jcromartieman, the Löve library names are worse than Ruby :|
15:54ToxicFrogjcromartie: yeah :/
15:55jcromartieAnAL, Goo, HUMP, HardonCollider (not Hadron), LUBE, Quickie, Pölygamy, Swingers
15:55SegFaultAXI've also used Moai for some medium sized projects.
15:55ToxicFrogIs data.xml currently the best way to turn XML source into something I can xml-seq?
15:55SegFaultAXAnother excellent C++/Lua framework.
15:55ToxicFrogjcromartie: yeah, I kind of feel like the love2d devs picked exactly the wrong name for their project.
15:55ToxicFrogOr possibly the wrong community.
15:56swarthyToxicFrog: but they can say "Made with Love"
15:56jcromartiewhen it came out, it was very similar to what I was doing with Lua
15:56jcromartie(in personal projects)
15:56jcromartiebut my approach was more of "virtual console" with more of an IoC approach
15:57jcromartieit's probably not too late to resurrect that idea
15:58ToxicFrogHmm. clojuredocs implicitly recommends data.xml, so let's go with that.
15:59kurisuPhoneToxicFrog, but those names are awesome! :)
16:00ToxicFrogkurisuPhone: until you view the source for something using them while at work~
16:00TimMc...not really.
16:00TimMcThey're *funny*, but that doesn't mean they're *good*.
16:01kurisuPhoneToxicFrog, only a problem if you work at enterprise
16:01glosoliWhat's ad-hoc hierarchy ?
16:02jcromartiekurisuPhone: or anywhere whose entire employee and customer base is not just a bunch of hipsters
16:02kurisuPhoneTheyre not descriptive, yeah, but then I'm not sure "pedestal" or "leiningen" are either
16:02ToxicFrogleiningen is totally descriptive if you know the story
16:03jcromartieThe problem is not the level of description.
16:07nDuffkurisuPhone: you don't have to be an "enterprise" for that to matter.
16:08kurisuPhoneYeah, I just wanted to imply that it depended on how conservative were ones views on sexuality
16:08nDuff(as implied by the naming).
16:09nDuffkurisuPhone: ...again, I can't agree with that at all.
16:09llasrams,conservative,mature,
16:09nDuffkurisuPhone: Personal and professional lives are two entirely different things.
16:10kurisuPhoneI can't agree with that, theyre intrinsically intertwined
16:11jcromartiekurisuPhone: so, being so very sexually liberated, would you put your kid in a daycare called "anal lube enterprises"?
16:11jcromartiethey may be the pinnacle of professionalism
16:11jcromartie:|
16:11jcromartieanyway, waaaaaay off topic
16:12jcromartiethank you #clojure for not naming libraries after anything you wouldn't feel comfortable talking about with any old lady on the bus
16:12kurisuPhoneI dont see why not, even though the analogy wasn't the best one. But yeah, offtopic
16:13jcromartieon topic: I have given in and tried Emacs Live, and it seems to be a great set of defaults
16:13jcromartieI have completely forgot about my old config
16:14hugodI'm trying to find a sane packaging strategy for clojurescript libs that depend on plain js - one that allows the library consumer to override or provide the js lib, either on the classpath or through the js runtime (eg. via a cdn on browser)
16:14hugodusing :libs prevents the use of a cdn, iiuc
16:15ztellmanjcromartie SegfaultAX: yeah, penumbra's dead, I've been looking at maybe creating some lower-level opengl 2.0+ bindings
16:15dnolenhugod: is that what :foreign-libs is for?
16:16jcromartieztellman: the hard part is all the byte bufffer juggling for VBOs, arrays, etc. that are really needed to do anything serious
16:16jcromartieztellman: immediate mode is all well and good for playing around
16:16jcromartiebut if anything is dead, it's glBegin()
16:16hugoddnolen: not sure - it requires the consumer of the cljs library to specify :foreign-libs
16:17jcromartietbaldridge: see if you spot the problem here :) (GL11/glClear (or GL11/GL_COLOR_BUFFER_BIT GL11/GL_DEPTH_BUFFER_BIT))
16:17ztellmanjcromartie: https://github.com/ztellman/vertigo
16:17hugodmaybe that's not a bad thing - i.e. always provide the js in a resource, and allow the consumer to decide to use it with :foreign-libs
16:17ztellmanproblem solved-ish
16:17jcromartieztellman: ah, wow, nice
16:18ToxicFrogdeath to xml
16:18jcromartieztellman: you just crank this stuff out man
16:18ztellmanhaha
16:18TimMclike frog eggs
16:18ztellmanI have this pyramid of projects I've had in my head for years
16:19ztellmanmost of them have certain problems that need to be solved before I could undertake it
16:19ztellmanI'm cranking out prerequisite libraries right now
16:19ztellmanwhether I have any energy left over once I'm done is the real question
16:20bbloomtbaldridge: are there still some issues w/ case statements in ioc?
16:20technomancycandle at both ends =)
16:20tbaldridgejcromartie: rofl, nice! (not= or bitwise-or)
16:20tbaldridgebbloom: what problem are you hitting? I'm not aware of anything
16:20ztellmantechnomancy: burns twice as bright etc. etc.
16:20jcromartieztellman: what's your final plan? to take over the world?
16:20bbloomtbaldridge: dunno yet, trying to make sense of it. i'll let you know
16:21jcromartie"I just need to be able to declaratively specify a binary protocol for automated goat feeders, then I can..."
16:21jcromartie:P
16:21ztellmanjcromartie: short term goal is to decouple pretty much everything useful I've written from Lamina's channels
16:21jcromartiesounds like a good plan
16:21ztellmanshould have done this ages ago, core.async gave me the kick in the ass I needed
16:22jcromartieyeah I was impressed with the size and scope of what Lamina internals were doing, wished they were in discrete libs
16:22jcromartieso that's great
16:22ztellmanyeah, I have this tendency to build towers of abstractions
16:23ztellmana few people have scaled it all the way to the top, and are using my stuff productively, but objectively they're crazy to have done it
16:23ztellmanamalloy, I'm looking at you
16:23ztellmanso instead of a big tower, I'm making a village of libraries
16:23ztellmanit's surprisingly fun
16:25ziltiztellman: So then you're splitting up lamina?
16:25bbloomtbaldridge: ah no, not case: fn
16:25bbloomtbaldridge: seems that if i build a state machine from (fn [x] x), then i get x not defined
16:25ztellmanzilti eventually, right now I just have duplicate functionality all over the place
16:25amalloyspeaking of being crazy to use ztellman's software, you all may be amused to know that lamina is currently spending 50% of all CPU time on Object#hashcode
16:25tbaldridgebbloom: ioc translation stops at (fn []) forms
16:25ztellmanamalloy: this is in query-seq?
16:26ziltiztellman: Because in the end pretty much everything inside lamina belongs together, so that's why I wonder
16:26bbloomtbaldridge: it's the root form
16:26amalloyyeah, like i was looking at a few weeks ago. finally getting back to it
16:26tbaldridgebbloom: root forms need to be expressions
16:26tbaldridge*non - fn expressions
16:26bbloomtbaldridge: OK, that makes sense. is there some way to get a parameterized thunk then?
16:26ztellmanI choose to take that as "lamina's so fast, only the hashCode lookups are left"
16:26Rayneszilti: Not all of it. The querying stuff, for example.
16:26jcromartieztellman: that's also how I read it
16:26bbloomlike i guess i can just make some terminal like get-message or whatever & start w/ that
16:27bbloomtbaldridge: then i presumably need to run-state-machine to kick it off & get to that point
16:27ystaeltechnomancy: I feel like we're still seeing the no-AOT'd-classes-in-uberjars bug in 2.3.1
16:27ztellmanzilti Raynes: and the code instrumentation, and the connection life-cycle stuff, and ...
16:27tieTYTi'd love for you guys to comment on this if you have time: http://programmers.stackexchange.com/questions/208154/everything-is-a-map-am-i-doing-this-right
16:28RaynestieTYT: I've read the title and can objectively say yes.
16:28ztellmanfor the most part, if I created a simple event source and promise abstraction, everything could just sit on that
16:28Raynes:p
16:28tieTYTRaynes: hah, that's all I wanted to hear :P
16:29tbaldridgebbloom: you should be able to use closures, so (gofn [a b] (+ a b)) becomes (fn [a b] (go (+ a b)))
16:29bbloomtbaldridge: except in my case, i am cloning the the state machine to make them reusable with *different* parameters each time :-)
16:30bbloomtbaldridge: just gonna add an extra terminal and prefix the state machine with `(let [args# (that-terminal)] …
16:30tieTYTstuartsierra: especially you, if you have time. Since it's your talk
16:30tbaldridgebbloom: in that case, we'd be looking at USER-IDX stuff
16:30stuartsierratieTYT: eh, what?
16:30jcromartie(^^^ This is why I love IRC)
16:30bbloomtbaldridge: oh yeah, dur. forgot about that. that's even better
16:30tieTYTstuartsierra: http://programmers.stackexchange.com/questions/208154/everything-is-a-map-am-i-doing-this-right
16:30RaynestieTYT: I think this is very nice.
16:31RaynestieTYT: You can take ideas obtained from FP-focused languages and apply them elsewhere.
16:31RaynesThat's what people mean when they say that FP influences how you write code in other languages.
16:31ziltiIs there no -> equivalent in JavaScript?
16:31jcromartieRaynes, tieTYT it's not that easy to do in JS though, without doing lots of deep copying
16:31bbloomtbaldridge: oh, well actually that's basically precisely the same thing as adding an extra terminal. i need the terminal so that the machinery will give me a handle to the state array
16:31jcromartiewhich is not always trivial
16:32tieTYTjcromartie: you must be focusing on the immutability. I just had to skip that part
16:32jcromartieyeah
16:32tieTYTand that's part of my question. Did I lose out on everything by skipping that part?
16:32tieTYTdid I just architect something horrible w/o the immutability?
16:32tbaldridgebbloom: yeah, you'll still need terminals
16:32stuartsierratieTYT: It's a trade-off, like everything else.
16:32jcromartiewell, what's the point of a functional approach if everything is achieved via mutation?
16:33tieTYTjcromartie: that's kind of MY question
16:33jcromartietieTYT: yeah I see
16:33RaynestieTYT: Well, you're contradicting yourself a bit.
16:34tieTYTi feel like I'm getting all the same benefits mentioned in step 3
16:34tieTYTRaynes: how so?
16:34RaynestieTYT: If you're mutating everything, what do you mean by everything takes and returns objects? What's the point of that? If you're just mutating the underlying objects then you're not gaining anything at all afaict.
16:34RaynesI mean, I guess I'd have to see your actual code or something to make actual sense of what you're doing, but I'm very confused by what's going on at this point.
16:35callenjcromartie: Common Lispers would object to that sentiment, even if I agree
16:35jcromartieI think you can mix it up just fine
16:35tieTYTyou're right, more often than not the "return" is ceremony more than really necessary
16:36jcromartiefor a game, mutation is pretty handy
16:36callens/handy/critical/g
16:36jcromartiecallen: not strictly
16:36jcromartieit depends on what you're doing
16:36callenanything high churn...
16:36jcromartieyes
16:36jcromartiephysics
16:36tieTYTRaynes: so I could do the same thing except no return types ever
16:37tieTYTRaynes: so besides that point, I still get all of the benefits afaict
16:37jcromartieI think you could have a low-level mutation based engine with highl-evel pure functional AI/logic
16:37callenit's pretty common to use const all over the place in games, but it can't be done everywhere.
16:39tbaldridgecallen: jcromartie: I'm interested in seeing what carmack comes up with in haskeel. In his talk he mentioned that he used monads only for IO, 90% of the rest of his engine was pure functions. I wonder how he did that without trashing the Haskell GC.
16:39jcromartiecallen: John Carmack and the Unreal guys are advocating functional programming
16:39tbaldridge*haskell
16:39jcromartietbaldridge: ah yeah you beat me to it
16:40bbloom i'm sure he did just trash the gc, but wolfenstin had few enough objects that it couldn't have been too bad
16:40jcromartieTime Sweeny, that's the guy
16:40jcromarties/Time/Tim/
16:41callenjcromartie: I know, I've been following TS and JC closely for years
16:41jcromartie:) cool, I am just an armchair game dev, wish I did more
16:41jcromartiethat's what I'm doing now :P
16:43juhu_chapahiredman: Hi! Does java.jmx have a connection pool option?
16:43hiredmanuh, beats me
16:44jcromartiejuhu_chapa: I would try #java for that one
16:44hiredmanmy java.jmx repo is a non-active fork of https://github.com/clojure/java.jmx
16:45tieTYTstuartsierra: not sure if you're interested in my question or not, but I just wanted to say that was a great talk and it definitely affected the way I think. Thanks for that presentation
16:45hiredmanoh, and I don't even have a repo for it on github, I just published something to clojars
16:45juhu_chapajcromartie: clojure/java.jmx?
16:45jcromartieoh derp, I thought you meant the plain Java JMX
16:45stuartsierratieTYT: Thank you.
16:46juhu_chapajcromartie: Does exist a clojure connection pool manager?
16:46juhu_chapaI mean socket connection pool
16:46callenjuhu_chapa: clj-bonecp
16:46callener, that's for JDBC, sorry.
16:46juhu_chapa:O
16:46jcromartieI've always used c3p0 directly
16:46callenwell you could use bonecp the same way.
16:47callenand bonecp is faster >:)
16:47jcromartiehm, I'll try bonecp next time
16:48callenhttp://jolbox.com/index.html?page=http://jolbox.com/benchmarks.html
16:49TimMcamalloy: Huh, I wonder how many of the Java and Clojure base objects memoize their hashcodes.
16:49TimMc*base classes
16:49amalloyTimMc: in this case it was actually Object#hashcode, not any overridden version, so it was looking up a memory address
16:50TimMcOh, I see.
16:50TimMcThat's... OK, that's a good sign then!
16:51technomancysooooo
16:52ztellmanamalloy: https://github.com/ztellman/narrator is going to get a formal release soon, it fixes any of the time skew issues
16:52ztellmanalso is probably faster
16:52technomancyif you have a project that depends on Leiningen's :main-implies-aot behaviour, you'll need to add explicit :aot for 2.3.1
16:53ystaeltechnomancy: testing...
16:55ystaeltechnomancy: awesome, thank you!
16:56TimMc:-P
16:59hyPiRionhah, :monkeypatch-clojure-test, :main-implies-aot, what's next?
16:59technomancywe actually already have ^:skip-aot on :main
17:04TimMcHow about :max-lein-version ?
17:04technomancyTimMc: happy to take a pull for that
17:05justin_smithI finally figured out the issue with the totally blank nrepl buffer in emacs
17:05TimMcNah, sounds too useful.
17:05justin_smithit was slime stuff, I guess I can only have one or the other loaded now
17:05TimMcI'll send a PR for :cowsay-compile-errors
17:06technomancyTimMc: yes please
17:07hiredmanI would love to see stacktraces in cowsay
17:08ystaelone cow with a big speech bubble, or a stack of cows standing on each other's backs?
17:09hiredmanystael: obviously configurable via a dynamic binding
17:09ystael(binding [*max-cow-stack* Long/MAX_VALUE] ...
17:11hiredmanmaybe this is complected
17:11hiredmanclojure.pprint should have a cowsay mode, and then you just need a library that turns exceptions in to data
17:12hyPiRionactually, I know that some of my plugins will break in 3.0.0, so it kind of makes sense
17:13hyPiRionnot yet saved in the pom, but that we can fix
17:28dobry-den`lein uberjar` on my server creates `target/uberjar+provided/app.jar` and then steps through all the `Including...` steps to produce `target/app-standalone.jar`. But i believe ever since i upgraded leiningen locally, `lein uberjar` locally creates `target/uberjar/app.jar` (not uberjar+provided) and `target/app-standalone.jar` without including any deps.
17:29jcromartiewhat's a better way of doing this: (doseq [[x y] (map identity x-seq y-seq)] …)
17:29jcromartiefor [1 2 3] [4 5 6] I'm looking for a seq of [[1 4] [2 5] [3 6]]
17:30dobry-deni think the way you have it is pretty good and obvious
17:32technomancydobry-den: lein 2.3.1 fixes the target path issues
17:32jcromartieoh, that's wrong, no I used (map list ...)
17:32technomancythough there's still a caveat around AOT if you haven't set :aot
17:33jcromartiethis is what I'm using: (defn slices [& seqs] (apply map list seqs))
17:33jcromartiewould that be better named as "pivot"?
17:33jcromartieslices makes sense though
17:33dobry-dentechnomancy: i just have (:gen-class) in myapp.handler. in project.clj i have `:main myapp.handler`. so i need to start using the :aot key?
17:33technomancydobry-den: yeah; hang on I'm in the middle of writing an email about this =)
17:38bbloomtbaldridge: what exactly are "persistent" values? closed-over variables?
17:46technomancydobry-den: https://groups.google.com/forum/#!topic/clojure/V7mC8PKq1Kg
18:02wolfjbI am trying to read a file which has data like (order-line (quantity 2) (product "foo") (description "descr") (line-number 1)), I have created a record to match (defrecord order-line-type [quantity product description line-number]) and I would like to just "execute" the incoming file. I have created (defn quantity [num] num) so I can call (order-line-type. (quantity 2) ...) but I'm trying to understand how to make that work when I ge
18:02wolfjbthe file
18:02wolfjbwhen I run (symbol "(quantity 2)") I get the result of (quantity 2) which I would like to execute
18:02wolfjbbut I'm not having any success
18:03wolfjbwhat am I missing?
18:04wolfjba description of the problem is at https://bitbucket.org/wolfjb/shootout
18:08supersymwolfjb: so what are you trying to exec exactly? just read a line of the file or parse back to csv?
18:09wolfjbread a line of the file
18:09wolfjbeventually, i'll write back the data as csv
18:10wolfjbso if I read (quantity 2), I would like to "exec" the quantity method and get the 2 out
18:10Fer`wolfjb: if you have a function called quantity you can use eval
18:10wolfjbideally this would work (order-line-type. (read-line) (read-line) (read-line) (read-line))
18:11wolfjbor something like that
18:11Fer`(eval (read-string "(quantity 2)"))
18:11wolfjbFer`: Ah!!!
18:12wolfjbI was trying (eval (read "(quantity 2)")) without success
18:12supersymah ok... right so its tied to some method, that I didnt get yet
18:12Fer`wolfjb: read takes an input stream
18:12Fer`a string is not an input string
18:12wolfjbI haven't checked in all the code, just updating the readme at the moment, just now trying things in repl to try
18:12Fer`stream*
18:13wolfjbFer`: I see.. that make sense
18:13wolfjb:-)
18:13wolfjbThanks Fer`
18:13supersymright... anyway you can read a file (with-open [r (clojure.java.io/reader "/etc/passwd")] (doall (line-seq r)))
18:14supersymalso destructuring the form in the file might help e.g. (let [a (quote (foo (baz 1) (bar 2))) [b c d :as s] a] [a b c d])
18:14Fer`wolfjb: if the format is that then the problem is very simple and you dont need a protocol
18:15Fer`you just need to use clojure's reader which will give you lists and then eval the lists
18:16wolfjbFer`: but wouldn't (quantity 2) fail to evaluate? maybe I'm not understanding you
18:16Fer`only if you havent defined the fn quantity
18:16wolfjbok
18:16Fer`you just need to define all the functions you need, the format is pretty much already clojure
18:18bbloomtbaldridge: holy hell. i have this working!
18:26swarthycan anyone tell me what is good/bad about this article? http://fragmental.com.br/2011/08/14/clojure_maps_are_not_the_answer.html
18:29callenswarthy: sounds very hypothetical.
18:29technomancyswarthy: it's correct that returning nil instead of throwing an exception is not a good default, but that ship has sailed in Clojure IMO. if you try to fight that you're just going against the grain and are going to isolate yourself in a weird sub-dialect of clojure.
18:29callenusing struct everywhere? just lol.
18:30swarthycallen: technomancy: I was just curious about the author's stance sat within the community\idioms. As I stumbled across it while browsing.
18:30swarthythanks for your input
18:30Fer`my programs are mostly maps and functions
18:30technomancyif you're concerned about the wrong maps getting passed around I feel like preconditions are a much better solution
18:30callenswarthy: the reason for maps, as the article states, is primarily about composability. Identity/class shouldn't really matter in most of your functions.
18:30dnolenswarthy: mostly don't agree, though it's true that with larger code bases it can be challenging to know what a map might need to look like.
18:31technomancythey will get you errors much closer to the root cause
18:31callenI agree on using pre/postconditions.
18:31asteveI hate to say it but don't write code that makes absolutely no sense in context
18:31dnolenswarthy: there are various shape/scheme libraries floating about, you have preconditions, and Typed Clojure can type heterogenous maps.
18:31callenI think you'll write much more reliable code with the educated use of pre/post conditions than you will trying to kill off maps.
18:31dnolens/scheme/schema
18:32callenproliferating structs is...misguided.
18:32dnolenand structs are deprecated
18:33astevedefstruct is deprecated?
18:33callenyep
18:33callenshould be using defrecord/deftype
18:33asteveah, right
18:33callendepending on use-case. Probably defrecord most of the time.
18:34swarthySo maps the majority of the time defrecord if it is really important seems to be the consensus?
18:34callenswarthy: the way I would put it, is that "if you have to ask, just use a map"
18:34technomancyinc
18:34callenmost people coming to need defrecord will know when they need it.
18:35technomancyintroducing a defrecord that isn't driven by a need for fast polymorphism really bugs me
18:35callenditto.
18:35callenit's almost always unnecessary.
18:36swarthyWould you mind giving a simple example of that, or is it useful only in the non-trivial?
18:36callenit's only useful in a non-trivial, highly performance driven use-case
18:36swarthyfair enough
18:36callenpretty much only people like ztellman or aphyr have an excuse.
18:37swarthyhaha, (not-for-newbies defrecord)
18:37callenyep.
18:37swarthyThanks for all the input\help.
18:37callenswarthy: np
18:37swarthyIts hard to know what is of value on the internet.
18:37jkjwell.. at least for a java programmer like me... my brain seems to want dispatch by type that defrecord and implementing protocols gives
18:37callenjkj: don't. your code is cleaner and more reusable if you don't complect your code together more than it needs to be.
18:38callenif your code can be simplified to only caring about associative keys and pairs, and the transformation thereof, *do so*
18:38callenjkj: resist the urge to pimp thy cdoe
18:38callencode*
18:38jkjtrying to :D
18:39callencase in point, Selmer was extremely performance focused and we still didn't use defrecord.
18:39callenwasn't worth our time.
18:39callenwe *did* use protocols, but that was it.
18:40callenand even the protocols were arguably not that big of a win.
18:40jkjcallen: where did you use protocols?
18:41callenFunctionNode/TextNode dispatch.
18:41jkjcallen: deftypes?
18:41callen...no.
18:41callenwell yes'ish
18:41callenh/o
18:42callenit was the dispatch we cared about.
18:42callenSelmer isn't really a shining example of idiomatic Clojure code.
18:42callenit was, as I said, highly performance focused.
18:42jkji used a defmulti for converting getparameters in http://dxsummit.remod.fi/ int query conditions
18:42callenrelative to other libraries solving the same problem.
18:42jkjthe query conditions are defrecords
18:42callendefmulti is usually better.
18:43callenit was deftype and defprotocol, but again, we were concerned primarily with the dispatch.
18:43dobry-denWhat's the best way to refer to files in your resources folder so that your paths still work when you run your app from outside your myapp/ root?
18:43callenit was still maps for everything.
18:44jkjso the original dispatch by parameter name is used to call the proper constructor... that makes records that e.g. know how to make negative versions of themselves
18:44callendobry-den: actually, Selmer can answer this too.
18:44callenjkj: https://github.com/yogthos/Selmer/blob/master/src/selmer/node.clj
18:44callendobry-den: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj#L90-L107
18:45Fer`dobry-den: you can use (clojure.io/resource "path")
18:45Fer`which will turn the path into an url that you can use
18:45Fer`clojure.java.io that is
18:46Fer`dobry-den: the file must be in the classpath though
18:46callenours works the same way, classpath.
18:47Fer`you can make a resources folder inside your project and that will be inside the classpath
18:48jkjany ideas for caching rest api query results?
18:48jkjhttp gets are slow
18:49jkj(get-me-something-from-the-internets-and-cache-it-please "foo")
18:49jonhi like it
18:49kristofjkj: But how will you invalidate that cache? And name the procedure to do so?
18:49jkjkristof: the things i'm after are good for at least 24h or so
18:50jkjso ttl
18:50kristofjkj: It was a reference to the adage about the two hardest things in computer science.
18:50jkjkristof: ok :D
18:51jkjquite true
18:52Fer`jkj: a map of query -> time & result inside an atom?
18:53jkjFer`: might work nicely
19:03callena brief note on defrecords, structs, and maps.
19:03callenMost Python written by veterans, especially in larger codebases, ends up having a LOT of usage of setattr/getattr.
19:03callenThis is a glorified hack to work around the rigidity of class instances and to treat them like dictionaries (maps)
19:03callentry not to repeat their mistakes.
19:03clojurebotNo entiendo
19:03callenjust use maps.
19:06ztellmandefrecord also acts as implicit schema documentation
19:07rasmustocallen: ah, that explains why I was getting confused at my python classes
19:07ztellmanthere are maybe better ways to encode this, but having a Widget defrecord makes it clear what fields/properties a Widget has
19:07ztellmanwhich is valuable, especially in larger codebases
19:07dobry-denHow come this attempt to grab all files within resources/public/ fails with NullPointerException when run in uberjar but works when run through `lein run server`?: (.getPath (clojure.java.io/resource "public"))
19:09dobry-dener i didn't even get to the part of finding all files within `public/` with that code. but that code doesn't work within uberjar
19:10justin_smithdobry-den: in a jar, you cannot do File operations
19:11jkjcallen, ztellman: any examples / docs / war stories / best practices on the issue would be hot. i'm still trying to bend my mind around what kind of polymorphism and multiple dispatch should i do and when not to
19:11technomancyif you have an instinct to frame everything in terms of classes the best thing to do would be to stay the hell away from defrecord until you get that sorted out =)
19:11jkji quess reading other people's code would solve this if i just knew where to start
19:13jkjan example: http://dxsummit.remod.fi/spots?band[]=-vhf <- there are thingies parsed from url query string
19:14jkj...that are shown in the UI and also generate SQL queries
19:14dobry-denjustin_smith: ah, basically i have a jekyll-like system that dynamically renders posts out of `resources/posts/`. when the app starts, i've been looping through the contents of `resource/posts/` and i've been trying to look for a replacement for my now-defunct (.listFiles (File. "resources/posts") code.
19:15jkjthey are e.g. BandCondition{:value "vhf" :negative true :ranges [[1 2][3 4]]}
19:15dobry-denThat code works with older Leiningen when the uberjar is run from app root
19:16callenjkj: like I already said. If you have to ask, you *do not need it*
19:16jkjended up using defrecords as i wanted to make the protocols explicit
19:16justin_smithdobry-den: probably because it actually seeing the file on disk
19:16callenjkj: stop trying to pimp out your code and just use maps.
19:16supersym:)
19:16jkjcallen: yup. i just have a problem that i don't know how to not need it :D
19:17jkjif there is no type, there is no explicit key for multiple dispatch
19:17jkjwell... there is if i make one, but :P
19:17dobry-denjustin_smith: oh. i guess i don't understand the distinction which explains why i don't yet understand why the uberjar works when run with local relative path rather than absolute path.
19:19dobry-denIs there another way to, say, loop through all .markdown files in resources/posts/ and (markdown-to-html %) them on the fly then within a jar?
19:20jkji quess there is no listing files in jars?
19:20justin_smiththere is a way to open them using java.util.zip.ZipInputStream
19:21justin_smithI was just playing with it in a repl to see if I could just hand you a working recipe
19:21justin_smithhere we go http://stackoverflow.com/questions/5419125/using-java-api-from-clojure-reading-zip-file
19:21justin_smithtop answer
19:22dobry-denjustin_smith: thanks, i'll play with that
19:23jkjcallen: i think i figured out how it could've worked without optimizing prematurely.... it's just that just hard to get to use all the language features in one small code base ;)
19:25benedikthttp://pastebin.com/RjwNZnZC # can i make (start-threads) return a list of futures (it is nil)? should i use something other than doseq?
19:26Fer`benedikt: use for + doall?
19:26benediktFer`: what is the differense between that and doseq?
19:27Fer`doseq is for sideeffects and returns nil
19:27justin_smithfor returns a sequence, unlike doseq
19:27Fer`for returns a lazy seq and has the same semantics as doseq
19:27benediktdoes doseq always return nil?
19:27Fer`yes
19:27benedikti learned about something similar in haskell the other day. but ive forgot what so i'ts a moo point.
19:28Fer`doall forces the whole lazy seq to be realized and returns the seq
19:28benediktsounds like what i was looking for
19:32callentechnomancy: I didn't know you actually favored exceptions over nil for error conditions.
19:33Fer`maybe he favors any exception over nullpointerexceptions :P
19:33technomancycallen: ocaml is teaching me how terrible nil actually is
19:34benediktFer`: what happens with the stdout for the futures when usong doall and for? Using println doesn't write to my stdout
19:36justin_smithare you sure the futures are being realized?
19:36benediktjustin_smith: they start listen on the sockets.
19:36justin_smithalso, is this in emacs by any chance?
19:37benediktjustin_smith: it is :o
19:37Fer`benedikt: nothing happens with the stdout. Maybe you should try dereferencing the future to make sure it completes
19:37justin_smithsometimes things in emacs that should print to your nrepl window instead print to the stdout of the nrepl process
19:37justin_smiththat is why I always manually run lein repl and then m-x nrepl rather than jack-in
19:37justin_smithto catch that oddness
19:37Fer`but if you're sending a bunch of futures that write to stdout that sounds like a bad idea
19:38benediktFer`: dangit, there it is.
19:38Fer`the output will be mixed up at best
19:38benedikti used to do that until i discovered jack-in
19:38benediktbetter go back
19:38benediktjustin_smith: meant to highlight you
19:39justin_smithI figured it out, thanks
19:49callentechnomancy: because of option or their support for exceptions?
19:50callentechnomancy: I don't have a problem with nil as long as there's an explicit or implicit "maybe/option" to the API.
19:50callenClojure's GIGO is effectively an implicit maybe/option, which I'm fine with.
19:51justin_smiththe difference is that a failure to check for nil cannot be caught until run time, not using a maybe type properly can be caught at build time
19:51justin_smithbut that is another can of worms
19:51callendoes core.typed have maybe/option?
19:52callenjustin_smith: you're scaring the muggles, stop it.
19:52justin_smithFer`: ocaml, there's a difference
19:52callenthe difference is being able to read other peoples' code.
19:52Fer`do i need a phd for that too
19:52callenno, OCaml is a pretty "lightweight" feeling language.
19:53callenHaskell is smashing you in the face over and over with a wifflebat named "Category Theory"
19:54hyPiRionIn Clojure, you only need to know the difference between simple and easy.
19:55cmathesoncallen: what is GIGO?
19:55justin_smithgarbage in garbage out
19:56callenI answer that question 3-4 times a week.
19:56callenI think I'll outsource it to justin_smith here on out.
19:56justin_smithrelated to pebkac
19:56justin_smithproblem exists between keyboard and chair
19:56callenhyPiRion: lolwut
19:58hyPiRioncallen: why you! think! category on the other shoe to spell for etc. Haskell, Clojure,
19:58jmnozwhat do you use to babel-execute scheme code? racket?
19:58hyPiRionAnd other smart words to live by from horse_ebooks and friends
19:58callenhyPiRion: I actually really like https://github.com/uncomplicate/fluokitten
19:59cmathesonthanks justin_smith
20:01hyPiRionI don't mind fluokitten either, but I don't understand the name of the lib
20:01hyPiRionBut at least it's very easy to google, so there's that
20:12kmicuflu-o-kitten
20:16kmicuYou do not need to understand IO monad to use it and you do not need have a PhD to create let form in clojure.
20:16kmicuhttp://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/
20:16kmicujust sayin'
20:16kristof^
20:16kristoflet's not fight, guys =)
20:17kmicuThis is not a fight.
20:17kmicuThis is simple morphizm.
20:19kristofIt's a functor!
20:19kristofBetween two categories =)
20:20kmicuFunctor is so basic, that we shouldn
20:30kmicuCall it extreme if you like, but I propose we hit it hard and hit it fast with a major - and I mean major - leaflet monad campaign.
20:38jimdueyfor monads and more: http://clojure.net
22:18FoxboronIs there any twitter or mailing list dedicated to promote new clojure libs?
22:20`cbpFoxboron: maybe you could try def newsletter?
22:23Foxboron`cbp: actually following the twitter but not signed too the newsletter. Thanks ^^
23:32callenFoxboron: Planet clojure has a twitter feed, the official Clojure mailing list has [ANN].
23:32Foxboroncallen: thanks ^^