#clojure log - Mar 10 2013

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

0:03 anildigital: Hi.. I installed clojure-mode in emacs but I don't have Mx clojure-jack-in

0:04 tomoj: is there a really good reason you can't extend one protocol to another?

0:05 (extend-protocol CollReduce Object (coll-reduce ([coll f] (seq-reduce coll f)) ...))

0:06 Raynes: devn: I don't think API docs are really more useful than just looking at the source.

0:07 You 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.

0:07 technomancy: inc

0:07 arrdem: anildigital: it's nrepl-jack-in from package nrepl

0:07 Raynes: devn: As for inclusive-range, ask amalloy.

0:07 anildigital: arrdem: there is no clojure-jack-in present now

0:08 arrdem: anildigital: that's provided by swank-clojure

0:08 anildigital: which is deprecated for nrep.el

0:08 anildigital: arrdem: what package should I install for swank-clojure

0:08 arrdem: so you say nrepl is new

0:08 arrdem: anildigital: https://github.com/kingtim/nrepl.el

0:09 technomancy: anildigital: if you want clojure-mode to help you with swank, you would need an older version (1.x)

0:10 anildigital: technomancy: hmm ..can I know latest steps to play with clojure from emacs

0:10 technomancy: sure: http://clojure-doc.org/articles/tutorials/emacs.html

0:13 anildigital: technomancy: I created a project .. and done nrepl-jack-in .. it says "error in process sentinel: Leiningen 2.x is required by nREPL.el"

0:13 I have upgraded my lein just now

0:15 looks like this issue http://stackoverflow.com/questions/13243048/mac-osx-emacs-24-2-and-nrepl-el-not-working

0:17 technomancy: it worked when I ran this from command line /Applications/Emacs.app/Contents/MacOS/Emacs project.clj

0:17 any setting that I can do so that I don't have to run emacs with command line

0:17 thanks

0:18 technomancy: yeah, the $PATH on OS X is really ridiculous

0:18 I don't know off the top of my head how to fix it, but it involves editing a plist.xml file

0:18 if you need to launch it from the GUI anyway

0:19 anildigital: technomancy: okay thanks

0:19 technomancy: sure

0:37 dcolish: yeah theres a .MacOS folder in your home dir you need to set the path in

0:55 anildigital: technomancy: https://github.com/purcell/exec-path-from-shell was the answer .. spread the word

0:56 technomancy: gross =\

0:56 but yeah, for those that have the misfortune to run into that problem it's probably better than editing XML files

0:58 thm_prover: (clojure.core.typed/check-ns) <-- does this hang for anyone else?

0:58 has anyone managed to use typed in production code?

0:59 anildigital: technomancy: :)

0:59 technomancy: would you suggest any good book to start learning clojure?

1:00 thm_prover: technomancy: what have you used core.typed for?

1:00 technomancy: anildigital: http://clojurebook.com is a great place to start

1:00 Raynes: anildigital: That seems like a whole lot of code.

1:00 anildigital: technomancy: thanks..

1:00 technomancy: thm_prover: I'm not really interested in static typing without an inference engine

1:00 anildigital: Raynes: yeah.. but it helped..

1:01 thm_prover: technomancy: I like inference engines too. In fact, I like theorem provers like isabelle/coq.

1:02 technomancy: hopefully some day typed clojure will provide that, but it sounds like it's a long way away

1:04 thm_prover: technomancy: http://cljbin.com/paste/513c22c8e4b03285d2084c90 <-- any idea why check-ns infinite loops or how I should start debuggint this?

1:06 amalloy: maybe it's not infinite. wait till the end of the universe, just in case

1:07 arrdem: amalloy: could even be O(1) where C is the heat death of the universe...

1:07 amalloy: certainly your annotation for add is bogus

1:07 thm_prover: yeah, why did it accept it?

1:07 arrdem: thm_prover: thanks for linking that project

1:07 thm_prover: it should be Integer -> Integer -> Integer

1:08 it'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

1:09 dnolen: a response to Mark's LP is overrated blog post - http://swannodette.github.com/2013/03/09/logic-programming-is-underrated/

1:13 Raynes: dnolen: I really enjoyed the other guy's blog post.

1:14 dnolen: Raynes: 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.

1:15 Raynes: dnolen: 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.

1:15 It's likely just OCD, but it makes me want to break my laptop.

1:15 dnolen: Raynes: then don't write that in your own code.

1:15 Raynes: And 'conde'

1:15 "What, you're using ghandi in your code?"

1:16 dnolen: Raynes: I don't use conde much

1:16 alandipert: dnolen: nice

1:17 Raynes: dnolen: 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

1:17 Not to put anyone who has done core.logic talks down or anything.

1:17 Just that I, in particular, have seen the topics covered enough times that it becomes yawn inducing after a while.

1:18 But I, as it turns out, am not the only person in the world, so *shrug*.

1:18 dnolen: Raynes: heh, I think there's only one core.logic talk at Clojure/West?

1:18 Raynes: Doesn't help me because I'm not going to clojure.west. :p

1:19 Everyone will make up for it with 4 extra logic talks at conj 2013!

1:19 dnolen: Raynes: haha, I doubt it - I'm looking forward to the "core.logic in my codebse? no big deal ..." future

1:20 er, codebase

1:24 scottj: dnolen: do you have a list of what you'd call the core.logic core functions if it weren't for minikanren?

1:27 dnolen: scottj: I should probably be more consistent ... buuut ... most things with a docstring are intended to be used by users.

1:27 scottj: we're slowing moving away from the miniKanren / TRS stuff - too much emphasis on lists

1:27 scottj: dnolen: 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?

1:28 dnolen: scottj: not really, my point is mK is really list centric. Which is pretty jarring for Clojure programmers.

1:28 scottj: I'm on a mission this year to change to that story.

1:29 scottj: 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.

1:35 scottj: maybe that isn't answering your question, are there some mK goal names you have in mind?

1:36 scottj: dnolen: 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

1:37 dnolen: 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

1:38 dnolen: scottj: primitive operators like run/run*/fresh/conde are unlikely to change

1:40 scottj: and I'm not sure there are better names for those and conde ideally used less often than defne/matche

3:33 danneu: eclipse + ccw + vrapper is pretty nice

3:34 Raynes: I have a box of facts here.

3:34 I'll put that in it.

3:36 danneu: that's right. i don't have opinions, just facts

3:37 i just mean i've been using vim since i started programming (ruby) and never needed to use an ide before.

3:40 alandipert: Raynes: lol

3:43 Raynes: danneu: I was just being silly. :)

4:12 devn: alandipert: oh hello

4:13 Raynes: yo

4:13 Raynes: devn: sup

4:13 devn: Raynes: meh, a little water logged and trying to figure out what's broken

4:13 Raynes: Well, it sounds like a pipe is broken.

4:14 devn: Raynes: heh

4:15 Raynes: i copy and pasted too much from your code on refheap

4:15 Raynes: My code is broken or you don't understand my code and thus your code is broken and you can't figure out why? :p

4:15 devn: im trying to figure out why :user is always nil when I query for all the sexps saved with {:user "foo"}

4:15 Raynes: likely the latter because i threw it together

4:15 https://github.com/devn/getclojure/blob/master/src/getclojure/models/sexp.clj

4:16 also, don't judge me for that "make-connection!" thing

4:16 it's litter and it needs to be picked up

4:16 Raynes: I didn't plan on it. REPL development is a pain in the ass with monger/mongodb connections.

4:17 devn: that's why it's littered :)

4:17 exactly

4:17 i should probably just with-connection-ize it

4:17 and use that pattern

4:18 Raynes: devn: You've looked into the DB and made sure these things are, in fact, not nil?

4:18 devn: Raynes: nono, they're quite nil

4:18 but im not sure why

4:18 because it's late and im getting lazy

4:18 this is a cry for code review

4:19 Raynes: lol

4:19 devn: Do you have all of your current code in this repo?

4:19 If so, I'll take a look.

4:19 devn: Raynes: yeah this is it

4:19 Raynes: Okay.

4:20 Give me 10 minutes and I'll have this fixed for you.

4:20 devn: haha, <3

4:20 Raynes: Also know that I can't make the above promise.

4:20 :p

4:20 devn: Raynes: are you going to clojure/west?

4:20 Raynes: Nope.

4:20 devn: shit

4:20 Raynes: We're all hoping to get to go to the conj though.

4:20 devn: i reallllly want to make it to west

4:20 but im not sure if i can

4:21 mainly i just want to see alandipert invert people's brains with what he's been working on

4:33 Raynes: the seed task is hint

4:33 err the seed.clj -main

4:34 Raynes: devn: Why did you set this crazy ass mongodb port?

4:34 devn: I don't think I set a port?

4:35 Raynes: hrm

4:35 Attempting to connect to elastic search...

4:35 The elastic search endpoint is http://127.0.0.1:9200

4:35 devn: Where do you mean?

4:35 Raynes: Did elastic search set this port?

4:35 devn: that's elasticsearch

4:35 clojurebot: Titim gan éirí ort.

4:35 Raynes: It is trying to connect to mongodb on this port.

4:35 It makes no sense. This isn't the default port.

4:35 devn: wha? really?

4:35 what version of mongo and what version of ES?

4:35 that's...just strange

4:36 im not having that issue

4:36 Raynes: Elastic search is something else you have to run?

4:36 I guess so.

4:36 devn: Raynes: yeah sorry for the super shitty docs

4:36 Raynes: Did not know this.

4:36 devn: man, now i feel bad

4:36 Raynes: Well, it isn't your fault I didn't know what elasticsearch is.

4:37 devn: yes, 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'

4:38 im using a heroku addon for elastic

4:38 (in prod)

4:43 Raynes: are you still looking at it? im close to bed time

4:44 actually i'm way past, but it would be cool to get this figured out before bed

4:44 Raynes: devn: 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.

4:46 devn: Raynes: 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)

4:46 which is useless, so I'd like to bring the idea of ratings on sexps into the equation

4:46 Raynes: lol

4:46 devn: allow people to login, rate things, and then make that part of the "score" of an sexp in the db

4:46 Raynes: juxt juxt juxt juxt

4:47 devn: yeah, unfortunately i think a useful search engine for this kind of info requires some human intervention

4:48 there 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

4:48 Raynes: I pictured you sitting handling requests and selecting only queries you personally think are relevant to serve.

4:48 Slowest web service ever.

4:48 devn: hahaha yeah, well, i could write skynet, or i could rate 32k results by hand

4:48 whether anyone likes it or not, i think the latter might be the best bet

4:49 Raynes: devn: Whooooa

4:49 devn: Is it seeding 32k things?

4:49 Because this is majorly slow.

4:49 devn: yes

4:49 clojurebot: 'Sea, mhuise.

4:49 devn: Raynes: welcome to shelling out to pygments :)

4:49 Raynes: In that case, I might have to look at this tomorrow because it'll be 7 years before this is finished.

4:49 Is it necessary to seed the whole thing in order to do things?

4:49 devn: Raynes: just seed it with (take 10 ...)

4:49 Raynes: nah, that seed task is just something i've been running after i deploy to heroku

4:49 Raynes: I just stopped the seed stuff. It should have the 108 I seeded.

4:50 devn: Raynes: you should be able to mc/find-as-maps "sexps"

4:50 and see those 108

4:50 Raynes: Got the site running.

4:50 devn: you'll notice that all of the :user keys on those maps have a value of nil

4:50 and that's what im trying to figure out

4:51 Raynes: You've got the king of debugging stupid shit on your side.

4:51 devn: i just want to seed the initial set of queries as belonging to the user "admin"

4:51 Raynes: We'll have this figured out in no time.

4:52 devn: I 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.

5:00 Raynes: devn: Well, your problem is that :id isn't a thing.

5:01 devn: Are you still awake?

5:20 devn: Raynes: barely. i need to go to bed like now. it's really late here. can we chat tomorrow?

5:21 hopefully the answer is yes because im literally falling asleep

5:21 Raynes: devn: I sent you a pull req.

5:21 devn: woohoo! ill look in the morning

5:21 thanks for the help buddy

5:21 Raynes: np

5:21 devn: gnight

5:21 Raynes: night

6:09 tomoj: (assert (satisfies? clojure.core.protocols/CollReduce 42))

6:10 (inc default protocol impls)

6:10 lazybot: ⇒ 1

6:13 tomoj: hmm

6:13 is there any good way to try to get the next element of a lazy seq but with a timeout?

6:14 basically IBlockingDeref for the hidden delay

6:14 Raynes: tomoj: Well, you could use a blocking queue.

6:15 tomoj: seque?

6:15 Raynes: tomoj: seque wont work because there is no timeout.

6:16 You can pass it a blocking queue indeed, but you can't make it use a timeout arg when polling that queue.

6:17 That said, it isn't too hard to write something like it yourself.

6:18 Actually, what you said is kinda weird and may not be what I was solving here.

6:18 tomoj: https://www.refheap.com/paste/e10b0d030f1fa49bc87f32a4c

6:18 Raynes: tomoj: So your lazy seq is produced via something that causes side effects and may take a long time, or?

6:18 tomoj: well

6:19 I realized I don't actually want IBlockingDeref, I just don't want to block at all, because it's cljs

6:19 I was thinking I wanted to detect whether first would block, but you wouldn't write a blocking lazy seq in cljs anyway

6:19 Raynes: Yeah, I'm useless for cljs.

6:20 tomoj: still interesting to me that if lazy seq's delay were exposed as a deref, IBlockingDeref could be there

6:43 so default impls with closed dispatch for one or a few core types in the language are OK, but protocol impl inheritance is evil? :(

6:47 cljs could use it to define CollReduce for all ISeq, or there's Diff

6:47 but because someone could use it to build crazy hierarchies of impl inheritance, it can't be allowed?

6:49 ragge: anyone up for some AOT related troubleshooting?

6:50 ambrosebs: tomoj: 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.

6:50 ragge: it's an exciting issue, promise

6:50 OscarZ: many 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 ?

6:51 tomoj: write macros?

6:51 you mean like adapt-protocol?

6:51 I'm not lamenting the dust in the core bootstrap

6:52 I'm trying to decide if protocols have a problem

6:54 https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/data.cljs#L105-108

6:54 I wrote that, so I think I'm being fair :)

6:55 and no java in the way

6:55 borkdude: I see as-> expands to let*

6:55 what's the difference between let and let*

6:55 in clojure, not in elisp, etc

6:55 tomoj: the body of the let macro: `(let* ~(destructure bindings) ~@body)

6:56 lmM-.tfy

6:56 borkdude: let* is a lower level let without checks?

6:56 tomoj: without destructuring

6:57 borkdude: ah

6:57 I 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...

6:58 and then I looked at the expansion of as-> :)

7:02 ambrosebs: tomoj: sorry I thought you meant core Clojure JVM

7:10 tomoj: well, that too

7:10 but it's actually better there

7:10 because you can extend to an interface

7:11 I still can't extend to my protocol, but I don't have many types, so it's OK :)

7:17 Guest46648: do 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?

7:21 squidz: do 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?

7:22 vijaykiran: squidz: did you try titan?

7:22 squidz: no Ive never heard of it

7:22 is it clojure specific=

7:22 ?

7:22 vijaykiran: no not really - it is a graphdb based on cassandra

7:23 squidz: okay now I see. Is it pretty standard among clojurists?

7:23 scottj: squidz: clojure wrapper for titan https://github.com/gameclosure/hermes

7:23 squidz: I see that the last source update was 9 months ago

7:23 vijaykiran: https://github.com/thinkaurelius/titan

7:23 there are atleast two clojure-titan libraries

7:23 hermes and another one from clojurewerkz

7:23 squidz: it looks really nice to use though

7:24 vijaykiran: I think titan has a friendlier license

7:24 than neo4j

7:24 scottj: squidz: last source update 16 hours ago at repo vijaykiran posted

7:24 squidz: scottj: for titan-clj?

7:24 scottj: squidz: titan itself

7:25 squidz: oh okay, I meant the wrapper

7:25 so between the titan-clj and the clojurewerkz what is used more'ß

7:27 okay it seems like titanium is more active

7:27 scottj: squidz: 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)

7:28 squidz: scottj: 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

7:33 WormJuice: squidz, I'm the best programmer in the world second only to the Microsoft Chief Software Architect

7:33 squidz: WormJuice: lol okay

7:34 WormJuice: squidz, serve me well, and I shall let you live.

7:34 Fail me, and you shall meet a swift death

7:35 squidz: okay this is out of nowhere. Are you going somewhere with this?

7:37 WormJuice: squidz, yes, with your cunning and my skills, the world shall be at our bidding.

7:37 Join me and we wil rule this wretched planet

7:39 squidz: ...

7:42 WormJuice: do I know you?

7:43 WormJuice: squidz, not yet, but my name shall soon be engraved into your memory as we take over the world.

7:43 Join me

7:44 squidz: Join you with what?

7:44 WormJuice: With our bid for world domination my friend.

7:44 squidz, https://lh6.googleusercontent.com/--KCN_CX7NCQ/UTxpxq7XMxI/AAAAAAAABUo/1-n4pmV_w3I/s0/Terrain%2520146.jpg

7:45 squidz: starcraft?

7:47 WormJuice: squidz, you play?

7:48 squidz: not really. Ive played a couple of times why?

7:48 WormJuice: Just wondering if you do, a lot of people here seem to.

7:49 squidz: I thought you were going to make a programming proposal

7:49 to join you in a clojure quest

7:49 only to be let down

9:01 ambrosebs: Is the Rhino REPL *the* way of working on CLJS, or are there more popular methods?

9:01 My core.typed port will probably require using it, hopefully that's no hassle. I'm out of the loop here.

9:04 Bodil: ambrosebs: I'd recommend https://github.com/bodil/cljs-noderepl unless you really enjoy slow JS engines. :)

9:06 ambrosebs: Bodil: Right now I plug in to the Java implementation of core.typed via :require-macros. Is this still possible?

9:07 Bodil: ambrosebs: As long as the macros don't generate any JDK specific code, then yeah.

9:08 ambrosebs: Ok. I need to actually run Java code during macroexpansion :/

9:09 Is that possible?

9:09 edw: ambrosebs: Let's assume it's possible. Are you discerning things about the JVM? Because the macroexpanding VM might not be the evaluating VM.

9:10 Think `lein uberjar`. Also `gen-class`.

9:11 ambrosebs: Currently I'm using Rhino, and it seems to just work.

9:12 edw: CLJS?

9:12 Bodil: ambrosebs: That still works. The only problem is if the code that comes out of the macro expansion doesn't run on Cljs.

9:13 ambrosebs: Bodil: ok. g2g tho, thanks!

10:06 dimovich: given the reorganized clojure contrib ecosystem, where can I find the re-gsub function?

10:06 borkdude: hmm, looks like the clojure entry here can use some work: http://hyperpolyglot.org/lisp

10:37 gfredericks: is there any reason to prefer (alter-var-root #'foo (constantly val)) over (def foo val)?

10:37 I guess it's an explicit update? :/

10:41 dimovich: does clojure.string/replace not do what you want?

11:03 lispy_: hey guys

11:03 whats the current best practice way to do a recursive directory delete ?

11:06 I'm seeing a 'delete-file' function but no mention of recursive delete in clojure.java.io ?

11:07 edw: lispy_, 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:07 lispy_: edw: I just wanted to know how directory delete is done in clojure land

11:08 I just thought it was curious that there is a delete file but no delete directory

11:10 edw: lispy_: ah.

11:10 lispy_: edw: just use (.delete (File. "some-directory")) ?

11:11 edw: No, that doesn't recursively delete either. You need to depth-first delete all files.

11:11 Apache's commons-io FileUtils has something for you.

11:11 lispy_: edw: nuts… thought this would be handled in a library somewhere :-)

11:11 ah cool

11:11 thanks!

11:11 edw: You're welcome.

11:12 FileUtils.deleteDirectory().

11:12 Or give me ten minutes and I'll write the equiv in Clojure for you. Burnt out but in a programing mood.

11:12 lispy_: no :-) sounds like you need to take a break

11:13 thanks for the pointer

11:13 surprised we don't have it yet

11:14 gonna scan for libraries like : https://github.com/jashmenn/clj-file-utils see if someone has clojurised this for me already

11:22 edw: lispy_: `delete-cursively`: https://gist.github.com/edw/5128978

11:22 lispy_: edw: haha, nice one

11:22 saves me pulling in a bunch of jars :-)

11:22 thanks

11:24 edw: No problem. Always enjoy writing some nice looking code.

11:25 lispy_: wonder what has stopped a version of it going into clojure ecosystem core somewhere ?

11:27 edw: Parsimony? It's a simple function. And it's a chainsaw.

11:28 BTW, lispy_, that call to `file` allows this to take a string pathname.

11:28 lispy_: I guess… leave maintenance of it to others

11:28 edw: I spotted that thanks

11:33 edw: Take another look: this one is better. It doesn't call file more often than necessary. https://gist.github.com/edw/5128978

11:36 Just updated it again so that it, you know, works… https://gist.github.com/edw/5128978

11:37 lispy_: edw: cool, thanks will try it out now

11:43 ToxicFrog: This seems like a specific application of ftw

11:45 edw: ToxicFrog hmm?

11:46 ToxicFrog: edw: 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:46 I forget if java.io has an equivalent.

11:47 edw: Ah! I thought your were making some (ugh!) “FTW!” reference a la "FAIL.”

11:47 Hmm, yeah, that makes me wonder if clojure.walk has something useful for this situation.

11:49 Nope. Need a fund to create a lazy file tree and then clojure.walk becomes the way to go.

11:50 Hmm…

12:05 lispy_: There is is file-seq, which looks like what we need.

12:06 lispy_: edw: cool, looking it up now

12:08 edw: You could probably (doseq [f (reverse (file-seq (java.io.File. file-name)))] (delete-file f))

12:09 You need to reverse it, lispy_, because it lists a dir before its contents.

12:12 lispy_: edw: oh, I've used file-sew before, forgot about tit, cool

12:13 mye: What do the clojurescript and emacs users among you do to manage two repls (one for clojure, on for clojurescript)?

12:14 I'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:15 There's one way to do it manually shown here: https://groups.google.com/forum/#!topic/clojure-tools/C0jND-uuV28/discussion

12:16 He later mentions "nrepl.el streams", is someone using that?

13:04 antoineB: hello

14:02 supersym: programming in LightTable is so much fun already,... nice that this time (Leiningen,LightTable) I get the joy of learning Clojure/Lisp properly :D

14:03 zmiller: is there some special way that protocols have to be :required from other namespaces?

14:08 squidz: is there a way to make lein refresh project dependencies within emacs nrepl?

14:10 zmiller: I 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:10 ...without putting in inside a defn

14:11 gfredericks: lastlog -clear

14:12 zmiller: could you post a bit of code?

14:13 zmiller: so the first namespace has

14:13 gfredericks: refheap.com

14:15 zmiller: https://www.refheap.com/paste/12373

14:16 the announce-winner! function throws the error when i try to define the form

14:16 but if i replace the dod/winners with some random function such as first, it will compile that form

14:16 gfredericks: what is the (:import dice.dice_of_doom) about?

14:17 zmiller: those types are defined in the first namespace, there is another protocol that i am extending to those types in the 2nd namespace

14:18 so 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:18 gfredericks: hmm I can reproduce it; I have no guesses but I'll noodle it a bit

14:19 I've never seen a VerifyError before

14:19 zmiller: i googled, i only found 1 clojure page talking about it

14:21 Bronsa: mh

14:22 >java.lang.IllegalArgumentException: Unable to resolve classname: ISeq

14:22 zmiller: ah!

14:22 gfredericks: I have to think this has something to do with the typehint

14:22 which is the weirdest part

14:22 Bronsa: yeah

14:22 that's it

14:22 zmiller: if you import ISeq into the 2nd namespace, it's okay

14:22 gfredericks: I don't know why though

14:23 o_O?

14:23 clojurebot: LINE-ing-en ['laɪnɪŋən]

14:23 gfredericks: clojurebot: thanks

14:23 clojurebot: We live to serve.

14:23 Bronsa: gfredericks: it looks like it doesn't use the full qualified class name

14:23 gfredericks: it wants to resolve it in every namespace you use the protocol in?

14:23 Bronsa: apparently so

14:23 gfredericks: that weeerd

14:24 zmiller: oh, 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:24 jtoy: can I read in a string with a macro and evaluate it without using eval?

14:24 Bronsa: well I think this is a bug anyway

14:24 zmiller: yeah, it doesn't seem like it works the way that it should

14:24 thank you you 2! i could never have figured this out on my own

14:25 Bronsa: I'll try and see if i can get a patch

14:26 zmiller: oh 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:27 gfredericks: jtoy: that's a question that's hard to interpret; can you describe your motivating use case?

14:28 zmiller: oh i see, i have to open up the nrepl-events buffer

14:29 supersym: :)

14:29 jtoy: gfredericks: 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:31 supersym: huh... so like a string, as in date or like someones life story.. and is age not the only one criteria to search for

14:31 doesnt seem to me you would need a macro tho

14:32 Bronsa: zmiller: I'm still using SLIME

14:32 jtoy: supersym: this is exactly what im trying to do: https://groups.google.com/group/cascalog-user/browse_frm/thread/908ef0ef7449c35b

14:33 zmiller: what would be wrong with using eval?

14:33 jtoy: well, 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:34 gfredericks: jtoy: if you're processing strings you don't need a mocr

14:34 macro*

14:34 Bronsa: zmiller: it looks like it's really an edge case

14:34 gfredericks: eval should work fine

14:34 zmiller: (def hello 3)

14:34 (defn age-comp [s]

14:34 (> (eval (symbol s)) 5))

14:34 (age-comp "hello")

14:35 gfredericks: (defn process-in-context [code-string] (binding [*ns* (the-ns "my.system")] (-> code-string read-string eval)))

14:36 if you're only dealing with single symbols you can probably use resolve and deref instead of eval

14:36 jtoy: gfredericks: ok, ill test out your example, is this releveant though? " "eval wouldn't work because the query itself is generated

14:36 from macros""

14:36 gfredericks: I have no idea what that means

14:36 jtoy: neither do I

14:36 haha

14:37 gfredericks: I'll look at the thread

14:39 oh maybe I know what he meant

14:40 you could put the query in a backtick

14:40 this is a bit sticky though. should definitely be workable but I don't have the time to braindump about it

14:40 you should definitely _not_ have to write your own macro, though it's possible doing so might make things slightly simpler

14:40 but eval should be sufficient

14:41 jtoy: gfredericks: ok, ill test some more,thx

14:43 gfredericks: hyPiRion: dangit I kept looking around github and twitter for "hyperion" and couldn't find you :P

14:56 supersym: could I use something like org-mode emacs with LightTable, that anyone knows of?

14:56 meta-programming that is

14:57 i know you could build it from scratch, but i wondered if it was able to tap into the elisp Babel program

15:06 Bronsa: gfredericks: zmiller I have a patch

15:06 http://sprunge.us/WENi?diff I'm opening a bug on jira now

15:14 ghadishayban: 1.5.1 just got released

15:14 fyi

15:21 zmiller: wow Bronsa, you are fast

15:37 ghadishayban: bronsa: there are some failing tests in your patch

15:37 hyPiRion: gfredericks: That's what you get for not spelling my nick properly

15:37 ghadishayban: in clojure.test-clojure.protocols

15:38 Bronsa: ghadishayban: I tried building it and they were passing, let me check

15:40 ghadishayban: bronsa: np. I had some phantom issues getting repeatable tests today on another patch.

15:42 you might have to correct equality in on the "protocol fns have useful metadata" deftest

15:42 Bronsa: ghadishayban: tests are passing here, can you nopaste me the error you're getting?

15:43 ghadishayban: sure, one sec

15:43 zmiller: so you're the hyPiRion who i shall never catch in projecteuler!

15:46 hyPiRion: zmiller: Yeah. Not worked on it for a long time though. Perhaps I should.

15:46 ghadishayban: bronsa: http://nopaste.info/476f5346f5.html

15:49 bronsa: the tags in the metadata don't match anymore

15:50 Bronsa: yeah

15:50 they are resolved now

15:51 ghadishayban: I'll fix this, resolve is not the correct function

15:51 edw: Is there a reason I need to ('require clojure.repl) to get C-c C-d to work in nrepl-emacs?

15:51 arohner: does (alter-var-root #'my-fn) work as expected with clj 1.3+ compiling of defn sites?

15:51 Bronsa: edw: C-c C-d is probably using clojure.repl/doc

15:52 edw: Bronsa: yes, I am aware. But why doesn't nrepl.el require it?

15:52 ghadishayban: edw: it should -- I *just* switched to emacs and it's there by default

15:53 edw: Huh. It disappeared with 1.5.

15:53 ghadishayban: edw: do you have melpa and marmalade enabled?

15:53 edw: When I switched to 1.5.0, that i.

15:53 devn: ,(require '[clojure.pprint :as pp])

15:53 clojurebot: nil

15:53 ghadishayban: Clojure 1.5.1 is out -- FYI. nasty little memleak

15:54 edw: Saw that seconds ago. Already updated me 1.5 apps. Thanks.

15:54 Comparing MELPA to Marmalade nrepl versions. I have (only) Marmalade.

15:55 devn: ,(pp/pprint (read-string "(^:once fn* [x] x)"))

15:55 clojurebot: (fn* [x] x)\n

15:56 devn: ,*clojure-version*

15:56 clojurebot: {:major 1, :minor 5, :incremental 0, :qualifier "RC6"}

15:56 devn: weird

15:56 ghadishayban: enable melpa and you should be good.

15:56 devn: im on clojure {:major 1, :minor 5, :incremental 0, :qualifier nil}

15:56 ghadishayban: i think -- technomancy helped

15:56 devn: this is what i see when i try the above

15:57 ,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(^:once fn* [x] x)")))

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

15:57 devn: ,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(fn [x] x)")))

15:57 clojurebot: (fn [x] x)\n

15:57 devn: anyone know what's up with that?

15:58 ,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(fn* [x] x)")))

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

15:59 devn: it doesn't like that *

16:02 edw: The 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:04 Ah, upgrading to the current MELPA version of nrepl solved my problems. Thank you.

16:05 ghadishayban: edw: no problem.

16:06 edw: ghadishayban: yeah, the (require 'package) did it for me. Thanks again.

16:18 Bronsa: ew

16:18 definterface is broken too

16:20 ghadishayban: it's hard to remember *where* exactly type hints go

16:21 the code in CLJ-1180 doesn't ring familiar to me -- I thought the hint goes outside the fn

16:22 but I'm speculating -- should look it up

16:23 bronsa: see CLJ-1136 for a laugh

16:23 Bronsa: heh

16:24 yeah, the compiler is definitely not consistent on metadata evaluation

16:25 ghadishayban: official doc is that return hints go on the arg vector

16:25 (f ^ISeq [a b c])

16:26 Bronsa: ghadishayban: that might have changed a while agoo i think

16:26 ghadishayban: errr (defn f (^String [a b c]))

16:26 Bronsa: becasuse of problems with varargs functions

16:26 ghadishayban: oh

16:26 Bronsa: mmmh

16:26 ghadishayban: pulled it off clojure.org

16:26 clojurebot: clojure is like life: you make trade-offs

16:26 ghadishayban: no guarantee there =)

16:27 Bronsa: ghadishayban: well, on clojure test (defprotocol ExcampleProtocol .. (^String baz [a] [a b] ..))

16:27 so..

16:28 ghadishayban: you're totally right

16:30 Bronsa: ok, tests are passing now

16:31 ghadishayban: nice. fixing the worlds problems

16:31 what did you end up doing?

16:31 Bronsa: one sec

16:33 ghadishayban: http://sprunge.us/CAjJ?diff

16:33 either I had to make tagToClass public, or I'd have had to rewrite maybeClass in clojure

16:34 resolve is a no-go becasuse (resolve 'booleans) => #'clojure.core/booleans

16:34 because*

16:35 ghadishayban: what about tagClass?

16:37 Bronsa: oh, that's probably better, you're right

16:37 ghadishayban: dunno

16:37 i'm not really peeking too deeply

16:37 Bronsa: no wait

16:37 it seems like they do the same thing actually

16:38 tagClass is just nil-safe

16:38 but my call to tagToClass is wrapped in a when so it's safe

16:42 ghadishayban: looks good

16:42 Bronsa: well, fixing clj-1136 would probabily fix all those issues too

16:42 ghadishayban: did you try it with ^int ^ints or other prims?

16:44 devn: Hey amalloy -- how good are you with cl-format? :)

16:44 Bronsa: user=> (defprotocol p (^int x [_]))

16:44 p

16:44 user=> (:tag (meta #'x))

16:44 int

16:44 user=> (class *1)

16:44 amalloy: on a scale of 1 to ten, i'm a -1

16:44 Bronsa: java.lang.Class

16:44 devn: aww bummer

16:44 Bronsa: ghadishayban: ^

16:45 devn: im stuck on a problem

16:45 ,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(^:once fn* [x] x)")))

16:45 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: pp, compiling:(NO_SOURCE_PATH:0:0)>

16:45 devn: ,(require '[clojure.pprint :as pp])

16:45 clojurebot: nil

16:45 devn: ,(pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(^:once fn* [x] x)")))

16:45 squidz: how can i reconfigure lein after changing the project name/ns

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

16:46 squidz: after changing the project name(that is namespace and folder name), I can no longer run my namespace call

16:46 is there a way to reset the project with lein?

16:46 I also changed my project.clj

16:46 devn: amalloy: pretty sure it's blowing up in https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/dispatch.clj#L367

16:47 but uh, you already told me you're -1 so im going to shut up now

16:47 "~<#(~;~@{~w~^ ~_~}~;)~:>" <---sigh

16:47 hyPiRion: ~_ ? I've not seen that before.

16:47 clojurebot: Pardon?

16:48 devn: dude, dont ask me

16:48 hyPiRion: To the hyperref

16:48 *spec

16:48 devn: hyPiRion: sounds like you know you're way around the formatter, any ideas on the above illegalargumentexception?

16:49 hyPiRion: Let me have a look

16:50 devn: hyPiRion: thanks in advance

16:50 im stumped

16:51 Petein: Hello babes! is there any framework which you can develop android applications using clojure?

16:52 is there any reason to do that rather than using the native android sdk?

16:56 hyPiRion: devn: 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:57 devn: hyPiRion: that string above?

16:57 hyPiRion: ,(pp/cl-format true "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 12))

16:57 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: pp, compiling:(NO_SOURCE_PATH:0:0)>

16:57 devn: ,(require '[clojure.pprint :as pp])

16:57 clojurebot: nil

16:57 hyPiRion: ,(pp/cl-format true "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 12))

16:57 clojurebot: #(0 1 2 3 4 ...)

16:57 hyPiRion: ,(pp/cl-format true "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 30))

16:57 clojurebot: #(0 1 2 3 4 ...)

16:57 hyPiRion: meh.

16:57 ,(pp/cl-format nil "~<#(~;~@{~w~^ ~_~}~;)~:>" (range 30)) ;; <<-

16:57 clojurebot: "#(0 1 2 3 4 ...)"

16:58 devn: so it takes a seq, eh?

16:58 Petein: Hello 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:58 hyPiRion: Okay, eh, the point is either way that it requres the first element to be a sequence

16:58 right.

16:58 devn: well that's no good

16:58 because

16:59 ,(first (rest (rest '(fn* [x] x))))

16:59 clojurebot: x

16:59 devn: ,(pp/cl-format nil "~<#(~;~@{~w~^ ~_~}~;)~:>" 'x)

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

17:00 devn: hyPiRion: how could i get it to play nice when it's not given a seq?

17:00 hyPiRion: is there an easy way to do that?

17:01 hyPiRion: I'm not familiar with the rest of pp

17:01 jjido: seq?

17:01 clojurebot: seq is short for ,(doc ...)

17:01 hyPiRion: but I'll take a quick peek

17:01 devn: hyPiRion: it's cool, just didn't know if you knew of a simple way to make it at least not blow up

17:03 hyPiRion: hm

17:03 jjido: ,(seq? '(1 2 3))

17:03 clojurebot: true

17:03 hyPiRion: ,(pp/with-pprint-dispatch pp/code-dispatch (read-string "(^:once fn* [x] x)"))

17:03 clojurebot: (fn* [x] x)

17:03 hyPiRion: pp/pprint prints, and returns nil.

17:03 devn: wait...no...you have to be kidding me...

17:03 jjido: ,(seq? [1 2 3])

17:03 clojurebot: false

17:03 devn: i mean that makes 100% sense

17:04 but uh oh hyPiRion -- i think this is the difference though

17:05 ,(with-out-str (pp/with-pprint-dispatch pp/code-dispatch (pp/pprint (read-string "(fn* [x] x)"))))

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

17:05 devn: i want to capture it with-out-str

17:05 hyPiRion: ,(pp/with-pprint-dispatch pp/code-dispatch (with-out-str (pp/pprint (read-string "(^:once fn* [x] x)"))))

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

17:06 * hyPiRion scratches head.

17:06 hyPiRion: ,(with-out-str (pp/pprint (read-string "(^:once fn* [x] x)")))

17:06 clojurebot: "(fn* [x] x)\n"

17:06 devn: now with code dispatch... *KABOOOOM*

17:07 hyPiRion: ,(pp/with-pprint-dispatch pp/code-dispatch "what is this")

17:07 clojurebot: "what is this"

17:07 hyPiRion: ,(pp/with-pprint-dispatch pp/code-dispatch "(fn* [x] x)\n")

17:07 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: pp, compiling:(NO_SOURCE_PATH:0:0)>

17:07 devn: grrr

17:07 hyPiRion: stupid timeout

17:07 devn: ,(require '[clojure.pprint :as pp])

17:07 clojurebot: nil

17:07 hyPiRion: ,(pp/with-pprint-dispatch pp/code-dispatch "(fn* [x] x)\n")

17:07 clojurebot: "(fn* [x] x)\n"

17:08 hyPiRion: Well, it's certain that with-pprint-dispatch is a macro, so it does some magic there I guess.

17:08 devn: yeah :(

17:08 Petein: anyone developing android apps in clojure?

17:09 technomancy: Petein: android apps on clojure are currently too slow to be practical

17:09 jjido: ,with-pprint-dispatch

17:09 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: with-pprint-dispatch in this context, compiling:(NO_SOURCE_PATH:0:0)>

17:09 technomancy: unless you're very patient and all your users are too

17:09 hyPiRion: Petein: http://dev.clojure.org/display/design/Android+Support

17:09 devn: if you're making a game that's all about patience

17:09 it might be cool

17:10 Petein: technomancy: thanks for the feedback

17:10 hyPiRion: It's not a focus yet, but Rich talked about making slimmer Clojure versions for e.g. that purpose.

17:10 And more debug-friendly ones.

17:10 devn: hyPiRion: i assume you're done looking at this with me? :)

17:10 hyPiRion: Though I'm pretty sure that's far away, I'm afraid.

17:11 devn: Well, I should probably figure out what with-pprint-dispatch and code-dispatch does :p

17:11 devn: let's get weird with it hyPiRion

17:12 code-dispatch is a multi-method

17:12 hyPiRion: https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/dispatch.clj#L448

17:13 hyPiRion: https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/pprint_base.clj#L274

17:13 there's with-pprint-dispatch

17:14 hyPiRion: Oh, I see what's bugging you.

17:14 devn: !!!

17:14 sgarrett|afk: Anyone with experience using ElasticSearch?

17:14 devn: sgarrett: yeah

17:15 sgarrett: what's up?

17:15 sgarrett: devn: 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:16 devn: sgarrett: describe the use case

17:16 sgarrett: devn: I know that I could refresh the index on each write but that seems like a bad idea.

17:16 devn: like... a user saves a record and it gets indexed, and they dont see it fast enough?

17:16 why do you need to see it immediately?

17:16 sgarrett: devn: I basically have a collaborative blog. So anyone could be creating a post at any time.

17:17 devn: sgarrett: are you using elastisch?

17:17 sgarrett: devn: Yes.

17:17 devn: IIRC there's a way to force it to update

17:17 solr has that too I believe

17:17 sgarrett: devn: 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:17 devn: sgarrett: do you have a LOT of users?

17:17 how big is this?

17:18 sgarrett: devn: That's the plan.

17:18 devn: ah, yes, but a plan is not reality :)

17:18 only suggesting that maybe this isn't an issue at all

17:18 sgarrett: devn: 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:18 hyPiRion: devn: the gist of it is this

17:18 ,(class (read-string "(^:once fn* [x] x)"))

17:18 clojurebot: clojure.lang.PersistentList

17:19 devn: sgarrett: my sense is that if at some point your writes get out of control, you could scale ES to handle it

17:19 hyPiRion: code-dispatch has no dispatcher for PersistentList, so it'll use pprint-simple-default (as far as I can see)

17:19 devn: hyPiRion: hmmm

17:19 sgarrett: devn: Okay. Do you know if refreshing the index per write would have bad repercussions?

17:20 devn: sgarrett: ive worked on a solr DB that had 250 million records

17:20 there were optimizations and lots of subtle tuning

17:21 but for indexes that are smallish, like 10-50k records, won't bite you unless you're updating a spellchecking index

17:21 (on commit)

17:21 and that's solr parlance: you would do something like (doseq [doc tons-of-docs] (add-to-index doc))

17:21 and THEN (commit!)

17:22 sgarrett: I see. Yeah these would all be individual commits.

17:22 devn: ive done aggressive commits before, and as long as it doesn't trigger "optimize" (more solr parlance)

17:22 it seemed to be no trouble at all for <100k records

17:22 hyPiRion: devn: okay, I've found it. https://github.com/clojure/clojure/blob/master/src/clj/clojure/pprint/dispatch.clj#L367-379

17:23 sgarrett: devn: Okay. That sounds good.

17:23 devn: that else condition is where it happens hyPiRion ?

17:23 sgarrett: dont treat what im saying as gospel

17:23 sgarrett: devn: No worries there. ;)

17:23 devn: sgarrett: but my suggestion is to push it and try to benchmark it with a ton of records

17:23 i have a feeling you'll be surprised at the speed

17:23 sgarrett: devn: Agreed. Definitely will be doing some load testing.

17:23 hyPiRion: devn: (first (rest (rest alis))) is the issue. it's expecting it to be a list, but it's not.

17:24 devn: hyPiRion: yeah, that's what i was saying earlier

17:24 sgarrett: devn: 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:24 hyPiRion: oh, sorry

17:24 sgarrett: devn: Thanks for the help!

17:24 devn: hyPiRion: nono it's okay, im happy to hear im not totally off the mark

17:24 hyPiRion: im wondering wth I can do to fix this

17:25 hyPiRion: I didn't read what you wrote earlier, remind me on doing that.

17:25 devn: hyPiRion: no worries, this formatter logic expects a list right?

17:25 hyPiRion: devn: It's a bug with the pprinter, so I suggest you ask them to fix it.

17:25 yeah, it's buggy, simply put.

17:25 devn: hyPiRion: so you think it's a legit bug?

17:25 edw: What does the :once metadata do?

17:26 hyPiRion: devn: yes

17:26 amalloy: edw: promises the compiler you'll only call the function once, so it does locals-clearing on its closed-over variables asap

17:26 hyPiRion: ,(let [id (fn* [x] x)] (id 40))

17:26 clojurebot: 40

17:26 devn: edw: like (defonce ...)

17:27 amalloy: devn: wat. :once has nothing to do with defonce

17:27 edw: Ah. I was searching the docs. Is that documented anywhere?

17:27 devn: amalloy: oh, really?

17:27 i just assumed they were related

17:27 hyPiRion: devn: But regardless, it seems clever to file a report on that bug.

17:27 devn: hyPiRion: much appreciated

17:27 hyPiRion: now, given the lifecycle of bugs in the clojure world

17:28 im still looking for a way to hack around this, because this is a blocker for me :(

17:28 amalloy: probably not, edw

17:28 sgarrett: devn: 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:28 edw: amalloy: OK, so I'll feel less ignorant for not having known that.

17:29 devn: sgarrett: depends on how you set things up

17:29 hyPiRion: devn: 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:29 edw: BTW, I'm soon going to be looking for a programmer for a Clojure-heaviy position in NYC.

17:30 hyPiRion: Not pretty, but it'll solve the problem temporarily.

17:30 edw: s/heaviy/heavy

17:30 sgarrett: edw: I don't know you, but I might be interested. :)

17:30 devn: hyPiRion: 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:30 edw: sgarrett: The feeling is mutual. ;)

17:31 devn: and just remove the anon-func from the list of things that are pretty printable by code-dispatch

17:31 or something like that

17:31 hyPiRion: devn: ah, right. Well, feel free to do whatever pleases you.

17:31 devn: hyPiRion: either way i should log an issue for this

17:31 edw: sgarrett: I'm edw on Github; drop me a line.

17:31 sgarrett: edw: I have some interviews in the next week, but I'm looking.

17:31 hyPiRion: yeah

17:31 devn: i sent something to the list earlier, so i have a feeling an issue will get created either way

17:32 * devn jumps over to jira

17:32 edw: sgarrett: You in NYC?

17:32 Or thereabouts?

17:32 sgarrett: edw: I lived in NYC last year and loved it. I basically just moved away so I could save some money. :P

17:33 edw: sgarrett: I know how you feel. I've been cash-flow negative for the last year plus, living in Manhattan. Ah, start-ups…

17:33 sgarrett: edw: Just "followed" you on github.

17:33 edw: I'm looking for a startup position specifically if that helps.

17:34 edw: We should take this private but, we're a mobile adtech startup getting deeply into processing and acting on huge amounts of data.

17:39 Raynes: sgarrett: People love NYC?

17:40 ravster: I'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:40 gillies: just heard about Zing JVM. Does it work with clojure?

17:40 sgarrett: Raynes: ha! I did.

17:41 Raynes: When 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:41 But I've never actually been there. ;)

17:41 sgarrett: Raynes: I think it's tough to beat culturally.

17:42 technomancy: Raynes: also http://sadguysontradingfloors.tumblr.com/

17:42 metellus: most of those things would also apply to LA...

17:42 edw: Raynes, 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:42 danneu: How 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:42 technomancy: metellus: yeah, but Hollywood has incentive to glamourize LA

17:42 Raynes: metellus: Parts of LA, of course. Didn't say I enjoyed all of LA either though.

17:43 technomancy: They're doing a terrible job of it.

17:43 sgarrett: I wasn't a big fan of LA when I visited last August.

17:43 metellus: danneu: because an "element" of a map is a [key value] pair

17:43 edw: My gf has been stuck in Long Beach, CA, just southwest of LA, and the whole place is insipid.

17:43 metellus: and the order is not guaranteed

17:44 devn: ill take weather over NYC credentials

17:44 technomancy: Raynes: it looks pretty great in Iron Man, but then you realize it's because he can just fly places instead of driving.

17:44 edw: I liked the paved paths along the beach for skateboarding, though.

17:44 sgarrett: "insipid" is the definition of my trip to LA.

17:44 Raynes: Santa Monica is pretty great.

17:44 devn: I wouldn't live in LA, but I would live in most of the rest of CA.

17:44 Raynes: As is Malibu.

17:44 edw: Skateboarding to work through slush gets old quick.

17:44 Raynes: LA isn't that bad, guys. LA is a lot of places.

17:45 Bronsa: to what is C-h k bound in emacs?

17:45 devn: edw: lol, I'm in WI so moving to NYC for me is not at all something I'm interested in.

17:45 Raynes: NYC isn't all fun and games either, you know. You live in Manhattan.

17:45 Bronsa: I rebinded C-h but now I don't remember what C-h k is :(

17:45 devn: I have seen snow before. I do not like it.

17:45 Bronsa: rebound*

17:45 danneu: metellus: Did you see the Gist? That doesn't seem to explain the inconsistency

17:46 metellus: it does, because you should have no expectations whatsoever about the ordering of elements in a map

17:46 edw: Raynes: 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:46 devn: metellus: actually that looks weird

17:46 he has two seperate maps

17:46 separate*

17:46 danneu: metellus: How come the results are consistent then?

17:47 devn: metellus: that looks real weird, you don't agree

17:47 ?

17:47 edw: C-h k is describe-key, Bronsa.

17:47 Bronsa: thanks

17:47 edw: Or describe-key-1, actually.

17:47 Raynes: I haven't seen edw, but descriptions residents give me of it make me wonder why everybody enjoys it so much.

17:47 Oops.

17:48 metellus: devn: what's so weird about it?

17:48 Raynes: I haven't seen SF.

17:48 danneu: metellus: I encountered this when reading about `doseq` http://clojuredocs.org/clojure_core/clojure.core/doseq#example_183

17:48 jjido: ,'({:1 1 :2 2} {:3 3 :4 4})

17:48 clojurebot: ({:1 1, :2 2} {:3 3, :4 4})

17:48 Raynes: Not edw. Wow. That was the best typo ever.

17:48 edw: Raynes: Where? SF or NYC?

17:48 Raynes: SF.

17:48 edw: Funny, yes!

17:48 devn: metellus: oh, nevermind

17:49 ,(map list [{:a 1 :b 2} {:c 3 :d 4}])

17:49 clojurebot: (({:a 1, :b 2}) ({:c 3, :d 4}))

17:49 jjido: aah

17:49 devn: if ^that produces (([:a 1] [:c 3]) ([:b 2] [:d 4])) that would be weird

17:49 metellus: yes, that would be very bad

17:49 edw: I 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:49 ravster: I'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:50 devn: edw: the NYC wall street dudes are people i would like to never hang out with again

17:50 id rather live in a petri dish of progressives than in a cesspool of cocaine sniffing assholes

17:50 edw: devn: I have like zero contact with those people; they're easy to avoid.

17:51 danneu: ,(map list {:1 1 :2 2} {:3 3 :4 4})

17:51 clojurebot: (([:1 1] [:4 4]) ([:2 2] [:3 3]))

17:52 jjido: danneu: what's the last arg?

17:52 devn: edw: yeah, but now and then one of them sneaks in

17:52 edw: :)

17:52 edw: I 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:52 Raynes: devn: Well, CA is exactly that only with crack smoking assholes.

17:52 SF, I mean.

17:52 edw: I live in paradise, I feel.

17:52 devn: haha

17:52 Raynes: Jesus, I can't get my abbreviations straight today.

17:53 devn: So did my pull request fix your problem?

17:53 devn: Here is where I want to live: http://www.youtube.com/watch?v=iYJKd0rkKss

17:53 edw: Raynes: Yeah, SF has the most pretty aggressive panhandlers.

17:53 devn: Raynes: indeed it did, I just needed to drop (str ...) from around (str (:_id (get-user username)))

17:54 Raynes: devn: 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:55 danneu: jimt_: what do you mean 'last arg'?

17:55 jjido: ,doc map

17:55 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0:0)>

17:56 danneu: jjido: how is my example different from (map + [1 2] [3 4])

17:56 jjido: I mean in (map list x y) what is y?

17:57 danneu: jjido: i don't understand your question. y is the second collection that'll be zipped up with x.

17:57 jjido: ,(map + [1 2] [10 20])

17:57 clojurebot: (11 22)

17:57 jjido: danneu: thanks

17:58 metellus: danneu: becasue [1 2] is a vector and {:a 1 :b 2} is a map

17:58 vectors are ordered, maps are not

17:58 jjido: so you are doing (list [:1 1] [:4 4])

17:59 metellus: (there is *some* internal ordering to a map, but it's not necessarily the one you would expect)

17:59 danneu: metellus: ah, so it's not random

17:59 er, it doesnt randomize

17:59 metellus: it's determined by the JVM and/or Clojure

17:59 danneu: in 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:01 edw: What do you mean "replicate"?

18:01 danneu: (map list {:1 1 :2 2} {:3 3 :4 4}) always pairs :1 with :4

18:02 whether this irc bot is evaluating it or my repl is

18:02 meanwhile {:a 1 :b 2} {:c 3 :d 4} always pairs :a with :c as i'd expect

18:03 edw: danneu, Dude, what you're doing is deeply wrong. What are you trying to accomplish?

18:03 hyPiRion: danneu: if you prepend clojure functions with ',' or '&', you'll get it evaluated

18:03 ,(map list {:1 1 :2 2} {:3 3 :4 4})

18:03 clojurebot: (([:1 1] [:4 4]) ([:2 2] [:3 3]))

18:03 hyPiRion: But as mentioned, maps don't give you any ordering guarantees.

18:04 edw: Are you trying to pair map entries from two maps sorted by key?

18:04 danneu: edw: i'm just trying to understand line 9 of http://clojuredocs.org/clojure_core/clojure.core/doseq#example_183

18:05 edw: First of all, those are vectors, not maps.

18:05 jjido: no maps {}

18:05 metellus: edw: I think you're looking at the wrong example

18:06 one of those example does exactly what he's trying to do and gives (([:1 1] [:3 3]) ([:2 2] [:4 4]))

18:06 edw: OK.

18:06 jjido: do you know clojure differentiates between brackets?

18:06 ok

18:06 hyPiRion: edw: that's a bad example, heh. Don

18:06 Don't look at it ;)

18:06 edw: Do danneu, the deal is this: maps are unordered. The order is not something you can/should depend on.

18:07 ,(map identity {:a 1})

18:07 clojurebot: ([:a 1])

18:08 danneu: edw: yeah i get that much.

18:08 Raynes: edw: http://www.youtube.com/watch?v=-sKDd9uOW-0

18:08 edw: danneu, does what I just eval'd make sense to you? The function that is being mapped is called with each map entry.

18:08 arrdem: is there an http proxy handler for ring?

18:09 danneu: edw: yeah, i see that mapping funcs to hash-maps vectorizes hash-map k/v pair.

18:09 edw: danneu: OK, so this should be crystal clear, too: ,(map list {:a 1} {:b 2})

18:10 ,(map list {:a 1} {:b 2})

18:10 clojurebot: (([:a 1] [:b 2]))

18:10 edw: danneu: right?

18:10 Because there's only one possible ordering of entries for a one item map.

18:10 danneu: right, it's zipping :a and :b

18:10 in an order that can't be ambiguous

18:11 i guess my issue is understanding the implications of 'map key order is not guaranteed'

18:11 edw: Right. You should not depend on the output of that example code. It's _one possible_ result. There are _four possible results_.

18:11 metellus: that you shouldn't do anything with maps that relies on them having a consistent order

18:11 that's the implication

18:11 if you want something ordered, us a vector

18:12 use

18:12 danneu: i get that. but i can run my gist 1000 times and the two examples diverge from eachother the same way every time.

18:12 edw: danneu: As metellus said, your inability to rely on the order is the implication of the nature of a map.

18:12 danneu: and i can't replicate the clojure doc example even once

18:12 metellus: danneu: it's not determined randomly

18:13 there is some reason in the internals that will order it

18:13 so with the same versions of everything on the same machine, you'll get the same result consistently

18:13 danneu: metellus: so it's like it's using the same 'seed' every time. like the hash of the values or something.

18:13 edw: danneu: The internal representation of maps has (probably changed) since that sample code was placed in the docs.

18:13 danneu: ahh, thanks guys

18:13 that was killing me

18:13 metellus: but yeah, that example was probably from an older version of Clojure

18:13 jjido: or the JVM

18:15 danneu: phew

18:15 edw: danneu: 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:19 arrdem: edw: 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:22 edw: arrdem: Don't disagree. Just trying to explain how the system can choose implementations at run time.

18:22 danneu: clojure does have some nice examples in its docs tho

18:40 zakwilson: I'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:42 rebcabin: I 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:43 zerokarmaleft: rebcabin: check out profiles in the docs

18:43 zakwilson: https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md

18:44 rebcabin: thank you :)

19:17 muhoo: what are we using for database migrations these days? migratus? ragtime? lobos? drift? other?

19:21 Raynes: muhoo: The blood of children.

19:22 muhoo: muaaaahahaha

19:23 btw, 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:24 ok well then i guess i have a day of researching and trying a handful of migration libraries :-/

19:24 lazyIRC fails to absolve me of that, apparently

19:28 Raynes: muhoo: I could fart at the microphone and you'd tell me nice job, fwiw.

19:28 Cause you're a nice guy.

19:29 muhoo: well you are good. if you sucked i'd probably say nothing.

19:30 Raynes: Heh.

19:30 I can't even remember what song I did.

19:30 muhoo: it was something i'd never heard of :-P

19:31 Raynes: Mercy?

19:31 Yeah, Mercy.

19:31 Good ol' OneRepublic.

19:31 devn: Raynes: devn needs your help again

19:31 Raynes: Heroku won't pick up the damned MONGOLAB_URI

19:33 Raynes: devn: You mean getclojure won't pick up the damned MONGOLAB_URI?

19:34 Heroku is the one that should be setting it and you're the one who should be picking it up.

19:35 devn: You can do 'heroku config' or something to see what vars are set.

19:39 devn: Raynes: im getting an NPE

19:40 (System/getenv "MONGOHQ_URL") is nil at compile time methinks

19:40 Raynes: Well, I thought you wanted MONGOLAB_URI?

19:40 devn: tried adding MONGOHQ just to see if it worked

19:40 Raynes: Can you set it locally and then run it?

19:41 gfredericks: hyPiRion: ping

19:43 Raynes: devn: It works fine locally. Sounds like Heroku isn't setting the variable.

19:48 yogthos|away: http://yogthos.net/blog/41?utm_source=dlvr.it&utm_medium=twitter BOOM, FIRST COMMENT.

19:53 devn: Raynes: I booted up a lein repl and checked for it

19:53 it's there

19:59 gillies: is there a way to read in a file as a clojure data strucure ?

19:59 liek foo.txt == {:foo "bar"}

20:00 arrdem: well you could (eval (read-string (slurp "foo.txt")))

20:00 but then you have arbitrary code execution...

20:00 so you really want to use the data reader

20:01 https://github.com/clojure/tools.reader

20:01 gillies: arrdem: fsvo "arbitrary"

20:01 isn't code just data?

20:02 arrdem: gillies: yes and no... the issue is that via reader macros one could execute potentially malicious code.

20:02 ghadishayban: arrdem: read-string is sufficient without the eval

20:03 devn: ^-(read-string (slurp "foo.txt"))

20:03 use it all the time

20:03 ghadishayban: slurp -> string ; read-string -> clojure data structure ; eval ~-> compilation

20:03 arrdem: ,(read-string "#=(println \"foobarbaz\")")

20:03 clojurebot: #<RuntimeException java.lang.RuntimeException: eval reading not allowed when *read-eval* is false.>

20:04 devn: gillies: 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:04 arrdem: ghadishayban, gillies http://news.ycombinator.com/item?id=5343704

20:05 devn: i 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:05 arrdem: which is what clojurebot did to me...

20:06 devn: or use clojail's safe-read

20:06 amalloy: safe-read really isn't safe either. nothing is safe but upgrading to 1.5 and using edn/read

20:06 arrdem: ... can I make clojurebot remember that as ~reader somehow?

20:06 ghadishayban: devn: regarding *read-eval* false, -- see Fogus's comment

20:06 devn: nothing is safe

20:07 ghadishayban: also, amalloy == truth

20:07 arrdem: ~reader

20:07 clojurebot: Reader syntax of collections has gotchas

20:07 arrdem: well I suppose there's that too.

20:07 amalloy: clojurebot: reader is http://news.ycombinator.com/item?id=5343704

20:07 clojurebot: You don't have to tell me twice.

20:07 arrdem: amalloy: I assume that's permissioned...

20:07 amalloy: huh?

20:08 arrdem: the "foo is" syntax for clojurebot

20:08 amalloy: i don't know why you would assume such a thing, when you have the opportunity to try it and see

20:08 arrdem: clojurebot: arrdem is awesome

20:08 clojurebot: Roger.

20:08 arrdem: ~arrdem

20:08 clojurebot: arrdem is awesome

20:08 devn: clojurebot: arrdem isn't very curious

20:08 clojurebot: arrdem is jeremy

20:08 arrdem: works for me

20:08 devn: clojurebot: arrdem is beautiful person

20:08 clojurebot: c'est bon!

20:09 devn: ~devn

20:09 clojurebot: No entiendo

20:09 devn: clojurebot: devn put a car in your car, so you can car while you cdr.

20:09 clojurebot: John McCarthy is someone without whom we would not be here today.

20:10 zakwilson: muhoo: I had your problem yesterday. I decided on migratus, largely because its author was here. Also, it sounded fairly sane.

20:17 pjstadig: i'll take that as a compliment

20:17 :)

20:19 tyler_: wow i can't belive i didn't learn about edn until today

20:21 zakwilson: pjstadig: 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:25 ravster: How do I fix this error when starting "lein ring server" --> Assert failed: (vector? (:dependencies project []))

20:26 pjstadig: zakwilson: maybe something to do with out you have the migration dir configured?

20:27 and/or the way the files are name...i'd have to get more specifics

20:30 gfredericks: ravster: I think I saw that just the other day

20:30 cannot remember what on earth caused it though.

20:32 ravster: apparently I need to find a package I'm using that might be using an outdated leinjacker.

20:33 hyPiRion: gfredericks: pong

20:33 zakwilson: pjstadig: I just followed the example on github. I may have gotten it wrong, but I'm pretty sure I did not.

20:34 pjstadig: is there source i could see? otherwise, what is your migration dir config, and what are the names of your migration files?

20:38 tyler__: they they remove entity-db from clojure api?

20:38 dat.core=> d/entity-db

20:38 CompilerException java.lang.RuntimeException: No such var: d/entity-db, compiling:(NO_SOURCE_PATH:1)

20:38 d/entity is a function

20:44 ah entity has all keywords you just have to merge with a native map

20:45 zakwilson: pjstadig: sorry, got distract.d Neighbor made me drink too much beer.

20:45 pjstadig: https://gist.github.com/zakwilson/5131226

20:51 gfredericks: hyPiRion: I noticed in the logs you said at some point that nth-prime should be trivial in swearjure

20:51 just curious what the high-level idea was there

20:51 Raynes: zakwilson: Wish I had neighbors like yours.

20:52 zakwilson: Raynes: I gave her cookies.

20:52 gfredericks: Raynes: but he said "too much" -- that's more than you're supposed to have!

20:53 pjstadig: zakwilson: should be *.up.sql and *.down.sql not *-up.sql and *-down.sql

20:54 Raynes: gfredericks: I don't think anyone knows how much you're supposed to have.

20:54 gfredericks: you don't have to know -- we're talking about "too much" in an unqualified sense

20:55 pjstadig: zakwilson: i thought i changed migratus to warn when it found names in the migration dir that don't match its pattern

20:55 zakwilson:

20:56 pjstadig: the docs say “[id]-[name]-[direction].sql”, t the example says “s"rc/migrations/20111206154000-create-foo-table.up.sql”"

20:57 And those are dumb quotes.

20:57 hyPiRion: gfredericks: 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:57 gfredericks: do we have `count`?

20:57 pjstadig: zakwilson: hrm

20:57 zakwilson: Anyway, I tried it both ways, same result.

20:57 gfredericks: I guess rest gives you count

20:57 hyPiRion: gfredericks: we don't need it either way

20:58 gfredericks: so presumably you're thinking of a way of doing this without division?

20:58 unless we have some way of getting `rem` that I'm unaware of

20:58 hyPiRion: oh, right. That's a bugger.

20:58 gfredericks: okay just checking if you had gotten that far

20:59 I think it's probably still possible

20:59 just hairier

20:59 hyPiRion: yeah, must be

20:59 can we simulate rem?

20:59 Right, we can.

20:59 gfredericks: I was just thinking about that

20:59 either that or do a division-less algorithm

20:59 a sievy thing

21:00 pjstadig: zakwilson: 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:00 gfredericks: simulating rem is probably the simplest from a high level

21:00 hyPiRion: yeah, probably more efficient for high values of n

21:00 (the sieve, that is)=

21:01 devn: Raynes: lol, dude I am STILL trying various crap to get that config variable out.

21:01 Raynes: devn: I can't imagine what would be the problem.

21:02 It shouldn't matter if it is compile time or not.

21:02 devn: it's driving me insane man

21:02 Raynes: devn: https://github.com/Raynes/refheap/blob/master/src/refheap/server.clj#L13 I did this and it worked fine on heroku.

21:03 pjstadig: zakwilson: it is also expecting a 14 digit number for the migration id

21:03 zakwilson: yours are 12

21:05 zakwilson: pjstadig: the docs do NOT say that.

21:05 pjstadig: zakwilson: i just updated them

21:06 devn: Raynes: im doing the exact same thing

21:07 zakwilson: pjstadig: ok, it liked that. Failed, but there may well be a typo in my sql.

21:09 If that is the case, I consider it a flaw that whatever postgres would say in complaint is not being displayed.

21:10 Raynes: devn: :|

21:10 devn: Raynes: well, hard-coding it works

21:10 ugh

21:10 Raynes: Hahaha

21:11 tyler__: in the repl is there a symbol that represents last output?

21:13 tmciver: tyler__: *1

21:13 tyler__: tmciver: thanks

21:13 ah nice it goes backwards

21:13 so i can get *5

21:13 bravo

21:14 tmciver: tyler__: I think it only goes to *3

21:14 devn: technomancy: 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:14 tyler__: meh

21:14 close enough heh

21:15 someone needs to make a clojroku

21:15 heh

21:15 Raynes: yogthos: First comment on your blog post about luminus + clabango is a guy complaining about no laser support. :D

21:15 YOU'VE BEEN SERVED HOMEBOY.

21:16 devn: oh damn

21:17 egghead: :)

21:17 devn: omg im going to murder someone if this doesn't work soon

21:34 clifton: is there a good way to do 0-downtime deploys with clojure web apps?

21:34 brehaut: clifton: it would depend on your deployment situation

21:35 clifton: eg, jetty behind (forex) nginx is different to servlet in an app container

21:35 clifton: yeah im using nginx now

21:35 im used to using unicorn in ruby, which is a pretty simple master/worker pre-forking setup

21:37 brehaut: i 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:38 most of the time you'd only have one running, and you'd cut over when you want to update

21:38 clifton: yeah the solution i googled uses port failover

21:41 technomancy: devn: they're not there at compile time or at runtime?

21:42 exposing config at compile time is possible, but introduces a lot of undesirable semantics around the purity of the build function

21:47 tomoj: so what's the workaround?

21:48 or you just accept the impurity if you need an s3 key at build time?

21:49 devn: technomancy: at compile time

21:49 tomoj: I mean, I know the user-env-compile workaround, but what's the workaround around user-env-compile? :)

21:50 dabd_: How can I force the evaluation of lazy seqs? The expression [(some-fn-that-returns-a-lazy-seq)] returns [clojure.lang.LazySeq@...]

21:50 I tried doall but it doesn't work

21:50 devn: technomancy: 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:51 pjstadig: zakwilson: migratus should let bubble any exception that would be getting thrown from JDBC

21:51 devn: tomoj: i didn't know that workaround

21:51 tomoj: but like he says, "undesirable" :/

21:51 devn: yeah and i understand why

21:51 but im looking to just finish this and go do something else

21:51 so this is going to have to do for now

21:52 zakwilson: pjstadig: "java.sql.BatchUpdateException: Batch entry 1 <unknown> was aborted. Call getNextException to see the cause.

21:52 preyalone: Are there macros for Haskell-like pattern matching?

21:52 tomoj: I can't even remember how "clojure.lang.LazySeq@" happens. it's not str or print, so what is it?

21:53 devn: technomancy: i also cant seem to get Pygments to install via pip :\

21:54 tomoj: lazybot: google clojure match

21:54 lazybot: [clojure/core.match · GitHub] https://github.com/clojure/core.match

21:55 preyalone: core.match isn't available yet.

21:55 devn: Raynes: 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:56 Raynes: devn: I did.

21:57 tomoj: it's not available?

21:58 preyalone: I'm using clojure stable and this feature is not yet available.

21:58 Raynes: It's a library, preyalone.

21:58 bbloom: lynaghk: remind me at clojure/west, you and i need to discuss rewrite systems!

21:58 lynaghk: and property trees

21:58 Raynes: Not built into Clojure, but it is available.

21:59 preyalone: If it's a library, why is it called core / clojure?

21:59 *core.match

21:59 Raynes: Because it could potentially get moved into Clojure one day.

21:59 And if it did, the namespaces would not need to change.

21:59 And thus existing code would continue to work without modification.

21:59 This will likely never happen, but they also use JIRA and Confluence as well so their sanity is already questionable.

22:00 preyalone: interesting

22:00 How did Atlassian get so popular?

22:00 devn: Java

22:00 Raynes: How did Hitler get so popular?

22:00 brehaut: painting

22:00 devn: bahahahaha

22:01 Using Jira is sort of like the holocaust... I guess...

22:03 technomancy: tomoj: I have a hack where you can add query params to your buildpack URL for private params

22:03 but 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:03 even though for the solutions it does work on it's a superior solution to user-env-compile

22:04 devn: 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:04 tomoj: https://github.com/heroku/slug-compiler/blob/master/lib/slug_compiler.rb#L77 <- not in production

22:32 arrdem: amalloy: thanks for reminding me to try before asking XP

22:32 solving my own problems is way more fun

22:32 amalloy: "try it and see" is the right answer to like a quarter of all questions asked in irc

22:34 tomoj: generous estimate

22:34 abp: amalloy: That even applies to how I work on my library. Written 10 or more prototypish things in along the way.

22:34 -in

22:35 arrdem: tomoj: really? I'd guess it's conservative...

22:36 * arrdem pushes a question-tracking #clojure bot onto the projects heap

22:36 Raynes: Just write a plugin for lazybot.

22:36 Why do people keep writing new bots? Damned lisp curse.

22:37 arrdem: there's your answer... it's about as easy to roll your own as to build on something else :D

22:39 brehaut: i smell irony

22:39 tomoj: hmm, 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:40 oh I guess obviously cemerick.cljs.test shouldn't use a promise library

22:40 * arrdem does the happy dance 'cause a DIY HTTP proxy was only four lines

22:48 hyperboreean: how can one figure out the clojurescript version to use in a project.clj ?

22:50 supersym: https://github.com/emezeske/lein-cljsbuild

22:50 technically not the correct answer

22:50 but guessing its the result you probably would want that counts?

22:50 tomoj: http://search.maven.org/#search%7Cga%7C1%7Cclojurescript

22:51 &(learn-command! lazybot 'mvn)

22:51 lazybot: java.lang.RuntimeException: Unable to resolve symbol: learn-command! in this context

22:51 arrdem: dakrone: clj-http is a dream, thanks!

22:52 Raynes: tomoj: I'd like an extension of my $latest command to work with maven central. Go.

22:54 tomoj: but using laser, not lein's indices

22:55 I'll do that on thursday

23:02 alandipert: arrdem: re: proxy, pushed out https://github.com/tailrecursion/ring-proxy the other week... also based on clj-http by the awesome dakrone

23:03 arrdem: alandipert: 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:04 tyler__: whats an easy way to cancel in lein repl if i get caught in bad parens?

23:05 not quit the repl just restore back to sane state

23:05 arrdem: alandipert: badass, that's exacltly what I was thinking would be in order

23:05 alandipert: arrdem: cool! yes it does all http verbs and munges cookie domains

23:06 tyler__: alandipert: nice

23:08 alandipert: tyler__: thanks

23:08 arrdem: tyler__: 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:09 tyler__: control d it is then

23:09 arrdem: tyler__: I would suggest just closing the expression (balancing the parens, brackets etc) and feeding the repl a bad form rather than C-ding

23:10 tyler__: arrdem: tried that, it got stuck i think

23:11 i was like )))))))))))))))))))))))))))))))))))

23:11 heh

23:12 johnmn3: in clojurescript, instead of dom/appendChild, I want to do something like dom/setChild. What is the best way to go about doing that?

23:14 alandipert: johnmn3: (do (set! (.-innerHTML ele) (dom/appendChild ele x)) is one way

23:15 johnmn3: err, that's busted, but idea is to clear and append

23:15 johnmn3: right

23:15 I was thinking that... closure has goog.dom.RemoveChildren

23:16 goog.dom.removeChildren, rather

23:16 alandipert: that's another way, yeah. also jquery's empty()

23:33 brehaut: im curious, why does re-seq use an fn an explicit recursion rahter than loop recur for its lazy-seq generation?

23:38 ivan: brehaut: isn't that the only way to recur (lazily) in a lazy-seq?

23:39 brehaut: ivan: no, thats the very purpose of lazy-seq

23:42 in hindsight, i suspect its because the recursive call is not in the tail position

23:58 devn: yeesh, constant stream of memory errors on heroku

23:58 2013-03-11T03:59:53+00:00 heroku[web.1]: Process running mem=534M(104.4%)

23:59 technomancy: are you leaving lein running?

Logging service provided by n01se.net