#clojure logs

2012-11-25

00:01abplynaghk: Sounds like it could be a solution. I felt C2 a little lacking on docs and samples, despite having some. But got around to get everything to work. Good to know about bind!
00:02bbloomlynaghk: yeah, it's a shame that clojars doesn't give any download stats
00:02lynaghkabp: yeah, definitely. Docs/samples haven't been a strong point. There are a few things here: https://github.com/lynaghk/c2-demos
00:03lynaghkbbloom: yeah, I keep hearing that. It's open source, isn't it? Maybe it's just an afternoon's patch?
00:03jblomolynaghk: fyi http://keminglabs.com/c2/ex/bullet/ is out of dat i think
00:03bbloomlynaghk: hm, maybe. similarly, i wish github had traffic stats
00:03jblomodate
00:04jblomostyle is not in c2.core
00:05lynaghkjblomo: yeah, I need to update all of the samples to remove that.
00:06lynaghkjblomo: if you're using in cljs, you can use maps in the :style attribute. with plain Hiccup on the JVM Clojure side of things there is no such convenience.
00:06bbloomlynaghk: https://github.com/ato/clojars-web/issues/26
00:07abplynaghk: Yes, todoMVC was most helpful to understand what I needed for my experiments.
00:08bbloomlynaghk: http://www.clojuresphere.com/ is your best bet at the moment, but only really github stats
00:08abplynaghk: Probably you should do more of those when you've got some time. :P
00:08bbloom*shrug* somebody else will solve this problem :-)
00:09jblomolynaghk: yep, thanks for that tweet, got it working in vrepl
00:09lynaghkabp: more working samples? Pull requests welcome =P
00:10abplynaghk: No one wants to see that.
00:10lynaghkabp: widespread adoption is a non-goal for the project, to be honest. I'm happy to help people who contact me with questions, but I don't have the bandwidth to maintain a suite of docs
00:10abplynaghk: Probably will integrate my libs with C2, but that wouldn't clarify anything, I suppose.
00:11lynaghkabp: what do you mean?
00:13lynaghkabp: in particular re: docs/adoption, there is a tension between how we actually use C2 internally (on larger projects, integrated with things like HAML/SASS from the Ruby world) and the self-contained pedagogical snippets that are in the sparse docs.
00:13abplynaghk: Can't do pull requests with samples while writing my own libs and when I integrate C2 with them, it will not be a good resource to learn C2 either.
00:13lynaghkabp: ah, yeah. we have exactly the same problem =/
00:14abplynaghk: Have you actually built a whole app just on C2 or do you structure your client-side code with other libs?
00:14lynaghkabp: I run a small consulting company and we've done something like half a dozen apps built primarily on C2
00:15lynaghkabp: which is why the library exists in the first place. The only open source full app we have at the moment is the Harvard VCF genetic variant tool
00:15lynaghkabp: https://github.com/lynaghk/vcf
00:16lynaghkabp: this uses the "crossfilter" JavaScript library to do fast histogram calculations, but is otherwise just something like 800 lines of cljs.
00:16abplynaghk: Oh, have seen it but not that it uses C2.
00:21jblomohrm is the datomic query engine a) separable from datomic and b) working clojurescript?
00:21jblomoas in just applying queries to datastructures
00:23lynaghkjblomo: I don't think datomic works in cljs at the moment, but you can do some similar stuff with core.logic
00:24lynaghkjblomo: though only a portion of core.logic has been copy-pasted over to work with cljs.
00:29abpWow, I have some recursion on a graph blowing my mind at 6:25 am here. Probably should drink another coffee to really get out of bed before thinking about anything.
00:29bbloomjblomo: there is also datalog… used to be part of contrib, seems like https://github.com/martintrojer/datalog/wiki is here
00:32wingydo i have to use a query to get an entity by id in datomic: (q '[:find ?id :in $ ?id :where [?id]] db id)
00:33wingyhmm … perhaps i could just do (d/entity id) if i have the id
00:35seangrovelynaghk: We used it initially for a night in SF for the Clojure dojo, and we've used it internally for admin pages
00:35seangroveWill eventually be rolling it out for customer-facing tools, but not for a bit
00:46abplynaghk: You can't open source a library for cljs these days without getting some adoption. ;)
00:49jblomoarg is it just me or is the cljs compiler really loose with undeclared variables? made a type on compile assumed it was a global
00:52abpjblomo: Clojure(scripts) embracing of the host at work. ;)
01:08bbloomjblomo: the problem is that clojurescript only analyzes vars in a single namespace
01:09bbloomjblomo: because external namespaces may be google closure, or arbitrary javascript, so there is no way to know in there
01:09bbloomjblomo: we could probably get it working by looking at google closure externs, but that just hasn't been done yet
01:24abpIt's nearly shaking me to tears, seeing how getting your problem right reduces Clojure code needed for the solution to relevant lines only. https://gist.github.com/4142595 Dependency graph iteration, anyone?
01:27abpUpdated https://gist.github.com/4142595 with a sample of application.
01:33jblomolynaghk: I see you suggested CSS transitions, is there something similar for SVG? trying to grok all this information about animations vs transitions
01:34abpUpadated again with more samples and a bug fixed: https://gist.github.com/4142595
01:34abp*spam*
01:38bbloomjblomo: as far as i can tell, animations are about the journey, but transitions are about the destination
01:38bbloomin the context of CSS
01:38abpUpdated https://gist.github.com/4142595 with svg generated from the dependency graph. Gist can't inline that. Pff.
01:39Urthwhytethis is your graph lib a?
01:39Urthwhyteabp*
01:40abpUrthwhyte: One of it's main parts and a sample application, yes.
01:41abpUrthwhyte: I implemented this in Java with Javassist, JGraphT and Java Beans. Multiple thousand lines of code. *SHRUGGG*
01:41abpUrthwhyte: Prismatic's graph came as a great inspiration.
01:43abpUrthwhyte: Now around 300 lines, including visualization. Using a few libs, though. The svg-lib is particulary ugly and needs replacement. But lynaghk's C2 can't render graphs out of the box. :(
01:43bbloomabp: I like the fnk and defnk macros they described
01:44abpbbloom: Yup, implemented something similiar as you can see in the sample.
01:44bbloomthat's why i mentioned them
01:44abpbbloom: But only fnk by now.
01:44abpbbloom: Ok
01:45abpbbloom: Once the graph part is stable I start working on integration of other libs. All your computations belong to the graphs.
01:46bbloomabp: all your *local* computations
01:46abpbbloom: All your computations. I'll call the nodes rpck etc. hornetqk? :P
01:47bbloomabp: I had this interesting idea for a datomic/redis hybrid. where you have a distributed hash table, with each value having a unique datatype, such that you could create a graph with keys as nodes and computations as edges
01:47abpbbloom: Glad you mention datomic, that's where graphs should be stored eventually, just need to put the fns in there, too.
01:48abpbbloom: And that's not good for cljs. :/
01:48bbloomabp: how does cljs come in to play with this?
01:49abpYou declare a server-side app, you declare the client-side app. You thereby declare integration in terms of ajax rpc and websockets.
01:49abpbbloom:
01:49UrthwhyteEhhhhh
01:49UrthwhyteI'm wary of that path after my GWT nightmare
01:50abpbbloom: Quite sophisticated, I know. But I've got a few years in my spare time. Urthwhyte: Would that happen with Clojure too? ;)
01:51UrthwhyteWell
01:51abpUrthwhyte: Also, there's nothing with components. It's just about functions calling functions. But you declare the deps and behavior.
01:52UrthwhyteI know, for one, the Dart team has quite a few LISPers on it and decided to build their own runtime all over
01:53abpUrthwhyte: Sure they all know ClojureScript and would be able to get management behind it?
01:53Urthwhyteand my brief experience with ClojureScript One made me fear that anything that touches so many parts of your app is going to be a pain when you finally hit a non-ideal use case
01:54bbloomUrthwhyte: yeah, that's why im working on little bits and pieces of the problem
01:54bbloomUrthwhyte: trying to build the libraries that will ultimately make something nice for client side development
01:54abpUrthwhyte: I'm not sure myself, but considering queues and declarative programming good pieces for programming I'll make them as easy to use everywhere as possible.
01:54bbloomUrthwhyte: abp seems to be working top down, i'm going bottom up :-)
01:55UrthwhyteI'm looking at tackling my first real world app in Clojure these next few days
01:55bbloomabp: declarative programming for sure, but i'm not sure that a computation graph is the right mental model. it's likely a core component of the implementation for some kind of bindings system, but i doubt manual dependency graphs are what you want as the programmer facing API
01:55abpbbloom: Yeah, asolutely, I love all of your and other people in this community. A place full of geniuses. I'm just using what you all give me. Thanks. :)
01:56UrthwhyteSo I've really little experience to comment on what you're doing
01:56bbloomabp: I'd say your welcome, but I don't think I've contributed enough to take any credit… .yet :-)
01:56abpbbloom: They are flexible because all of Clojures abstractions still apply. But I don't know where my path leads by now. Let me see.
01:57ivanSgeo__: since you can think really hard, maybe you want to review the Promises callback proposal on clojure-dev esp. wrt to composability and error handling
01:58abpbbloom: At least you're working on it. Much enough of an effort. I'm into Clojure for 1 and a half year now and not haven't done anything for clj or cljs, just studying. Approaches, libs etc.
01:58abp-not
01:59bbloomabp: maybe you should try to start contributing? i learned more trying to fix my first bug in cljs than i did in all my reading combined :-)
01:59abpMost functional programming I did before Clojure was Javascript. :/
02:00abpbbloom: Now I have my libraries to develop. A lot of integration and dsl building ahead. Also I've written one converter for production at work and our new product is Clojure based.
02:00abpbbloom: But eventually I will contribute.
02:04Sgeo__ivan, uh, I think you think a bit too highly of mean, but um, sure?
02:04Sgeo__Link?
02:04clojurebotyour link is dead
02:04ivanSgeo__: https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/7BKQi9nWwAw
02:04abpHm bbloom have you seen the slides of prismatics graph? In there is a graph of prismatic. The whole app.
02:05abpbbloom: Because that could be evidence against "declarative programming for sure, but i'm not sure that a computation graph is the right mental model" .
02:06bbloomabp: yeah it's super cool for data processes
02:06bbloomabp: probably not super cool for a user interface :-)
02:07abpbbloom: frp?
02:07bbloomi've studied FRP quite a bit
02:07bbloomdatabinding needs a dependency graph model, for sure
02:07abpbbloom: I not. But for me it seems like a dependency graph
02:07abpbbloom: So does binding data to views.
02:08bbloomthat's what i mean, databinding in the gui sense
02:08abpbbloom: And then I don't know why binding server side functions to client-side structures wouldn't be useful.
02:09abpbbloom: And binding routes to a request. You get reverse routing for free, something compojure alone fails on.
02:09bbloomserver/client separation is a totally separate discussion
02:09abpbbloom: Sure? Why? It's all about data.
02:10bbloomabp: because you can't ignore latency; it has an impact on user experience
02:10abpbbloom: Algorithms will not be obsolete with this, but large chunks of your applications control flow will vanish.
02:11bbloomabp: lots have people have tried it, but no one has gotten there yet. i think some fundamental pieces are still missing. if you want to take a crack at it, you should examine why those others have failed
02:11abpbbloom: Yes. But what's the difference between waiting in a function call or in a graphs calculation? Once new state is ready it's ready.
02:11Sgeo__ivan, I don't fully understand the executor stuff, I assume that that's Java-ish?
02:12bbloomSgeo__: yeah, java has executor pools for distributing work among threads
02:12Raynesbbloom: Your name sounds like an explosion.
02:12abpbbloom: Perhaps I'm over oversimplyfiying
02:12RaynesBah BLOOOOOOM
02:12bbloomRaynes: I like that. Maybe I'll change my name to Brandon BOOM
02:12abpRaynes: bbloom "Blume" is flower in german.. Flowery explosion. :)
02:13RaynesAttractive.
02:13Sgeo__"Delivering a promise A as a value to another promise B causes B to attend on A."
02:13Sgeo__ivan, not entirely sure I like that. What if I want to deliver A to B for purposes other than causing B to attend on A?
02:14abpbbloom: I haven't found a lot of things like what I do now. But probably I haven't searched in the right places.
02:14ivanI guess you are kind of hosed unless you put it in a vector or something
02:14Sgeo__Maybe some additional operation?
02:14Sgeo__Instead of that mechanism?
02:27lynaghkjblomo: CSS transitions don't work on SVG
02:29lynaghkjblomo: SVG has its own animation markup/language thing, but I don't have a ton of experience with it. If you want to animate SVG you can use an atom as a clock and derive markup from that (refreshing the page as often as possible). Or you can go out-of-band and use a JavaScript library to do manual tweening. I don't have much experience with that route, though.
02:37abplynaghk: Do you have experience with or heard of any graph computation systems?
02:39lynaghkabp: I don't have any firsthand experience with any, no
02:39lynaghkabp: I used neo4j on a toy project once, and I read one of the Pragel papers, but that's it
02:39lynaghkabp: why?
02:41abplynaghk: I'm building one for clojure, a little like prismatics graph but meant as a way to abstract whole apps throug specific nodes for everything: routes, dom listeners and rendering, datomic etc.
02:41abplynaghk: https://gist.github.com/4142595
02:42lynaghkabp: I don't really get the appeal of Prismatic's graph library; at least, from the example in the blog post about it my sense is that it's covering something that the compiler should be doing for me.
02:42abplynaghk: It's able to calculate now. So I can start writing node-definitions for other libs.
02:44lynaghkabp: What's your use case for something like this?
02:45abplynaghk: It's really only about declaring things that happen for state transitions
02:46abplynaghk: Give it a graph, give it state, say what changed. From there on it's your logic but auto-wired, no function calls needed to access your model or render your views. Just declarations.
02:46lynaghkabp: have you seen the FlapJax stuff?
02:47abplynaghk: Much of the things I program.
02:47abplynaghk: Yes, not looked into it deeply. It, as many other libs, seems to take a quite specific approach to an uniform problem.
02:48abplynaghk: The beautiful thing about clojure is, that you are able to unify everything. It's just data, right? :D
02:49lynaghkabp: Alan Dipert and Mich Niskin are doing some interesting cljs+FlapJax kind of work. Apparently one neat thing about FlapJax is that you only need fns to use it---not a ton of JavaScript <-> ClojureScript interop.
02:49lynaghkabp: yeah, most of the stuff I've done has been with that philosophy. See, e.g., my Reflex library.
02:49lynaghkabp: which is a way more hacky way to solve this problem than what you're doing---explicit dependency calculation and graph sorting.
02:50abplynaghk: Yea right, that's what specific node libs do for the graph, lift some libs up into one abstraction on functions. FlapJax is doing that for the dom.
02:50lynaghkFlapJax has hooks into the DOM, but you can use all of its event stream stuff independently of the DOM
02:51bbloomabp: you'll find that UI graphs are cyclic
02:52bbloomabp: prismatic's graph is a DAG
02:52abpbbloom: I know. I've alread got that sorted out.
02:52bbloomabp: UI binding graphs are cyclical and you'll need a linearization algorithm
02:53bbloomabp: Adobe has written about their property model and their use of the QuickPlan solver algorithm for this purpose
02:53abpbbloom: Yes, It's :uncircle in the meta of node-fns.
02:53lynaghkabp: one thing I'm interested in is the performance of dependency graph sorting approaches vs. simpler things like dirty-checking (see: http://stackoverflow.com/questions/9682092/databinding-in-angularjs)
02:53bbloomabp: what approach are you taking?
02:54abpbbloom: Let me gist something up.;)
02:55abplynaghk: Yes, I need to test in cljs soon. No one needs a autmatism choking on its inards.
02:55lynaghkabp, bbloom: please contact me as soon as you have "todoFRP" implementations of your respective approaches so I can catalog them
02:55lynaghk= )
02:55abplynaghk: That's for sure!
02:56bbloomlynaghk: haha. are you maintaining those? :-P
02:56abplynaghk: As an extended sample I'd like to reimplement Raynes refheap with it.
02:56lynaghkbbloom, abp: I'm strongly considering it, since the cljs clientside space is no longer just myself and ibdknox =P
02:57Raynesabp: Reimplement it with what?
02:57RaynesYou mean rewrite the javascript portion in cljs?
02:57bbloomlynaghk: yeah, i find http://addyosmani.github.com/todomvc/ to be pretty hilarious
02:57lynaghkAlso in IRC we tend to have very theoretical arguments and wave papers+architectures around without any concrete code. I have an impossible time evaluating these kind of arguments without actually looking at implementations.
02:58lynaghkbbloom: I thought it was a stupid project at first, but it's actually a very good "hello world" because there are some non-trivial problems in the app that make a lot of the more dogmatic abstractions leak.
02:58bbloomlynaghk: i didn't say it was stupid. i said it was hilarious :-)
02:59lynaghkbbloom: yeah, totes. =P
02:59bbloomlynaghk: It would be better if someone could enumerate those non-trivial problems and make sure that TODO is actually an interesting example
02:59bbloomlynaghk: I wonder if there is something equally simple that would be more enlightening, but it's a reasonable proxy for that hypothetical hello world app for now
03:00Raynesabp: If you mean you want to rewrite refheap's javascript in cljs, go for it, but I probably wouldn't accept a pull request. cljs has made no sense to me insofar and I don't really have time to make sense of it and work with such a pull request.
03:00bbloomlynaghk: regarding angular: it's awesome. I think it's totally a local maximum in javascript-based development
03:00bbloomlynaghk: but I think clojurescript can do better
03:00Rayness/insofar/so far/
03:01bbloomRaynes: I don't think he was suggesting reimplementing it because it was bad or broken or anything. i think he was looking for a case study
03:01lynaghkbbloom: agreed re: Angular. I've been on the fence about porting it to cljs for a few months now.
03:02Raynesbbloom: I assumed, but I just don't want him to go after it and be disappointed if he tries to contribute it back.
03:02lynaghkbbloom: The spec for TodoMVC is interesting enough, don't worry.
03:02abpRaynes: If you allow, I would rewrite refheap completely.
03:02bbloomabp: I don't think refheap is an interesting case study for a client side app
03:02RaynesI'm not sure what that means in regards to clojurescript.
03:02abpRaynes: Using my graph stuff I talked about in the last hours.
03:03RaynesHow would refheap make sense as a client side thing?
03:03abpbbloom: Cross client/server
03:03bbloomabp: yeah, i don't think it has any interesting client side logic....
03:04abpbbloom: Raynes Probably spiced with some client-side whistles. Using websockets to update views etc.
03:04bbloomlynaghk: angular's "dirty checking" approach is interesting too
03:04bbloomlynaghk: it's kinda like a game architecture with frames
03:05RaynesGotcha. Yeah, I probably wouldn't take that stuff. But if it seems like fun, have at it, of course.
03:05lynaghkbbloom: yeah. After wresting with callback mess (manually constructed or automatically built via Reflex) I'm very interested in other approaches.
03:05bbloomlynaghk: the interesting bit to me is that I think that angular is right that dirty checking, which basically amounts to a diff and patch strategy, is the right way to treat the dom
03:06lynaghkbbloom: the dirty checking strategy is independent of the DOM
03:06bbloomlynaghk: but i'm not so sure that the idea of a dependency graph is without merit in GUIs
03:06abplynaghk: bbloom: It's crazy how we struggle with call-graph mess everytime we program in any paradigm. This needs to be solved for a lot of cases.
03:07lynaghkbbloom: it's not that it's without merit, but I think the implementation is very difficult to get right and in practice lifting+sorting is slower than simple dirty checking.
03:07abplynaghk: bbloom: If it's not about graphs I will find the right data structures. ;)
03:07lynaghkbbloom: I'm pushing out a cljs iPhone app this week, but once that is done I think I'll sit down and give a dirty-checking loop in cljs a go.
03:08abplynaghk: But dirty tracking is polling, right?
03:08abplynaghk: Oh, meant checking.
03:08bbloomabp: basically, but it doesn't sit in a busy loop, it waits for a stimulus event
03:08lynaghkabp: somewhat---the loop only starts running when you know something has gotten dirty (i.e., a DOM event that you're listening to has fired)
03:08bbloomlynaghk: cool, would love to see what you come up with
03:09abplynaghk: How does that resolve dependencies?
03:09lynaghkbbloom: well github says I whined about this two months ago (https://gist.github.com/3856153) so it's about time I got around to it =)
03:09bbloomabp: you just recompute every branch of the tree that changes
03:09lynaghkabp: http://docs.angularjs.org/guide/concepts#runtime
03:10lynaghkbbloom, abp: I'm out for tonight, though. Cya!
03:10bbloomlynaghk: cheers
03:10abplynaghk: Cu
03:15abpbbloom: https://gist.github.com/4142803 cycle resolution for guis probably look like that. It's just a concept, nothing that works or is tested in any way.
03:16abpbbloom: And it's an implementation detail, nothing you would ever do.
03:16bbloomabp: it can't be an implementation detail
03:16bbloomabp: you need to worry about constraint hierarchies
03:17bbloomabp: i'm not sure what this gist is supposed to do...
03:17bbloomwhat's the wacky character after the x about?
03:17bbloomwhat does :uncircle do?
03:18abpbbloom: it's :x€, the euro sign.
03:18abpbbloom: uncircle is a typo, I'll correct to uncycle
03:18bbloomabp: there are two :x keys in your map
03:19abpbbloom: That's right, need to correct that.
03:20abpbbloom: But it's supposed to have either: A calculated value, based on some dependencies or a value typed in by the user. Then it resolves the cycle when typing to and providing a new :x
03:21bbloomabp: can't really study it right now, but it's not clear to me, would need to see the implementation
03:22abpbbloom: But lynaghk was right, code samples are clearer and easier to grasp than theories.
03:22abpbbloom: Yes, give me some weeks. :)
03:37nightfly_How can I call a different aritied form of an anonymous function from within itself?
03:39abpnightfly_: http://stackoverflow.com/questions/5626641/non-tail-recursive-anonymous-functions-in-clojure
03:41nightfly_Neat, thanks
04:22tomojtodofrp is uninteresting :(
04:23abptomoj: Hm, yes, there is not much to it. But better than nothing.
04:45tomojcan you pass a fn as a Callable to java?
04:45tomojif there is an overload for Runnable
04:45tomojtype-hinting doesn't seem to work
04:48tomojeven casting to Callable doesn't work
04:49tomojah
04:49tomoj(let [^Callable f (fn [] ..)] ...)
04:54bbloomtomoj: use reify
04:54bbloomoh nevermind
04:54bbloomthe hint worked
04:54bbloomnice
04:54tomojit worked in the repl, haven't gotten it to work for cljque yet
04:55tomojah, yeah typehints fixed cljque O_o
04:55tomojpromises were always deref'ing to nil because fns were being submitted as runnables
04:55tomojdue to reflection
05:16abpbbloom: I have a compile-graph function, that's where I cache a topological sort of the graph now. When changes occur, there will be no further node sorting. Probably that gets me to match dirty checking in terms of performance.
05:17abpbbloom: Later on I could investigate on successive topological sorting, to make compiling and multiple compile passes more efficient.
05:34abpbbloom: It works, got to use let-> :)
05:37abphttps://gist.github.com/4142595 Now with cached :topo-sort in compile-graph.
07:27NocabI looked at one article posted on reddit about setting up sublime-text for clojure
07:27NocabI had no idea sublime edit could do that much :)
07:28Nocabhttp://internistic.blogspot.ca/2012/11/clojure-quickstart-with-sublime-text-2.html
07:28Nocabfor those interested
07:53ucbNocab: sure, but can it to M-butterfly ;)
09:04FoxboronAny good resources for learning to think with recursion?
09:05FoxboronFeeling i struggle alot with this.
09:07daimrodFoxboron: SICP
09:07AimHereIt's not clojure, but Structure and Interpretation of Computer Programs starts off with recursion early, and it's intended for first-time programmers, albeit MIT undergrads
09:08AimHereThere's a book, it's freely available on the net, also there's a lecture series, if you want to see people in the 1980s dressed like they're from the 1970s
09:09ambrosebsThe Little Schemer
09:12Foxboronyeah
09:12Foxboroni was going to buy SICP
09:12Foxboronbut i bought the wrong version, and can't cancle ._.
09:12Foxboronso i got the instructor version of SICP <.<
09:26Nocablol
09:27hughfdjacksonWhat's the favourite commandline argument/documentation lib in the clojure landscape?
09:32abphughfdjackson, don't use contrib. https://github.com/clojure/tools.cli That's current and I used it. Smooth sailing. ;)
09:32abp$google where did clojure contrib go
09:32lazybot[Where Did Clojure.Contrib Go - Clojure Design - Clojure Development] http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
09:33abphughfdjackson, ^
09:37hughfdjacksonabp: :D thanks
09:38hughfdjacksonthat does look a lot cleaner..
09:39hughfdjacksonalso, just so i don't get entirely behind the times, what's the default emacs/clojure setup?
09:39hughfdjacksonclojure-swank?
09:39thorwilhughfdjackson: nrepl
09:40hughfdjackson:| good job i asked, huh
09:40hughfdjacksonthanks
09:40thorwilwell, nothing bad happens if use slime/swank
09:41thorwilbut for a new setup, i think it makes little sense to not go with nrepl
09:41hughfdjackson:D i'm sure; but where the community is at as a whole is probably a better starting point than starting using the tools that have largely been left behind
09:42thorwili guess the leaving behind has just started
09:52p_lthe bad things that happen with slime is that you lose up all other slime-supported languages
09:52p_lso probably better to go with nrepl
10:03szhangyeah, slime is a little old, but slime is sure working, fine.
10:04the-kennyGnah, after updating to clojurescript "0.0-1535" I get com.google.javascript.jscomp.Compiler.newTracer in my private project :/
10:04the-kennyThis cljs-version + newest lein cljsbuild works fine at work :/
10:31solussddoes nayone have a real sense of how much slower multimethods really are compared to single dispatch via protocols? I use them in a couple of places for their flexibility, but I could replace them with defrecords, protocols, and the boiler plate of stuffing data into those records for the sake of being able to use protocols. In my micro-benchmarking I see no difference in performance.
10:33solussdI imagine the performance of multimethods hinge quite a bit on the performance of the dispatch function, which in my case is a map lookup
11:16tgoossenshas doseq anything to do with monads?
11:43clojure-newbhey guys… looking for REST framework with nice caching and resource management… I've seen liberator and bishop, with liberator looking maybe more active, but been unable to get docs for 304's etc with liberator… anyone done this… or can anyone recommend bishop ?
11:45luxbockif I want to read data from a file that ships with my project, can I just place the file in the project folder and then (slurp "filename.txt")?
11:45technomancyluxbock: it's best to put it in resources/ instead
11:46technomancyyou can still use slurp iirc
11:48AimHereIf it's a really big file, you might want some option other than slurping it all in at once
11:48luxbockok, and if I put it in there do I have to specify that as a part of the file path, or does Clojure know where to look for the file if called just by its name?
11:48technomancyluxbock: slurp looks on the classpath
11:49raekluxbock: if you have a file in resources/foo/bar.txt, you can slurp it with (slurp (io/resource "foo/bar.txt"))
11:50raekwhere io is (:require [clojure.java.io :as io])
11:50luxbockin this case the file is 634kb text file, I assume that's still ok to slurp?
11:50luxbockah cool
11:51raekthat will require at least 2 * 634kb bytes of memory
11:51raekdepending on the file format, you could possibly process the file piece by piece instead
11:52thorwili can't work out how to use with-redefs in either a macro or a for: https://gist.github.com/4144278 . any ideas on that?
11:52technomancynm; it looks like slurp doesn't check the classpath automatically
11:52raekyeah, I think converts string arguments to file system paths
11:53raekoh, or maybe file path / URL dependening on its content
11:53technomancyright; it automatically calls c.j.io/reader on its arg
11:54luxbockthe file contains a list of words
11:55raekhow are you going to process it? word by word, or do you need to use all words at some point?
11:56luxbockI'm taking the edx 6.00 CS course, which is taught in Python, and I'm trying to port one of the excercises into Clojure
11:56luxbockI need to use all the words to check if a word entered by the user is a valid word
11:57raekok, but after you have compared to one word you can forget about it?
11:57raekin that case you could use line-seq
11:57luxbockthe excercise is to build a hangman game
11:57clojurebotAlles klar
11:57technomancyclojurebot: forget the excercise |is| to build a hangman game
11:57clojurebotI forgot that the excercise is to build a hangman game
11:59ziltiWhat can be the reasons for "namespace y not found after loading /x/y" except a wrong-named file?
11:59technomancyzilti: bad ns form
11:59luxbockraek: it's checked once everytime the user enters a word guess
11:59ziltitechnomancy: It evaluates fine.
12:00technomancyzilti: doesn't mean it's correct
12:01luxbockin the Python script all the words are just loaded into one big list
12:02luxbockwhich is used to set the initial word that the user tries to guess, and every time when a guess is made
12:03ziltiOh. It was a typo...
12:05raekluxbock: you could do it like this: https://www.refheap.com/paste/6972
12:07luxbockah I see, thanks
12:08raekluxbock: another "in memory" version: https://www.refheap.com/paste/6973
12:08raekthis one buids a big set instead (which supports the 'contains?' function)
12:11raekluxbock: note that 'line-seq' produces a lazy sequence that you have to traverse completely within the 'with-open' block. sets are not lazy, so that's why the 'into' line works
12:13ambrosebsdnolen: this currently works with type checking CLJS code :) Should be a good slide https://gist.github.com/4144347
12:14ambrosebsdnolen: point out the type of "x" in each branch
12:14luxbockraek: what about choosing a random word from the list of words
12:15luxbockseems like you can't really do that with sets
12:16raekluxbock: yes. in that case you would need a vector instead.
12:16raekjust replace (into #{} ...) with (vec ...)
12:17luxbockalright, great
12:17luxbockjust out of curiosity
12:17luxbockwith the approach you suggested first
12:18raek(also, (into #{} ...) can be written (set ...))
12:19luxbocksince there is one word per line, could I use that approach by randomizing which line to read, and save a lot of memory being used?
12:19raekand the whole loop could be written as (boolean (some #{word} (line-seq reader)))
12:20raekluxbock: I guess so, but you would still need to scan through the file linearly (since you don't know wher in the file the nth word is)
12:21luxbockso would it be anymore efficient?
12:22raekin terms of space or time?
12:22raekit's a tradeoff
12:23luxbockin terms of memory, so space I suppose
12:23raekthen I guess you want to keep all the data on the disk
12:24luxbockand if I wanted to read a random line from the line, how would that work?
12:25luxbockthanks a lot for the help btw!
12:25luxbock*from the file, even
12:30raekluxbock: I wrote this for fun / inpsiration: https://www.refheap.com/paste/6975
12:31raekthis variant only holds a single word at a time
12:33luxbocknice, thanks a lot
12:33raekhave fun!
12:44tgoossensHow much does TDD "live" in the clojure community? Concretely: is it a frequently used paradigm in clojure programming?
12:46ucbtgoossens: difficult to say, but check out midje by brian marick as a good example of a lib to support TDD
12:47tgoossensucb: thanks
12:47tgoossensucb: if i may ask, how do you write your code ? (repl, tests, etc)
12:48ziltiI'm new to the whole testing stuff and find it very difficult to get started. Does it really have to be that much work to create all those tests? What's the most recommended workflow of coding/testing in clojure?
12:52tgoossensi've heard and read about people using the repl a lot for testing (at the moment itself (after writing a function))
12:52tgoossenszilti: and then put it in a 'comment' function
12:52tgoossensat least i've seen rich hickey do it
12:53tgoossensat the bottom of this file: https://github.com/clojure/clojure/blob/master/src/clj/clojure/zip.clj
12:54tgoossensalso (just quoting) rich is not a big fan of TDD
12:55raekmidje works well for TDD
12:56raekusing the repl is a substitute for debugging, not testing
12:56ziltiHmm yes, it's cumbersome to do all that for each function manually...
12:57ziltiHow are you doing that stuff? One test per function I suppose? Like: Define functions -> Write tests for the functions -> implement the functions?
12:58tgoossensso far what i've done is
12:58tgoossensto write functions
12:58raekif the function involves conditionals, then you should have more than one test for it
12:58tgoossensand then tests for them
12:58tgoossensbut recently i came across metadata
12:59tgoossensand you can "bind" some test with a function using metadata
12:59raeksome examples of tests in midje: https://github.com/raek/ircumflex/blob/master/test/ircumflex/message_test.clj
12:59raek(pure functions)
12:59raekand: https://github.com/raek/ircumflex/blob/master/test/ircumflex/connection_test.clj
12:59raek(effects)
13:00ziltinice, thanks for the links
13:00tgoossenscool
13:00raektgoossens: yeah, core.test (one of the first clojure test libs) attached test cases in the metadata of the function vars
13:01tgoossensso far i(ve been using) jayf expectations, which i like so far
13:01raekbut most people don't write tests in the same files as the implementation
13:01tgoossensbut midje looks great as well
13:01tgoossensyeah
13:01tgoossensit makes it messy (in my opinion)
13:02B-ratOKThere's something unique about Dutch people.
13:02B-ratOKSomething about their cuisine.
13:02tgoossenswhat?
13:02clojurebotwhat is exceptions
13:02B-ratOKStroopwafels and Bitterballen, who invents that.
13:02B-ratOKBrilliance I say.
13:02tgoossensstroopwafels zijn geweldig en bitterballen ook
13:03tgoossens(we have that to in belgium :D)
13:03tgoossens*too
13:03B-ratOKStroopwafels his violent and bitterballen too?
13:03B-ratOKMy Dutch is a bit rusty.
13:03B-ratOKhis violence*
13:04tgoossens"stroopwafels zijn geweldig en bitterballen ook" -> "stroopwafels are great and bitterballen too"
13:04B-ratOKOh wait, that's like 'the violence and of stroopwafels' right?
13:04B-ratOKOh yeah
13:04B-ratOKOf couse, zijn can also mean 'are'.
13:04raektgoossens: there are multiple fully useable test frameworks. find one you like (and check that it has reasonable editor integration)
13:04tgoossensraek: i will :)
13:05tgoossensare you in belgium/netherlands right now?
13:06B-ratOKYeah.
13:06B-ratOKNetherlands
13:06tgoossensok cool
13:06B-ratOKI'm studying at the ILLC
13:06tgoossenscool
13:06tgoossensme at the university of leuven :)
13:07tgoossensbtw
13:07tgoossensb-ratOk: you might find this interesting
13:08tgoossensi've been willing to go to such events but we don't have them in belgium
13:08tgoossensbut in amsterdam
13:08tgoossensthere is a clojure meetup group
13:08tgoossenshttp://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/
13:09tgoossensi'm sure you'll it will be cool
13:17ucbtgoossens: sorry for delay; I normally write a simple function, quickly test it in the repl (especially if it consumes data from an external service) and then go about writing tests
13:18ucbtgoossens: I'm quite sold on midje btw :)
13:18tgoossensucb: i'll take a look at it next time i write tests :)
13:19ucbcool
13:25seangrovednolen: When will the fix for https://github.com/unnali/cljs-sscce be released for cljsbuild? Right now, if I edit any file other than main.cljs, the order of compilation is wrong, and I have to touch main.cljs again to get the output to work properly.
13:41i_sI'm seeing this error in the javascript console when trying to run the clojurescript repl sample : Uncaught Error: Undefined nameToPath for goog.async.Deferred
13:41i_sanyone know how to fix?
13:41pandeiroi_s: i think that's a dependency issue in the latest CLJS release
13:41pandeiroi am developing against 1503 until it is fixed
13:41i_sah
13:42i_sill try that, thanks pandeiro
13:44abpseangrove, I want that fix too!
13:45seangroveabp: You have the same problem? I always get "Namespace 'goog.debug.Error' already declared." until I touch main.cljs
13:47abpseangrove, I get it when using shoreleave-remote-ring. On each incremental compile, http_rpc has no provide-statement generated.
13:48seangroveabp: shoreleave-remote-ring looks nice, have you used Fetch at all? Any high level comparison? I see that one inspired the other...
14:27dnolenseangrove: I can ping clojure-dev tomorrow, now's a good a time as any for another release.
14:44thorwilis there anything that makes error buffers in emacs less annoying (sudden creation of new windows, random placement in existing ones)? especially nrepl errors
14:45ivanthorwil: (setq nrepl-popup-stacktraces nil)
14:45RaynesAnger management classes, thorwil.
14:45thorwilheh
14:45ivananother thing is to always have two windows
14:47thorwili almost never have only the repl in view, but there's seems to be a non-trivial pattern in deciding where the error buffer appears
14:50muhoothorwil: yes, turn it off
14:50muhoothere's a switch in nrepl.el to turn pop-up windows off when in the repl
14:51thorwilmuhoo: the (setq nrepl-popup-stacktraces nil) ivan posted? ty, btw
14:51muhoothorwil: (defcustom nrepl-popup-stacktraces t ..
14:51abpseangrove, no I haven't used fetch, only shoreleave-remote-ring because I haven't tried Noir either
14:51muhooaye, yes, looks like he did, great.
14:52thorwilmy .emacs keeps growing :)
14:53abpdnolen, have you seen any paper on successive topological sorting of graphs? Would be useful for immutable graphs to maintain a topological list of nodes as nodes get added.
14:54abpdnolen, or some thing at all.
14:55muhoohmm, can shoreleave be used without noir?
14:56dnolenabp: nope
14:58Raynesmuhoo: Looks like you could probably write a remote package for Compojure.
14:58RaynesProbably wouldn't be hard to port the Noir package.
14:58muhooi see there's shorleave-remote and shoreleave-remote-noir. reading docs atm
14:58weavejesterOr just Ring in general
14:58muhoobut it uses fetch, which presumes noir IIRC
14:59muhoo"Shoreleave makes no assumptions about other libraries you might be using in your app" um. not true?
14:59muhooeverything has dependencies :-)
14:59Raynesibdknox: You wouldn't happen to be around, would ya
14:59Raynes?
15:00muhooRaynes: did you make it back home OK?
15:01RaynesNo, I'm currently sitting on a park bench in NC helping people out on IRC.
15:01RaynesI made it home. ;)
15:02muhooLast I heard from you, you were in a hospital room in NC helping people on IRC. So I figured I'd ask :-/
15:02RaynesFair enough.
15:02muhooyour mom is ok now i hope.
15:02RaynesShe's excellent.
15:03RaynesJust your muscles don't like it when they run out of potassium to juice on.
15:03muhoois that an anemia thing?
15:03RaynesThey replaced it and she was fine within 24 hours. Problem is making sure it doesn't happen again (this was the second time).
15:04muhoomy grandmother used to take pottasium. i think it was thyroid or anemia, don't remember.
15:04RaynesNo, she has Crohn's disease which sometimes flares up and causes a whole lot of… bordering on TMI, but you get the point.
15:05RaynesYou can lose potassium through your bowels remarkably fast.
15:06muhooah, i worked with someone who had that. not fun.
15:07muhoook i see, shoreleave is based on fetch, not requires fetch.
15:09muhoonot seeing a whole lot in here that looks like it wouldn't work without noir.
15:34devnhttps://github.com/devn/codeq-playground
15:48devnNot sure if the above is useful to anyone yet, but if you have any suggestions or a cache of queries laying around that you want to add, go for it.
15:49tomojis there an informal rule that, an non-value identity (IDeref) i, @i should always be a value? are there reasonable exceptions?
15:50tomojs/an/for a/
15:55dnolendevn: neat
16:13abpdnolen, do you have experience with dependency graph based computation and control flow systems? I'm working on something: https://gist.github.com/4142595
16:14dnolenabp: you keep asking me about things I know hardly anything about :)
16:15abpdnolen, Urm, sorry, following you on twitter and got the impression that you read and know a lot of papers and programming literature. Won't bother you.
16:16dnolenabp: I do like reading papers, but mostly around programming languages & logic programming. It's a big world out there.
16:16abpgfredericks, my loop/recur problem from yesterday vanished via mapcat. ;D
16:17abpdnolen, sure, probably I should start my own adventure.
16:33gfredericksabp: was that my prediction?
16:49abpgfredericks, yes.
16:54seangrovedevn dnolen: wei_ and I have been working on http://jida.herokuapp.com/ with roughly the same goal, but for public clojure repos
16:55dnolenseangrove: hey, cool!
16:55bbloomseangrove: that's cool! can you put the schema on the site somewhere? like a quick reference cheetsheet?
16:55seangroveProvide a pastie/gist-like tool for exploring clojure repos
16:55seangroveSure
16:56bbloomseangrove: I'd love to run a query, but I guess I'd need to first query codeq to figure out what the attributes are :-P
16:56seangrovebbloom: Yeah, we need to provide pre-built queries that you can start exploring from
16:57seangroveI think there's probably a gui-approach to make gettings started much more intuitive
16:57bbloomseangrove: would be cool. for now, i think a side bar with a list of attributes would be fine
16:57bbloomseangrove: clicking the attributes could just take me to a page showing the raw schema data, or nicely format it, but whatever, just the list is a good start
16:57seangrovebbloom: Here's the codeq schema: http://cloud.github.com/downloads/Datomic/codeq/codeq.pdf
16:58seangroveWonder how to concisely represent that inline
16:58bbloomseangrove: Maybe just a clickable version of datomic.codeq.core/schema to start? https://github.com/Datomic/codeq/blob/master/src/datomic/codeq/core.clj
16:59seangroveCould use an accordion menu built from that, yeah
17:00seangroveI'll just add a link to the pdf for now
17:00bbloomseangrove: that'll work
17:01bbloomseangrove: while you're adding links: how about a link to the datomic query tutorial?
17:02seangrovehttp://docs.datomic.com/tutorial.html ?
17:03seangroveI'd like to re-write a bit of codeq to make using it as a library easier (it makes assumptions about ENV that aren't fun right now), anyone know the likelihood of it a pr being accepted?
17:03bbloomseangrove: whoops. executed a HUGE query. worked absurdly fast tho :-P
17:04seangrovebbloom: Nice :) There are a few that cause it to slow down badly, but nothing too terrible yet
17:04seangroveNot totally sure about the use case for Jida yet, trying to figure out what benefit the community could get from it
17:04bbloomseangrove: first thing i found interesting is that :code/name is qualified. would be nice if it was unqualified but offered :code/ns, and a qualified :code/symbol or something like that
17:05bbloomseangrove: yeah, it's one of those things that just seems like it would have to be interesting :-)
17:06seangroveA json-return might be nice for building C2 visualizations around the info... not sure
17:06seangroveLooking at the schema, isn't :code/name scoped by the codeq?
17:06seangroveAh, I see, you mean if it weren't at all...
17:06bbloomseangrove: yeah, i was trying to find clojure.core/inc from just the name inc
17:07bbloomseangrove: says :db/doc "A globally-namespaced programming language identifier", but it would be nice if the non-globally namespaced version was also indexed
17:11seangrovedevn: Mind if we take some of those queries and put them on Jida?
17:40seangrovebbloom: Ok, updated with some links for getting started: http://jida.herokuapp.com/
17:41seangroveA stop-gap until we can bring in some of that into the tool itself in some more intelligent way
18:00bbloomseangrove: cool. would be interesting if you could search for the :in clause and pull out the parameters and make a row of text boxes, one per parameter :-)
18:01bbloomseangrove: being able to query code is something i've wanted for a long time, so i can keep you busy with feature requests until the end of time :-)
18:01seangroveHaha, that's great though, good to have a use case to work towards
18:01bbloomseangrove: i think the first use case i'm interested in is vanity
18:02bbloomi'm gonna query a bunch of stuff about myself :-P
18:02bbloomuseful use cases can come once people get excited, heh
18:02seangroveMind putting it on the wiki then? Can just put a list up so we can keep track - we'll hack on it more this week as well
18:02bbloomsure, i'll see what i come up with
18:02bbloomwould be neat if there was a one-click login with github and then it told you a bunch of cool stuff about all the projects you've contributed to
18:03seangrovebbloom: Yeah, would definitely love to have that personally as well
18:03seangroveI'd like to extend codeq a bit to be integrated with CI systems too
18:03seangroveSo figure out which builds/authors broke which functions, which were teh most brittle, etc.
18:05bbloomseangrove: where is the list of aggregate functions?
18:05bbloomlike min/max
18:05seangrovebbloom: No idea, seems that you can use any clojure function as long as it's only one function-deep
18:07bbloomseangrove: hm ok, guessing seems to work :-)
18:07bbloomseangrove: the results should label the output fields
18:07seangroveAh, good idea
18:07bbloomseangrove: what's the delay on importing? i'd love to query clojurescript
18:08seangroveMaybe ~1-2 minutes?
18:08seangroveMore on bigger projects, but most clojure projects are tiny
18:09seangrovehttps://github.com/yayitswei/jida/wiki <- place to list suggestions
18:10seangroveFeel free to import it, and just let me know if it doesn't work - better to have other people test it out at this point :)
18:10bbloomseangrove: I tried to add two repositories
18:10bbloomone of mine cljs-cps
18:10bbloomand clojure/clojurescript
18:10bbloomabout 5 min ago
18:10bbloomneither has appeared
18:12seangroveI'll look at it right now
18:20tomojdoes codeq work for cljs?
18:20tomojoh, well, those have clj too
18:20bbloomtomoj: I don't see why not. it's just reading clj forms and heuristically searching for forms that begin with "def"
18:20bbloom:-P
18:21tomojyeah, but the clj analyzer only advertises support for .clj
18:22bbloomtomoj: oh, trivial fix :-)
18:22tomojnot sure if there's a good reason.. guess they are waiting for a separate cljs analyzer?
18:23tomojthere's nothing in .cljs that can't be read by the clojure reader, right?
18:23tomojobv
18:23bbloomtomoj: the clojurescript compiler's reader IS the clojure reader
18:23tomojsince cljs uses the clojure reader :)
18:23gfredericksI thought the clojure reader was what the compiler used
18:24gfrederickslet's all three say it in unison now
18:24tomojI guess it's tricky though
18:24bbloomseangrove: while you debug, i'm filling up your suggestions wiki :-)
18:24tomojif you do that trivial fix, won't your codeq db get confused about cljs vs clj references?
18:25bbloomtomoj: i don't think analyzer goes that deep yet
18:25seangrovebbloom: Yeah, it was just a stupid typo from hacking too late last night: https://github.com/yayitswei/jida/blob/master/src/cljs/main.cljs#L65-L72
18:25seangroveurl => address
18:26bbloomseangrove: k, let me know when i should try again
18:26seangrovePushing to Heroku again, but it seems ~50% of the time the cljs resources are compiled incorrectly during the heroku-side build and it needs a new commit/push
18:27bbloomseangrove: odd. any idea why?
18:28seangroveHaven't looked into Heroku's clojure build-pack, but it seems that our dev + prod profiles both get built on push, and sometimes we get 'cljs.core is not defined'
18:28seangroveNot much idea, not quite the cljs guru I'd like to be yet
18:29bbloomseangrove: hm
18:33seangrovebbloom: I queued those two repos myself from the repl while I redeploy the frontend fix
18:33bbloomseangrove: cool thanks
18:33seangroveWill let you know when it's finished
18:38clj_newb_234is there something like take, but returns the _last_ [n] elements of [coll]] instead?
18:38clj_newb_234I'd preer something shorter than (drop (- (count coll) n) coll)
18:39seangrovebbloom: Ok, imported
18:39seangroveWaiting for the heroku dyno to come back up to see if the cljs compiled correctly on this push
18:40bbloomseangrove: glorious!
18:40seangroveOk, and import is working again
18:40bbloomseangrove: I ran https://www.refheap.com/paste/6979
18:40seangroveSpeaking of frontend failures, is midje compatible with cljs?
18:40bbloomno idea
18:41seangroveI'll check on it later, and use the normal tests first
18:41seangroveLooks like that query works :)
18:42bbloomseangrove: I keep having ideas for you :-) check the wiki
18:42bbloomseangrove: lots of work ahead ;-)
18:43seangrovebbloom: https://www.refheap.com/paste/6980 is pretty cool too
18:43bbloomseangrove: heh, yeah, all clojure contributors :-)
18:44bbloomseangrove: need some way to sort the results....
18:44seangroveOh, nice suggestions
18:44bbloomseangrove: need to plugin code mirror or some other extensible editor
18:46bbloomi want a pivot table :-)
18:49seangroveCode-mirror sounds like a good idea
18:53seangrovePivot-table migh be a *bit* extreme for the next few iterations... :)
18:55derridaIs the "best practice" for using clojure from emacs to use nrepl.el+clojure-mode with nrepl instead of clojure-swank/slime altogether?
18:56seangrovederrida: I believe so, clojure-swank is deprecated now
18:56seangroveI switched last week
18:56derridayeah, I was surprised to see that last night
18:57derridaalso, marmalade seems to have completely gone to hell. melpa is seeming great though! :D
18:58seangrovebbloom: Taking that last query and searching for dnolen's surname, you can see the number of commits from any given machine...
18:58seangroveHmm, I think I'm still using marmalade. Damnit emacs...
18:59bbloomseangrove: heh. that brings up the next issue: identity :-)
18:59bbloomcodeq needs a way to map multiple email addresses to the same person
19:00seangroveCould probably be a pre-built rule
19:00seangroveA couple of implicit OR's
19:04derridaseangrove: melpa is *much* better
19:04derridaimho
19:05seangroveWill give it a try when marmalade breaks, thanks for the heads up
19:05derridaso much in marmalade is out-of-date, unstable, broken
19:05derridaseangrove: this blog post was my savior, http://batsov.com/articles/2012/04/06/melpa-homebrew-emacs-edition/
19:05derridaI was starting to blame M-x package
19:06derridanow that I've wasted a few days on that, time to start having fun with clojure! I want to check out Ritz!
19:13derridaseangrove: one weird thing, I'm having to manually enter nrepl-interaction-mode from the clj buffers if I want to be able to compile forms to my nrepl
19:14derridaseangrove: sorry, the way I said that it might have seemed like a question. I'm just wondering if you had to do the same thing :)
19:15seangroveI have this in my .emacs: (add-hook 'clojure-mode-hook 'turn-on-nrepl-interaction-mode)
19:17seangroveAnd a few other things too, I think I grabbed it from the nrepl.el github page
19:18derridaseangrove: thank you, that makes sense. I wish `package.el` would be more aggressive in telling me when an installed package requires additional configuration.
19:18seangroveHeh, emacs + user-experience... a wonderful dream :)
19:19derridahehe, yeah, I should know better, I've been manually managing my modules for years, somewhat of a hassle but you usually get installation/configuration right. :D
19:40creaseHey, does anyone know if there's a good, or goodish, way to tell where an arbitrary collection will conj elements, in terms of the seq returned by (seq (conj x coll))? It looks like there isn't, really, like it's just a matter of poking around in clojure.lang.* and knowing every special case, but it's be really useful if there was. I need it for the make-node function of zippers. Thanks!
19:43abphttps://gist.github.com/4142595 Going to implement some graph helpers to define route graph nodes. Will resemble Compojure a bit, support it's middleware but use it's own route regexes, provide reverse-routing, content-negotiation and what else makes it to the plan.
19:45Sgeo__crease, well, I think conj is supposed to put the item in the most efficient place for that collection
19:46weavejestercrease: Why do you need it for make-node?
19:46weavejesterabp: Good luck! I've been thinking that a more deterministic routing library would be useful.
19:47Sgeo__Hmm ##(seq (conj 5 (map identity [1 2 3]))
19:47Sgeo__:/
19:47Sgeo__,(seq (conj 5 (map identity [1 2 3]))
19:47clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
19:47abpweavejester, It's deterministic. Even in a visualizable way.
19:47Sgeo__,(seq (conj 5 (map identity [1 2 3])))
19:47clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IPersistentCollection>
19:47Sgeo__(doc conj)
19:47clojurebot"([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type."
19:47Sgeo__,(seq (conj (map identity [1 2 3]) 5))
19:47clojurebot(5 1 2 3)
19:47weavejesterabp: Right, that's why I was saying good luck
19:48weavejesterabp: As in, that's a good idea you have
19:48Sgeo__,(conj (seq (map identity [1 2 3]) 5))
19:48clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$seq>
19:48Sgeo__,(conj (seq (map identity [1 2 3])) 5)
19:48clojurebot(5 1 2 3)
19:49abpweavejester, can I ignore trailing slashes in Compojure routes somehow?
19:50abpweavejester, oh thanks. :)
19:50abpweavejester, misread that before your clarification. :x
19:50weavejesterabp: I thought they did, but maybe I'm misremembering
19:50abpweavejester, at least they were working once. But that commit got lost or whatever.
19:51wingywhy do i get an error: https://www.refheap.com/paste/6981
19:51weavejesterabp: Odd. Clout hasn't changed in a while.
19:53abpweavejester, https://github.com/weavejester/compojure/issues/68 has a good way to resolve that under the covers.
19:54abpweavejester, have you looked into that: https://github.com/cgrand/regex I'm thinking about integrating it for route regex.
19:54wingyany datomic guru in here?
19:55abpNovice wingy.
19:55weavejesterabp: Hm… the person who opened the request was talking about writing middleware to do it, but now that you mention it, I wonder if it wouldn't make sense just to incorporate it into Compojure's routes directly...
19:55tomojwingy: refheap the full stacktrace?
19:55abpweavejester, yep just go for 301. :)
19:56weavejesterabp: I hadn't noticed that, thanks for pointing it out
19:56wingytomoj: that is all i got from the (light table) repl
19:56creaseweavejester: the idea is to be able to edit a heterogenous nested collection with a zipper. If I'm doing that by extending a protocol specifying the branch?, children, and make-node functions required by clojure.zip/zipper, I need to know how to reconstruct various collections provided only a seq of new children. It would be nice to use something like (into (empty coll) new-children), but that doesn't work for every collection. Ma
19:56creasevectors, but conj things onto the front, so if you zip down a map, edit a node, and zip back up, the value is now the key and vice versa. My guess is that the only way to deal with this is to identify all the collection interfaces for which order matters that conj in back, and extend the protocol over each of them individually reversing the children order, then have a default implementation extended over java.lang.Object conjing t
19:56tomojthen run (clojure.repl/pst)
19:56creaseorder for everything else. Feels kind of hacky, though.
19:56wingytomoj: perhaps its not showing me everything
19:56creaseer, sorry about paragraph length
19:57abpweavejester, that's why I love open source. I'll come beg you to review my libraries around ring, hiccup and co!
19:57tomojthe only possible error I spot there is that :user/phone-number is not an attribute
19:57tomojtry pst to see if the stacktrace says what the real problem is
19:58wingytomoj: i wrapped it around the pst but it showed the same message
19:58weavejestercrease: I thought (into (empty coll) …) always worked, but I guess I'm wrong
19:58tomojwrapped?
19:58wingytomoj: what do you mean its not a real attributed .. it is defined in the schema
19:58tomojyou did (try ... (catch Throwable t (pst t))) ?
19:59wingyno
19:59tomojit should also work to just call (pst) after you get the exception
19:59wingywait
19:59wingyi did this https://www.refheap.com/paste/6983
19:59tomojthat's not right, do one of the above two things
19:59wingyill rewrite it
20:01wingytomoj: it gave me nil: https://www.refheap.com/paste/6984
20:01wingyso its not an error? i dont know what "processing rule: (q__4151 ?user)" means
20:01tomojhuh, guess pst prints to stdout in light table?
20:01tomojtry (datomic.api/entity (datomic.api/db conn) :user/phone-number)
20:03wingytomoj: (datomic.api/entity (datomic.api/db conn) :user/phone-number)|| => {:db/id nil}
20:03wingy(datomic.api/entity (datomic.api/db conn) :user/phone-number) => {:db/id nil}
20:03tomojyeah, your attribute isn't there
20:03wingyhm
20:03tomojpresumably you need to install your schema
20:03tomojgoing to be tough debugging if you can't figure out a way to see the stack trace!
20:04tomojor maybe that was one of those weird exceptions that doesn't have a stack trace, for reasons I don't understand?
20:04clojurebotexceptions is what
20:13crease##(into {} [ (vec (into (empty (first {:k1 :v1})) [:k2 :v2]))])
20:13lazybot⇒ {:v2 :k2}
20:14creaseyou need that vec in there, too, so I guess it needs a special case anyway
20:15crease##(into {} [(into (empty (first {:k1 :v1})) [:k2 :v2])])
20:15lazybotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
20:36creaseman, what a pain
21:02tomojbbloom: can you give an example of cancelling the whole async operation during an intermediate step?
21:03bbloomtomoj: consider a fan out task
21:03creaseokay, it seems to work if you use (into (empty this) (reverse children)) for clojure.lang.ASeq, and (vec (into (empty this) (reverse children))) for clojure.lang.AMapEntry
21:03creaseneeds more testing, good enough for now though
21:03bbloomtomoj: let's say you have a web service that correlates several external data sources
21:04bbloomtomoj: you execute correlate-data as a listenable future
21:04bbloomtomoj: in turn, that issues query-service-a, query-service-b, and query-service-c
21:04bbloomthere may be a waterfall of extra queries
21:05bbloomlike after you get a and b, you want to query d
21:05bbloom(query-service-d result-a result-b)
21:05bbloomif you decide you're not interested in the result of the query and want to cancel
21:05bbloomou shouldn't bother service-d
21:05creaseha, (vdc children) also works for AMapEntry
21:05creasevec
21:05bbloomso you should be able to cancel your root level future
21:05bbloomtomoj: does that make sense?
21:09tomojyes, excellent example
21:09tomojboth the examples I'd come up with didn't reveal the problem
21:09tomojthanks
21:10bbloomtomoj: are you putting these examples somewhere?
21:11tomojmy notebook for now
21:11tomojI'll maybe respond to the groups thread eventually, still thinking..
22:00tomojhmm, so is stu suggesting creating a new promise-like ("task"?) for processes?
22:01tomojif you wanted to do RefCountDisposable craziness, you'd have to have tasks all the way down, no cljque.promises in the middle
22:01tomojall the way up, I should say
22:02tomojsince a promise won't propagate remove-watch up
22:02tomojI guess he's not suggesting that tasks be promise-like - just that a task isn't a promise
22:04tomojthis seems like a spot where auto-joining promises of promises might cause some trouble
22:06tomojif a promise A of task B gets delivered to task C and you didn't auto-join, to cancel C you could attend on C, deref to get A, then attend on A and deref to get B, which you need to cancel
22:06tomojright?
22:06clojurebotto be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks
22:29holohi
22:35holoi passed {:ssl true...} to korma.db/postgres , but it doesn't seem to work because i get this exception: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "2.83.241.254", user "y", database "x", SSL of . is it possible at all to pass this parameter?
23:21dnolensource mapping is PITA
23:24derridaIs there an clojure evalbot for irc that "just works", I haven't had good luck with clojurebot, I had lazybot working for a while but now he won't cooperate either.
23:39nightfly_,"hello"
23:39clojurebot"hello"
23:46creasednolen: looks pretty badass, though