#clojure logs

2013-03-10

00:03anildigitalHi.. I installed clojure-mode in emacs but I don't have Mx clojure-jack-in
00:04tomojis there a really good reason you can't extend one protocol to another?
00:05tomoj(extend-protocol CollReduce Object (coll-reduce ([coll f] (seq-reduce coll f)) ...))
00:06Raynesdevn: I don't think API docs are really more useful than just looking at the source.
00:07RaynesYou still have no way of knowing if what you want is there without looking through everything, and the source code is well organized so you don't have to look through *everything*, just everything in the category of the thing you need.
00:07technomancyinc
00:07arrdemanildigital: it's nrepl-jack-in from package nrepl
00:07Raynesdevn: As for inclusive-range, ask amalloy.
00:07anildigitalarrdem: there is no clojure-jack-in present now
00:08arrdemanildigital: that's provided by swank-clojure
00:08arrdemanildigital: which is deprecated for nrep.el
00:08anildigitalarrdem: what package should I install for swank-clojure
00:08anildigitalarrdem: so you say nrepl is new
00:08arrdemanildigital: https://github.com/kingtim/nrepl.el
00:09technomancyanildigital: if you want clojure-mode to help you with swank, you would need an older version (1.x)
00:10anildigitaltechnomancy: hmm ..can I know latest steps to play with clojure from emacs
00:10technomancysure: http://clojure-doc.org/articles/tutorials/emacs.html
00:13anildigitaltechnomancy: I created a project .. and done nrepl-jack-in .. it says "error in process sentinel: Leiningen 2.x is required by nREPL.el"
00:13anildigitalI have upgraded my lein just now
00:15anildigitallooks like this issue http://stackoverflow.com/questions/13243048/mac-osx-emacs-24-2-and-nrepl-el-not-working
00:17anildigitaltechnomancy: it worked when I ran this from command line /Applications/Emacs.app/Contents/MacOS/Emacs project.clj
00:17anildigitalany setting that I can do so that I don't have to run emacs with command line
00:17anildigitalthanks
00:18technomancyyeah, the $PATH on OS X is really ridiculous
00:18technomancyI don't know off the top of my head how to fix it, but it involves editing a plist.xml file
00:18technomancyif you need to launch it from the GUI anyway
00:19anildigitaltechnomancy: okay thanks
00:19technomancysure
00:37dcolishyeah theres a .MacOS folder in your home dir you need to set the path in
00:55anildigitaltechnomancy: https://github.com/purcell/exec-path-from-shell was the answer .. spread the word
00:56technomancygross =\
00:56technomancybut yeah, for those that have the misfortune to run into that problem it's probably better than editing XML files
00:58thm_prover(clojure.core.typed/check-ns) <-- does this hang for anyone else?
00:58thm_proverhas anyone managed to use typed in production code?
00:59anildigitaltechnomancy: :)
00:59anildigitaltechnomancy: would you suggest any good book to start learning clojure?
01:00thm_provertechnomancy: what have you used core.typed for?
01:00technomancyanildigital: http://clojurebook.com is a great place to start
01:00Raynesanildigital: That seems like a whole lot of code.
01:00anildigitaltechnomancy: thanks..
01:00technomancythm_prover: I'm not really interested in static typing without an inference engine
01:00anildigitalRaynes: yeah.. but it helped..
01:01thm_provertechnomancy: I like inference engines too. In fact, I like theorem provers like isabelle/coq.
01:02technomancyhopefully some day typed clojure will provide that, but it sounds like it's a long way away
01:04thm_provertechnomancy: http://cljbin.com/paste/513c22c8e4b03285d2084c90 <-- any idea why check-ns infinite loops or how I should start debuggint this?
01:06amalloymaybe it's not infinite. wait till the end of the universe, just in case
01:07arrdemamalloy: could even be O(1) where C is the heat death of the universe...
01:07amalloycertainly your annotation for add is bogus
01:07thm_proveryeah, why did it accept it?
01:07arrdemthm_prover: thanks for linking that project
01:07thm_proverit should be Integer -> Integer -> Integer
01:08thm_proverit's so frustrating using experimental projects by people smarter than me; I can't bash them for being stupid since I can't implement it myself
01:09dnolena response to Mark's LP is overrated blog post - http://swannodette.github.com/2013/03/09/logic-programming-is-underrated/
01:13Raynesdnolen: I really enjoyed the other guy's blog post.
01:14dnolenRaynes: heh, I didn't mostly because of the inaccuracies. But I certainly won't argue w/ the point that list comprehensions can be used to do the same thing for small problems.
01:15Raynesdnolen: I'd probably like core.logic more if it weren't for there being 'o' at the end of every thing. I hate reading that.
01:15RaynesIt's likely just OCD, but it makes me want to break my laptop.
01:15dnolenRaynes: then don't write that in your own code.
01:15RaynesAnd 'conde'
01:15Raynes"What, you're using ghandi in your code?"
01:16dnolenRaynes: I don't use conde much
01:16alandipertdnolen: nice
01:17Raynesdnolen: I don't actually have anything against core.logic or anything though. I haven't had a reason to use it but I'm sure I will one day. I'm mostly just waiting for a Conj where there are less than 5 core.logic talks. :p
01:17RaynesNot to put anyone who has done core.logic talks down or anything.
01:17RaynesJust that I, in particular, have seen the topics covered enough times that it becomes yawn inducing after a while.
01:18RaynesBut I, as it turns out, am not the only person in the world, so *shrug*.
01:18dnolenRaynes: heh, I think there's only one core.logic talk at Clojure/West?
01:18RaynesDoesn't help me because I'm not going to clojure.west. :p
01:19RaynesEveryone will make up for it with 4 extra logic talks at conj 2013!
01:19dnolenRaynes: haha, I doubt it - I'm looking forward to the "core.logic in my codebse? no big deal ..." future
01:20dnolener, codebase
01:24scottjdnolen: do you have a list of what you'd call the core.logic core functions if it weren't for minikanren?
01:27dnolenscottj: I should probably be more consistent ... buuut ... most things with a docstring are intended to be used by users.
01:27dnolenscottj: we're slowing moving away from the miniKanren / TRS stuff - too much emphasis on lists
01:27scottjdnolen: I see now how my question is confusing :) have you come up with alternative names for the core functions, like names you think are better than the minikanren ones?
01:28dnolenscottj: not really, my point is mK is really list centric. Which is pretty jarring for Clojure programmers.
01:28dnolenscottj: I'm on a mission this year to change to that story.
01:29dnolenscottj: so core.logic suffers a bit currently from adopting some of the list centric stuff, ideally we'd have polymorphic goals/constraints in proper Clojure style.
01:35dnolenscottj: maybe that isn't answering your question, are there some mK goal names you have in mind?
01:36scottjdnolen: I actually don't know core.logic well, but even names like run, run*, fresh, conde, didn't sound like the names someone would give these functions if they were designed by a clojure programmer with no minikanren history
01:37scottjdnolen: I realize why you kept them, to make learning and using reasoned schemer easier, but I wondered if you'd thought up alternative more clojure-like names
01:38dnolenscottj: primitive operators like run/run*/fresh/conde are unlikely to change
01:40dnolenscottj: and I'm not sure there are better names for those and conde ideally used less often than defne/matche
03:33danneueclipse + ccw + vrapper is pretty nice
03:34RaynesI have a box of facts here.
03:34RaynesI'll put that in it.
03:36danneuthat's right. i don't have opinions, just facts
03:37danneui just mean i've been using vim since i started programming (ruby) and never needed to use an ide before.
03:40alandipertRaynes: lol
03:43Raynesdanneu: I was just being silly. :)
04:12devnalandipert: oh hello
04:13devnRaynes: yo
04:13Raynesdevn: sup
04:13devnRaynes: meh, a little water logged and trying to figure out what's broken
04:13RaynesWell, it sounds like a pipe is broken.
04:14devnRaynes: heh
04:15devnRaynes: i copy and pasted too much from your code on refheap
04:15RaynesMy code is broken or you don't understand my code and thus your code is broken and you can't figure out why? :p
04:15devnim trying to figure out why :user is always nil when I query for all the sexps saved with {:user "foo"}
04:15devnRaynes: likely the latter because i threw it together
04:15devnhttps://github.com/devn/getclojure/blob/master/src/getclojure/models/sexp.clj
04:16devnalso, don't judge me for that "make-connection!" thing
04:16devnit's litter and it needs to be picked up
04:16RaynesI didn't plan on it. REPL development is a pain in the ass with monger/mongodb connections.
04:17devnthat's why it's littered :)
04:17devnexactly
04:17devni should probably just with-connection-ize it
04:17devnand use that pattern
04:18Raynesdevn: You've looked into the DB and made sure these things are, in fact, not nil?
04:18devnRaynes: nono, they're quite nil
04:18devnbut im not sure why
04:18devnbecause it's late and im getting lazy
04:18devnthis is a cry for code review
04:19Rayneslol
04:19Raynesdevn: Do you have all of your current code in this repo?
04:19RaynesIf so, I'll take a look.
04:19devnRaynes: yeah this is it
04:19RaynesOkay.
04:20RaynesGive me 10 minutes and I'll have this fixed for you.
04:20devnhaha, <3
04:20RaynesAlso know that I can't make the above promise.
04:20Raynes:p
04:20devnRaynes: are you going to clojure/west?
04:20RaynesNope.
04:20devnshit
04:20RaynesWe're all hoping to get to go to the conj though.
04:20devni reallllly want to make it to west
04:20devnbut im not sure if i can
04:21devnmainly i just want to see alandipert invert people's brains with what he's been working on
04:33devnRaynes: the seed task is hint
04:33devnerr the seed.clj -main
04:34Raynesdevn: Why did you set this crazy ass mongodb port?
04:34devnI don't think I set a port?
04:35Rayneshrm
04:35RaynesAttempting to connect to elastic search...
04:35RaynesThe elastic search endpoint is http://127.0.0.1:9200
04:35devnWhere do you mean?
04:35RaynesDid elastic search set this port?
04:35devnthat's elasticsearch
04:35clojurebotTitim gan éirí ort.
04:35RaynesIt is trying to connect to mongodb on this port.
04:35RaynesIt makes no sense. This isn't the default port.
04:35devnwha? really?
04:35devnwhat version of mongo and what version of ES?
04:35devnthat's...just strange
04:36devnim not having that issue
04:36RaynesElastic search is something else you have to run?
04:36RaynesI guess so.
04:36devnRaynes: yeah sorry for the super shitty docs
04:36RaynesDid not know this.
04:36devnman, now i feel bad
04:36RaynesWell, it isn't your fault I didn't know what elasticsearch is.
04:37devnyes, you need elastic-search running. i just `brew install elasticsearch` and then run it in the foreground like: elastic-up='elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.20.4/config/elasticsearch.yml'
04:38devnim using a heroku addon for elastic
04:38devn(in prod)
04:43devnRaynes: are you still looking at it? im close to bed time
04:44devnactually i'm way past, but it would be cool to get this figured out before bed
04:44Raynesdevn: Yep. I'll pull request you if I figure out the problem, or at least open an issue or something if I can't fix it tonight.
04:46devnRaynes: thanks for taking a look. if you go to getclojure.org right now you can see sort of the direction im going in, but the idea is: search is great, but the relevance of results is way wrong: a search for "juxt" will give you a result near the first page of results like: (juxt juxt juxt juxt juxt juxt juxt juxt juxt juxt)
04:46devnwhich is useless, so I'd like to bring the idea of ratings on sexps into the equation
04:46Rayneslol
04:46devnallow people to login, rate things, and then make that part of the "score" of an sexp in the db
04:46Raynesjuxt juxt juxt juxt
04:47devnyeah, unfortunately i think a useful search engine for this kind of info requires some human intervention
04:48devnthere are 32k sexps to rate -- i figure if i do something like clojuredocs and have a leaderboard or something, i might be able to get all of them rated
04:48RaynesI pictured you sitting handling requests and selecting only queries you personally think are relevant to serve.
04:48RaynesSlowest web service ever.
04:48devnhahaha yeah, well, i could write skynet, or i could rate 32k results by hand
04:48devnwhether anyone likes it or not, i think the latter might be the best bet
04:49Raynesdevn: Whooooa
04:49Raynesdevn: Is it seeding 32k things?
04:49RaynesBecause this is majorly slow.
04:49devnyes
04:49clojurebot'Sea, mhuise.
04:49devnRaynes: welcome to shelling out to pygments :)
04:49RaynesIn that case, I might have to look at this tomorrow because it'll be 7 years before this is finished.
04:49RaynesIs it necessary to seed the whole thing in order to do things?
04:49devnRaynes: just seed it with (take 10 ...)
04:49devnRaynes: nah, that seed task is just something i've been running after i deploy to heroku
04:49RaynesI just stopped the seed stuff. It should have the 108 I seeded.
04:50devnRaynes: you should be able to mc/find-as-maps "sexps"
04:50devnand see those 108
04:50RaynesGot the site running.
04:50devnyou'll notice that all of the :user keys on those maps have a value of nil
04:50devnand that's what im trying to figure out
04:51RaynesYou've got the king of debugging stupid shit on your side.
04:51devni just want to seed the initial set of queries as belonging to the user "admin"
04:51RaynesWe'll have this figured out in no time.
04:52devnI think I might be messing up :_id and :id at some point, or I'm getting an empty map back or? Grr... Needs more eyes. Thanks for looking.
05:00Raynesdevn: Well, your problem is that :id isn't a thing.
05:01Raynesdevn: Are you still awake?
05:20devnRaynes: barely. i need to go to bed like now. it's really late here. can we chat tomorrow?
05:21devnhopefully the answer is yes because im literally falling asleep
05:21Raynesdevn: I sent you a pull req.
05:21devnwoohoo! ill look in the morning
05:21devnthanks for the help buddy
05:21Raynesnp
05:21devngnight
05:21Raynesnight
06:09tomoj(assert (satisfies? clojure.core.protocols/CollReduce 42))
06:10tomoj(inc default protocol impls)
06:10lazybot⇒ 1
06:13tomojhmm
06:13tomojis there any good way to try to get the next element of a lazy seq but with a timeout?
06:14tomojbasically IBlockingDeref for the hidden delay
06:14Raynestomoj: Well, you could use a blocking queue.
06:15tomojseque?
06:15Raynestomoj: seque wont work because there is no timeout.
06:16RaynesYou can pass it a blocking queue indeed, but you can't make it use a timeout arg when polling that queue.
06:17RaynesThat said, it isn't too hard to write something like it yourself.
06:18RaynesActually, what you said is kinda weird and may not be what I was solving here.
06:18tomojhttps://www.refheap.com/paste/e10b0d030f1fa49bc87f32a4c
06:18Raynestomoj: So your lazy seq is produced via something that causes side effects and may take a long time, or?
06:18tomojwell
06:19tomojI realized I don't actually want IBlockingDeref, I just don't want to block at all, because it's cljs
06:19tomojI was thinking I wanted to detect whether first would block, but you wouldn't write a blocking lazy seq in cljs anyway
06:19RaynesYeah, I'm useless for cljs.
06:20tomojstill interesting to me that if lazy seq's delay were exposed as a deref, IBlockingDeref could be there
06:43tomojso default impls with closed dispatch for one or a few core types in the language are OK, but protocol impl inheritance is evil? :(
06:47tomojcljs could use it to define CollReduce for all ISeq, or there's Diff
06:47tomojbut because someone could use it to build crazy hierarchies of impl inheritance, it can't be allowed?
06:49raggeanyone up for some AOT related troubleshooting?
06:50ambrosebstomoj: That doesn't sound like a fair comparison. Rich is using Java idioms to write Java, and there are no alternatives there. We can always write macros in Clojure.
06:50raggeit's an exciting issue, promise
06:50OscarZmany of you have probably read SICP (structure and interpretation of computer programs) .. would you recommend it or is there some better book on the same topic ?
06:51tomojwrite macros?
06:51tomojyou mean like adapt-protocol?
06:51tomojI'm not lamenting the dust in the core bootstrap
06:52tomojI'm trying to decide if protocols have a problem
06:54tomojhttps://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/data.cljs#L105-108
06:54tomojI wrote that, so I think I'm being fair :)
06:55tomojand no java in the way
06:55borkdudeI see as-> expands to let*
06:55borkdudewhat's the difference between let and let*
06:55borkdudein clojure, not in elisp, etc
06:55tomojthe body of the let macro: `(let* ~(destructure bindings) ~@body)
06:56tomojlmM-.tfy
06:56borkdudelet* is a lower level let without checks?
06:56tomojwithout destructuring
06:57borkdudeah
06:57borkdudeI was typing something about the threading macro's. Like: you can do (let [x 10 x (inc x) x (inc x)] x) but this isn't idiomatic. Clojure has threading macro's for this, blablablablabla...
06:58borkdudeand then I looked at the expansion of as-> :)
07:02ambrosebstomoj: sorry I thought you meant core Clojure JVM
07:10tomojwell, that too
07:10tomojbut it's actually better there
07:10tomojbecause you can extend to an interface
07:11tomojI still can't extend to my protocol, but I don't have many types, so it's OK :)
07:17Guest46648do you guys know of any good graph based Databstorage besides neo4j. I noticed that I can only use the free version of neo4j in non-commercial settings. Any ideas of what would work good with a clojure stack?
07:21squidzdo you guys know of any good graph based Databstorage besides neo4j. I noticed that I can only use the free version of neo4j in non-commercial settings. Any ideas of what would work good with a clojure stack?
07:22vijaykiransquidz: did you try titan?
07:22squidzno Ive never heard of it
07:22squidzis it clojure specific=
07:22squidz?
07:22vijaykiranno not really - it is a graphdb based on cassandra
07:23squidzokay now I see. Is it pretty standard among clojurists?
07:23scottjsquidz: clojure wrapper for titan https://github.com/gameclosure/hermes
07:23squidzI see that the last source update was 9 months ago
07:23vijaykiranhttps://github.com/thinkaurelius/titan
07:23vijaykiranthere are atleast two clojure-titan libraries
07:23vijaykiranhermes and another one from clojurewerkz
07:23squidzit looks really nice to use though
07:24vijaykiranI think titan has a friendlier license
07:24vijaykiranthan neo4j
07:24scottjsquidz: last source update 16 hours ago at repo vijaykiran posted
07:24squidzscottj: for titan-clj?
07:24scottjsquidz: titan itself
07:25squidzoh okay, I meant the wrapper
07:25squidzso between the titan-clj and the clojurewerkz what is used more'ß
07:27squidzokay it seems like titanium is more active
07:27scottjsquidz: no clue, in case you didn't notice there are 3 clojure titan wrappers though (hermes, which looks to have the most forks but readme says its young)
07:28squidzscottj: oh thanks I didnt notice. Ill take a look at how it is with all three. Thanks for the tips. Yall gave me exactly what I was looking for
07:33WormJuicesquidz, I'm the best programmer in the world second only to the Microsoft Chief Software Architect
07:33squidzWormJuice: lol okay
07:34WormJuicesquidz, serve me well, and I shall let you live.
07:34WormJuiceFail me, and you shall meet a swift death
07:35squidzokay this is out of nowhere. Are you going somewhere with this?
07:37WormJuicesquidz, yes, with your cunning and my skills, the world shall be at our bidding.
07:37WormJuiceJoin me and we wil rule this wretched planet
07:39squidz...
07:42squidzWormJuice: do I know you?
07:43WormJuicesquidz, not yet, but my name shall soon be engraved into your memory as we take over the world.
07:43WormJuiceJoin me
07:44squidzJoin you with what?
07:44WormJuiceWith our bid for world domination my friend.
07:44WormJuicesquidz, https://lh6.googleusercontent.com/--KCN_CX7NCQ/UTxpxq7XMxI/AAAAAAAABUo/1-n4pmV_w3I/s0/Terrain%2520146.jpg
07:45squidzstarcraft?
07:47WormJuicesquidz, you play?
07:48squidznot really. Ive played a couple of times why?
07:48WormJuiceJust wondering if you do, a lot of people here seem to.
07:49squidzI thought you were going to make a programming proposal
07:49squidzto join you in a clojure quest
07:49squidzonly to be let down
09:01ambrosebsIs the Rhino REPL *the* way of working on CLJS, or are there more popular methods?
09:01ambrosebsMy core.typed port will probably require using it, hopefully that's no hassle. I'm out of the loop here.
09:04Bodilambrosebs: I'd recommend https://github.com/bodil/cljs-noderepl unless you really enjoy slow JS engines. :)
09:06ambrosebsBodil: Right now I plug in to the Java implementation of core.typed via :require-macros. Is this still possible?
09:07Bodilambrosebs: As long as the macros don't generate any JDK specific code, then yeah.
09:08ambrosebsOk. I need to actually run Java code during macroexpansion :/
09:09ambrosebsIs that possible?
09:09edwambrosebs: Let's assume it's possible. Are you discerning things about the JVM? Because the macroexpanding VM might not be the evaluating VM.
09:10edwThink `lein uberjar`. Also `gen-class`.
09:11ambrosebsCurrently I'm using Rhino, and it seems to just work.
09:12edwCLJS?
09:12Bodilambrosebs: That still works. The only problem is if the code that comes out of the macro expansion doesn't run on Cljs.
09:13ambrosebsBodil: ok. g2g tho, thanks!
10:06dimovichgiven the reorganized clojure contrib ecosystem, where can I find the re-gsub function?
10:06borkdudehmm, looks like the clojure entry here can use some work: http://hyperpolyglot.org/lisp
10:37gfredericksis there any reason to prefer (alter-var-root #'foo (constantly val)) over (def foo val)?
10:37gfredericksI guess it's an explicit update? :/
10:41gfredericksdimovich: does clojure.string/replace not do what you want?
11:03lispy_hey guys
11:03lispy_whats the current best practice way to do a recursive directory delete ?
11:06lispy_I'm seeing a 'delete-file' function but no mention of recursive delete in clojure.java.io ?
11:07edwlispy_, do you want to delete a directory or are you looking for some idiomatic sample code? If the former, why not just shell out to the OS and "rm -rf ..."?
11:07lispy_edw: I just wanted to know how directory delete is done in clojure land
11:08lispy_I just thought it was curious that there is a delete file but no delete directory
11:10edwlispy_: ah.
11:10lispy_edw: just use (.delete (File. "some-directory")) ?
11:11edwNo, that doesn't recursively delete either. You need to depth-first delete all files.
11:11edwApache's commons-io FileUtils has something for you.
11:11lispy_edw: nuts… thought this would be handled in a library somewhere :-)
11:11lispy_ah cool
11:11lispy_thanks!
11:11edwYou're welcome.
11:12edwFileUtils.deleteDirectory().
11:12edwOr give me ten minutes and I'll write the equiv in Clojure for you. Burnt out but in a programing mood.
11:12lispy_no :-) sounds like you need to take a break
11:13lispy_thanks for the pointer
11:13lispy_surprised we don't have it yet
11:14lispy_gonna scan for libraries like : https://github.com/jashmenn/clj-file-utils see if someone has clojurised this for me already
11:22edwlispy_: `delete-cursively`: https://gist.github.com/edw/5128978
11:22lispy_edw: haha, nice one
11:22lispy_saves me pulling in a bunch of jars :-)
11:22lispy_thanks
11:24edwNo problem. Always enjoy writing some nice looking code.
11:25lispy_wonder what has stopped a version of it going into clojure ecosystem core somewhere ?
11:27edwParsimony? It's a simple function. And it's a chainsaw.
11:28edwBTW, lispy_, that call to `file` allows this to take a string pathname.
11:28lispy_I guess… leave maintenance of it to others
11:28lispy_edw: I spotted that thanks
11:33edwTake another look: this one is better. It doesn't call file more often than necessary. https://gist.github.com/edw/5128978
11:36edwJust updated it again so that it, you know, works… https://gist.github.com/edw/5128978
11:37lispy_edw: cool, thanks will try it out now
11:43ToxicFrogThis seems like a specific application of ftw
11:45edwToxicFrog hmm?
11:46ToxicFrogedw: file tree walk. A POSIX C function that is basically (ftw path fn flags) and recursively calls fn on every file and directory under path.
11:46ToxicFrogI forget if java.io has an equivalent.
11:47edwAh! I thought your were making some (ugh!) “FTW!” reference a la "FAIL.”
11:47edwHmm, yeah, that makes me wonder if clojure.walk has something useful for this situation.
11:49edwNope. Need a fund to create a lazy file tree and then clojure.walk becomes the way to go.
11:50edwHmm…
12:05edwlispy_: There is is file-seq, which looks like what we need.
12:06lispy_edw: cool, looking it up now
12:08edwYou could probably (doseq [f (reverse (file-seq (java.io.File. file-name)))] (delete-file f))
12:09edwYou need to reverse it, lispy_, because it lists a dir before its contents.
12:12lispy_edw: oh, I've used file-sew before, forgot about tit, cool
12:13myeWhat do the clojurescript and emacs users among you do to manage two repls (one for clojure, on for clojurescript)?
12:14myeI've piggieback setup and can start both repls, but now I need some automation that sends to the clojurescript repl from .cljs buffers and does the right thing for .clj files
12:15myeThere's one way to do it manually shown here: https://groups.google.com/forum/#!topic/clojure-tools/C0jND-uuV28/discussion
12:16myeHe later mentions "nrepl.el streams", is someone using that?
13:04antoineBhello
14:02supersymprogramming in LightTable is so much fun already,... nice that this time (Leiningen,LightTable) I get the joy of learning Clojure/Lisp properly :D
14:03zmilleris there some special way that protocols have to be :required from other namespaces?
14:08squidzis there a way to make lein refresh project dependencies within emacs nrepl?
14:10zmillerI created a protocol with 1 function that only takes 1 argument (this). If i create a function that uses that protocol from within the same namespace, there's no problem. but if i :require that protocol and then try to define the function that uses it in another namespace, i get a java.lang.verifyerror. however, it is perfectly fine if i just call the protocol from the other namespace...
14:10zmiller...without putting in inside a defn
14:11gfrederickslastlog -clear
14:12gfrederickszmiller: could you post a bit of code?
14:13zmillerso the first namespace has
14:13gfredericksrefheap.com
14:15zmillerhttps://www.refheap.com/paste/12373
14:16zmillerthe announce-winner! function throws the error when i try to define the form
14:16zmillerbut if i replace the dod/winners with some random function such as first, it will compile that form
14:16gfrederickswhat is the (:import dice.dice_of_doom) about?
14:17zmillerthose types are defined in the first namespace, there is another protocol that i am extending to those types in the 2nd namespace
14:18zmillerso i wanted to refer to them without typing out the entire class. i have also been putting type hints in (for myself) so i don't want to type out the whole name every time
14:18gfrederickshmm I can reproduce it; I have no guesses but I'll noodle it a bit
14:19gfredericksI've never seen a VerifyError before
14:19zmilleri googled, i only found 1 clojure page talking about it
14:21Bronsamh
14:22Bronsa>java.lang.IllegalArgumentException: Unable to resolve classname: ISeq
14:22zmillerah!
14:22gfredericksI have to think this has something to do with the typehint
14:22gfrederickswhich is the weirdest part
14:22Bronsayeah
14:22Bronsathat's it
14:22zmillerif you import ISeq into the 2nd namespace, it's okay
14:22gfredericksI don't know why though
14:23gfrederickso_O?
14:23clojurebotLINE-ing-en ['laɪnɪŋən]
14:23gfredericksclojurebot: thanks
14:23clojurebotWe live to serve.
14:23Bronsagfredericks: it looks like it doesn't use the full qualified class name
14:23gfredericksit wants to resolve it in every namespace you use the protocol in?
14:23Bronsaapparently so
14:23gfredericksthat weeerd
14:24zmilleroh, so the fact that ISeq is typehinted in namespace 1 means that if namespace 2 wants to use it, it has to import ISeq
14:24jtoycan I read in a string with a macro and evaluate it without using eval?
14:24Bronsawell I think this is a bug anyway
14:24zmilleryeah, it doesn't seem like it works the way that it should
14:24zmillerthank you you 2! i could never have figured this out on my own
14:25BronsaI'll try and see if i can get a patch
14:26zmilleroh by the way, how did you get the error that mentioned ISeq? i'm using nrepl and emacs and it didn't give me that error
14:27gfredericksjtoy: that's a question that's hard to interpret; can you describe your motivating use case?
14:28zmilleroh i see, i have to open up the nrepl-events buffer
14:29supersym:)
14:29jtoygfredericks: I'm trying to create a function that allows me to pass in a string and have them be evaluated in the context of the sytem, very simple expressions like (> age 25), someone recommended that I use a macro to do this. im still very new to the macros so im trying to figure out how to do this
14:31supersymhuh... so like a string, as in date or like someones life story.. and is age not the only one criteria to search for
14:31supersymdoesnt seem to me you would need a macro tho
14:32Bronsazmiller: I'm still using SLIME
14:32jtoysupersym: this is exactly what im trying to do: https://groups.google.com/group/cascalog-user/browse_frm/thread/908ef0ef7449c35b
14:33zmillerwhat would be wrong with using eval?
14:33jtoywell, i tried eval, but I couldnt get it to work, i think its because "eval wouldn't work because the query itself is generated from macros"
14:34gfredericksjtoy: if you're processing strings you don't need a mocr
14:34gfredericksmacro*
14:34Bronsazmiller: it looks like it's really an edge case
14:34gfrederickseval should work fine
14:34zmiller(def hello 3)
14:34zmiller(defn age-comp [s]
14:34zmiller (> (eval (symbol s)) 5))
14:34zmiller(age-comp "hello")
14:35gfredericks(defn process-in-context [code-string] (binding [*ns* (the-ns "my.system")] (-> code-string read-string eval)))
14:36gfredericksif you're only dealing with single symbols you can probably use resolve and deref instead of eval
14:36jtoygfredericks: ok, ill test out your example, is this releveant though? " "eval wouldn't work because the query itself is generated
14:36jtoy from macros""
14:36gfredericksI have no idea what that means
14:36jtoyneither do I
14:36jtoyhaha
14:37gfredericksI'll look at the thread
14:39gfredericksoh maybe I know what he meant
14:40gfredericksyou could put the query in a backtick
14:40gfredericksthis is a bit sticky though. should definitely be workable but I don't have the time to braindump about it
14:40gfredericksyou should definitely _not_ have to write your own macro, though it's possible doing so might make things slightly simpler
14:40gfredericksbut eval should be sufficient
14:41jtoygfredericks: ok, ill test some more,thx
14:43gfrederickshyPiRion: dangit I kept looking around github and twitter for "hyperion" and couldn't find you :P
14:56supersymcould I use something like org-mode emacs with LightTable, that anyone knows of?
14:56supersymmeta-programming that is
14:57supersymi know you could build it from scratch, but i wondered if it was able to tap into the elisp Babel program
15:06Bronsagfredericks: zmiller I have a patch
15:06Bronsahttp://sprunge.us/WENi?diff I'm opening a bug on jira now
15:14ghadishayban1.5.1 just got released
15:14ghadishaybanfyi
15:21zmillerwow Bronsa, you are fast
15:37ghadishaybanbronsa: there are some failing tests in your patch
15:37hyPiRiongfredericks: That's what you get for not spelling my nick properly
15:37ghadishaybanin clojure.test-clojure.protocols
15:38Bronsaghadishayban: I tried building it and they were passing, let me check
15:40ghadishaybanbronsa: np. I had some phantom issues getting repeatable tests today on another patch.
15:42ghadishaybanyou might have to correct equality in on the "protocol fns have useful metadata" deftest
15:42Bronsaghadishayban: tests are passing here, can you nopaste me the error you're getting?
15:43ghadishaybansure, one sec
15:43zmillerso you're the hyPiRion who i shall never catch in projecteuler!
15:46hyPiRionzmiller: Yeah. Not worked on it for a long time though. Perhaps I should.
15:46ghadishaybanbronsa: http://nopaste.info/476f5346f5.html
15:49ghadishaybanbronsa: the tags in the metadata don't match anymore
15:50Bronsayeah
15:50Bronsathey are resolved now
15:51Bronsaghadishayban: I'll fix this, resolve is not the correct function
15:51edwIs there a reason I need to ('require clojure.repl) to get C-c C-d to work in nrepl-emacs?
15:51arohnerdoes (alter-var-root #'my-fn) work as expected with clj 1.3+ compiling of defn sites?
15:51Bronsaedw: C-c C-d is probably using clojure.repl/doc
15:52edwBronsa: yes, I am aware. But why doesn't nrepl.el require it?
15:52ghadishaybanedw: it should -- I *just* switched to emacs and it's there by default
15:53edwHuh. It disappeared with 1.5.
15:53ghadishaybanedw: do you have melpa and marmalade enabled?
15:53edwWhen I switched to 1.5.0, that i.
15:53devn,(require '[clojure.pprint :as pp])
15:53clojurebotnil
15:53ghadishaybanClojure 1.5.1 is out -- FYI. nasty little memleak
15:54edwSaw that seconds ago. Already updated me 1.5 apps. Thanks.
15:54edwComparing MELPA to Marmalade nrepl versions. I have (only) Marmalade.
15:55devn,(pp/pprint (read-string "(^:once fn* [x] x)"))
15:55clojurebot(fn* [x] x)\n
15:56devn,*clojure-version*
15:56clojurebot{:major 1, :minor 5, :incremental 0, :qualifier "RC6"}
15:56devnweird
15:56ghadishaybanenable melpa and you should be good.
15:56devnim on clojure {:major 1, :minor 5, :incremental 0, :qualifier nil}
15:56ghadishaybani think -- technomancy helped
15:56devnthis is what i see when i try the above
15:57devn,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(^:once fn* [x] x)")))
15:57clojurebot#(#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
15:57devn,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(fn [x] x)")))
15:57clojurebot(fn [x] x)\n
15:57devnanyone know what's up with that?
15:58devn,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(fn* [x] x)")))
15:58clojurebot#(#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
15:59devnit doesn't like that *
16:02edwThe MELPA docs say put the add-to-list *before* package-initialize but I get warning when doing that and have always put it *after*. Thoughts?
16:04edwAh, upgrading to the current MELPA version of nrepl solved my problems. Thank you.
16:05ghadishaybanedw: no problem.
16:06edwghadishayban: yeah, the (require 'package) did it for me. Thanks again.
16:18Bronsaew
16:18Bronsadefinterface is broken too
16:20ghadishaybanit's hard to remember *where* exactly type hints go
16:21ghadishaybanthe code in CLJ-1180 doesn't ring familiar to me -- I thought the hint goes outside the fn
16:22ghadishaybanbut I'm speculating -- should look it up
16:23ghadishaybanbronsa: see CLJ-1136 for a laugh
16:23Bronsaheh
16:24Bronsayeah, the compiler is definitely not consistent on metadata evaluation
16:25ghadishaybanofficial doc is that return hints go on the arg vector
16:25ghadishayban(f ^ISeq [a b c])
16:26Bronsaghadishayban: that might have changed a while agoo i think
16:26ghadishaybanerrr (defn f (^String [a b c]))
16:26Bronsabecasuse of problems with varargs functions
16:26ghadishaybanoh
16:26Bronsammmh
16:26ghadishaybanpulled it off clojure.org
16:26clojurebotclojure is like life: you make trade-offs
16:26ghadishaybanno guarantee there =)
16:27Bronsaghadishayban: well, on clojure test (defprotocol ExcampleProtocol .. (^String baz [a] [a b] ..))
16:27Bronsaso..
16:28ghadishaybanyou're totally right
16:30Bronsaok, tests are passing now
16:31ghadishaybannice. fixing the worlds problems
16:31ghadishaybanwhat did you end up doing?
16:31Bronsaone sec
16:33Bronsaghadishayban: http://sprunge.us/CAjJ?diff
16:33Bronsaeither I had to make tagToClass public, or I'd have had to rewrite maybeClass in clojure
16:34Bronsaresolve is a no-go becasuse (resolve 'booleans) => #'clojure.core/booleans
16:34Bronsabecause*
16:35ghadishaybanwhat about tagClass?
16:37Bronsaoh, that's probably better, you're right
16:37ghadishaybandunno
16:37ghadishaybani'm not really peeking too deeply
16:37Bronsano wait
16:37Bronsait seems like they do the same thing actually
16:38BronsatagClass is just nil-safe
16:38Bronsabut my call to tagToClass is wrapped in a when so it's safe
16:42ghadishaybanlooks good
16:42Bronsawell, fixing clj-1136 would probabily fix all those issues too
16:42ghadishaybandid you try it with ^int ^ints or other prims?
16:44devnHey amalloy -- how good are you with cl-format? :)
16:44Bronsauser=> (defprotocol p (^int x [_]))
16:44Bronsap
16:44Bronsauser=> (:tag (meta #'x))
16:44Bronsaint
16:44Bronsauser=> (class *1)
16:44amalloyon a scale of 1 to ten, i'm a -1
16:44Bronsajava.lang.Class
16:44devnaww bummer
16:44Bronsaghadishayban: ^
16:45devnim stuck on a problem
16:45devn,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(^:once fn* [x] x)")))
16:45clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: pp, compiling:(NO_SOURCE_PATH:0:0)>
16:45devn,(require '[clojure.pprint :as pp])
16:45clojurebotnil
16:45devn,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(^:once fn* [x] x)")))
16:45squidzhow can i reconfigure lein after changing the project name/ns
16:45clojurebot#(#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
16:46squidzafter changing the project name(that is namespace and folder name), I can no longer run my namespace call
16:46squidzis there a way to reset the project with lein?
16:46squidzI also changed my project.clj
16:46devnamalloy: pretty sure it's blowing up in https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/dispatch.clj#L367
16:47devnbut uh, you already told me you're -1 so im going to shut up now
16:47devn"~<#(~;~@{~w~^ ~_~}~;)~:>" <---sigh
16:47hyPiRion~_ ? I've not seen that before.
16:47clojurebotPardon?
16:48devndude, dont ask me
16:48hyPiRionTo the hyperref
16:48hyPiRion*spec
16:48devnhyPiRion: sounds like you know you're way around the formatter, any ideas on the above illegalargumentexception?
16:49hyPiRionLet me have a look
16:50devnhyPiRion: thanks in advance
16:50devnim stumped
16:51PeteinHello babes! is there any framework which you can develop android applications using clojure?
16:52Peteinis there any reason to do that rather than using the native android sdk?
16:56hyPiRiondevn: The gist of it is that it takes a single value, which must be a sequence and pretty prints it (newlines after every element, indented 2 spaces if the whole thing is longer than 72 characters).
16:57devnhyPiRion: that string above?
16:57hyPiRion,(pp/cl-format true "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 12))
16:57clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: pp, compiling:(NO_SOURCE_PATH:0:0)>
16:57devn,(require '[clojure.pprint :as pp])
16:57clojurebotnil
16:57hyPiRion,(pp/cl-format true "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 12))
16:57clojurebot#(0 1 2 3 4 ...)
16:57hyPiRion,(pp/cl-format true "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 30))
16:57clojurebot#(0 1 2 3 4 ...)
16:57hyPiRionmeh.
16:57hyPiRion,(pp/cl-format nil "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 30)) ;; <<-
16:57clojurebot"#(0 1 2 3 4 ...)"
16:58devnso it takes a seq, eh?
16:58PeteinHello babes! is there any framework which you can develop android applications using clojure and it has any benefit rather than using the native android sdk?
16:58hyPiRionOkay, eh, the point is either way that it requres the first element to be a sequence
16:58hyPiRionright.
16:58devnwell that's no good
16:58devnbecause
16:59devn,(first (rest (rest '(fn* [x] x))))
16:59clojurebotx
16:59devn,(pp/cl-format nil "~<#(~;~@{~w~^ ~_~}~;)~:>" 'x)
16:59clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
17:00devnhyPiRion: how could i get it to play nice when it's not given a seq?
17:00devnhyPiRion: is there an easy way to do that?
17:01hyPiRionI'm not familiar with the rest of pp
17:01jjidoseq?
17:01clojurebotseq is short for ,(doc ...)
17:01hyPiRionbut I'll take a quick peek
17:01devnhyPiRion: it's cool, just didn't know if you knew of a simple way to make it at least not blow up
17:03hyPiRionhm
17:03jjido,(seq? '(1 2 3))
17:03clojurebottrue
17:03hyPiRion,(pp/with-pprint-dispatch pp/code-dispatch (read-string "(^:once fn* [x] x)"))
17:03clojurebot(fn* [x] x)
17:03hyPiRionpp/pprint prints, and returns nil.
17:03devnwait...no...you have to be kidding me...
17:03jjido,(seq? [1 2 3])
17:03clojurebotfalse
17:03devni mean that makes 100% sense
17:04devnbut uh oh hyPiRion -- i think this is the difference though
17:05devn,(with-out-str (pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(fn* [x] x)"))))
17:05clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
17:05devni want to capture it with-out-str
17:05hyPiRion,(pp/with-pprint-dispatch pp/code-dispatch (with-out-str (pp/pprint (read-string "(^:once fn* [x] x)"))))
17:05clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
17:06hyPiRion,(with-out-str (pp/pprint (read-string "(^:once fn* [x] x)")))
17:06clojurebot"(fn* [x] x)\n"
17:06devnnow with code dispatch... *KABOOOOM*
17:07hyPiRion,(pp/with-pprint-dispatch pp/code-dispatch "what is this")
17:07clojurebot"what is this"
17:07hyPiRion,(pp/with-pprint-dispatch pp/code-dispatch "(fn* [x] x)\n")
17:07clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: pp, compiling:(NO_SOURCE_PATH:0:0)>
17:07devngrrr
17:07hyPiRionstupid timeout
17:07devn,(require '[clojure.pprint :as pp])
17:07clojurebotnil
17:07hyPiRion,(pp/with-pprint-dispatch pp/code-dispatch "(fn* [x] x)\n")
17:07clojurebot"(fn* [x] x)\n"
17:08hyPiRionWell, it's certain that with-pprint-dispatch is a macro, so it does some magic there I guess.
17:08devnyeah :(
17:08Peteinanyone developing android apps in clojure?
17:09technomancyPetein: android apps on clojure are currently too slow to be practical
17:09jjido,with-pprint-dispatch
17:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: with-pprint-dispatch in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:09technomancyunless you're very patient and all your users are too
17:09hyPiRionPetein: http://dev.clojure.org/display/design/Android+Support
17:09devnif you're making a game that's all about patience
17:09devnit might be cool
17:10Peteintechnomancy: thanks for the feedback
17:10hyPiRionIt's not a focus yet, but Rich talked about making slimmer Clojure versions for e.g. that purpose.
17:10hyPiRionAnd more debug-friendly ones.
17:10devnhyPiRion: i assume you're done looking at this with me? :)
17:10hyPiRionThough I'm pretty sure that's far away, I'm afraid.
17:11hyPiRiondevn: Well, I should probably figure out what with-pprint-dispatch and code-dispatch does :p
17:11devnlet's get weird with it hyPiRion
17:12devncode-dispatch is a multi-method
17:12devnhyPiRion: https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/dispatch.clj#L448
17:13devnhyPiRion: https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/pprint_base.clj#L274
17:13devnthere's with-pprint-dispatch
17:14hyPiRionOh, I see what's bugging you.
17:14devn!!!
17:14sgarrett|afkAnyone with experience using ElasticSearch?
17:14devnsgarrett: yeah
17:15devnsgarrett: what's up?
17:15sgarrettdevn: I've got a small portion of it working for my application but I'm wondering if maybe my design is off. I was thinking that I could do writes to ES and then read immediately from the index, but I see that there's a refresh interval.
17:16devnsgarrett: describe the use case
17:16sgarrettdevn: I know that I could refresh the index on each write but that seems like a bad idea.
17:16devnlike... a user saves a record and it gets indexed, and they dont see it fast enough?
17:16devnwhy do you need to see it immediately?
17:16sgarrettdevn: I basically have a collaborative blog. So anyone could be creating a post at any time.
17:17devnsgarrett: are you using elastisch?
17:17sgarrettdevn: Yes.
17:17devnIIRC there's a way to force it to update
17:17devnsolr has that too I believe
17:17sgarrettdevn: So when the user would go back to their "my posts" section they would need to see the "new" post they just created there.
17:17devnsgarrett: do you have a LOT of users?
17:17devnhow big is this?
17:18sgarrettdevn: That's the plan.
17:18devnah, yes, but a plan is not reality :)
17:18devnonly suggesting that maybe this isn't an issue at all
17:18sgarrettdevn: True. I don't want to over engineer, but I also don't want to get into a situation where migrating or something is terrible.
17:18hyPiRiondevn: the gist of it is this
17:18hyPiRion,(class (read-string "(^:once fn* [x] x)"))
17:18clojurebotclojure.lang.PersistentList
17:19devnsgarrett: my sense is that if at some point your writes get out of control, you could scale ES to handle it
17:19hyPiRioncode-dispatch has no dispatcher for PersistentList, so it'll use pprint-simple-default (as far as I can see)
17:19devnhyPiRion: hmmm
17:19sgarrettdevn: Okay. Do you know if refreshing the index per write would have bad repercussions?
17:20devnsgarrett: ive worked on a solr DB that had 250 million records
17:20devnthere were optimizations and lots of subtle tuning
17:21devnbut for indexes that are smallish, like 10-50k records, won't bite you unless you're updating a spellchecking index
17:21devn(on commit)
17:21devnand that's solr parlance: you would do something like (doseq [doc tons-of-docs] (add-to-index doc))
17:21devnand THEN (commit!)
17:22sgarrettI see. Yeah these would all be individual commits.
17:22devnive done aggressive commits before, and as long as it doesn't trigger "optimize" (more solr parlance)
17:22devnit seemed to be no trouble at all for <100k records
17:22hyPiRiondevn: okay, I've found it. https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/dispatch.clj#L367-379
17:23sgarrettdevn: Okay. That sounds good.
17:23devnthat else condition is where it happens hyPiRion ?
17:23devnsgarrett: dont treat what im saying as gospel
17:23sgarrettdevn: No worries there. ;)
17:23devnsgarrett: but my suggestion is to push it and try to benchmark it with a ton of records
17:23devni have a feeling you'll be surprised at the speed
17:23sgarrettdevn: Agreed. Definitely will be doing some load testing.
17:23hyPiRiondevn: (first (rest (rest alis))) is the issue. it's expecting it to be a list, but it's not.
17:24devnhyPiRion: yeah, that's what i was saying earlier
17:24sgarrettdevn: Okay. I'm used to working with MarkLogic server and that automatically reindexes on create, so didn't know what the implications would be here.
17:24hyPiRionoh, sorry
17:24sgarrettdevn: Thanks for the help!
17:24devnhyPiRion: nono it's okay, im happy to hear im not totally off the mark
17:24devnhyPiRion: im wondering wth I can do to fix this
17:25hyPiRionI didn't read what you wrote earlier, remind me on doing that.
17:25devnhyPiRion: no worries, this formatter logic expects a list right?
17:25hyPiRiondevn: It's a bug with the pprinter, so I suggest you ask them to fix it.
17:25hyPiRionyeah, it's buggy, simply put.
17:25devnhyPiRion: so you think it's a legit bug?
17:25edwWhat does the :once metadata do?
17:26hyPiRiondevn: yes
17:26amalloyedw: promises the compiler you'll only call the function once, so it does locals-clearing on its closed-over variables asap
17:26hyPiRion,(let [id (fn* [x] x)] (id 40))
17:26clojurebot40
17:26devnedw: like (defonce ...)
17:27amalloydevn: wat. :once has nothing to do with defonce
17:27edwAh. I was searching the docs. Is that documented anywhere?
17:27devnamalloy: oh, really?
17:27devni just assumed they were related
17:27hyPiRiondevn: But regardless, it seems clever to file a report on that bug.
17:27devnhyPiRion: much appreciated
17:27devnhyPiRion: now, given the lifecycle of bugs in the clojure world
17:28devnim still looking for a way to hack around this, because this is a blocker for me :(
17:28amalloyprobably not, edw
17:28sgarrettdevn: One last question. If I had the index sharded, does a refresh of the index happen only on that shard or is it the whole index? More just curious on that one.
17:28edwamalloy: OK, so I'll feel less ignorant for not having known that.
17:29devnsgarrett: depends on how you set things up
17:29hyPiRiondevn: When would the deadline for a fix be? I can probably make a patch during next week. You could depend on a self-built Clojure version and add in that patch.
17:29edwBTW, I'm soon going to be looking for a programmer for a Clojure-heaviy position in NYC.
17:30hyPiRionNot pretty, but it'll solve the problem temporarily.
17:30edws/heaviy/heavy
17:30sgarrettedw: I don't know you, but I might be interested. :)
17:30devnhyPiRion: im open to submitting a patch as well. i mean, for what im doing it might be reasonable to say "screw fn* pprinting" for now
17:30edwsgarrett: The feeling is mutual. ;)
17:31devnand just remove the anon-func from the list of things that are pretty printable by code-dispatch
17:31devnor something like that
17:31hyPiRiondevn: ah, right. Well, feel free to do whatever pleases you.
17:31devnhyPiRion: either way i should log an issue for this
17:31edwsgarrett: I'm edw on Github; drop me a line.
17:31sgarrettedw: I have some interviews in the next week, but I'm looking.
17:31hyPiRionyeah
17:31devni sent something to the list earlier, so i have a feeling an issue will get created either way
17:32edwsgarrett: You in NYC?
17:32edwOr thereabouts?
17:32sgarrettedw: I lived in NYC last year and loved it. I basically just moved away so I could save some money. :P
17:33edwsgarrett: I know how you feel. I've been cash-flow negative for the last year plus, living in Manhattan. Ah, start-ups…
17:33sgarrettedw: Just "followed" you on github.
17:33sgarrettedw: I'm looking for a startup position specifically if that helps.
17:34edwWe should take this private but, we're a mobile adtech startup getting deeply into processing and acting on huge amounts of data.
17:39Raynessgarrett: People love NYC?
17:40ravsterI'm getting --> Assert failed: (vector? (:dependencies project [])) <-- when am doing lein ring server. But my :dependencies in the project file seem to be alright.
17:40gilliesjust heard about Zing JVM. Does it work with clojure?
17:40sgarrettRaynes: ha! I did.
17:41RaynesWhen I think of NYC all I an see and hear are sirens, police, drug addicts, the constant roar of cars and their horns, smoke in the distance from a fire and the thick smell of exhaust fumes.
17:41RaynesBut I've never actually been there. ;)
17:41sgarrettRaynes: I think it's tough to beat culturally.
17:42technomancyRaynes: also http://sadguysontradingfloors.tumblr.com/
17:42metellusmost of those things would also apply to LA...
17:42edwRaynes, NYC is a million different places. Depends on where you are. Went to the Upper West Side, felt like a different planet. I'm a downtown (Village, Alphabet City, SoHo, Little Italy) kind of person.
17:42danneuHow come (map list {:1 1 :2 2} {:3 3 :4 4}) ;=> (([:1 1] [:4 4]) ([:2 2] [:3 3])) ? https://gist.github.com/danneu/a39f5354938b7b9a754e
17:42technomancymetellus: yeah, but Hollywood has incentive to glamourize LA
17:42Raynesmetellus: Parts of LA, of course. Didn't say I enjoyed all of LA either though.
17:43Raynestechnomancy: They're doing a terrible job of it.
17:43sgarrettI wasn't a big fan of LA when I visited last August.
17:43metellusdanneu: because an "element" of a map is a [key value] pair
17:43edwMy gf has been stuck in Long Beach, CA, just southwest of LA, and the whole place is insipid.
17:43metellusand the order is not guaranteed
17:44devnill take weather over NYC credentials
17:44technomancyRaynes: it looks pretty great in Iron Man, but then you realize it's because he can just fly places instead of driving.
17:44edwI liked the paved paths along the beach for skateboarding, though.
17:44sgarrett"insipid" is the definition of my trip to LA.
17:44RaynesSanta Monica is pretty great.
17:44devnI wouldn't live in LA, but I would live in most of the rest of CA.
17:44RaynesAs is Malibu.
17:44edwSkateboarding to work through slush gets old quick.
17:44RaynesLA isn't that bad, guys. LA is a lot of places.
17:45Bronsato what is C-h k bound in emacs?
17:45devnedw: lol, I'm in WI so moving to NYC for me is not at all something I'm interested in.
17:45RaynesNYC isn't all fun and games either, you know. You live in Manhattan.
17:45BronsaI rebinded C-h but now I don't remember what C-h k is :(
17:45devnI have seen snow before. I do not like it.
17:45Bronsarebound*
17:45danneumetellus: Did you see the Gist? That doesn't seem to explain the inconsistency
17:46metellusit does, because you should have no expectations whatsoever about the ordering of elements in a map
17:46edwRaynes: I hear you. Everything's a tradeoff. I'm an East Coaster. If you forced me to move to the West Coast, I'd probably be pretty happy in SF, but like Philly, the place goes to sleep pretty early. (And I say that as a forty year old.)
17:46devnmetellus: actually that looks weird
17:46devnhe has two seperate maps
17:46devnseparate*
17:46danneumetellus: How come the results are consistent then?
17:47devnmetellus: that looks real weird, you don't agree
17:47devn?
17:47edwC-h k is describe-key, Bronsa.
17:47Bronsathanks
17:47edwOr describe-key-1, actually.
17:47RaynesI haven't seen edw, but descriptions residents give me of it make me wonder why everybody enjoys it so much.
17:47RaynesOops.
17:48metellusdevn: what's so weird about it?
17:48RaynesI haven't seen SF.
17:48danneumetellus: I encountered this when reading about `doseq` http://clojuredocs.org/clojure_core/clojure.core/doseq#example_183
17:48jjido,'({:1 1 :2 2} {:3 3 :4 4})
17:48clojurebot({:1 1, :2 2} {:3 3, :4 4})
17:48RaynesNot edw. Wow. That was the best typo ever.
17:48edwRaynes: Where? SF or NYC?
17:48RaynesSF.
17:48edwFunny, yes!
17:48devnmetellus: oh, nevermind
17:49devn,(map list [{:a 1 :b 2} {:c 3 :d 4}])
17:49clojurebot(({:a 1, :b 2}) ({:c 3, :d 4}))
17:49jjidoaah
17:49devnif ^that produces (([:a 1] [:c 3]) ([:b 2] [:d 4])) that would be weird
17:49metellusyes, that would be very bad
17:49edwI didn't like living in the SF Bay area because it's a monoculture in so many ways. Everyone's either an MBA or a programmer. Everyone's a lefty, Whole Foods shopper. (And I'm basically one of those too, but still…)
17:49ravsterI'm getting an assertionerror when trying to run "lein ring server". I don't understand why its not seeing the :dependencies are a vector in my project file. https://gist.github.com/ravster/5130631
17:50devnedw: the NYC wall street dudes are people i would like to never hang out with again
17:50devnid rather live in a petri dish of progressives than in a cesspool of cocaine sniffing assholes
17:50edwdevn: I have like zero contact with those people; they're easy to avoid.
17:51danneu,(map list {:1 1 :2 2} {:3 3 :4 4})
17:51clojurebot(([:1 1] [:4 4]) ([:2 2] [:3 3]))
17:52jjidodanneu: what's the last arg?
17:52devnedw: yeah, but now and then one of them sneaks in
17:52devnedw: :)
17:52edwI skateboard or walk or bike or (occasionally) take the train everywhere and belong to four museums and have to shoulder my away through masses of models and artists to get my soup at lunchtime, and then I go home and practice skateboarding at Tompkins Sq Park, less than a block from me.
17:52Raynesdevn: Well, CA is exactly that only with crack smoking assholes.
17:52RaynesSF, I mean.
17:52edwI live in paradise, I feel.
17:52devnhaha
17:52RaynesJesus, I can't get my abbreviations straight today.
17:53Raynesdevn: So did my pull request fix your problem?
17:53devnHere is where I want to live: http://www.youtube.com/watch?v=iYJKd0rkKss
17:53edwRaynes: Yeah, SF has the most pretty aggressive panhandlers.
17:53devnRaynes: indeed it did, I just needed to drop (str ...) from around (str (:_id (get-user username)))
17:54Raynesdevn: Yeah, I saw that and has a feeling it was nutty but I wasn't sure enough to remove it myself and you were already gone.
17:55danneujimt_: what do you mean 'last arg'?
17:55jjido,doc map
17:55clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0:0)>
17:56danneujjido: how is my example different from (map + [1 2] [3 4])
17:56jjidoI mean in (map list x y) what is y?
17:57danneujjido: i don't understand your question. y is the second collection that'll be zipped up with x.
17:57jjido,(map + [1 2] [10 20])
17:57clojurebot(11 22)
17:57jjidodanneu: thanks
17:58metellusdanneu: becasue [1 2] is a vector and {:a 1 :b 2} is a map
17:58metellusvectors are ordered, maps are not
17:58jjidoso you are doing (list [:1 1] [:4 4])
17:59metellus(there is *some* internal ordering to a map, but it's not necessarily the one you would expect)
17:59danneumetellus: ah, so it's not random
17:59danneuer, it doesnt randomize
17:59metellusit's determined by the JVM and/or Clojure
17:59danneuin other words i'm trying to figure out why i can't replicate the `;; where` code in this example http://clojuredocs.org/clojure_core/clojure.core/doseq#example_183
18:01edwWhat do you mean "replicate"?
18:01danneu(map list {:1 1 :2 2} {:3 3 :4 4}) always pairs :1 with :4
18:02danneuwhether this irc bot is evaluating it or my repl is
18:02danneumeanwhile {:a 1 :b 2} {:c 3 :d 4} always pairs :a with :c as i'd expect
18:03edwdanneu, Dude, what you're doing is deeply wrong. What are you trying to accomplish?
18:03hyPiRiondanneu: if you prepend clojure functions with ',' or '&', you'll get it evaluated
18:03hyPiRion,(map list {:1 1 :2 2} {:3 3 :4 4})
18:03clojurebot(([:1 1] [:4 4]) ([:2 2] [:3 3]))
18:03hyPiRionBut as mentioned, maps don't give you any ordering guarantees.
18:04edwAre you trying to pair map entries from two maps sorted by key?
18:04danneuedw: i'm just trying to understand line 9 of http://clojuredocs.org/clojure_core/clojure.core/doseq#example_183
18:05edwFirst of all, those are vectors, not maps.
18:05jjidono maps {}
18:05metellusedw: I think you're looking at the wrong example
18:06metellusone of those example does exactly what he's trying to do and gives (([:1 1] [:3 3]) ([:2 2] [:4 4]))
18:06edwOK.
18:06jjidodo you know clojure differentiates between brackets?
18:06jjidook
18:06hyPiRionedw: that's a bad example, heh. Don
18:06hyPiRionDon't look at it ;)
18:06edwDo danneu, the deal is this: maps are unordered. The order is not something you can/should depend on.
18:07edw,(map identity {:a 1})
18:07clojurebot([:a 1])
18:08danneuedw: yeah i get that much.
18:08Raynesedw: http://www.youtube.com/watch?v=-sKDd9uOW-0
18:08edwdanneu, does what I just eval'd make sense to you? The function that is being mapped is called with each map entry.
18:08arrdemis there an http proxy handler for ring?
18:09danneuedw: yeah, i see that mapping funcs to hash-maps vectorizes hash-map k/v pair.
18:09edwdanneu: OK, so this should be crystal clear, too: ,(map list {:a 1} {:b 2})
18:10edw,(map list {:a 1} {:b 2})
18:10clojurebot(([:a 1] [:b 2]))
18:10edwdanneu: right?
18:10edwBecause there's only one possible ordering of entries for a one item map.
18:10danneuright, it's zipping :a and :b
18:10danneuin an order that can't be ambiguous
18:11danneui guess my issue is understanding the implications of 'map key order is not guaranteed'
18:11edwRight. You should not depend on the output of that example code. It's _one possible_ result. There are _four possible results_.
18:11metellusthat you shouldn't do anything with maps that relies on them having a consistent order
18:11metellusthat's the implication
18:11metellusif you want something ordered, us a vector
18:12metellususe
18:12danneui get that. but i can run my gist 1000 times and the two examples diverge from eachother the same way every time.
18:12edwdanneu: As metellus said, your inability to rely on the order is the implication of the nature of a map.
18:12danneuand i can't replicate the clojure doc example even once
18:12metellusdanneu: it's not determined randomly
18:13metellusthere is some reason in the internals that will order it
18:13metellusso with the same versions of everything on the same machine, you'll get the same result consistently
18:13danneumetellus: so it's like it's using the same 'seed' every time. like the hash of the values or something.
18:13edwdanneu: The internal representation of maps has (probably changed) since that sample code was placed in the docs.
18:13danneuahh, thanks guys
18:13danneuthat was killing me
18:13metellusbut yeah, that example was probably from an older version of Clojure
18:13jjidoor the JVM
18:15danneuphew
18:15edwdanneu: And the implementation is allowed to do things like store map entries in a vector if it's really small vs a hash table or whatever. It's the implementation's choice. Imagine a sufficiently smart compiler that saw that you used only integer keys in sequential order. It could implement the map as a vector.
18:19arrdemedw: that sort of stuff is far easier to do in a JIT where you have runtime information unless you can somehow staticly prove that access pattern with type information such as Map<Integer:Object>.
18:22edwarrdem: Don't disagree. Just trying to explain how the system can choose implementations at run time.
18:22danneuclojure does have some nice examples in its docs tho
18:40zakwilsonI'm using migratus and it's saying "no migrations found" even though there are migrations which appear to be named correctly in src/migrations.
18:42rebcabinI have both clojure-1.4.0 and clojure-1.5.0 installed, but "lein repl" always brings up 1.4.0 when I am not in a project directory ... clues on how to switch the default plz & thx?
18:43zerokarmaleftrebcabin: check out profiles in the docs
18:43zakwilsonhttps://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
18:44rebcabinthank you :)
19:17muhoowhat are we using for database migrations these days? migratus? ragtime? lobos? drift? other?
19:21Raynesmuhoo: The blood of children.
19:22muhoomuaaaahahaha
19:23muhoobtw, nice job on that video. definitely redo it when you can really cut loose and belt it out. and wear some rock-star clothes too-- rock is to dress up to.
19:24muhoook well then i guess i have a day of researching and trying a handful of migration libraries :-/
19:24muhoolazyIRC fails to absolve me of that, apparently
19:28Raynesmuhoo: I could fart at the microphone and you'd tell me nice job, fwiw.
19:28RaynesCause you're a nice guy.
19:29muhoowell you are good. if you sucked i'd probably say nothing.
19:30RaynesHeh.
19:30RaynesI can't even remember what song I did.
19:30muhooit was something i'd never heard of :-P
19:31RaynesMercy?
19:31RaynesYeah, Mercy.
19:31RaynesGood ol' OneRepublic.
19:31devnRaynes: devn needs your help again
19:31devnRaynes: Heroku won't pick up the damned MONGOLAB_URI
19:33Raynesdevn: You mean getclojure won't pick up the damned MONGOLAB_URI?
19:34RaynesHeroku is the one that should be setting it and you're the one who should be picking it up.
19:35Raynesdevn: You can do 'heroku config' or something to see what vars are set.
19:39devnRaynes: im getting an NPE
19:40devn(System/getenv "MONGOHQ_URL") is nil at compile time methinks
19:40RaynesWell, I thought you wanted MONGOLAB_URI?
19:40devntried adding MONGOHQ just to see if it worked
19:40RaynesCan you set it locally and then run it?
19:41gfrederickshyPiRion: ping
19:43Raynesdevn: It works fine locally. Sounds like Heroku isn't setting the variable.
19:48Raynesyogthos|away: http://yogthos.net/blog/41?utm_source=dlvr.it&amp;utm_medium=twitter BOOM, FIRST COMMENT.
19:53devnRaynes: I booted up a lein repl and checked for it
19:53devnit's there
19:59gilliesis there a way to read in a file as a clojure data strucure ?
19:59gilliesliek foo.txt == {:foo "bar"}
20:00arrdemwell you could (eval (read-string (slurp "foo.txt")))
20:00arrdembut then you have arbitrary code execution...
20:00arrdemso you really want to use the data reader
20:01arrdemhttps://github.com/clojure/tools.reader
20:01gilliesarrdem: fsvo "arbitrary"
20:01gilliesisn't code just data?
20:02arrdemgillies: yes and no... the issue is that via reader macros one could execute potentially malicious code.
20:02ghadishaybanarrdem: read-string is sufficient without the eval
20:03devn^-(read-string (slurp "foo.txt"))
20:03devnuse it all the time
20:03ghadishaybanslurp -> string ; read-string -> clojure data structure ; eval ~-> compilation
20:03arrdem,(read-string "#=(println \"foobarbaz\")")
20:03clojurebot#<RuntimeException java.lang.RuntimeException: eval reading not allowed when *read-eval* is false.>
20:04devngillies: anyway, listen to what he's saying, but if it's just for your own purposes and you're confident no one you don't trust will write to the file, go nuts
20:04arrdemghadishayban, gillies http://news.ycombinator.com/item?id=5343704
20:05devni quit following the read-eval discussion awhile ago, but if you want to be safe: (binding [*read-eval* false] (read-string (slurp "foo.txt")))
20:05arrdemwhich is what clojurebot did to me...
20:06devnor use clojail's safe-read
20:06amalloysafe-read really isn't safe either. nothing is safe but upgrading to 1.5 and using edn/read
20:06arrdem... can I make clojurebot remember that as ~reader somehow?
20:06ghadishaybandevn: regarding *read-eval* false, -- see Fogus's comment
20:06devnnothing is safe
20:07ghadishaybanalso, amalloy == truth
20:07arrdem~reader
20:07clojurebotReader syntax of collections has gotchas
20:07arrdemwell I suppose there's that too.
20:07amalloyclojurebot: reader is http://news.ycombinator.com/item?id=5343704
20:07clojurebotYou don't have to tell me twice.
20:07arrdemamalloy: I assume that's permissioned...
20:07amalloyhuh?
20:08arrdemthe "foo is" syntax for clojurebot
20:08amalloyi don't know why you would assume such a thing, when you have the opportunity to try it and see
20:08arrdemclojurebot: arrdem is awesome
20:08clojurebotRoger.
20:08arrdem~arrdem
20:08clojurebotarrdem is awesome
20:08devnclojurebot: arrdem isn't very curious
20:08clojurebotarrdem is jeremy
20:08arrdemworks for me
20:08devnclojurebot: arrdem is beautiful person
20:08clojurebotc'est bon!
20:09devn~devn
20:09clojurebotNo entiendo
20:09devnclojurebot: devn put a car in your car, so you can car while you cdr.
20:09clojurebotJohn McCarthy is someone without whom we would not be here today.
20:10zakwilsonmuhoo: I had your problem yesterday. I decided on migratus, largely because its author was here. Also, it sounded fairly sane.
20:17pjstadigi'll take that as a compliment
20:17pjstadig:)
20:19tyler_wow i can't belive i didn't learn about edn until today
20:21zakwilsonpjstadig: oh, good, you're here. Migratus seems like a good enough idea, but it's saying "No migrations found" when I do, in fact have migrations.
20:25ravsterHow do I fix this error when starting "lein ring server" --> Assert failed: (vector? (:dependencies project []))
20:26pjstadigzakwilson: maybe something to do with out you have the migration dir configured?
20:27pjstadigand/or the way the files are name...i'd have to get more specifics
20:30gfredericksravster: I think I saw that just the other day
20:30gfrederickscannot remember what on earth caused it though.
20:32ravsterapparently I need to find a package I'm using that might be using an outdated leinjacker.
20:33hyPiRiongfredericks: pong
20:33zakwilsonpjstadig: I just followed the example on github. I may have gotten it wrong, but I'm pretty sure I did not.
20:34pjstadigis there source i could see? otherwise, what is your migration dir config, and what are the names of your migration files?
20:38tyler__they they remove entity-db from clojure api?
20:38tyler__dat.core=> d/entity-db
20:38tyler__CompilerException java.lang.RuntimeException: No such var: d/entity-db, compiling:(NO_SOURCE_PATH:1)
20:38tyler__d/entity is a function
20:44tyler__ah entity has all keywords you just have to merge with a native map
20:45zakwilsonpjstadig: sorry, got distract.d Neighbor made me drink too much beer.
20:45zakwilsonpjstadig: https://gist.github.com/zakwilson/5131226
20:51gfrederickshyPiRion: I noticed in the logs you said at some point that nth-prime should be trivial in swearjure
20:51gfredericksjust curious what the high-level idea was there
20:51Rayneszakwilson: Wish I had neighbors like yours.
20:52zakwilsonRaynes: I gave her cookies.
20:52gfredericksRaynes: but he said "too much" -- that's more than you're supposed to have!
20:53pjstadigzakwilson: should be *.up.sql and *.down.sql not *-up.sql and *-down.sql
20:54Raynesgfredericks: I don't think anyone knows how much you're supposed to have.
20:54gfredericksyou don't have to know -- we're talking about "too much" in an unqualified sense
20:55pjstadigzakwilson: i thought i changed migratus to warn when it found names in the migration dir that don't match its pattern
20:55zakwilson
20:56zakwilsonpjstadig: the docs say “[id]-[name]-[direction].sql”, t the example says “s"rc/migrations/20111206154000-create-foo-table.up.sql”"
20:57zakwilsonAnd those are dumb quotes.
20:57hyPiRiongfredericks: Well, if we want to get the nth prime, we can first start off by having the vector [2] and then generate n-1 primes through recursion. We then pick the nth element in the generated vector.
20:57gfredericksdo we have `count`?
20:57pjstadigzakwilson: hrm
20:57zakwilsonAnyway, I tried it both ways, same result.
20:57gfredericksI guess rest gives you count
20:57hyPiRiongfredericks: we don't need it either way
20:58gfredericksso presumably you're thinking of a way of doing this without division?
20:58gfredericksunless we have some way of getting `rem` that I'm unaware of
20:58hyPiRionoh, right. That's a bugger.
20:58gfredericksokay just checking if you had gotten that far
20:59gfredericksI think it's probably still possible
20:59gfredericksjust hairier
20:59hyPiRionyeah, must be
20:59hyPiRioncan we simulate rem?
20:59hyPiRionRight, we can.
20:59gfredericksI was just thinking about that
20:59gfrederickseither that or do a division-less algorithm
20:59gfredericksa sievy thing
21:00pjstadigzakwilson: sorry about that. I'll update the docs, but it should be .[direction].sql, and you should get a warning if there's a file that doesn't match that pattern in the migrations dir
21:00gfrederickssimulating rem is probably the simplest from a high level
21:00hyPiRionyeah, probably more efficient for high values of n
21:00hyPiRion(the sieve, that is)=
21:01devnRaynes: lol, dude I am STILL trying various crap to get that config variable out.
21:01Raynesdevn: I can't imagine what would be the problem.
21:02RaynesIt shouldn't matter if it is compile time or not.
21:02devnit's driving me insane man
21:02Raynesdevn: https://github.com/Raynes/refheap/blob/master/src/refheap/server.clj#L13 I did this and it worked fine on heroku.
21:03pjstadigzakwilson: it is also expecting a 14 digit number for the migration id
21:03pjstadigzakwilson: yours are 12
21:05zakwilsonpjstadig: the docs do NOT say that.
21:05pjstadigzakwilson: i just updated them
21:06devnRaynes: im doing the exact same thing
21:07zakwilsonpjstadig: ok, it liked that. Failed, but there may well be a typo in my sql.
21:09zakwilsonIf that is the case, I consider it a flaw that whatever postgres would say in complaint is not being displayed.
21:10Raynesdevn: :|
21:10devnRaynes: well, hard-coding it works
21:10devnugh
21:10RaynesHahaha
21:11tyler__in the repl is there a symbol that represents last output?
21:13tmcivertyler__: *1
21:13tyler__tmciver: thanks
21:13tyler__ah nice it goes backwards
21:13tyler__so i can get *5
21:13tyler__bravo
21:14tmcivertyler__: I think it only goes to *3
21:14devntechnomancy: can you think of any reason why I wouldn't be able to get at a config var on heroku? Apprently if you have like 64k or something of config vars you get capped, but they're there and I can see them from a lein repl, but when I deploy they're not there
21:14tyler__meh
21:14tyler__close enough heh
21:15tyler__someone needs to make a clojroku
21:15tyler__heh
21:15Raynesyogthos: First comment on your blog post about luminus + clabango is a guy complaining about no laser support. :D
21:15RaynesYOU'VE BEEN SERVED HOMEBOY.
21:16devnoh damn
21:17egghead:)
21:17devnomg im going to murder someone if this doesn't work soon
21:34cliftonis there a good way to do 0-downtime deploys with clojure web apps?
21:34brehautclifton: it would depend on your deployment situation
21:35brehautclifton: eg, jetty behind (forex) nginx is different to servlet in an app container
21:35cliftonyeah im using nginx now
21:35cliftonim used to using unicorn in ruby, which is a pretty simple master/worker pre-forking setup
21:37brehauti think (though i dont know specifics) that you can just start two jetty's on different ports and set up nginx to fail over
21:38brehautmost of the time you'd only have one running, and you'd cut over when you want to update
21:38cliftonyeah the solution i googled uses port failover
21:41technomancydevn: they're not there at compile time or at runtime?
21:42technomancyexposing config at compile time is possible, but introduces a lot of undesirable semantics around the purity of the build function
21:47tomojso what's the workaround?
21:48tomojor you just accept the impurity if you need an s3 key at build time?
21:49devntechnomancy: at compile time
21:49tomojI mean, I know the user-env-compile workaround, but what's the workaround around user-env-compile? :)
21:50dabd_How can I force the evaluation of lazy seqs? The expression [(some-fn-that-returns-a-lazy-seq)] returns [clojure.lang.LazySeq@...]
21:50dabd_I tried doall but it doesn't work
21:50devntechnomancy: this is the code that is forcing me to set it at compile time: https://github.com/devn/getclojure/blob/master/src/getclojure/models/sexp.clj#L11
21:51pjstadigzakwilson: migratus should let bubble any exception that would be getting thrown from JDBC
21:51devntomoj: i didn't know that workaround
21:51tomojbut like he says, "undesirable" :/
21:51devnyeah and i understand why
21:51devnbut im looking to just finish this and go do something else
21:51devnso this is going to have to do for now
21:52zakwilsonpjstadig: "java.sql.BatchUpdateException: Batch entry 1 <unknown> was aborted. Call getNextException to see the cause.
21:52preyaloneAre there macros for Haskell-like pattern matching?
21:52tomojI can't even remember how "clojure.lang.LazySeq@" happens. it's not str or print, so what is it?
21:53devntechnomancy: i also cant seem to get Pygments to install via pip :\
21:54tomojlazybot: google clojure match
21:54lazybot[clojure/core.match · GitHub] https://github.com/clojure/core.match
21:55preyalonecore.match isn't available yet.
21:55devnRaynes: you ran pygmentize on heroku, right? i see in the logs that it untars that dir to resources, but then when i inspect the slug it's not there
21:56Raynesdevn: I did.
21:57tomojit's not available?
21:58preyaloneI'm using clojure stable and this feature is not yet available.
21:58RaynesIt's a library, preyalone.
21:58bbloomlynaghk: remind me at clojure/west, you and i need to discuss rewrite systems!
21:58bbloomlynaghk: and property trees
21:58RaynesNot built into Clojure, but it is available.
21:59preyaloneIf it's a library, why is it called core / clojure?
21:59preyalone*core.match
21:59RaynesBecause it could potentially get moved into Clojure one day.
21:59RaynesAnd if it did, the namespaces would not need to change.
21:59RaynesAnd thus existing code would continue to work without modification.
21:59RaynesThis will likely never happen, but they also use JIRA and Confluence as well so their sanity is already questionable.
22:00preyaloneinteresting
22:00preyaloneHow did Atlassian get so popular?
22:00devnJava
22:00RaynesHow did Hitler get so popular?
22:00brehautpainting
22:00devnbahahahaha
22:01devnUsing Jira is sort of like the holocaust... I guess...
22:03technomancytomoj: I have a hack where you can add query params to your buildpack URL for private params
22:03technomancybut I don't think we'll end up productionizing it because it doesn't work for certain cases and having two ways to do it is confusing
22:03technomancyeven though for the solutions it does work on it's a superior solution to user-env-compile
22:04technomancydevn: but this is what you want if you can't avoid needing config during build: https://devcenter.heroku.com/articles/labs-user-env-compile
22:04technomancytomoj: https://github.com/heroku/slug-compiler/blob/master/lib/slug_compiler.rb#L77 <- not in production
22:32arrdemamalloy: thanks for reminding me to try before asking XP
22:32arrdemsolving my own problems is way more fun
22:32amalloy"try it and see" is the right answer to like a quarter of all questions asked in irc
22:34tomojgenerous estimate
22:34abpamalloy: That even applies to how I work on my library. Written 10 or more prototypish things in along the way.
22:34abp-in
22:35arrdemtomoj: really? I'd guess it's conservative...
22:36RaynesJust write a plugin for lazybot.
22:36RaynesWhy do people keep writing new bots? Damned lisp curse.
22:37arrdemthere's your answer... it's about as easy to roll your own as to build on something else :D
22:39brehauti smell irony
22:39tomojhmm, I want to test my promise library, so I want to add async support to cemerick.cljs.test, so I want a promise library, ...
22:40tomojoh I guess obviously cemerick.cljs.test shouldn't use a promise library
22:48hyperboreeanhow can one figure out the clojurescript version to use in a project.clj ?
22:50supersymhttps://github.com/emezeske/lein-cljsbuild
22:50supersymtechnically not the correct answer
22:50supersymbut guessing its the result you probably would want that counts?
22:50tomojhttp://search.maven.org/#search%7Cga%7C1%7Cclojurescript
22:51tomoj&(learn-command! lazybot 'mvn)
22:51lazybotjava.lang.RuntimeException: Unable to resolve symbol: learn-command! in this context
22:51arrdemdakrone: clj-http is a dream, thanks!
22:52Raynestomoj: I'd like an extension of my $latest command to work with maven central. Go.
22:54tomojbut using laser, not lein's indices
22:55tomojI'll do that on thursday
23:02alandipertarrdem: re: proxy, pushed out https://github.com/tailrecursion/ring-proxy the other week... also based on clj-http by the awesome dakrone
23:03arrdemalandipert: okay cool, a quick google didn't turn any up so I threw together a generic handler that just did a (client/get (:url request))
23:04tyler__whats an easy way to cancel in lein repl if i get caught in bad parens?
23:05tyler__not quit the repl just restore back to sane state
23:05arrdemalandipert: badass, that's exacltly what I was thinking would be in order
23:05alandipertarrdem: cool! yes it does all http verbs and munges cookie domains
23:06tyler__alandipert: nice
23:08alandiperttyler__: thanks
23:08arrdemtyler__: none that I know of short of interacting with the repl via emacs or vim where you have a full editor to fix your mistakes with.
23:09tyler__control d it is then
23:09arrdemtyler__: I would suggest just closing the expression (balancing the parens, brackets etc) and feeding the repl a bad form rather than C-ding
23:10tyler__arrdem: tried that, it got stuck i think
23:11tyler__i was like )))))))))))))))))))))))))))))))))))
23:11tyler__heh
23:12johnmn3in clojurescript, instead of dom/appendChild, I want to do something like dom/setChild. What is the best way to go about doing that?
23:14alandipertjohnmn3: (do (set! (.-innerHTML ele) (dom/appendChild ele x)) is one way
23:15alandipertjohnmn3: err, that's busted, but idea is to clear and append
23:15johnmn3right
23:15johnmn3I was thinking that... closure has goog.dom.RemoveChildren
23:16johnmn3goog.dom.removeChildren, rather
23:16alandipertthat's another way, yeah. also jquery's empty()
23:33brehautim curious, why does re-seq use an fn an explicit recursion rahter than loop recur for its lazy-seq generation?
23:38ivanbrehaut: isn't that the only way to recur (lazily) in a lazy-seq?
23:39brehautivan: no, thats the very purpose of lazy-seq
23:42brehautin hindsight, i suspect its because the recursive call is not in the tail position
23:58devnyeesh, constant stream of memory errors on heroku
23:58devn2013-03-11T03:59:53+00:00 heroku[web.1]: Process running mem=534M(104.4%)
23:59technomancyare you leaving lein running?