2013-09-19
| 00:03 | akurilin | Has anybody tried setting transaction isolation level in clojure.jdbc? Am I correctly seeing that there's currently no way to? |
| 00:05 | akurilin | callen, I know I mentioned that already, but I have to reiterate that blackwater is absolutely priceless when mocking db interfaces for testing. |
| 00:06 | akurilin | callen, some of those calls are tricky to spot without intentionally disabling the db or nuking the schema, which obviously breaks integration tests. |
| 00:26 | chord | no one is here |
| 00:30 | noprompt | chord: i'm here. |
| 00:30 | noprompt | chord: heh, from the look of it there are lots of people here. |
| 00:30 | callen | akurilin: I'm glad it's been so useful to you. I know I hate not being able to see wtf is going on :) |
| 00:30 | coventry | Does (fn eager-map [& colls] (doall (apply map colls))) exist? |
| 00:30 | noprompt | chord: maybe you meant, "no one is chatting?" |
| 00:30 | callen | akurilin: I'm 99% certain you use it more than I do because I've been doing so much datomic stuff lately, haha. :) |
| 00:31 | callen | maybe I should add datomic support? |
| 00:32 | chord | lets start the starcraft clone in clojure project |
| 00:32 | coventry | I prefer thermonuclear war. |
| 00:32 | callen | I prefer troll hunting. |
| 00:32 | noprompt | chord: lol okay! |
| 00:33 | noprompt | callen: is chord a troll? |
| 00:33 | chord | callen why are you so against starcraft |
| 00:33 | noprompt | chord: are you a troll? |
| 00:33 | chord | no |
| 00:33 | noprompt | chord: yeah, sorry man, it's hard to know these days. sometimes you gotta ask the hard questions, ya know? |
| 00:34 | callen | chord: I'm not, I'm all for displacing the evil Blizzard Empire. |
| 00:34 | tbaldridge | callen: yeah he is, he gets on here every few nights and babbles about Erlang or Haskel, or CL trying to convince people Clojure is sub-par in one day or another |
| 00:34 | tbaldridge | *in one way or another |
| 00:34 | callen | tbaldridge: you don't have to tell me, I'm the one that pasted the screenshot of him accusing me of incest in /query |
| 00:34 | brehaut | tbaldridge: wrong address? |
| 00:34 | noprompt | that's so lol |
| 00:34 | callen | tbaldridge: I'm starting to think he's the loper-os guy. |
| 00:35 | noprompt | callen: i don't think that would make sense. |
| 00:35 | callen | tbaldridge: also I liked your article on __call__ and IFn. :) |
| 00:35 | noprompt | callen: then why don't you marry it? |
| 00:35 | noprompt | :-{P) |
| 00:36 | chord | so then lets start making the starcraft clone, I already made a concession and said that using clojure instead of haskell is ok |
| 00:36 | callen | noprompt: do you write any Clojure that touches a database? |
| 00:36 | coventry | I suppose the fact that I want eager-map so bad reflects how ridden with side-effects this code is. Hmm. |
| 00:36 | noprompt | callen: sure. |
| 00:36 | callen | coventry: (doall ...) ALL THE THINGS |
| 00:36 | callen | noprompt: which library do you use? |
| 00:37 | noprompt | callen: umm i've used monger for MongoDB, neocons for Neo4J, and Korma for SQL. |
| 00:37 | brehaut | coventry, callen: or doseq! |
| 00:37 | callen | noprompt: Korma/JDBC - https://github.com/bitemyapp/blackwater/ |
| 00:38 | callen | noprompt: do you find yourself wanting something similar with monger or no? |
| 00:38 | noprompt | callen: you mean timing queries? |
| 00:38 | noprompt | loggin them? |
| 00:38 | callen | noprompt: it's just dev mode logging, the timing is icing on top. |
| 00:38 | coventry | eager-map seems better than doseq in these cases. It's just a function being called on every collection element. |
| 00:38 | callen | so you can quickly see if a slow query is coming through. |
| 00:39 | noprompt | callen: not really. i just usually interact with the repl mostly and assume the lib i'm using is doing the right thing. |
| 00:39 | noprompt | sometimes i might be interested, but i'm not an sql expert. |
| 00:39 | noprompt | if shit gets weird, slow, buggy, etc. then i look at the code and start digging around. |
| 00:40 | callen | noprompt: yes keep going? |
| 00:40 | callen | devn: hi! |
| 00:40 | devn | howdy |
| 00:40 | callen | devn: I finally wrote a library somebody other than myself uses. lol. |
| 00:40 | callen | I almost got Raynes to use bulwark, but he was lazy about integrating it. :) |
| 00:40 | brehaut | callen: i did that once. im very sorry to all those people |
| 00:40 | devn | dude, i managed to keep a post about rich's talks for the last 5 years on the front page of HN for 24 hours |
| 00:40 | noprompt | callen: but i should reword all of that as, "i wouldn't mind having this feature" |
| 00:40 | callen | devn: how have your programming perambulations been? |
| 00:41 | callen | devn: oh that was you?! |
| 00:41 | devn | moving slowly, ebbing and flowing |
| 00:41 | devn | yeah, i just started writing for the changelog |
| 00:41 | callen | devn: that was a fantastic post. I used it to spread the good word to coworkers. |
| 00:41 | brehaut | devn: are ypu a githuber mow? |
| 00:41 | devn | my first post got them more play on HN than many moons before it |
| 00:41 | devn | nah |
| 00:42 | noprompt | callen: i mean you give a shit right? and by extension i do, now that you've shown me this. |
| 00:42 | callen | one thing I have to avoid with Rich Hickey is the tech industry interviews. They're usually kinda bad. |
| 00:42 | devn | *shrug* |
| 00:42 | devn | they're different |
| 00:42 | devn | they're for a different audience |
| 00:42 | noprompt | callen: no kidding. |
| 00:42 | callen | noprompt: hum. not sure what you mean. |
| 00:42 | devn | knowing the audience is half the battle |
| 00:42 | callen | devn: Hickey's *talks* are generally considered easy mode. I don't know what his interviews should be classified under. |
| 00:42 | noprompt | did anyone see the interview with ryan dahl at the nodejs summit or something. |
| 00:42 | noprompt | god it was halarious. |
| 00:43 | callen | no, link? |
| 00:43 | devn | callen: they tend to be pretty jammed with information |
| 00:43 | noprompt | it was set up like a pre-game show or something. weird. |
| 00:43 | devn | noprompt: no |
| 00:43 | callen | I actually think hickey's talks are sparse. Valuable! but sparse. |
| 00:43 | devn | that's why they're good |
| 00:43 | devn | there was a comment on HN to that effect |
| 00:43 | noprompt | http://www.youtube.com/watch?v=Fc26auhSLqM |
| 00:44 | devn | some people don't get the synergy between philosophy and pragmatism |
| 00:44 | callen | well I think it's because the value of Hickey's talks is in making certain the point is hammered home. I think that's far more valuable than Simon Peyton-Jones babbling about GHC inside baseball. |
| 00:44 | callen | noprompt: didn't Dahl rage-quit Node.js dev? |
| 00:44 | devn | it's all about the "why" to me |
| 00:44 | devn | too many talks without enough "why" |
| 00:44 | noprompt | callen: i dunno, i think he still commits. |
| 00:45 | devn | rich always brings the why, is excruciating detail |
| 00:45 | callen | noprompt: he had a rather public hissy fit. |
| 00:45 | devn | s/is/in/* |
| 00:45 | noprompt | callen: i think he rage-quit twitter. |
| 00:45 | callen | devn: and that's the part that's really missing with my coworkers, anecdotally. |
| 00:45 | callen | devn: many of them are "aware" of things like immutability, Scala, Clojure, Datomic, etc |
| 00:45 | callen | but many haven't really had the epiphany yet. |
| 00:45 | callen | Hickey's talks are a vehicle to the epiphany. |
| 00:45 | devn | callen: i share this with everyone i can: |
| 00:45 | devn | you cant be told your favorite band |
| 00:46 | noprompt | chord: so what's up buddy? we doing starcraft or what? |
| 00:46 | devn | one finds it on his/her own |
| 00:46 | callen | devn: I tend to think of programming in more engineering-centric terms :) |
| 00:46 | devn | the journey is what makes the discovery feel personal and rel |
| 00:46 | devn | real |
| 00:46 | noprompt | eww that video is so gross. |
| 00:46 | callen | not because I think we should regard ourselves as proper engineers, but because I think that's the rigor we should strive for. |
| 00:46 | chord | noprompt so you know how to make starcraft with clojure? |
| 00:46 | noprompt | the guy talks about nodejs like it's a stock or something. |
| 00:47 | devn | callen: you're fooling yourself a bit then |
| 00:47 | noprompt | "great growth there" |
| 00:47 | callen | devn: I know there's other things thrown in. |
| 00:47 | callen | devn: but the personal expression is there, the rigor is not. |
| 00:47 | noprompt | chord: what? no. i thought you were the hot shit programmer with all the plans. |
| 00:47 | devn | without expression, rigor is meaningless |
| 00:47 | chord | noprompt: hey i already said I made the concession of not using haskell and using clojure instead, its your job to be the clojure hot shit expert not mine since i use haskell |
| 00:47 | callen | noprompt: why the fuck is he explaining (terribly) asynchrony to these muggles? |
| 00:48 | noprompt | muggles lol |
| 00:48 | noprompt | oh, callen, every time you use that word it tickles me. |
| 00:48 | devn | be nice folks |
| 00:48 | chord | nodejs is a horrible language to use |
| 00:48 | callen | omg I agree with chord on something |
| 00:48 | devn | stop the hate. |
| 00:48 | callen | I...am...oh god. |
| 00:48 | callen | WHAT DOES IT MEEEAAAAAAN |
| 00:49 | brehaut | it means everyone hates node |
| 00:49 | chord | the only reason to use nodejs is beacuse you've got a team of javascript programmers that can't be bothered to learn another language |
| 00:49 | noprompt | chord: i'll write it in haskell with you. can you show me the ropes? i got up to like chapter 9 or something in "Learn You A..." |
| 00:49 | devn | dont hate on languages like that in here |
| 00:49 | callen | noprompt: farther than most. |
| 00:49 | devn | it's tasteless |
| 00:49 | chord | noprompt: shit i'm reading chapter 11 right now |
| 00:49 | callen | devn: JS is not a language, it's compiler output ^_^ |
| 00:49 | callen | noprompt: word on the street is people get stuck on typeclasses in LYAH. |
| 00:50 | callen | chord: so I take it you haven't run into the monomorphism restriction in Haskell yet? |
| 00:50 | callen | noprompt: no, I don't know why. |
| 00:50 | callen | noprompt: also what you said earlier about giving a shit, I couldn't really tell what you meant. |
| 00:50 | noprompt | tasteless is an interesting concept. |
| 00:51 | callen | I think every time I watch a video of Dahl talking, I have fangs grow and start sticking out of my mouth. |
| 00:51 | chord | noprompt: ok so heres the plan since we both haven't finished reading the book, we'll go with clojure and callen can be our clojure hot shit expert |
| 00:51 | noprompt | tasteless implies that whatever it is that is tasteless tastes like the current taste in your mouth. |
| 00:52 | noprompt | callen: i wonder if chord is like one of those chat bots or something. |
| 00:52 | noprompt | gee what'da'ya think? |
| 00:52 | callen | today I learned I'm a Clojure Hot Shit Expert. |
| 00:52 | callen | should screenshot it for mom so she can post it on the fridge. |
| 00:52 | noprompt | today i learned that mapcat rulez. |
| 00:53 | callen | noprompt: did you not see my flatten -> mapcat identity -> into progression earlier? |
| 00:53 | noprompt | i'm gonna write that on the wall in a bathroom somewhere with a paint pen. |
| 00:53 | callen | felt like a moron. |
| 00:53 | noprompt | callen: yes i was there |
| 00:53 | callen | I'm so terrible ;_; |
| 00:53 | callen | noprompt: I'm still trying to figure out what you meant earlier re: giving a shit |
| 00:53 | noprompt | (into {} '([:mind "blown"])) |
| 00:53 | noprompt | :P |
| 00:54 | callen | I know I'm terrible, but being confronted with it gives it a new flavor. |
| 00:54 | chord | callen you gonna help noprompt and I make the starcraft clone? |
| 00:54 | callen | chord: I'll send you my contract rate details. |
| 00:54 | callen | chord: what's your email? |
| 00:54 | noprompt | callen: oh heh. i was just saying that normally i don't worry about stuff like that until i have to, but since you made something that will do it for me now i care enough to add it to my project.clj whenever i hack on an app that uses an sql store. |
| 00:55 | callen | noprompt: yay. :) |
| 00:55 | SegFaultAX | What's this? |
| 00:56 | callen | everybody scatter! |
| 00:56 | callen | Concurrent trolling: IRC'ing while queueing in DotA. Perfection. |
| 00:57 | noprompt | well after a few weeks of being back in college, i think it's safe to say the computer science major is not for me. after this semester i think i'm going to just go back to math. |
| 00:57 | chord | noprompt ok you in for making the game without callen |
| 00:57 | callen | noprompt: I thought you worked for a living? |
| 00:57 | noprompt | i can't remember one math class i didn't enjoy. |
| 00:57 | noprompt | callen: i do, but i take a class here or there. |
| 00:58 | callen | ahhh. |
| 00:58 | noprompt | callen: one day i'll have a degree. |
| 00:58 | noprompt | it's pretty much a big fat waste of time though, since i'm not really motivated by money or anything like that. |
| 00:59 | callen | SegFaultAX: do you do anything with SQL databases in Clojure? |
| 00:59 | noprompt | now, the acquisition of knowledge is appealing. |
| 01:00 | chord | GOOD FOR YOU NOPROMPT UNLIKE CALLEN WHO ASKED FOR MONEY TO MAKE STARCRAFT |
| 01:01 | callen | the people who made StarCraft got paid too. |
| 01:01 | coventry | Actually, he was just telling you to fuck off. |
| 01:01 | callen | pretty hard to pay rent otherwise. |
| 01:01 | noprompt | ZING! |
| 01:02 | SegFaultAX | callen: Yes. |
| 01:02 | callen | coventry is here with the hard facts. |
| 01:02 | callen | SegFaultAX: https://github.com/bitemyapp/blackwater/ |
| 01:02 | SegFaultAX | callen: Oh yea I saw that. |
| 01:02 | chord | noprompt so you gonna help with starcraft |
| 01:03 | noprompt | chord: bro, i'd love to but you've been talking about that for the past 15 mins or so and i haven't seen a github repo or nothin. man, it's pretty much, like, you know, um, vaporware dude. |
| 01:03 | SegFaultAX | chord: Please stop spamming the channel. |
| 01:04 | chord | noprompt: i'm not a clojure expert thats why i'm waiting for you to make initial commit |
| 01:04 | noprompt | chord: s'to late bro. |
| 01:05 | noprompt | SegFaultAX: just so you know, i had no part in this. he kept asking me to help him with the starcraft port and, well, as you can see i have politely declined. |
| 01:05 | havenwood | chord: I see you've gone from trolling (or whatever it is) #ruby to trolling #clojure. |
| 01:06 | SegFaultAX | noprompt: I know. This is like day 3 of this shit. |
| 01:06 | chord | what are you talking about I didn't troll #ruby |
| 01:06 | noprompt | havenwood: is he looking for the starcraft port in #ruby? |
| 01:06 | chord | havenwood making shit up now |
| 01:07 | dissipate | chord, you should apply to work at blizzard. get them to switch to clojure. |
| 01:08 | chord | no we need to make starcraft clone independently from blizzard |
| 01:08 | havenwood | chord: Well, to be fair trolling isn't entirely a mischaracterisation from the logs i'm reading. >.> But no intent to insult, if well intentioned carry on and don't mind me. |
| 01:09 | chord | so is there any game that you guys would make with clojure since you all hate starcraft |
| 01:09 | dissipate | chord, why? |
| 01:09 | dissipate | chord, tic tac toe |
| 01:10 | noprompt | chord: uh, BioShock Infinite, duh. |
| 01:11 | chord | eww you guys like first person shooters? |
| 01:11 | SegFaultAX | noprompt, dissipate: Why are you feeding the trolls? |
| 01:12 | noprompt | SegFaultAX: alright. ok. i'll stop. |
| 01:12 | chord | i'm not trolling |
| 01:12 | SegFaultAX | chord: Fine, you've polled repeatedly to see if anyone wants to help you with a game. No one does. Kindly move on. |
| 01:14 | noprompt | chord: yeah! go peddle your pie-in-the-sky ideas else where! we don't want none! |
| 01:14 | chord | why are you guys so resistant to making a game |
| 01:21 | callen | SegFaultAX: it's been going on longer than three days. |
| 01:21 | indigo | :\ |
| 01:24 | chord | callen: don't you want to become famous for being the first to make a brilliant game in clojure |
| 01:26 | pizzasauce | test |
| 01:28 | bja | chord: sometimes I consider writing a better cockatrice-compatible mtg client |
| 01:29 | pizzasauce | hello |
| 01:29 | bja | chord: then I realize I have a daughter, a wife, and a job |
| 01:29 | nonuby | not strictly a clj question, but if I have a domain model where a change is subject to a relatively long running operation, e.g. user (1:*) virtual machines, and progress is often required to be visible, what approaches are available? I figured about just having a :status on the vm entity that progresses from requested, building, to ready but not sure if thats really the best approach |
| 01:30 | pizzasauce | bja: you have a family you mean. |
| 01:30 | bja | yeah, family, job, an addiction to reddit |
| 01:30 | bja | I think the last is most burdensome |
| 01:31 | sontek | Any of you guys using cassaforte (cassandra client) with clojure? Wondering if its the best one to use |
| 01:31 | pizzasauce | bja: what is reddit and why it is addictive? |
| 01:31 | havenwood | pizzasauce: http://www.reddit.com/ |
| 01:31 | bja | pizzasauce: http://www.reddit.com/ (and I'm sorta sorry for linking you this. cya in a few months) |
| 01:32 | chord | http://www.reddit.com/r/haskell |
| 01:32 | callen | pizzasauce: hi |
| 01:32 | callen | bja: you linked him to Reddit? You monster. |
| 01:32 | pizzasauce | it says:"reddit is a website about everything" |
| 01:33 | pizzasauce | hi callen |
| 01:33 | bja | pizzasauce: lies. just cats. |
| 01:33 | pizzasauce | bja: why it is addictive? |
| 01:34 | bja | pizzasauce: so many lolcats to view, so little time |
| 01:35 | pizzasauce | bja: oh, funny pictures you mean. yes they can be addictive. |
| 01:35 | callen | pizzasauce: lolcats. |
| 01:35 | pizzasauce | cats pictures, yes. |
| 01:35 | callen | bja: I've mostly taken a break from recreational redditing besides the occasional brief brain-break to check r/history, getting a lot more reading done :) |
| 01:37 | bja | callen: without reddit, I might be tempted to better document and test my codebases. wouldn't want my coworkers getting the wrong impression about future productivity. |
| 01:45 | noonian | is it more idiomatic for a var name that represents a field called name in a thing to use something like tname or t-name? with most fields I would just use the field name but I try to avoid redefining core functions even locally |
| 01:46 | rads | hey guys, I'm trying to test out core.async with clojurescript |
| 01:46 | rads | it seems like when I use a loop inside a go block, the code inside the loop doesn't run |
| 01:47 | rads | for example, this appears to do nothing until I remove the loops: https://gist.github.com/rads/44b0aa0aaa7f46c5761b |
| 01:47 | dnolen | rads: you need to use CLJS w/ core.async *master* |
| 01:47 | dnolen | if you are on CLJS >= 1877 |
| 01:48 | rads | oh ok. how do I specify that in my project.clj? |
| 01:51 | iamjarvo | can anyone spot any errors here? i am new to clojure http://pastie.org/private/zgah9uihuif42uuvclzicq error i get is Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: index in this context, compiling:(shoutr/core.clj:7:15) thanks! |
| 01:51 | francis_wolke | I'm unable to use macros at the clojurescript repl, but on compilation of my foo.cljs file, they work fine. Are you unable to use macros at the repl in clojurescript, or am I making a mistake somewhere along the chain? |
| 01:52 | jared314 | try it with routes below index |
| 01:52 | noonian | iamjarvo: you need to move the definition of index to above defroutes, or else (declare index) before the defroutes |
| 01:52 | francis_wolke | Clojure has a one-pass compiler. |
| 01:52 | francis_wolke | Err... single pass |
| 01:53 | bja | francis_wolke: pretty sure that clojurescript's compiler chain will keep evaluating defmacros until they run out |
| 01:53 | iamjarvo | ahh interesting |
| 01:53 | noonian | i think its actually 2 pass but on a per-form basis, at least for the regular clojure |
| 01:54 | bja | otherwise https://gist.github.com/emidln/bd33d9c0b40d20f60508 wouldn't be very useful |
| 01:54 | iamjarvo | thanks guys |
| 01:54 | bja | although I guess with source maps working, it's not super valuable anyway |
| 01:55 | bja | still useful for sending stack traces to raven |
| 01:55 | callen | recursion of macroexpansion doesn't really make the compiler multi-pass, it's just inherent to the nature of macroexpansion, no? |
| 01:56 | callen | or I might've misread. either way. I am quite tired :) |
| 01:58 | francis_wolke | bja: I'm not sure what the implications of what you stated are to repl development. IMO evaluating them until they run out wouldn't prevent their use at the repl - the compiler does that for clojure too |
| 01:59 | francis_wolke | *the also clojure compiler does this. |
| 01:59 | bja | in my cljs repl, I can do (ns foo (require-macros [my.macro :refer [supermacro]])) and then (supermacro) |
| 02:00 | bja | err, :require-macros |
| 02:00 | dnolen | rads: in your :dependencies list you need [org.clojure/clojurescript "0.0-1889"] |
| 02:01 | bja | francis_wolke: or are you talking about defining macros at your cljs repl? |
| 02:02 | rads | dnolen: I figured out how to use the master core.async with :source-paths. is that still a requirement with this new clojurescript version? |
| 02:02 | francis_wolke | bja: Nope. Just using them. |
| 02:02 | francis_wolke | bja: interestingly, I can use them when doing it as you described, but my ns definition from the cljs file does not carry over to the cljs repl. |
| 02:03 | francis_wolke | bja: thanks |
| 02:03 | dnolen | rads: until the next core.async release - though prior to this people were either using snapshot or installing manually anyways |
| 02:03 | bja | dnolen: there's a core.async release? |
| 02:04 | bja | wow, missed that |
| 02:05 | rads | I'm a little confused on the difference between a snapshot and installing manually -- if I use "0.1.0-SNAPSHOT" as a version, leiningen won't find it |
| 02:05 | augustl | is there anything like mori - Clojure's data structures implemented in JS, as a stand alone library - for the JVM? |
| 02:05 | rads | the only way I'm familiar with using a different version is to use :source-paths |
| 02:07 | bja | rads: I think if you mvn install it, lein can find it |
| 02:09 | noidi | augustl, clojure's data structures rely heavily on functional programming, so I don't think they're a good fit for Java |
| 02:09 | rads | bja: never used maven outside of leiningen, so I don't know how to do that either :/ |
| 02:09 | bja | rads: if you have a pom.xml, you can just do "mvn install" in your core.async directory |
| 02:10 | bja | I think there is a lein plugin that lets you run something like "lein install" to get similar functionality |
| 02:10 | bja | it might even be core lein functionality, not sure |
| 02:10 | s4muel | default functionality |
| 02:10 | s4muel | s/default/core/, better word :) |
| 02:11 | noidi | augustl, I assume you meant Java, because Scala has its own persistent data structures, and in JRuby you can probably use Hamster |
| 02:13 | rads | bja: so when I `mvn install` from a local checkout of core.async, it's supposed to put it somewhere where my leiningen project can read it as a snapshot version? |
| 02:15 | bja | rads: after quick inspection, lein install seems to generate a pom.xml and a jar that it doesn't install anywhere particularly useful. You can then type mvn install to get the snapshot installed somewhere that lein can find it. |
| 02:16 | rads | I tried that, but it didn't seem to work. still getting an error from leiningen saying 0.1.0-SNAPSHOT can't be found in any repo |
| 02:17 | bja | do you have anything in ~/.m2/repository/org/clojure/ ? |
| 02:17 | bja | specifically, a core.async directory? |
| 02:19 | rads | yeah, it's there |
| 02:19 | bja | is there a 0.1.0-SNAPSHOT directory? |
| 02:20 | rads | yes, but it only has a resolver-status.properties file |
| 02:20 | rads | there are other release verisons with jars in them |
| 02:21 | rads | it seems that the mvn install put it in core/async/core.async instead for some reason |
| 02:22 | dnolen | augustl: https://github.com/krukow/clj-ds |
| 02:24 | bja | rads: perhaps either the pom.xml isn't correct or mvn install is ignoring the <parent></parent> element that would position it under org/clojure |
| 02:27 | bja | ah |
| 02:27 | bja | rads: run git clean -fdX in your core.async checkout |
| 02:27 | bja | it'll get rid of pom.xml |
| 02:28 | bja | apparently pom.xml is old and was removed about a week ago (but added to gitignore in the next commit) so a normal git clean -fd won't rid you of it |
| 02:28 | bja | it seems as though mvn install doesn't respect the <parent> tag |
| 02:29 | bja | if you inspect pom.template.xml, you'll see that the groupId for the project was changed to org.clojure |
| 02:30 | rads | clean it, then run lein install again? |
| 02:30 | augustl | dnolen: cool, thanks |
| 02:30 | augustl | noidi: haha, good point, I meant java yeah :) |
| 02:31 | bja | clean it, then run script/build/pom |
| 02:31 | bja | that should generate you a new pom |
| 02:31 | bja | and then you can mvn install |
| 02:33 | rads | yeah, that seemed to work. leiningen still can't find it though :( |
| 02:33 | bja | rads, it probably has a different version |
| 02:34 | bja | the pom.xml I just generated via master has a version of 0.1.225.0-34a630-alpha |
| 02:34 | rads | if it's 0.1.0-SNAPSHOT, doesn't it pull the most recent version? |
| 02:34 | bja | rads: only if the pom.xml specifies the version as 0.1.0-SNAPSHOT |
| 02:35 | bja | the script/build/pom grabs the git revision (it seems). I didn't author the tool, so perhaps somewhere here with more knowledge could elaborate |
| 02:36 | rads | well, I can just specify that version in my project.clj |
| 02:38 | rads | in NPM I can specify a git repository and a revision (or "master") to stay up to date. I guess that's the advantage of hindsight, though? |
| 02:40 | bja | rads: I remember doing the same thing with pip for python |
| 04:00 | kral | namaste |
| 05:25 | edoloughlin | I'm switching from Eclipse to Emacs and can't seem to get nrepl working. I can jack-in, switch to my namespace but when I try to call a fn from the namespace I get a "CompilerException [...] compiling: (NO_SOURCE_PATH:1:24)" any ideas? |
| 05:25 | edoloughlin | It's a lein 2 project. |
| 05:26 | edoloughlin | Sorry. My own fault. I just remembered I opened my files using /ssh:... |
| 05:39 | borkdude | does pr-str force evaluation of a lazyseq? (in that case I can omit a doall) |
| 05:42 | hhenkel | Hi all, is there a way to do a "let" of a set and add more values if a condition is matched ( a parameter is set to true)? |
| 05:44 | clgv | hhenkel: example? |
| 05:45 | clgv | do you mean something like that (cond-> #{1 2 3} (= (+ 1 2) 3) (conj 4)) |
| 05:45 | clgv | ,(cond-> #{1 2 3} (= (+ 1 2) 3) (conj 4)) |
| 05:45 | clojurebot | #{1 2 3 4} |
| 05:48 | hhenkel | clgv: (let [data #{[:a :b :c]} (if (:use-https config) ;; ADD :https-port)) |
| 05:49 | clgv | hhenkel: ok. so you mean like the one above |
| 05:49 | hhenkel | clgv: yes looks like that is what I've been looking for. |
| 05:50 | clgv | ,(let [config {:use-https true :https-port 443}] (cond-> #{[:a :b :c} (:use-https config) (conj (:https-port config))) |
| 05:50 | clojurebot | #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: }> |
| 05:50 | clgv | ,(let [config {:use-https true :https-port 443}] (cond-> #{[:a :b :c]} (:use-https config) (conj (:https-port config))) |
| 05:50 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 05:50 | clgv | ,(let [config {:use-https true :https-port 443}] (cond-> #{[:a :b :c]} (:use-https config) (conj (:https-port config)))) |
| 05:50 | clojurebot | #{[:a :b :c] 443} |
| 05:56 | hhenkel | clgv: So I would do something like this: (let [needed-values (cond-> #{[:host :host :http-port :context-root]} (:use-https config) (conj (:https-port)))) ? |
| 06:39 | clgv | hhenkel: yeah. ideally the `let` would become superfluous in that function, but that depends of the context |
| 06:39 | clgv | *on |
| 07:21 | katratxo | hi all, newbiew question, reading the documentation, (:use x) in a namespace declaration uses `refer` but i also have seen (:require [x :refer y]), when do you want to use the latter ? |
| 07:23 | llasram | katratxo: Always. `use` is semi-deprecated. If you aren't in the habit of using it already, no need to start :-) |
| 07:23 | ddellacosta | katratxo: use will import everything into your namespace. require will let you selectively import vars into your namespace. Generally don't use use |
| 07:24 | ddellacosta | katratxo: if you really want to, you can mimic it with :refer :all, which arguably is a bit more explicitly, but in general avoid it (what llasram said) |
| 07:25 | katratxo | llasram, ddellacosta thanks!! :) |
| 07:26 | ddellacosta | katratxo: np. Also, this is a great article to read on Clojure namespaces if you haven't already--should clear some things up: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html |
| 07:45 | supersym | AimHere: I finally did a (distinct (map sum (drop 1 (subsets numbers)))) for those partial sums you helped me with... think it makes for a pretty elegant expression |
| 07:46 | supersym | btw...me thinks lazy-compile prismatic graphs = pwnage; I don't think I can do without their plumbing lib anymore =) |
| 07:47 | AimHere | Indeed. I really need to find a way or remembering all those little clojure collection operations |
| 07:49 | supersym | yeah I have the same though, have LightTable wired up with a few keys to open 2, 3 good cheatsheets/search resources online |
| 07:51 | supersym | now the fun part of my game design has come... AI/decisions/strategy ^^ |
| 08:00 | clgv | supersym: what are you developing? |
| 08:03 | borkdude | does someone here use the clj-configurator library? |
| 08:05 | potetm | Do we do clojurescript questions in here as well as JVM clojure? |
| 08:06 | borkdude | I do not understand its behavior: (process-tree {:a "foo"} {:a "bar"} []) ;;=> {:a "foo"}, while I expect {:a "bar"} |
| 08:06 | hashcat | what's different between == and = |
| 08:06 | hashcat | I've tried many thing to distinguish |
| 08:06 | hyPiRion | (doc ==) |
| 08:06 | clojurebot | "([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false" |
| 08:07 | hyPiRion | for numbers only |
| 08:07 | hashcat | oh thanks |
| 08:08 | potetm | When I try to compile my project using the latest clojurescript, I get a bunch of errors like the following: Reflection warning, clojure/tools/reader/default_data_readers.clj:177:15 - call to format can't be resolved. |
| 08:08 | potetm | Same for digit and write |
| 08:09 | potetm | It was working fine prior to 0.0-1853 |
| 08:09 | potetm | I've determined that that's the build that broke it |
| 08:10 | potetm | Anyone have any idea what changed between 1847 and 853? |
| 08:10 | potetm | s/853/1853/ |
| 08:11 | potetm | It's almost like some of the automatically included core functions aren't being imported. |
| 08:13 | bja | potetm: you could do git diff r1847 r1853 |
| 08:13 | potetm | @bja tried that, I have no idea what would cause this. The diff isn't that big actually. |
| 08:14 | bja | if you just want the commits |
| 08:14 | bja | git lg r1847..r1853 |
| 08:14 | bja | err, log |
| 08:14 | potetm | Looks like they included tools.reader in that version |
| 08:15 | bja | where lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %C(blue)<%an>%Creset %s %Cgreen(%cr)' --abbrev-commit --date=relative |
| 08:15 | supersym | clgv: a local variety of backgammon |
| 08:16 | clgv | supersym: ah ok, with an AI opponent? |
| 08:16 | hyPiRion | bja: ty, I lost that one for some time ago, and forgot where I found it |
| 08:17 | bja | hyPiRion: np. It's not originally mine, but I like to pass it on as it's pretty useful |
| 08:17 | hyPiRion | yeah |
| 08:17 | potetm | Yeah it looks like the inclusion of tools.reader is what did it. |
| 08:17 | potetm | But, from the error, it looks like it can't resolve symbols in tools.reader itself. |
| 08:17 | potetm | Which makes no sense to me. |
| 08:17 | supersym | clgv: well nothing true AI, but I can recall most of my decision moments when I play a game and translate those for the machine to look at |
| 08:18 | bja | potetm: is it critical that you use r1853? |
| 08:18 | potetm | No, I'm just trying to bring it up to date. It happens in every version after 1853 |
| 08:18 | bja | 1859 is pretty well supported, and there have been numerous tags since that have varying degrees of third party library support |
| 08:20 | potetm | Hang on, let me look at my dependency tree. Could be I'm transiently including an older version of tools.reader |
| 08:20 | bja | potetm: how does one do that? I know I can lein classpath |
| 08:20 | potetm | Piss that's it |
| 08:20 | potetm | lein deps :tree |
| 08:20 | Bronsa | potetm: that might be it, the tools.reader version that clojurescript uses doesn't have any reflection |
| 08:20 | supersym | often all I need is a few predicates and overall strategy of def/off and all that remains is a 2, maybe 3 moves it could take... the trick is of course on how to ensure the long term strategy follows through... but this is all just play time, I don't see myself resorting to e.g. genetic algorithms yet |
| 08:21 | potetm | @bja @Bronsa Well that was the problem. Thanks for taking the time to rubber ducky with me :) |
| 08:21 | bja | always happy to play the goldfish |
| 08:21 | potetm | Extremely helpful! |
| 08:22 | Bronsa | potetm: anyway, reflection warnings only means some performance loss, it doesn't mean that the code is not going to work |
| 08:23 | supersym | anyway its intresting as practice experiments since those rules we have are specific for this game, and the problem isn't infinite possibilities like with chess |
| 08:23 | potetm | @Bronsa I'm guessing it's some sort of versioning issue. I'm going to try to get that all hammered out and see if I have any luck. |
| 08:24 | clgv | supersym: huh? genetic algorithms? I think you need methods on game trees for that kind of game. |
| 08:25 | Bronsa | potetm: tools-reader pre 0.7.5 includes some reflection warnings |
| 08:25 | potetm | @Bronsa that's it then. We were running 0.7.3 |
| 08:26 | Bronsa | potetm: last released version is 0.7.7 :) |
| 08:27 | potetm | I'm probably just going to use whatever's in the latest clojurescript release |
| 08:28 | bja | layout practice question: if I have two src trees, src/clj and src/cljs, is it considered bad form to put cljs-only macros inside /src/cljs |
| 08:28 | bja | i.e. src/cljs/foo/macros.clj |
| 08:29 | bja | assuming the macros have no actual applicability to normal clojure code (running them would either be nonsensical or outright errors) |
| 08:31 | supersym | clgv: see... I'm no game designer, and thats a new term to read up on ;) |
| 08:32 | supersym | well in theory of course (also in practice) you can derive the optimal strategy from using those algorithms |
| 08:34 | potetm | Now I get "Use of undeclared Var my.namespace/format" all over the place |
| 08:34 | potetm | I'm guessing format is no longer supported in cljs? |
| 08:42 | Bronsa | potetm: it was removed from clojurescript, if you need it just use goog.string.format |
| 08:52 | Fender | Hi guys, I need something like a synchronized block in Java for creating a DB connection on demand. This takes half a sec and is side-effecty, so atoms are not the weapon of choice. What should I use? |
| 08:54 | Fender | in Java it'd be "if (x==null) {synchronized (some_lock) {if (x== null) x=createDbConn()}}} return x;" |
| 08:54 | Bronsa | Fender: `locking` is the clojure equivalent of java synchronized |
| 08:54 | Fender | I know but somehow this seems too Javaic and less clojuric |
| 08:55 | Fender | people say it's supposed to be used for Java Interop stuff |
| 08:55 | Fender | so I am looking for the idiomatic solution |
| 08:56 | Fender | I could manage it with a delayed connection that is deref every time when needed |
| 08:56 | Bronsa | Fender: yeah, you could use `delay` |
| 08:57 | Fender | but I don't want to define a delay block at startup because it assumes that the delay-contained connection does not change it params |
| 08:57 | Fender | it probably never will, but still |
| 08:58 | Fender | basically I'd like a swap! that blocks all other threads |
| 08:59 | Fender | agents also dont look like a good solution because of the async overhead |
| 09:00 | Fender | so refs are still in the game |
| 09:02 | llasram | Fender: You can have a memoized function which returns delays. So one delay per connection parameters |
| 09:02 | llasram | NB that I mean "memoized" in the broad sense -- you'd need to do something simple but custom to handle cache expiration |
| 09:05 | Fender | that seems like an idea but not that simple |
| 09:05 | Fender | I am investigating refs with commute right now |
| 09:06 | llasram | Refs also happen in transactions which may be restarted, so I don't think that's what you want either |
| 09:07 | llasram | I really think you want delays. Actually -- do you even need the memoization? That's essentially just a connection pooling layer |
| 09:07 | llasram | After you get the delay by opening it once, you can just pass that delay around |
| 09:08 | Fender | hmm |
| 09:08 | Fender | sounds good |
| 09:09 | Fender | I just looked for refs w commute coz of this: "Note that a change made to a ref by commute will never cause a transaction to retry. commute does not cause transaction conflicts." |
| 09:10 | Fender | but essentially, I'd have the same problem as with delay when some parameters change |
| 09:10 | Fender | ok, I will try the delay solution |
| 09:10 | devn | I think I know what the answer will be but do you prefer: (-> (java.io.File. "foo") .exists) or (. (java.io.File. "foo") exists)? |
| 09:11 | llasram | devn: (-> "foo" io/file .exists) |
| 09:11 | devn | meh |
| 09:12 | devn | i think that's a tad confusing |
| 09:12 | llasram | I tried :-p |
| 09:12 | llasram | what |
| 09:12 | llasram | Welp, we must agree to disagree |
| 09:12 | devn | haha, well let me state my case |
| 09:12 | devn | i think it's weird to see io/file in that position |
| 09:13 | Fender | why not (.exists (io/file "foo"))? |
| 09:13 | devn | Fender: just playing around with some different colors |
| 09:14 | Fender | ^^ |
| 09:14 | Fender | your optimizing your code for nice representation in EMACS?^^ |
| 09:14 | llasram | devn: Ok. I personally don't find it any more odd than seeing any other function in a threading-macro chain |
| 09:15 | devn | Fender: nah, just trying out different variations |
| 09:16 | devn | since we have . and .. it seems a little odd to use -> |
| 09:16 | devn | but in some ways i prefer to see the leading . on .exists, because it's clear what its purpose is |
| 09:16 | llasram | Eh. `.` is the special form, but I don't see it used much outside of the old parts of clojure.core |
| 09:17 | llasram | `..` ditto re: not seeing much outside of old parts of clojure.core |
| 09:17 | clojurebot | I don't understand. |
| 09:17 | llasram | You can get the same effect with `->`, but can thread and interweave arbitrary functions and methods |
| 09:17 | llasram | So it's more flexible |
| 09:18 | devn | llasram: except in this case, this is all java |
| 09:18 | devn | java.io.File on a java.io.String, calling the method .exists |
| 09:18 | llasram | Sure, until you want to add something that's not :-) |
| 09:18 | devn | it seems like a no-brainer to use . there |
| 09:19 | llasram | I'm just reporting what I see in existing Clojure code |
| 09:19 | llasram | Feel free to experience the Lisp Curse (tm) yourself :-) |
| 09:19 | devn | llasram: im not disagreeing, just thinking maybe everyone else is wrong and im right ;) |
| 09:19 | llasram | haha |
| 09:20 | llasram | See -- the Lisp Curse in action! |
| 09:42 | Fender | llasram, the delay version is quite simple so I consider this the idiomatic solution |
| 09:42 | Fender | thanks |
| 09:54 | clgv | llasram: devn: people that have to do a lot of java interop tend to use ".." when possible for cascading java method calls |
| 09:57 | squidz | is there a way to run something everytime leiningen auto-recompiles? |
| 09:57 | squidz | either in-code or an external script. I think I saw something similar for adding test runners |
| 10:13 | supersym | squidz: leininen auto-recompile? |
| 10:15 | supersym | as far as I know, leiningen doesn't do anything on that front, although quite a few employ a strategy like this https://github.com/aphyr/prism/blob/master/src/com/aphyr/prism.clj#L97 |
| 10:16 | squidz | supersym: yeah I mean I want to run ascript.sh everything lein cljsbuild auto updates |
| 10:20 | supersym | so if a plugin does recompile your code, I think your best bet is to use a hook to wrap some functionality |
| 10:20 | supersym | or something like http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Shebang_Scripting_in_Clojure |
| 10:20 | supersym | if you want to use a .sh file |
| 10:22 | hyPiRion | squidz: lein-shell and some hack on :prep-tasks? |
| 10:23 | hyPiRion | not that it autoupdates, but you could probably add in a robert.hooke-hook on cljsbuild |
| 10:23 | squidz | hyPiRion: thanks that might be interesting |
| 10:28 | Fender | OK, here's another question: |
| 10:29 | Fender | I use a lib that in turn uses Math.TANH which is very slow |
| 10:29 | Fender | Now I want this faster but I don't want to download the source, change it, compile the complete lib ... |
| 10:29 | Fender | the function that I want to use is the apache fastmath TANH |
| 10:30 | Fender | is it possible to use with-redefs to redefine this? |
| 10:30 | Ember- | oh god, please someone kill me |
| 10:31 | Ember- | I wonder what the client would say if just accidently this project would happen to end up with this library called Clojure... |
| 10:32 | hyPiRion | You could probably use reflection to replace the old java math.TANH with the apache fastmath one. No need for with-redefs, and it could be a bit faster. |
| 10:32 | hyPiRion | That being said, it doesn't immediately strike me as the viable solution. |
| 10:32 | Fender | me neither |
| 10:33 | Fender | the lib is supposed to get a new version like3 months ago |
| 10:33 | Fender | now I don't want to meddle with the lib itself |
| 10:34 | Fender | problem is: the run time of my little proggy is 73% Math/TANH |
| 10:34 | Fender | at least so says the sampler of JVisualVM |
| 10:35 | Fender | so I think it's quite worth the effort |
| 10:35 | Fender | ... until the lib (encog) is updated |
| 10:36 | Fender | Ember, define JAR deliverables in your contracts and never say what language you use! |
| 10:37 | Ember- | yeah, unfortunately I came to this project only after this had already started |
| 10:37 | Ember- | got to say, XML and XSD stuff with Java makes me insane |
| 10:37 | Ember- | we already wrote this custom XML writer to keep us sane |
| 10:38 | Ember- | but with XSD and validation there is no way going around Java apis |
| 10:38 | clgv | Fender: to be sure use instrumentation instead of sampling |
| 10:40 | Fender | clgv, you mean profiling with instrumentation? |
| 10:40 | Fender | or something else |
| 10:40 | clgv | Fender: yes |
| 10:41 | clgv | Fender: sampling can be misleading when you have very frequent calls to a function which in fact takes not too much time |
| 10:41 | Fender | ok, I will check this |
| 10:42 | hyPiRion | (also, don't worry too much unless you need the performance) |
| 10:45 | Fender | it's a financial app that spawns like tens of thousands of neural networks to predict close prices of stocks and so on |
| 10:45 | hyPiRion | oh, then I see |
| 10:46 | Fender | so it runs several hours at night and if the 73% is remotely true, then it would be really worth it |
| 10:58 | mdrogalis | What's the best way to have a function that I wrote available at every project? It's just a small function, not enough for a library |
| 10:58 | mdrogalis | Maybe something using a Leiningen profile. |
| 11:00 | supersym | mdrogalis: I use LT which has injections for the REPL, but I'd still need to add stuff if I want it in deployment |
| 11:00 | mdrogalis | supersym: It's not something I'd deploy. What's LT? |
| 11:00 | supersym | Light Table.. |
| 11:01 | technomancy | mdrogalis: if it's just for dev convenience you can put :injections [(some form)] in your user profile |
| 11:01 | mdrogalis | supersym: Ah, alright. |
| 11:01 | mdrogalis | technomancy: Thanks! I was never quite sure what injections did. |
| 11:01 | mdrogalis | Handy :) |
| 11:05 | technomancy | just have to be careful it doesn't sneak into published jars |
| 11:07 | borkdude | is there a way to let lein test quit after the first failure or error? |
| 11:08 | mdrogalis | technomancy: Got it. I appreciate it! |
| 11:08 | technomancy | borkdude: https://github.com/pjstadig/lein-fail-fast |
| 11:09 | vijaykiran | lein-fail-fast |
| 11:09 | vijaykiran | ah what technomancy said :) |
| 11:10 | borkdude | thanks |
| 11:12 | mavbozo | does ring-session some kind of session-id? |
| 11:12 | mavbozo | php session has session id and can be retrieved by session_id() |
| 11:16 | supersym | mavbozo: from what I understand you can just make these... for example using lib-noir https://github.com/noir-clojure/lib-noir/blob/master/src/noir/session.clj#L20 |
| 11:21 | echo-area | On github, if I want to replace a pull request whole patch with a new one, is it the only way to create a brand new pull request? |
| 11:24 | mdrogalis | technomancy: Hm, I can't seem to get injections to work. Can you gist me a little example of defining a function for usage in projects? |
| 11:25 | mpenet | echo-area: you can use reset, if you're using magit, type "x" until you're happy (or choosing a commit) then apply whatever commit you want over it then force push "P -f" |
| 11:25 | mpenet | echo-area: but it can be considered dirty I guess |
| 11:26 | mpenet | echo-area: I dont even know how to do it using the cli, magit spoiled me. If you're not using magit check git-reset man page |
| 11:27 | echo-area | mpenet: Ah I see. Since my personal remote repo is only used by me I think that'd not be a big problem. But it indeed is cleaner if my remote repo is not changed |
| 11:27 | echo-area | And for the old discussions, I think we'd better leave it the way it was. |
| 11:28 | mavbozo | supersym: thank you. It turns out that ring's request map contains :session/key. That's what I need. |
| 11:31 | supersym | cool |
| 11:45 | gfredericks | sometimes I feel like a read-only view over a reference type would be nice |
| 11:47 | gfredericks | e.g., I want to create a flag to tell some worker threads when to quit. But if I used an atom then it's technically modifiable from any thread. I'd rather have something the workers can see but only the manager thread can modify. |
| 11:48 | mdrogalis | Nevermind technomancy, I got it. :) |
| 11:57 | edw | Anyone here use Carmine with Redis? |
| 11:58 | mpenet | edw |
| 11:58 | mpenet | yes |
| 11:59 | edw | mpenet: Cool. You ever have a problem with it returning a string when you're looking for a byte array? |
| 12:00 | mpenet | edw: not really, how do you write your data? |
| 12:01 | edw | This is some content that I'm pushing via `redis-cli ... -x hset key field`. |
| 12:01 | mpenet | edw: I dont write byte array directly to redis tho |
| 12:01 | edw | mpenet: Ah. I'm wondering if redis-cli does some escaping. |
| 12:02 | mpenet | edw: I think the binary support in carmine is done via nippy |
| 12:02 | mpenet | so it's prefixed with an id etc etc, might not be compatible with what you do on the cli, but you can overwrite that behavior with a fn I think |
| 12:04 | mpenet | edw: but I dont write binary data via carmine so take this with a grain of salt |
| 12:04 | edw | mpenet: Yeah, I'm playing with the `parse-raw` macro, doesn't seem to work, which leads me to suspect that my data is getting ASCII-ified by the client. Data I insert via Carmine is fine. |
| 12:15 | mpenet | edw: well, redis stores it as strings so it wont natively be able to guess to return you a byte array unless nippy did it's thing over it |
| 12:15 | mpenet | edw: my guess it that you get the same reply as from the cli using "get" |
| 12:15 | edw | I think what's happening is that a Unicode BOM is being inserted, which is giving me a bad hair day. |
| 12:18 | TimMc | You got BOM'd. |
| 12:19 | TimMc | Happened on a weekly basis when I was working in NLP. |
| 12:20 | hyPiRion | I sometimes work with Unicode character outside the BMP. Java doesn't like that, especially when it tries to write stuff to disk :( |
| 12:21 | mdrogalis | hyPiRion: Is there any way to get Lein :injections to play well with nrepl in Emacs? |
| 12:22 | hyPiRion | technomancy: ^ |
| 12:23 | hyPiRion | mdrogalis: I don't think so, but I haven't worked much with injections to nrepl-mode |
| 12:23 | mdrogalis | hyPiRion: Ah, okie dokie. Thanks anyhow. :) |
| 12:47 | technomancy | mdrogalis: injections is completely orthogonal to the client you use to connect |
| 12:47 | technomancy | maybe what you want is :init-ns support; that is trickier |
| 12:59 | mheld | is there a thing I can use in compojure which will log out the urls + parameters I'm hitting? |
| 12:59 | mheld | like when I POST /login with some params, it'd be great to see them in the console |
| 13:01 | `cbp | mheld: I think you can just do (POST "/login" {:as post} (pr post))? |
| 13:02 | clgv | mheld: if someone implemented that in a lib it is very likely a ring middleware |
| 13:04 | mdrogalis | Thanks for the hint, technomancy |
| 13:04 | clojurebot | I don't understand. |
| 13:04 | xeqi | mheld: (defn logging-middleware [h] (fn [req] (pr req) (h req)))) ; and then add logging-middleware to your middleware stack |
| 13:04 | mheld | clgv: perfect, found what I want -> https://github.com/pjlegato/ring.middleware.logger |
| 13:05 | mheld | it added a bunch of shit to my deps, but that's ok for now! |
| 13:06 | clgv | mheld: great. if you want to get rid of the dependencies later on you can just lookup how they did it and implement your own lightweight version |
| 13:20 | mlb- | Can clojure.data.xml parse a XML document, but retain xmlns information (prefix and dtd)? |
| 13:23 | mtp | "probably" |
| 13:23 | mtp | i'm just guessing though |
| 13:27 | mlb- | mtp: can't find any documentation that refers to "xmlns". With default usage, all prefixes appear stripped and all xmlns attributes aren't displayed |
| 13:30 | rasmusto | callen: I tried profiles.clj again, but lein doesn't seem to have c.t.n.r on the classpath (it's in my .m2 from when I added it as a project dep) |
| 13:45 | marco2 | So I've been playing around with the core.async library, but I've been getting some weird results: https://gist.github.com/MarcoPolo/6626584 , is this normal, or am I doing something wrong? |
| 13:45 | clojurebot | Pardon? |
| 13:51 | cespare | foo , bar |
| 13:51 | cespare | what does clojurebot respond to? |
| 13:52 | hyPiRion | , |
| 13:52 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 13:52 | cespare | but not any comma |
| 13:52 | cespare | why did it respond to marco2? |
| 13:52 | hyPiRion | if it's first in the sentence |
| 13:53 | hyPiRion | oh, it's the sentient part of clojurebot. Ignore that |
| 13:53 | cespare | it just randomly spouts off? |
| 13:53 | TimMc | "sentient" |
| 13:53 | hyPiRion | not randomly, but unpredictably at least |
| 13:53 | cespare | i see |
| 13:54 | TimMc | cespare: It interprets 1 in N messages as being addressed to itself. |
| 13:54 | TimMc | This sometimes (but not usually) results in hilarity. |
| 13:55 | hyPiRion | TimMc: in N? What is N? |
| 13:55 | TimMc | I don't know. |
| 13:55 | hyPiRion | aha |
| 13:59 | TimMc | 967198 total lines in my log of this channel, with 25600 containing '< clojurebot>' and 19031 containing '> ,' |
| 14:00 | jared314 | , |
| 14:00 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 14:00 | jared314 | just testing |
| 14:00 | TimMc | That's 6569 unprompted responses. (Seems low.) |
| 14:01 | TimMc | hyPiRion: So N is about 140. |
| 14:04 | hyPiRion | TimMc: I assume it's 1/140 unconditionally? |
| 14:04 | havenwood | prolly 1 in 150 |
| 14:04 | havenwood | ,(/ 967198.0 (- 25600 19031)) |
| 14:04 | clojurebot | 147.23671791749123 |
| 14:04 | hyPiRion | makes sense |
| 14:04 | TimMc | havenwood: 7/1000 more likely |
| 14:05 | hyPiRion | ,(rationalize 147.23671791749123) |
| 14:05 | clojurebot | 14723671791749123/100000000000000 |
| 14:05 | hyPiRion | dang you. |
| 14:05 | havenwood | TimMc: Ah, good point. |
| 14:05 | rasmusto | clojurebot, now with sentience |
| 14:05 | clojurebot | Titim gan éirí ort. |
| 14:06 | TimMc | Sentience is easy, sapience is hard. |
| 14:06 | havenwood | Clojurebot speaks Irish Gaelic now? |
| 14:07 | hyPiRion | clojurebot speaks every language. |
| 14:08 | hyPiRion | It's best at Clojure though. |
| 14:08 | rasmusto | ,(prn ",(prn \"test\")") |
| 14:08 | clojurebot | ",(prn \"test\")"\n |
| 14:08 | Bronsa | hyPiRion: TimMc https://github.com/hiredman/clojurebot/blob/master/src/hiredman/clojurebot/noise.clj#L12 |
| 14:09 | rasmusto | can I printlnl that? |
| 14:10 | hyPiRion | Bronsa: The point was was to reverse engineer it :( |
| 14:10 | Bronsa | :( |
| 14:10 | hyPiRion | (inc Bronsa) ; Anyway, for source and all |
| 14:10 | lazybot | ⇒ 11 |
| 14:14 | marco2 | So it appears work fine when run normally in the page, but fails when run through the browser repl |
| 14:15 | marco2 | that's interesting... |
| 14:18 | TimMc | Bronsa: So where does the excess 5/1000 come from? Maybe it's from factoids. |
| 14:19 | Bronsa | TimMc: that, and also when clojurebot responds to questions/mentions |
| 14:19 | dnolen | marco2: it should work regardless of being in page or in browser REPL |
| 14:19 | Bronsa | (I guess) |
| 14:20 | TimMc | 123181 end in "?" |
| 14:20 | TimMc | clojurebot, why |
| 14:20 | clojurebot | why not? |
| 14:21 | TimMc | clojurebot why |
| 14:21 | jared314 | clojurebot, what are you working on? |
| 14:21 | clojurebot | Cool story bro. |
| 14:21 | TimMc | and 1695 with '> clojurebot[,:]' |
| 14:26 | tangramm_ | Hi folks, can anybody help me with a emacs clojure question? I'm trying to browse a clojure file from a dependency lib of my cljs project (cemerick.cljs.test) |
| 14:27 | tangramm_ | is there any key binding (i'm using nrepl) for that? |
| 14:27 | Kalimar | meta . |
| 14:27 | Kalimar | make sure it's compiled first - ctrl c ctrl k |
| 14:27 | tangramm_ | i know that meta-. works in clojure |
| 14:28 | tangramm_ | but you can't compile cljs file with macros if |
| 14:28 | tangramm_ | you dont evaluate first the macro |
| 14:28 | tangramm_ | i see it in david nolen post |
| 14:29 | tangramm_ | i saw it |
| 14:33 | jared314 | clojurebot, (doc juxt) |
| 14:33 | clojurebot | Excuse me? |
| 14:34 | jared314 | ,(doc juxt) |
| 14:34 | clojurebot | "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]" |
| 14:34 | supersym | juxt is awesome |
| 14:34 | dnolen | tangramm_: there's just no way to do that yet, I don't think any CLJS emacs tools hook into the information provided by the analyzer |
| 14:35 | dnolen | tangramm_: probably because there's no sensible interface to that stuff, lynaghk has been playing around with some ideas |
| 14:35 | Kalimar | tangramm_ yeah sorry, missed the detail of the question. Sounds like dnolen has the answer though |
| 14:36 | jared314 | ,(doc clojure.core/juxt) |
| 14:36 | clojurebot | "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]" |
| 14:36 | callen | rasmusto: and you're adding it to :dependencies in your profiles.clj? |
| 14:37 | callen | rasmusto: the problem cesare had was that he was adding it to :plugins not :dependencies |
| 14:37 | tangramm_ | dnolen: thanks, You are in all places David! I was searching your post related to this evaluation problem, ... At last i am working in a clj file to bring the code inside emacs |
| 14:38 | callen | Raynes: I just rolled into work, was up late last night because I'm a nightbird. |
| 14:38 | rasmusto | callen: ah, I do have it in :plugins. And I guess it's not a plugin :) |
| 14:38 | Raynes | me 2 |
| 14:38 | callen | rasmusto: it's a dependency |
| 14:38 | rasmusto | callen: thanks for fielding my ignorance |
| 14:38 | callen | rasmusto: you don't "require" a plugin. leiningen runs them. |
| 14:38 | callen | I didn't know people didn't know there were :dependencies in profiles. |
| 14:39 | callen | now I know that people don't know, so I can save them pain next time. |
| 14:39 | rasmusto | callen: I'm very unfamiliar with leiningen plugins in the first place, so that's part of the problem |
| 14:41 | callen | rasmusto: you should learn more Leiningen, it can make your life better. |
| 14:41 | rasmusto | callen: oh, I absolutely plan to. |
| 14:42 | callen | I know Leiningen "just works" and that's truly wonderful, but it has more to offer beyond being a nearly-perfect project dependencies manager :) |
| 14:42 | callen | dependencies/build/repl/run/etc |
| 14:42 | callen | not really sure what to call it. |
| 14:42 | callen | it's just Leiningen. :) |
| 14:45 | jared314 | ,(doc clojure.string/re-quote-replacement) |
| 14:45 | clojurebot | "([replacement]); Given a replacement string that you wish to be a literal replacement for a pattern match in replace or replace-first, do the necessary escaping of special characters in the replacement." |
| 14:55 | sm0ke | Hello is there a rest friendly introduction to compojure? |
| 14:56 | sm0ke | somewhere? |
| 14:56 | dsabanin | hey guys |
| 14:56 | sm0ke | i used to do web services in jersey ... and finding it hard to grok compojure |
| 14:57 | sm0ke | for instance i am still not able to figure out how to access query params and request body |
| 14:57 | chrisfjones | sm0ke: you might want to check out https://github.com/clojure-liberator |
| 14:57 | chrisfjones | sm0ke: might be a better level of abstraction to work at if you're used to jersey |
| 14:58 | sm0ke | chrisfjones: i am really not looking for jersey in clojure..i want to understand compojure ..but thw wiki seems sketchy to me |
| 14:59 | callen | really? condp = instead of case? |
| 14:59 | callen | http://clojure-liberator.github.io/liberator/tutorial/conneg.html |
| 15:00 | dsabanin | I'm having problems getting to a certain field in Java from clojure. https://www.refheap.com/18813 |
| 15:00 | dsabanin | I need to get to TransportGitSsh/PROTO_SSH |
| 15:01 | dsabanin | any ideas how? |
| 15:01 | marco3 | sm0ke, what are you speciFically trying to Figure out? |
| 15:02 | sm0ke | marco3: simple stuff...how do i access query params? |
| 15:02 | dsabanin | obvious way of just doing TransportGitSsh/PROTO_SSH yields: Unable to find static field: PROTO_SSH in class TransportGitSsh |
| 15:02 | jared314 | it looks like a private field |
| 15:02 | sm0ke | marco3: how do i get post request body |
| 15:02 | chrisfjones | sm0ke: access to query params and request body is the realm of ring rather than compojure, although compojure adds some nice sugar for destructuring: https://github.com/weavejester/compojure/wiki/Destructuring-Syntax |
| 15:03 | chrisfjones | sm0ke: might be a worthwhile exercise to build something simple using raw ring first, then move to compojure when routing becomes important |
| 15:03 | dsabanin | jared314 so there's no way to get to that? (not really good with Java) |
| 15:04 | jared314 | you could use java reflection |
| 15:04 | jared314 | in clojure |
| 15:04 | marco3 | sm0ke: here is a snippet of code: https://gist.github.com/MarcoPolo/53b680c8a006d4718c8e |
| 15:05 | marco3 | that runs a standard sql lookup and returns the value |
| 15:05 | marco3 | AlgorithmIDs is a post parameter given, so that's an example of the destructuring syntax |
| 15:07 | sm0ke | i think i am just being thick here...let me search some more |
| 15:07 | sm0ke | is compjoure build on ring? |
| 15:07 | callen | marco3: hi! It looks like you're using Korma. Might I suggest a handy-dandy logging library? github.com/bitemyapp/blackwater/ |
| 15:07 | marco3 | yup! |
| 15:07 | augustl | sm0ke: it's the other way around. Compojure parses ring requests. |
| 15:08 | chrisfjones | sm0ke: ring is like the servlet api, and compojure is like spring routing on top of that (not a rock solid analogy, I know) |
| 15:08 | marco3 | callen: woah, that's sexy |
| 15:09 | coventry | Callenpy the pointy paperclip. |
| 15:10 | sm0ke | yay i found a chapter on ring in clojure programming |
| 15:11 | marco3 | So I want to write a library to bring core.async/thread behavior to clojurescript through web workers, but I've been brainstorming on the best way to pass the code to the webworker |
| 15:11 | marco3 | anyone have any ideas? |
| 15:12 | marco3 | The first idea was to just send the function as a string, then the webworker would inject the function into itself and run it, returning the result |
| 15:12 | marco3 | but the problem with that is that closured variables wont work |
| 15:13 | callen | marco3: the most straight-forward way is not attempt to fuck with the way core.async works |
| 15:13 | callen | a wrapper library or something. |
| 15:13 | marco3 | callen: It'll be written on top of core.async |
| 15:13 | mdrogalis | marco3: Curious, why? |
| 15:13 | callen | also webworkers don't really fit into the core.async model conceptually |
| 15:13 | marco3 | callen: why? |
| 15:13 | callen | I don't know if the practical limitations are relevant, but it's worth thinking about |
| 15:13 | callen | webworkers aren't green threads :) |
| 15:14 | marco3 | mdrogalis: Web workers are great for running heavy computation, but they are really annoying to program |
| 15:14 | callen | they're also kinda fat. Not really suited to the way core.async works. |
| 15:14 | mdrogalis | Yeah, that ^ :/ |
| 15:14 | callen | more of a glorified fork. |
| 15:15 | coventry | I thought there was a thread pool underneath clojure core.async. |
| 15:15 | callen | coventry: sure, but webworkers is clojurescript. |
| 15:15 | callen | coventry: and what makes core.async green threads lightweight is that threads from the pool get retasked on yield. |
| 15:15 | coventry | Oh, I didn't realize webworkers were limited in that way. |
| 15:15 | marco3 | you could make webworkers leaner by creating the same idea of a pool of webworkers and reusing them |
| 15:16 | callen | you're back to rewriting core.async again |
| 15:16 | marco3 | and core.async would be used primarily to converting the message interface into channels |
| 15:16 | callen | you'd be better off coordinating a higher level pool of webworkers with a core.async channel and some kind of coordinator fn. |
| 15:16 | coventry | Brenton Ashworth talked about making an app with webworkers in his most recent relevance podcast. I could be misremembering, but I thought core.async was somewhere in the picture there too. |
| 15:16 | marco3 | that's exactly what I want to do |
| 15:16 | callen | not a task I'd want to tackle honestly. core.async JS apps are already fast. webworkers seems like a lot of hassle for little gain for now. |
| 15:17 | chrisfjones | marco3: since web workers have 0 context aside from whats passed in via the message, how would you deal with var access and other bindings? |
| 15:17 | marco3 | chrisfjones: Yup, and that's my main problem right now. I don't know the best way to provide that context |
| 15:18 | marco3 | callen: If you wouldn't use webworkers normally, there would be no point to this |
| 15:18 | callen | marco3: https://github.com/pedestal/app-tutorial/wiki/Parallel-Processing |
| 15:18 | marco3 | but if you need webworkers, this would be a great option |
| 15:18 | callen | I try to avoid getting sucked into frontend dev quagmires. |
| 15:18 | callen | but good luck! :) |
| 15:18 | chrisfjones | marco3: yipe, well you'd have a small leg up due to immutability but I have no idea how you'd deal with shared state like atoms... although in core.async code you *should* be just dealing with channels |
| 15:19 | marco3 | callen: this looks interesting, I figured you could use webworkers for pedestal, thanks! |
| 15:21 | marco3 | chrisfjones: There are going to have to be a lot of limitations, but hopefully the end result should just deal with channels |
| 15:22 | AimHere | Hmm, isn't there a predicate to test for regular-expressionness? I'm sure I can do something like (= (class foo) java.lang.RegularExpression) but it seems like an omission otherwise |
| 15:23 | coventry | I was wrong about Brenton Ashworth's app using web workers with core.async. He only mentions pedestal dataflows. (About 45 min in.) |
| 15:23 | marco3 | coventry: shame :( |
| 15:23 | tbaldridge | coventry: it's possible, and I think I've seen some examples of it, still experimental. |
| 15:24 | dnolen | core.async and webworkers do make sense in terms of using core.async to coordinate them sensibly, make something interesting could be done w/ atoms here? |
| 15:24 | dnolen | s/make/maybe |
| 15:24 | marco3 | dnolen: how so? |
| 15:24 | callen | that's what I was thinking, but you'd have to resist the urge to use core.async as anything but a coordination mechanism. |
| 15:24 | tbaldridge | coventry: IIRC, he had a version of a project that used Web Workers, and one that used Core.Async, just not one that used both. |
| 15:24 | dnolen | marco: data disappears from calling context if you put it into a worker |
| 15:25 | tbaldridge | dnolen: all of pedestal works off of message passing, so you could pretty much stick a queue anywhere you wish |
| 15:25 | marco3 | yeah, through arraybuffers |
| 15:25 | dnolen | marco3: otherwise you have pay for true clone, defeats the point of persistent data structures |
| 15:26 | dnolen | marco3: also need to put all of ClojureScript into the workers, but maybe that really isn't a problem for worker code? |
| 15:27 | dnolen | in anycase webworkers mostly suck IMO, but for some problems it's all you have |
| 15:27 | tbaldridge | I think the idea is that all APP code is in a WebWorker UI code in the main thread |
| 15:27 | marco3 | dnolen: loading clojurescript core shouldn't be a problem, especially if you keep reusing webworkers |
| 15:28 | marco3 | dnolen: yeah I know, but there are necessary sometimes. The way we use them now really sucks |
| 15:29 | marco3 | dnolen: there could be a hybrid approach where you clone certain data, while passing off other bigger data. |
| 15:29 | marco3 | how unreasonable would it be to try to resolve all symbols in given function, so you can pass the whole context into the webworker? |
| 15:29 | dnolen | marco3: yeah, I'm sure something reasonable could be constructed, perhaps some kind of new reference type just for worker communication |
| 15:30 | dnolen | marco3: so when you write it worker, less of issue since you have new abstractions for building it. |
| 15:30 | tbaldridge | This is where I think Pedestal's approach really shines the APP->UI communication deals purely with deltas (transforms over the UI, app data), so there really isn't a problem sending them to/from webworkers. |
| 15:31 | dnolen | tbaldridge: do you see that working for all use cases, the whole point of sending around array buffers to workers is about performance |
| 15:33 | marco3 | tbaldridge: Yeah you could have the whole data engine in a webworker and pass messages using arraybuffers, and everything should work just fine |
| 15:33 | tbaldridge | dnolen: No I don't think it will work for every type of program, but I think the proper approach is to simply build applications as services with queues in-between them. Much like we build the server-side stuff today. |
| 15:33 | dnolen | tbaldridge: yeah I don't disagree w/ that |
| 15:35 | kovas | anyone at rich's talk? |
| 15:35 | tbaldridge | I wish I was |
| 15:35 | kovas | following on twitter |
| 15:35 | marco3 | I'll think about it some more and come back with some results :) |
| 15:35 | kovas | lots of retweetable lines |
| 15:35 | coventry | kovas: What's the hash tag? |
| 15:35 | kovas | #strangeloop |
| 15:36 | kovas | or just search for @richhickey |
| 15:36 | callen | if I didn't have Clojure for this project I'd have lost my sanity ages ago. |
| 15:36 | coventry | Thanks. |
| 15:36 | callen | Data canonicalization from ugly sources is *_* |
| 15:36 | dnolen | marco3: hrm, I actually think maybe something cool w/ core.async, array buffers and workers could be done that make it sane ... |
| 15:36 | callen | marco3: uh oh. now you've done it. dnolen is going to go off to his laboratory now. |
| 15:37 | dnolen | marco3: esp if no one can touch the array buffer but it's hidden behind a channel |
| 15:37 | dnolen | worth thinking about |
| 15:39 | chrisfjones | marco3: If you could 'transparently' take advantage of web workers by writing simple core.async code, that would definitely drive a lot of cljs adoption |
| 15:39 | callen | chrisfjones: and create more demand for browsers that have webworker support. |
| 15:40 | callen | how did that API end up so terrible anyway? Can we blame the W3C for that? |
| 15:42 | dobry-den | ,(:a {:a 1 :b 2} :lol) |
| 15:42 | clojurebot | 1 |
| 15:42 | `cbp` | wat |
| 15:42 | dobry-den | What exactly is that form doing with :lol? |
| 15:42 | coventry | Exactly nothing. |
| 15:43 | `cbp | dobry-den: default value for when :a is not found |
| 15:43 | dobry-den | Oh, I thought you had to use get for that |
| 15:43 | dobry-den | Thanks |
| 15:43 | hyPiRion | ,(:a :a :a) |
| 15:43 | clojurebot | :a |
| 15:43 | callen | ,(:LEL {:a 1} :NOTLEL) |
| 15:43 | clojurebot | :NOTLEL |
| 15:43 | dobry-den | i dont know why that didn't occur to me |
| 15:44 | callen | dobry-den: you get used to it. |
| 15:44 | dobry-den | especially since the code i encountered names the 3rd argument "default-token" |
| 15:44 | callen | takes practice for some of the less obvious patterns in Clojure to "stick" |
| 15:45 | `cbp | Hmm you can't add meta to nil? |
| 15:45 | coventry | Or keywords or strings. |
| 15:46 | hyPiRion | or numbers, or anything java |
| 15:56 | timsg | How does one access the doc strings sometimes attached to namespaces? |
| 15:56 | ucb | callen: http://www.youtube.com/watch?v=KsMKOx6fumc |
| 15:56 | ucb | callen: even if for the lols |
| 15:59 | callen | ucb: after I'm done getting trolled to death by Apple Developer support |
| 16:00 | coventry | timsg: It's in the metadata on the ns symbol. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L5244 |
| 16:01 | timsg | coventry: thanks! |
| 16:02 | gfredericks | coventry: timsg: at runtime you'll want the metadata on the namespace though |
| 16:02 | gfredericks | ,(-> 'clojure.core the-ns meta) |
| 16:02 | clojurebot | {:doc "Fundamental library of the Clojure language"} |
| 16:03 | timsg | gfredricks: aha, yeah that's the use case, thanks |
| 16:04 | coventry | gfredericks: Thanks. timsg: Sorry, I had only proven that statement correct, not tried it. |
| 16:05 | callen | ucb: I've actually seen this before, it's great :) |
| 16:06 | callen | ucb: https://www.youtube.com/watch?v=hiRPc254dGE |
| 16:07 | callen | ucb: your company should benchmark datomic using different backends including couchbase :) |
| 16:07 | coventry | gfredericks: When does the namespace get the metadata? Is it some kind of gen-class magic? |
| 16:07 | timsg | coventry: np |
| 16:08 | callen | ucb: These guys got a ton of attention for their efforts: http://www.techempower.com/benchmarks/ |
| 16:08 | coventry | No, the gen-class stuff is irrelevant. |
| 16:09 | mdrogalis | FWIW: You can't publish Datomic benchmark metrics. |
| 16:09 | callen | oh right, I forgot about that. |
| 16:09 | callen | mdrogalis: is private discussion publication? |
| 16:09 | mdrogalis | callen: *Shrug* |
| 16:09 | mdrogalis | I'm no lawyer. |
| 16:15 | callen | ucb: http://www.youtube.com/watch?v=wgEosl2rEEw |
| 16:16 | ucb | callen: I spoke to Rich about us backing up datomic. He said "yeah, give me your card, I'll email you" and never did. It was the tech version of a date that ends up nowhere ("I'll call you…") |
| 16:16 | rplaca | coventry: my memory is that the namespace gets metadata when first created and nothing after that |
| 16:18 | callen | ucb: :( |
| 16:18 | ucb | callen: oh well :) |
| 16:19 | supersym | the double-colon prefix, what I don't get.. how can keywords collide? |
| 16:20 | llasram | supersym: metadata, for example. Two different libraries might want to use the same base keyword in metadata to mean entirely different things |
| 16:20 | ucb | callen: http://www.youtube.com/watch?v=rt4CQc1MSso#t=76 |
| 16:21 | supersym | llasram: ah, I see. thnx |
| 16:22 | callen | ucb: Skyrim |
| 16:22 | callen | that's what it makes me think of. |
| 16:23 | tbaldridge | ucb: you could try #datomic bobby (from Cognitect) hangs out there most of the day. |
| 16:23 | ucb | heh |
| 16:23 | ucb | tbaldridge: for backing plans? |
| 16:23 | tbaldridge | ucb: he's really good at answering those sort of questions |
| 16:24 | potetm | Okay, I'm having an issue getting source maps running in clojurescript |
| 16:25 | potetm | When I run the repl, I'm getting a ton of errors like the following: |
| 16:25 | potetm | WARNING: Symbol IFn is not a protocol at line 24 file:/Users/potetm/.m2/repository/jayq/jayq/2.3.0/jayq-2.3.0.jar!/jayq/core.cljs |
| 16:26 | gfredericks | coventry: I'm trying to figure out where in-ns happens but I'm not sure where |
| 16:26 | potetm | Granted, I'm running the snapshot, but this makes no sense to me. |
| 16:26 | dnolen | potetm: there's no support for incremental compilation, make sure you run lein cljsbuild clean before you try to generate a source map. |
| 16:26 | gfredericks | coventry: but that's my guess |
| 16:26 | ucb | tbaldridge: ok, cool, thanks |
| 16:26 | dnolen | potetm: no support yet |
| 16:26 | potetm | @dnolen I am doing a clean |
| 16:26 | potetm | @dnolen no support for what? |
| 16:27 | dnolen | potetm: for source maps under incremental compilation |
| 16:27 | potetm | @dnolen, this is a clean build |
| 16:27 | dnolen | potetm: so you can use auto, and you must run clean every time. |
| 16:27 | dnolen | s/can/can't |
| 16:27 | potetm | @dnolen got it |
| 16:28 | dnolen | potetm: if you still encounter the issue then we need a minimal project that demonstrates it, file a ticket in JIRA w/ exact command steps at the shell to reproduce |
| 16:52 | noprompt | callen: have you ever used multi-term (emacs) |
| 17:02 | ToBeReplaced | i have a map like {:a {:A {:x 1 :y 2} :B {:x 3 :y 4}} :b {:A {:x 5 :y 6} :B {:x 7 :y 8}} that i need to transform to change the inner map to the :y value -> {:a {:A 2 :B 4} :b {:A 6 :B 8}} |
| 17:02 | ToBeReplaced | right now, i have a nested reduce-kv, which is basically unreadable |
| 17:02 | ToBeReplaced | thoughts on better way? |
| 17:06 | rasmusto | callen: seems like c.t.n.r/refresh was having issues with (:use blah.foo) in a few of my namespaces, I have it working otherwise though :) |
| 17:08 | seangrov` | Our team is all traveling the actualy ClojureCup days, but we're thinking about taking two days beforehand to do it on our own. Thinking about building an open-source error reporting service (airbrake, errbit) and cljs library so that errors are reported to a clojure server that matches it to the correct source map, so you can collect client-side errors from users in production code and trace it back to the original code. |
| 17:08 | seangrov` | Any thoughts from anyone? Think it could be pretty nice for core.async and other production apps. |
| 17:08 | pepijndevos | I'm curious what this would look like in Clojure https://gist.github.com/pepijndevos/6580712 |
| 17:08 | seangrov` | Not as a commercial service, but a nice tool for smaller sites |
| 17:09 | seangrov` | pepijndevos: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6486 ? |
| 17:10 | rasmusto | ,(flatten [:a [:b :c :d [:e :f]]]) |
| 17:10 | clojurebot | (:a :b :c :d :e ...) |
| 17:10 | pepijndevos | seangrov`that is NOT what that function does |
| 17:10 | seangrov` | pepijndevos: Just a guess from the name :P |
| 17:11 | pepijndevos | {:a {:b 1}} -> {"a[b]": 1} |
| 17:11 | rasmusto | pepijndevos: how would you do that in clojure? |
| 17:12 | pepijndevos | php has this weird way of encoding arrays in url parameters |
| 17:13 | pepijndevos | The python code I wrote uses recursion and mutable state. The Clojure function would probably not use mutable state, so getting the values back out could be harder. |
| 17:14 | zanes | What was the rationale behind separating out + and +' and family in 1.3.0? Performance? |
| 17:14 | pepijndevos | probably |
| 17:15 | pepijndevos | I think the one does some "expensive" overlow checks |
| 17:15 | seangrov` | pepijndevos: presumably something similar to this the https://www.refheap.com/76d8a1e629c87d2b77d9d8727 |
| 17:15 | seangrov` | Just two helper functions I have in my cljs to serialize cljs objects to rails query params |
| 17:15 | seangrov` | But can't help you more than that tonight, need to sleep |
| 17:15 | pepijndevos | mee too |
| 17:16 | pepijndevos | I'll try to implement it tomorrow for fun |
| 17:25 | rasmusto | pepijndevos: sorry for my dumb response, I read "PHP" in the gist and my brain turned off |
| 17:28 | coventry | gfredericks: Yeah, it happens in in-ns. Thanks. |
| 17:31 | chronno | ToBeReplaced: (clojure.walk/postwalk #(get % :y %) {:a {:A {:x 1 :y 2} :B {:x 3 :y 4}} :b {:A {:x 5 :y 6} :B {:x 7 :y 8}}}) |
| 17:32 | ToBeReplaced | chronno: not using because :y may be in the earlier map ex: {:a {:y {:x 1 :y 2}} would collapse to {:a 2} not {:a {:y 2}}, but thanks |
| 17:33 | chronno | ToBeReplaced: oh, ok :-) |
| 17:33 | ToBeReplaced | i really want to say something like "do this to the innermost map", but "innermost map" is hard to define efficiently |
| 17:33 | ToBeReplaced | or alternatively, "do this to the nth level of nesting" |
| 17:34 | ToBeReplaced | i guess that's what i really mean... i want reduce-kv on the nthe nested level |
| 17:34 | noprompt | ToBeReplaced: maybe use zippers? |
| 17:35 | ToBeReplaced | noprompt: you're probably right |
| 17:35 | noprompt | ToBeReplaced: you could also try mucking around with get-in, but zippers might be the ticket. |
| 17:36 | ToBeReplaced | i've never used a zipper in production before, why not now! |
| 17:39 | noprompt | i <3 emacs. |
| 17:41 | ToBeReplaced | how would you turn {:a {:b 1 :c {:d 2 :e 3}}} into [:a :b 1] [:a :c :d 2] [:a :c :e 3] or similar? |
| 17:41 | callen | rasmusto: don't use :use |
| 17:42 | callen | noprompt: a couple of times. didn't have a fantastic experience but it seemed neat. Why? |
| 17:42 | ToBeReplaced | i guess just write ugly if map? and conj code |
| 17:43 | noprompt | callen: oh because i just hacked up a really cheap rip off to work with :shell last-night. https://github.com/noprompt/matilde/blob/master/emacs.d/noprompt-multi-shell.el |
| 17:43 | robink | Is the way to define a default value for a functional argument simply to have an or (optionally within a let if you're worried) within the function's body? i.e. (fn doathing [& [optionalarg]] (or optionalarg (give-me-a-default-value) "Hardcoded_Default")) |
| 17:43 | TimMc | noprompt: What, writing docs in comments instead of actual docstrings? |
| 17:43 | ToBeReplaced | robink: i would use a multiple-arity function |
| 17:44 | robink | ToBeReplaced: Ah, OK |
| 17:44 | noprompt | TimMc: no. i didn't realize that when you have a comment that spans multiple lines, you have to dedent a bit to get it to line up properly. |
| 17:44 | mschuene | or you can do it with keybord arguments easily |
| 17:44 | Chousuke | ToBeReplaced: you want all paths to leaves? hm |
| 17:44 | robink | mschuene: Ah, OK |
| 17:44 | noprompt | TimMc: specifically for ^:doc comments for defs. |
| 17:45 | mschuene | (fn doathing [& {:keys [a b c] :or {a default-a b default-b c default-c}}]) |
| 17:45 | Chousuke | ToBeReplaced: you should be able to do that recursively if you write the function to generate a lazy seq of lazy sequences. |
| 17:45 | noprompt | wow. you know you're a lisp programmer when you start accidentally replacing spaces with dashes in normal conversation. |
| 17:45 | robink | mschuene: Also looks like the :or keyword is allowed in let, that may be an option w/ fn/loop as well. |
| 17:45 | noprompt | just noticed i typed last-night. |
| 17:45 | callen | noprompt: you're a wizard harry. |
| 17:46 | callen | s/wizard/lisper/g |
| 17:46 | TimMc | hah_COMMA_-that_QUOTE_s-funny_BANG_ |
| 17:46 | callen | commas are whitespace. |
| 17:46 | TimMc | (Sorry for the lame mix of pre and post munged stuff.) |
| 17:46 | noprompt | callen: i still crack up from time to time whenever i think of "PHP muggles". |
| 17:47 | callen | noprompt: it's a word that has earned a permanent place in my vocabulary. |
| 17:47 | callen | it's too apropos not to use. |
| 17:47 | noprompt | callen: 'spretty funny. |
| 17:48 | Chousuke | if lisp is magic, what are the Dark arts? |
| 17:48 | callen | noprompt: http://www.youtube.com/watch?v=QPcOZcmHO-s |
| 17:48 | callen | Chousuke: mutation |
| 17:48 | Chousuke | callen: that's just transfiguration |
| 17:48 | mschuene | reader macros which are forbidden in clojure |
| 17:49 | callen | mschuene: ztellman would like to have a word with you about that :) |
| 17:49 | callen | https://github.com/ztellman/sleight |
| 17:49 | callen | not quite the same, but you can get damned close. |
| 17:50 | indigo | I thought reader macros were forbidden for a reason |
| 17:50 | mschuene | callen: my comment was half ironic about that ;) |
| 17:51 | mschuene | dosn't sleight applies the transformation after it read the forms ? |
| 17:51 | callen | indigo: you don't win much for your trouble re: macros. |
| 17:51 | mschuene | then you still have to use normal clojure forms and can't for example introduce new syntax |
| 18:02 | ToBeReplaced | Chousuke: yes -- was looking for paths to leaves... writing that code isn't hard, it just looks kinda ugly |
| 18:02 | TimMc | Right, I want to be able to directly embed PNG-encoded Piet subroutines in my fns, and reader macros would be good for that. |
| 18:02 | ToBeReplaced | ,((fn paths [root m] (if (map? m) (mapcat (fn [[k v]] (paths (conj root k) v)) m) [root])) [] {:a {:b 1 :c {:d 2 :e 3}}}) |
| 18:02 | clojurebot | ([:a :c :d] [:a :c :e] [:a :b]) |
| 18:05 | clj_newb_2345 | core.log |
| 18:05 | clj_newb_2345 | core.logic |
| 18:05 | clj_newb_2345 | is it the best prolog implementation on clojure right now? |
| 18:06 | dnolen | clj_newb_2345: core.logic isn't really a Prolog :P |
| 18:07 | clj_newb_2345 | dnolen: minikanen != prolog? |
| 18:08 | dnolen | clj_newb_2345: Prolog is it's own language with it's own syntax and different semantics, miniKanren is an embedding of relational programming in some host language |
| 18:09 | clj_newb_2345 | dnolen: what is the best "prolog" in? clojure then |
| 18:09 | clj_newb_2345 | is it a modification of On Lisp's prolog? |
| 18:09 | dnolen | clj_newb_2345: no, it's a miniKanren implementation, unrelated to On Lisp's Prolog |
| 18:10 | dnolen | clj_newb_2345: I don't know if it's the "best", but it's 2 1/2 old and people have used it production. |
| 18:10 | clj_newb_2345 | no no, I meant what is the best example of prolog in clojure? -- On Lisp's implemnetation ? |
| 18:10 | dnolen | actually almost 3 years old now |
| 18:11 | dnolen | clj_newb_2345: doesn't exist? but you can do Prolog-y things with core.logic |
| 18:12 | danielszmulewicz | wow, elm is making a splash at Strange Loop apparently. Watching this introduction right now: http://www.infoq.com/presentations/Elm |
| 18:13 | danielszmulewicz | Has anyone tried it? |
| 18:14 | danielszmulewicz | Interesting from a Clojurescript perspective. Kind of a rival. Maybe. Dunno. |
| 18:19 | rasmusto | callen: I had some :use blah :only [bar baz] that I didn't want to switch to :requires for the sake of "clean git history" |
| 18:20 | rasmusto | callen: I now know that nobody gives a damn about git history unless it breaks bisects or somesuch |
| 18:21 | callen | rasmusto: switch to :require, learn to use rebase. |
| 18:22 | callen | rasmusto: version control is supposed to help you fearlessly change code, not hinder. |
| 18:22 | rasmusto | callen: on it. I'm even tempted to rebase some "public" history that I'm sure nobody has looked at |
| 18:22 | callen | The first law of callen is: Do the right thing for the code. |
| 18:22 | rasmusto | don't worry, I'm all about making massive changes for the sake of the code |
| 18:22 | rasmusto | especially now that it works for the most part |
| 18:23 | rasmusto | plus it gives me a chance to learn emacs |
| 18:23 | dnolen | danielszmulewicz: Elm is cool but it's closed world, so not much of competitor |
| 18:25 | danielszmulewicz | dnolen: Interesting. And looking at the presentation, that's what I was thinking too! |
| 18:26 | danielszmulewicz | dnolen: I'll probably rummage the FRP offerings in Clojure to achieve the same benefits. Reagi is on my list. |
| 18:27 | dnolen | danielszmulewicz: Elm approach still probably nice for certain kinds of applications, but I think ClojureScript just has a broader scope and is agnostic about how to build interactive systems from a language perspective. |
| 18:28 | callen | devn: you're so positive and friendly :P |
| 18:28 | callen | Elm is as much a framework as anything else. I don't know why anybody would compare it with a general purpose language. |
| 18:30 | danielszmulewicz | callen: not comparing what they are, comparing what they provide |
| 18:31 | callen | a framework provides different things than a language. the particulars are almost irrelevant. |
| 18:31 | callen | nobody expects to sensibly compare Clojure with Ruby on Rails. |
| 18:31 | callen | frontend doesn't change that. |
| 18:32 | callen | in a different world, this is a type error. |
| 18:35 | danielszmulewicz | callen: it was a tentative proposition that generated useful comments. A win from my perspective. |
| 18:36 | dnolen | danielszmulewicz: fwiw, I think it makes sense to compare, Elm is very much a language - but it also brings a philosophy about how to built interactive systems - Smalltalk-esque in that way. |
| 18:37 | callen | You can't really think of it as a general purpose language because the opinionated-ness constraints it to what it chooses to be opinionated about. |
| 18:38 | callen | if you made a CMS that used a custom programming language, but the custom programming language was so opinionated that you could make CMSes with it, then it's just a quirky CMS. |
| 18:38 | callen | not a language in its own right in any meaningful capacity. |
| 18:38 | callen | that you could only make* |
| 18:38 | callen | you don't get to claim a higher title just because the implementation details are quirky. |
| 18:41 | danielszmulewicz | dnolen: I wonder also how much elm and clojurescript overlap/compete in attracting the kind of people that look into building web UIs in a novel way. |
| 18:42 | dnolen | danielszmulewicz: I would zero overlap, I wouldn't use Elm ever |
| 18:42 | dnolen | would say |
| 18:42 | callen | danielszmulewicz: there's an #elm channel where queries about elm can be served. |
| 18:42 | danielszmulewicz | dnolen: that doesn't surprise me:-) |
| 18:43 | dnolen | danielszmulewicz: ClojureScript doesn't get in the way of interacting directly w/ the DOM which is a must for most serious applications. |
| 18:43 | tsantos | Is there a way to write executable scripts in Clojure? I'm looking for something like #!/usr/bin/env clojure. Maybe somehow through leon? |
| 18:43 | tsantos | err, lein |
| 18:43 | callen | tsantos: there's lein exec, but it's not a fantastic use of Clojure :) |
| 18:44 | clj_newb_2345 | you can do it with nailgun |
| 18:44 | indigo | Lots of overhead while the JVM starts up, unless you use an already running repl |
| 18:44 | clj_newb_2345 | to reduce the jvm startup time |
| 18:44 | callen | clj_newb_2345: don't tell people to use nailgun. |
| 18:44 | tsantos | hehe |
| 18:44 | callen | if you need to reduce JVM startup time use drip or grench. |
| 18:44 | ToBeReplaced | tsantos: generally, make an uberjar, or use clojurescript |
| 18:44 | callen | grench exec is probably the way to go for scripts. |
| 18:44 | callen | maybe. |
| 18:45 | tsantos | How would you execute the ClojureScript? |
| 18:45 | tsantos | I'm using it for web development right now but I don't write one-offs with it |
| 18:45 | danielszmulewicz | dnolen: Elm's promise is that you don't need to touch the DOM. Don't we crave for high-level abstractions that hides away the DOM? |
| 18:45 | ToBeReplaced | tsantos: compile the file, then put #!/usr/bin/env node at the top |
| 18:46 | tsantos | Oh, looks like I need to do a bit of research on that. I haven't used node before. Thanks! |
| 18:46 | dnolen | danielszmulewicz: sometimes yes, sometimes no |
| 18:48 | danielszmulewicz | dnolen: Fair enough. Thanks for your input. |
| 18:49 | ToBeReplaced | tsantos: clojurescript compiles to javascript, which is executable on the desktop via nodejs -- most package managers should have node available, so it's pretty portable |
| 18:50 | clj_newb_2345 | what is nodejs? |
| 18:50 | tsantos | ToBeReplaced: Thanks. I got brew to install it. |
| 18:50 | clj_newb_2345 | on shit |
| 18:50 | clj_newb_2345 | nodejs + clojurescript = no need for java? |
| 18:56 | ToBeReplaced | clj_newb_2345: different platform, different experience; nodejs (or actually, V8, but I haven't tried bypassing nodejs before) + clojurescript lets you mitigate the complaint of jvm startup time for "shell" scripts |
| 18:58 | ToBeReplaced | that's actually how i'm starting to get wet with clojurescript -- I don't have enough confidence yet to use it on frontend, but i'm writing new shell scripts in cljs instead of python to see how it goes |
| 18:59 | tsantos | ToBeReplaced: one thing that occurs to me is that you can't leverage the huge library of stuff contained in Clojars |
| 19:02 | ToBeReplaced | tsantos: that was one of my initial concerns, but it hasn't been an issue for me -- turns out the number of external libraries i'm interested in for a shell script is close to zero... the only notable one missing is something as good as joda-time |
| 19:04 | supersym | one other option is to have a long running JVM instance |
| 19:04 | supersym | like they do here: https://github.com/michaelsbradleyjr/node-clojurescript |
| 19:04 | supersym | you can just compile against that instance |
| 19:06 | delexi | hello together. I just wanted to give clojure a shot, installed clojure 1.5.1, downloaded the lein-script and put it into my PATH and finally installed clojure-mode and nrepl, as stated in the getting started tutorial on clojure-doc.org. I ran `lein new command-line-args` and then did an M-x nrepl-jack-in and got the following error message: "error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: /bin/bash: line |
| 19:06 | delexi | 1: lein: command not found". What did I do wrong? |
| 19:06 | callen | I've been getting better at thinking before typing. It's helped me recently on my project that's in Clojure. |
| 19:07 | ToBeReplaced | delexi: it's not finding lein... my guess is that if you check your path in emacs, it'll be missing |
| 19:07 | coventry | delexi: Did you make the script executable? |
| 19:08 | coventry | Oh, I guess if the lein new worked, you did. |
| 19:08 | delexi | coventry: yes. |
| 19:08 | ToBeReplaced | delexi: it's prob in your path in the shell but not in emacs -- log out and back in (or similar) |
| 19:09 | delexi | ToBeReplaced: I will try that, thanks. |
| 19:13 | brehaut | morning talios |
| 19:14 | talios | Morning |
| 19:14 | talios | move to auckland and work with us! |
| 19:14 | brehaut | lol! |
| 19:14 | talios | you love javascript right? :) |
| 19:14 | brehaut | i use javascript frequently; its different ;) |
| 19:14 | talios | and looks like clojure is starting to foistered upon us |
| 19:14 | brehaut | excellent |
| 19:15 | brehaut | i am available for contract work in the new year |
| 19:15 | brehaut | remotely |
| 19:15 | brehaut | :P |
| 19:15 | talios | in one project so far, sadly not the main project |
| 19:15 | brehaut | always good to start small |
| 19:15 | brehaut | what are you using it for? |
| 19:15 | talios | that's actually maybe a possibility :) you're close enough to visit now and then |
| 19:15 | talios | storm jobs, log processing, cassandra fo |
| 19:16 | talios | foo |
| 19:16 | talios | main project is still very Hibernate/JTA/OSGi so trying to work out how to best put clojure in there is kinda hard, scala would just slot in, but clojure… poses some different idioms |
| 19:16 | brehaut | yeah, clojure isnt such a fan of that set up |
| 19:17 | callen | I've got a recursive function that produces a hierarchical one-to-many projection, thus making my tail recursive attempt at traversal seem like not a good fit. |
| 19:17 | talios | being more on the "go away OO" side doesn't really play with an instance services model |
| 19:17 | callen | is there potentially a pattern (I'd like to avoid zippers) that I am missing? |
| 19:17 | brehaut | talios: my guess is that you'd be best doing something like datomic does for its java API |
| 19:17 | delexi | ToBeReplaced: yupp, this worked excellent(ly?). Thank you! |
| 19:18 | amalloy | tree-seq, callen? |
| 19:18 | brehaut | talios: and writing java classes that act as an interface into clojure via RT |
| 19:18 | talios | brehaut - yep, RT is kinda a hacky kludge tho :) |
| 19:18 | callen | amalloy: I'll play around and see if it's a good fit. Thank you :) |
| 19:18 | brehaut | talios: its the approach that rhickey endorsed |
| 19:19 | callen | only problem is processing a child requires knowing the data of the parent. |
| 19:19 | talios | brehaut - and given everything is still hibernate/jta - bridging the two worlds might be ik. I'm trying to see if we can go Datomic first :) |
| 19:19 | brehaut | talios: agreed, that wouldnt be ideal at all |
| 19:19 | talios | brehaut - being endorsed doesn't make it any left kludgy :) |
| 19:19 | talios | less |
| 19:20 | talios | "the best and blessed way" is good, but not…. ideal. |
| 19:20 | brehaut | talios: well the idea is that you put your ugly java mess into java, and dont let the pain bleed into clojure. |
| 19:20 | brehaut | talios: the problem is that java likes to make layering hard :P |
| 19:20 | talios | you mean like hibernate/jta/osgi :) heh |
| 19:20 | talios | sadly thats a lot to keep in java :) |
| 19:21 | brehaut | talios: everyone has to live with their poor life choices ;? |
| 19:21 | brehaut | s/;?/;)/ |
| 19:22 | ToBeReplaced | TIL tree-seq is a thing |
| 19:22 | clj_newb_2345_ | anyone know of a good set of resources for machine learning _exercises_ ? |
| 19:22 | clj_newb_2345_ | i.e. things of the form "here's the data, write a program to achieve XYZ on the data" |
| 19:22 | clj_newb_2345_ | rather than just texts and texts of math ? |
| 19:23 | ToBeReplaced | callen: something like this? (fn paths [root m] (if (map? m) (mapcat (fn [[k v]] (paths (conj root k) v)) m) [root])) |
| 19:23 | ToBeReplaced | callen: example of hierarchical one-to-many where you see the data of the parent, i think? |
| 19:24 | callen | I think I might have to do a zipper'ish thing |
| 19:24 | callen | ToBeReplaced: thanks, but I only sort of understand what you're going for there. |
| 19:25 | callen | the root is a map, that has fields of scalars and colls, but also fields of scalar maps and vectors of maps. the mappy ones have to be processed recursively. |
| 19:26 | ToBeReplaced | callen: postwalk? |
| 19:26 | callen | ToBeReplaced: nah, I've already abandoned that whole ns/ |
| 19:27 | `cbp | :( |
| 19:27 | ToBeReplaced | well, postwalk if they can be looked at independently... if they depend on the data before it, you can use the pattern above -- that's an example of getting all of the nested paths to leaves |
| 19:28 | callen | they cannot be looked at independently. |
| 19:28 | callen | I have to retain direct parent information. |
| 19:28 | callen | and in fact, the parents and their direct children have to be processed side-by-side. |
| 19:29 | callen | but, after they've been processed, I have to recurse same logic down all of the children |
| 19:29 | callen | thus producing the one-to-many thing I'm talking about. |
| 19:30 | coventry | What is the ?r doing in this core.logic code? https://github.com/swannodette/logic-tutorial/blob/master/src/logic_tutorial/tut3.clj#L7 |
| 19:32 | coventry | What are the underscores in righto doing, for that matter? The same thing as in zebrao? |
| 19:32 | callen | I guess I essentially want to "map" a recursion across all of the children |
| 19:33 | callen | I'm tempted to do so without loop/recur (because it's not tail recursive AFAICT) and just hope it doesn't break. |
| 19:33 | callen | Have I missed something? |
| 19:33 | callen | perhaps I change my function to process seqs of docs instead of single docs, and tail recur against that? |
| 19:34 | ambrosebs | coventry: ?r is sort of like [x y & r] |
| 19:34 | callen | yes...this might be promising... |
| 19:35 | ToBeReplaced | callen: (fn [parents-seq child]), no? |
| 19:37 | coventry | ambrosebs: Thanks. Still confused, but that's a help. I'm planning to look at the sourceforge minikanren documentation. Are there any other sources you'd recommend? |
| 19:37 | coventry | Heh. Looks like The Reasoned Schemer IS the minikanren documentation. |
| 19:38 | ambrosebs | coventry: this is a bit a of fun, probably slightly old tho. https://github.com/frenchy64/Logic-Starter |
| 19:39 | ambrosebs | coventry: also http://minikanren.org/#writtenTutorials |
| 19:41 | coventry | Thank, ambrosebs. This is great. |
| 19:45 | ambrosebs | coventry: my tutorial has a good intro to match if that's what you're after. |
| 19:47 | `cbp | Is there a cond-let or something similar? :P |
| 19:50 | coventry | ambrosebs: Just trying to get a taste at the moment. |
| 19:51 | ambrosebs | coventry: the talks on minikanren.org are fun |
| 19:52 | Bronsa | mmh |
| 19:52 | Bronsa | suppose I have (letfn [(a [] 1) (b [] (a)) (a [] 2)] (b)) |
| 19:53 | Bronsa | (letfn [(b [] (a)) (a [] 2)] (b)) is equivalent to that right? |
| 19:53 | Bronsa | e.g. the first binding of a doesn't affect in any way the expression since it gets overwritten |
| 19:53 | ambrosebs | Bronsa: yes |
| 19:53 | amalloy | i'm a little surprised letfn lets you overwrite bindings, actually |
| 19:53 | Bronsa | amalloy: me too |
| 19:54 | Bronsa | ambrosebs: in your hygienic transformation pass do you take this case into account? |
| 19:54 | ambrosebs | Bronsa: yes |
| 19:54 | indigo | Hm, any good libraries for OAuth 2.0 providers in Clojure? |
| 19:54 | indigo | Not consumers |
| 19:55 | ambrosebs | Bronsa: I'm not sure if it was overkill, but I just gave unique bindings to each letfn. |
| 19:55 | Bronsa | ambrosebs: currently I transform it (more or less) to (letfn [(a_1 [] 1) (b [] (a_1)) (a_2 [] 2)]) (b_1)) which is wrong |
| 19:56 | Bronsa | I'll probably just discard every rebound binding |
| 19:56 | ambrosebs | Bronsa: Hmm no I think I worked out the unique bindings beforehand, so the same names get the same hygienic transform. |
| 19:57 | ambrosebs | Bronsa: TBH I'd rather never think about hygienic transform of letfn again! |
| 19:59 | ambrosebs | Bronsa: this is what I do currently https://gist.github.com/frenchy64/6631311 |
| 20:01 | ambrosebs | Bronsa: looks like I do a normal pass of the bindings, and then use the "last" hygienic name for each shadowed binding. |
| 20:05 | Bronsa | ambrosebs: yeah, I can't do that the way I implemented it: I can only walk forward |
| 20:05 | ambrosebs | Bronsa: damn :/ |
| 20:05 | Bronsa | I'll just discard the first binding before the pass |
| 20:05 | Bronsa | and not think about it. |
| 20:05 | Bronsa | after-all it's just a no-op, no reason to keep it in the ast |
| 20:07 | ambrosebs | Bronsa: I guess not. |
| 20:10 | ambrosebs | Bronsa: worth documenting as a difference IMO |
| 20:11 | Bronsa | ambrosebs: yeah |
| 20:43 | Bronsa | ugh. APersistentMap implements both clojure.lang.Associative and java.lang.Map; both c.l.A and j.l.M contain the method "boolean containsKey(Object)" |
| 20:47 | brehaut | typehints for all ! |
| 20:50 | callen | indigo: not really. I might consider writing an OAuth2 provider for Clojure though. |
| 20:50 | indigo | callen: I found one https://github.com/pelle/clauth |
| 20:51 | amalloy | brehaut: is that relevant? you could call either the Map or the Associative implementation, but since it's impossible for APM to provide two implementations they'll be the same anyway |
| 20:51 | indigo | Although build is failing ;P |
| 20:51 | callen | indigo: be sure to report back any victories and problems with it. |
| 20:51 | Bronsa | brehaut: my main wtf is that defrecord doesn't fail with a "Must hint overloaded method: containsKey" |
| 20:51 | callen | indigo: I'd like to know if it's any good. It looks pretty damned old. |
| 20:51 | brehaut | amalloy: oh true |
| 20:51 | indigo | Yeah, it seems like the author took a hiatus on it |
| 20:51 | indigo | But the last commit was a day ago |
| 20:51 | indigo | He might be using an old redis library |
| 20:51 | callen | indigo: barely, that was a tiny change to the project.clj - most things haven't changed since 2 years ago. |
| 20:56 | indigo | Well, no better way to learn OAuth2 and Clojure better than to fix up an old library for it |
| 21:00 | SegFaultAX | indigo: What a coincidence, I was just working on oauth-plugin earlier today. |
| 21:01 | indigo | Haha, nice |
| 21:03 | SegFaultAX | squashing bugs. |
| 21:03 | indigo | Always a good endeavor :) |
| 21:09 | rbxbx | weird, I was working on oauth2 stuff this morning as well ._. oauthpocalypse |
| 21:11 | ddellacosta | weird, I was thinking I'd fix this up this weekend: https://github.com/ddellacosta/friend-oauth2 |
| 21:13 | indigo | Damn |
| 21:13 | indigo | #oauth2-lovers |
| 21:13 | ddellacosta | just remember kids, the "auth" in oauth2 is "authorization!" *sigh* |
| 21:14 | indigo | :P |
| 21:14 | ddellacosta | actually, I kind of hate oauth2 now that I've dug into it enough. |
| 21:16 | indigo | And someone in #startups said that no one gets anything done in Lisp |
| 21:17 | indigo | :| |
| 21:17 | indigo | ddellacosta: Yeah? What's wrong with it? |
| 21:19 | ddellacosta | indigo: well, it's more that I hate that it is used--promoted! (https://developers.google.com/accounts/)--as an authentication method, when it is in fact an authorization protocol. |
| 21:20 | ddellacosta | indigo: I am guilty of promoting this misconception by writing a plugin for an authentication library using it. But, someone would have. |
| 21:21 | indigo | Haha :P |
| 21:21 | ddellacosta | the hilarity of that google accounts page is that they clearly state, right next to their "sign in with google" button promoting oauth2 as a way to authenticate your users, that oauth2 is about authorization. |
| 21:22 | coventry | What's the terminology in The Reasoned Schemer for the wildcards and list destructuring demonstrated in this example? Trying to understand the principle behind the fact that the wildcard in the second example will only match the minimal possible value of 1. https://github.com/frenchy64/Logic-Starter/wiki#matche-sugar-combining-wildcards-and-destructuring |
| 21:22 | coventry | Er, s/second example/third matche clause/ |
| 21:23 | coventry | No, sorry. Had paged back an example. The *second* matche clause. |
| 21:24 | ddellacosta | haha |
| 21:24 | indigo | It does say that they use OAuth for authentication and authorization |
| 21:25 | indigo | "Google APIs use the OAuth 2.0 protocol for authentication and authorization." |
| 21:25 | indigo | https://developers.google.com/accounts/docs/OAuth2 |
| 21:25 | ddellacosta | indigo: yes, fair enough, you're right--Google does say that. But tell me what this doc says: http://tools.ietf.org/html/draft-ietf-oauth-v2-22 |
| 21:26 | ddellacosta | indigo: sorry, I'll shut up now…this is my own little pet peeve. The battle is already lost with this one. |
| 21:26 | marco2 | Is there an alternative to (clj->js ...) in clojurescript? |
| 21:26 | coventry | Anyway, those examples make it clear what's going on in dnolen's tut3. Thanks again, ambrosebs. |
| 21:26 | ddellacosta | marco2: to do what? |
| 21:26 | indigo | Yeahhhh... OAuth2 is a cluster |
| 21:27 | ddellacosta | marco2: if you just want to create a JS object, you can use js-obj |
| 21:28 | marco2 | ddellacosta: The same thing actually, for some reason it breaks the second time I compile the file with cljsbuild |
| 21:28 | ddellacosta | marco2: hmm…give us a refheap/gist/etc. |
| 21:35 | noprompt | damn i love it when i clean up some messy/bad code. |
| 21:35 | bbloom | git rm -r somedir # orgasmic |
| 21:36 | `cbp | lein clean till it stops saying it doesn't find the method :) |
| 21:38 | coventry | I guess the idea in that wildcards/destructuring example is that the period symbol represents a cons. Perhaps minimality doesn't enter into it? |
| 21:38 | `cbp | actually i don't love that :| |
| 21:53 | Bronsa | is there a (comp butlast butlast)? |
| 22:09 | marco2 | ddellacosta: It seems like it has to do with the latest version of clojurescript |
| 22:09 | marco2 | https://gist.github.com/MarcoPolo/6632280 |
| 22:09 | noto2 | http://clojuredocs.org/clojure_core/clojure.core/drop-last |
| 22:10 | TEttinger | Bronsa: ^ |
| 22:10 | Bronsa | (inc TEttinger) |
| 22:10 | lazybot | ⇒ 3 |
| 22:10 | TEttinger | yay |
| 22:10 | ddellacosta | marco2: what errors/exceptions do you get with this? |
| 22:13 | marco2 | ddellacost: The first compilation yields the expected: {command: "function"} |
| 22:13 | marco2 | Subsequent compilations yield: {command: null} |
| 22:13 | ddellacosta | marco2: that compiled just fine for me |
| 22:13 | ddellacosta | marco2: ah, okay |
| 22:13 | marco2 | ddellacost: you getting the same thing? |
| 22:20 | ddellacosta | marco2: so, I'm not sure what the issue is. When I compile it and run it in the browser it runs fine for me--it dumps out "Object {command: "function"}" every time. |
| 22:22 | ddellacosta | marco2: and I'm not sure what you mean by re-compiling. Are you talking about re-compiling the CLJS? Do you do a lein cljsbuild clean first, and then re-compile? 'Cause that works fine for me too. |
| 22:33 | yedi | hows the machine learning landscape in clojure like? |
| 22:36 | marco2 | ddellacosta: Here is the whole project https://github.com/MarcoPolo/test-cljs. I run lein trampoline cljsbuild repl-listen to spawn the webserver, then lein cljsbuild auto |
| 22:37 | marco2 | ddellacost: then I modify the core.cljs |
| 22:37 | marco2 | ddellacosta: then it fails |
| 22:38 | ddellacosta | marco2: does the compilation fail, or does the compiled JS fail in runtime? |
| 22:39 | marco2 | ddellacosta: it compiles successfully, but I think the compiled output is incorrect since the value of (clj->js ...) is incorrect |
| 22:40 | ddellacosta | marco2: post whatever exception/error you are having in a refheap or gist as well. |
| 22:48 | marco2 | ddellacosta: there isn't an exception. The first time the file compiles the value of (clj->js {:command "stuff"}) is correctly {command:"stuff"}. when the file is changed (new line added/deleted) it compiles without errors, but the output becomes {command:null} |
| 22:48 | marco2 | ddellacosta: Thanks for helping btw |
| 22:49 | marco2 | Let me try running it on a different computer... |
| 22:50 | ddellacosta | marco2: you're welcome. I don't think the computer is the issue. |
| 22:51 | ddellacosta | marco2: how are you running this, btw? I see you don't have any handlers setup to load the html--are you just opening the index.html file in your browser? How does it find the javascript? |
| 22:51 | marco2 | ddellacosta: with lein trampoline repl-listen, then going to localhost:9000 |
| 22:52 | marco2 | but reading the file might work too |
| 22:52 | ddellacosta | huh |
| 22:52 | ddellacosta | sorry, I guess you said that |
| 22:52 | marco2 | no worries |
| 22:54 | ddellacosta | seriously, I really don't know. I guess testing another machine will at least tell you if your environment is out of wack, 'cause right now I'm not sure what is up. I do see the "command": null thing too though, on your code. |
| 22:54 | marco2 | Yeah I ran it on another computer, same results. |
| 22:55 | marco2 | It might have something to do with incremental compilation from r1877 |
| 22:55 | marco2 | I'll post a bug on jira |
| 22:57 | ddellacosta | marco2: I kind of suspect this is not it, but have you tried running it not in advanced compilation? |
| 22:58 | ddellacosta | marco2: like, just change optimizations to whitespace and see if that changes anything. |
| 22:58 | ddellacosta | it smells a bit like that kind of issue but, again, that's kind of a wild guess. |
| 22:59 | marco2 | ddellacosta: Yeah, should have mentioned, it works fine on simple compilation |
| 23:00 | ddellacosta | marco2: ah, okay, that is important. What happens if you name your object something longer than "t" and then compile in advanced? |
| 23:00 | noprompt | does anyone beside me wish there were a weekly clojure podcast? |
| 23:01 | ddellacosta | marco2: it could be a namespace collision you're experiencing. |
| 23:01 | tbaldridge | The ThinkRelevance podcast is almost weekly sometimes, but that's less Clojure and more general computing |
| 23:02 | noprompt | tbaldridge: right. and it's a nice podcast. but it'd be cool if there was something maybe once a week with news/interviews etc. more focused on what's happening. |
| 23:03 | chord | anyone started on a clojure game? |
| 23:03 | marco2 | ddellacosta: nope, that wasn't it. I used something-much-longer, but same results. It's also happened when I didn't even bind it. |
| 23:04 | noprompt | tbaldridge: wait, isn't the the cognicast now? |
| 23:04 | marco2 | chord: As in writing a game in clojure? |
| 23:04 | noprompt | *it the |
| 23:04 | noprompt | marco2: no. he's a troll. |
| 23:04 | ddellacosta | marco2: alright, I'm out of ideas. I've got to get back to work, but good luck figuring this out. Sorry I couldn't help more! |
| 23:05 | marco2 | ddellacosta: No worries, thanks so much! I'm following you on github btw! |
| 23:05 | chord | marco2: noprompt is just mad that he gave up on the game in clojure idea so quickly |
| 23:06 | marco2 | ddellacosta: it worked find in r1859 but not r1877 so I suspect incremental compilation is to blame |
| 23:06 | marco2 | chord: I did a game in clojurescript, it was awesome! |
| 23:06 | ddellacosta | marco2: ah, okay. Interesting…will have to take a closer look then. |
| 23:06 | ddellacosta | marco2: Thanks for the follow! :-) |
| 23:06 | noprompt | tbaldridge: there was mostly lazy, but cemerick, i guess, i probably too busy to update it consistently. |
| 23:07 | chord | marco2: you can help us make starcraft clone in clojure |
| 23:09 | frozenlock | Arrrg.... I stop using Clojure for 6 months and 'lein clojars' stops working >.< |
| 23:11 | gfredericks | frozenlock: lein holds grudges |
| 23:12 | chord | marco2: you gonan help with starcraft clone? |
| 23:15 | frozenlock | And now it asks for a gpg key. :( |
| 23:16 | frozenlock | technomancy: I suppose it's your doing? :p |
| 23:16 | marco2 | chord: I'd love to, but I have school + work :( |
| 23:23 | ddellacosta | know of any examples of FRP written in ClojureScript using core.async? |
| 23:25 | chord | marco2: you're already failing school so you might as well work on starcarft clone |
| 23:26 | frozenlock | "Uberjar aborting because jar failed: zip file is empty" o_O |
| 23:36 | frozenlock | lein deps ----> java.util.zip.ZipException: zip file is empty |
| 23:37 | frozenlock | Is there something new in Lein that I should know about? |
| 23:37 | ddellacosta | seems like most of what I'm reading regarding FRP assume you are using a typed system (since all the papers use Haskell, this is unsurprising). I'm having trouble sorting out what is * |
| 23:38 | ddellacosta | …core in FRP from what results from the type-system |
| 23:38 | ddellacosta | or, maybe that is core |
| 23:38 | coventry | frozenlock: You may have corruption in your ~/.m2. |
| 23:38 | frozenlock | coventry: Thanks, I'll try to wipe it clean |
| 23:39 | frozenlock | I must say, lein is faster than before! (or it's just my newer machine..?) |
| 23:41 | coventry | Has anyone read ztellman's sleight? I'm having trouble understanding why he bashes the core/pr-on var in a delay. Is there something running earlier in lein which depends on the canonical behavior of pr-on? https://github.com/ztellman/sleight/blob/master/src/sleight/reader.clj#L19 |
| 23:45 | frozenlock | coventry: Nope :( |
| 23:45 | frozenlock | I think I screwed something when I tried to upload one of my dependencies using lein-clojars |
| 23:48 | frozenlock | Lein deploy says that it can't sign the jar... I think it just stops there rather than uploading an unsigned jar |
| 23:56 | frozenlock | "To disable signing of releases, set `:sign-releases` to false in the `:repositories` entry you are targeting." Where is :repositories? Do I need to create a profiles.clj for that? :-/ |
| 23:56 | coventry | It seems unlikely that that scenario would cause the lein deps error you saw. |
| 23:57 | frozenlock | I pretty sure I somehow managed to corrupt the last jar I uploaded to clojars, because when I try an earlier version everything works fine. |
| 23:58 | frozenlock | *I'm |