#clojure log - Nov 25 2012

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

0:01 abp: lynaghk: 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!

0:02 bbloom: lynaghk: yeah, it's a shame that clojars doesn't give any download stats

0:02 lynaghk: abp: yeah, definitely. Docs/samples haven't been a strong point. There are a few things here: https://github.com/lynaghk/c2-demos

0:03 bbloom: yeah, I keep hearing that. It's open source, isn't it? Maybe it's just an afternoon's patch?

0:03 jblomo: lynaghk: fyi http://keminglabs.com/c2/ex/bullet/ is out of dat i think

0:03 bbloom: lynaghk: hm, maybe. similarly, i wish github had traffic stats

0:03 jblomo: date

0:04 style is not in c2.core

0:05 lynaghk: jblomo: yeah, I need to update all of the samples to remove that.

0:06 jblomo: 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.

0:06 bbloom: lynaghk: https://github.com/ato/clojars-web/issues/26

0:07 abp: lynaghk: Yes, todoMVC was most helpful to understand what I needed for my experiments.

0:08 bbloom: lynaghk: http://www.clojuresphere.com/ is your best bet at the moment, but only really github stats

0:08 abp: lynaghk: Probably you should do more of those when you've got some time. :P

0:08 bbloom: *shrug* somebody else will solve this problem :-)

0:09 jblomo: lynaghk: yep, thanks for that tweet, got it working in vrepl

0:09 lynaghk: abp: more working samples? Pull requests welcome =P

0:10 abp: lynaghk: No one wants to see that.

0:10 lynaghk: abp: 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

0:10 abp: lynaghk: Probably will integrate my libs with C2, but that wouldn't clarify anything, I suppose.

0:11 lynaghk: abp: what do you mean?

0:13 abp: 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.

0:13 abp: lynaghk: 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.

0:13 lynaghk: abp: ah, yeah. we have exactly the same problem =/

0:14 abp: lynaghk: Have you actually built a whole app just on C2 or do you structure your client-side code with other libs?

0:14 lynaghk: abp: I run a small consulting company and we've done something like half a dozen apps built primarily on C2

0:15 abp: 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

0:15 abp: https://github.com/lynaghk/vcf

0:16 abp: this uses the "crossfilter" JavaScript library to do fast histogram calculations, but is otherwise just something like 800 lines of cljs.

0:16 abp: lynaghk: Oh, have seen it but not that it uses C2.

0:21 jblomo: hrm is the datomic query engine a) separable from datomic and b) working clojurescript?

0:21 as in just applying queries to datastructures

0:23 lynaghk: jblomo: I don't think datomic works in cljs at the moment, but you can do some similar stuff with core.logic

0:24 jblomo: though only a portion of core.logic has been copy-pasted over to work with cljs.

0:29 abp: Wow, 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.

0:29 bbloom: jblomo: there is also datalog… used to be part of contrib, seems like https://github.com/martintrojer/datalog/wiki is here

0:32 wingy: do i have to use a query to get an entity by id in datomic: (q '[:find ?id :in $ ?id :where [?id]] db id)

0:33 hmm … perhaps i could just do (d/entity id) if i have the id

0:35 seangrove: lynaghk: We used it initially for a night in SF for the Clojure dojo, and we've used it internally for admin pages

0:35 Will eventually be rolling it out for customer-facing tools, but not for a bit

0:46 abp: lynaghk: You can't open source a library for cljs these days without getting some adoption. ;)

0:49 jblomo: arg is it just me or is the cljs compiler really loose with undeclared variables? made a type on compile assumed it was a global

0:52 abp: jblomo: Clojure(scripts) embracing of the host at work. ;)

1:08 bbloom: jblomo: the problem is that clojurescript only analyzes vars in a single namespace

1:09 jblomo: because external namespaces may be google closure, or arbitrary javascript, so there is no way to know in there

1:09 jblomo: we could probably get it working by looking at google closure externs, but that just hasn't been done yet

1:24 abp: It'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?

1:27 Updated https://gist.github.com/4142595 with a sample of application.

1:33 jblomo: lynaghk: I see you suggested CSS transitions, is there something similar for SVG? trying to grok all this information about animations vs transitions

1:34 abp: Upadated again with more samples and a bug fixed: https://gist.github.com/4142595

1:34 *spam*

1:38 bbloom: jblomo: as far as i can tell, animations are about the journey, but transitions are about the destination

1:38 in the context of CSS

1:38 abp: Updated https://gist.github.com/4142595 with svg generated from the dependency graph. Gist can't inline that. Pff.

1:39 Urthwhyte: this is your graph lib a?

1:39 abp*

1:40 abp: Urthwhyte: One of it's main parts and a sample application, yes.

1:41 Urthwhyte: I implemented this in Java with Javassist, JGraphT and Java Beans. Multiple thousand lines of code. *SHRUGGG*

1:41 Urthwhyte: Prismatic's graph came as a great inspiration.

1:43 Urthwhyte: 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. :(

1:43 bbloom: abp: I like the fnk and defnk macros they described

1:44 abp: bbloom: Yup, implemented something similiar as you can see in the sample.

1:44 bbloom: that's why i mentioned them

1:44 abp: bbloom: But only fnk by now.

1:44 bbloom: Ok

1:45 bbloom: Once the graph part is stable I start working on integration of other libs. All your computations belong to the graphs.

1:46 bbloom: abp: all your *local* computations

1:46 abp: bbloom: All your computations. I'll call the nodes rpck etc. hornetqk? :P

1:47 bbloom: abp: 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

1:47 abp: bbloom: Glad you mention datomic, that's where graphs should be stored eventually, just need to put the fns in there, too.

1:48 bbloom: And that's not good for cljs. :/

1:48 bbloom: abp: how does cljs come in to play with this?

1:49 abp: You declare a server-side app, you declare the client-side app. You thereby declare integration in terms of ajax rpc and websockets.

1:49 bbloom:

1:49 Urthwhyte: Ehhhhh

1:49 I'm wary of that path after my GWT nightmare

1:50 abp: bbloom: Quite sophisticated, I know. But I've got a few years in my spare time. Urthwhyte: Would that happen with Clojure too? ;)

1:51 Urthwhyte: Well

1:51 abp: Urthwhyte: Also, there's nothing with components. It's just about functions calling functions. But you declare the deps and behavior.

1:52 Urthwhyte: I know, for one, the Dart team has quite a few LISPers on it and decided to build their own runtime all over

1:53 abp: Urthwhyte: Sure they all know ClojureScript and would be able to get management behind it?

1:53 Urthwhyte: and 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

1:54 bbloom: Urthwhyte: yeah, that's why im working on little bits and pieces of the problem

1:54 Urthwhyte: trying to build the libraries that will ultimately make something nice for client side development

1:54 abp: Urthwhyte: 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.

1:54 bbloom: Urthwhyte: abp seems to be working top down, i'm going bottom up :-)

1:55 Urthwhyte: I'm looking at tackling my first real world app in Clojure these next few days

1:55 bbloom: abp: 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

1:55 abp: bbloom: 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. :)

1:56 Urthwhyte: So I've really little experience to comment on what you're doing

1:56 bbloom: abp: I'd say your welcome, but I don't think I've contributed enough to take any credit… .yet :-)

1:56 abp: bbloom: They are flexible because all of Clojures abstractions still apply. But I don't know where my path leads by now. Let me see.

1:57 ivan: Sgeo__: 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

1:58 abp: bbloom: 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.

1:58 -not

1:59 bbloom: abp: 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 :-)

1:59 abp: Most functional programming I did before Clojure was Javascript. :/

2:00 bbloom: 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.

2:00 bbloom: But eventually I will contribute.

2:04 Sgeo__: ivan, uh, I think you think a bit too highly of mean, but um, sure?

2:04 Link?

2:04 clojurebot: your link is dead

2:04 ivan: Sgeo__: https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/7BKQi9nWwAw

2:04 abp: Hm bbloom have you seen the slides of prismatics graph? In there is a graph of prismatic. The whole app.

2:05 bbloom: Because that could be evidence against "declarative programming for sure, but i'm not sure that a computation graph is the right mental model" .

2:06 bbloom: abp: yeah it's super cool for data processes

2:06 abp: probably not super cool for a user interface :-)

2:07 abp: bbloom: frp?

2:07 bbloom: i've studied FRP quite a bit

2:07 databinding needs a dependency graph model, for sure

2:07 abp: bbloom: I not. But for me it seems like a dependency graph

2:07 bbloom: So does binding data to views.

2:08 bbloom: that's what i mean, databinding in the gui sense

2:08 abp: bbloom: And then I don't know why binding server side functions to client-side structures wouldn't be useful.

2:09 bbloom: And binding routes to a request. You get reverse routing for free, something compojure alone fails on.

2:09 bbloom: server/client separation is a totally separate discussion

2:09 abp: bbloom: Sure? Why? It's all about data.

2:10 bbloom: abp: because you can't ignore latency; it has an impact on user experience

2:10 abp: bbloom: Algorithms will not be obsolete with this, but large chunks of your applications control flow will vanish.

2:11 bbloom: abp: 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

2:11 abp: bbloom: 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.

2:11 Sgeo__: ivan, I don't fully understand the executor stuff, I assume that that's Java-ish?

2:12 bbloom: Sgeo__: yeah, java has executor pools for distributing work among threads

2:12 Raynes: bbloom: Your name sounds like an explosion.

2:12 abp: bbloom: Perhaps I'm over oversimplyfiying

2:12 Raynes: Bah BLOOOOOOM

2:12 bbloom: Raynes: I like that. Maybe I'll change my name to Brandon BOOM

2:12 abp: Raynes: bbloom "Blume" is flower in german.. Flowery explosion. :)

2:13 Raynes: Attractive.

2:13 Sgeo__: "Delivering a promise A as a value to another promise B causes B to attend on A."

2:13 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?

2:14 abp: bbloom: I haven't found a lot of things like what I do now. But probably I haven't searched in the right places.

2:14 ivan: I guess you are kind of hosed unless you put it in a vector or something

2:14 Sgeo__: Maybe some additional operation?

2:14 Instead of that mechanism?

2:27 lynaghk: jblomo: CSS transitions don't work on SVG

2:29 jblomo: 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.

2:37 abp: lynaghk: Do you have experience with or heard of any graph computation systems?

2:39 lynaghk: abp: I don't have any firsthand experience with any, no

2:39 abp: I used neo4j on a toy project once, and I read one of the Pragel papers, but that's it

2:39 abp: why?

2:41 abp: lynaghk: 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.

2:41 lynaghk: https://gist.github.com/4142595

2:42 lynaghk: abp: 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.

2:42 abp: lynaghk: It's able to calculate now. So I can start writing node-definitions for other libs.

2:44 lynaghk: abp: What's your use case for something like this?

2:45 abp: lynaghk: It's really only about declaring things that happen for state transitions

2:46 lynaghk: 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.

2:46 lynaghk: abp: have you seen the FlapJax stuff?

2:47 abp: lynaghk: Much of the things I program.

2:47 lynaghk: Yes, not looked into it deeply. It, as many other libs, seems to take a quite specific approach to an uniform problem.

2:48 lynaghk: The beautiful thing about clojure is, that you are able to unify everything. It's just data, right? :D

2:49 lynaghk: abp: 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.

2:49 abp: yeah, most of the stuff I've done has been with that philosophy. See, e.g., my Reflex library.

2:49 abp: which is a way more hacky way to solve this problem than what you're doing---explicit dependency calculation and graph sorting.

2:50 abp: lynaghk: 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.

2:50 lynaghk: FlapJax has hooks into the DOM, but you can use all of its event stream stuff independently of the DOM

2:51 bbloom: abp: you'll find that UI graphs are cyclic

2:52 abp: prismatic's graph is a DAG

2:52 abp: bbloom: I know. I've alread got that sorted out.

2:52 bbloom: abp: UI binding graphs are cyclical and you'll need a linearization algorithm

2:53 abp: Adobe has written about their property model and their use of the QuickPlan solver algorithm for this purpose

2:53 abp: bbloom: Yes, It's :uncircle in the meta of node-fns.

2:53 lynaghk: abp: 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)

2:53 bbloom: abp: what approach are you taking?

2:54 abp: bbloom: Let me gist something up.;)

2:55 lynaghk: Yes, I need to test in cljs soon. No one needs a autmatism choking on its inards.

2:55 lynaghk: abp, bbloom: please contact me as soon as you have "todoFRP" implementations of your respective approaches so I can catalog them

2:55 = )

2:55 abp: lynaghk: That's for sure!

2:56 bbloom: lynaghk: haha. are you maintaining those? :-P

2:56 abp: lynaghk: As an extended sample I'd like to reimplement Raynes refheap with it.

2:56 lynaghk: bbloom, abp: I'm strongly considering it, since the cljs clientside space is no longer just myself and ibdknox =P

2:57 Raynes: abp: Reimplement it with what?

2:57 You mean rewrite the javascript portion in cljs?

2:57 bbloom: lynaghk: yeah, i find http://addyosmani.github.com/todomvc/ to be pretty hilarious

2:57 lynaghk: Also 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.

2:58 bbloom: 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.

2:58 bbloom: lynaghk: i didn't say it was stupid. i said it was hilarious :-)

2:59 lynaghk: bbloom: yeah, totes. =P

2:59 bbloom: lynaghk: It would be better if someone could enumerate those non-trivial problems and make sure that TODO is actually an interesting example

2:59 lynaghk: 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

3:00 Raynes: abp: 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.

3:00 bbloom: lynaghk: regarding angular: it's awesome. I think it's totally a local maximum in javascript-based development

3:00 lynaghk: but I think clojurescript can do better

3:00 Raynes: s/insofar/so far/

3:01 bbloom: Raynes: 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

3:01 lynaghk: bbloom: agreed re: Angular. I've been on the fence about porting it to cljs for a few months now.

3:02 Raynes: bbloom: I assumed, but I just don't want him to go after it and be disappointed if he tries to contribute it back.

3:02 lynaghk: bbloom: The spec for TodoMVC is interesting enough, don't worry.

3:02 abp: Raynes: If you allow, I would rewrite refheap completely.

3:02 bbloom: abp: I don't think refheap is an interesting case study for a client side app

3:02 Raynes: I'm not sure what that means in regards to clojurescript.

3:02 abp: Raynes: Using my graph stuff I talked about in the last hours.

3:03 Raynes: How would refheap make sense as a client side thing?

3:03 abp: bbloom: Cross client/server

3:03 bbloom: abp: yeah, i don't think it has any interesting client side logic....

3:04 abp: bbloom: Raynes Probably spiced with some client-side whistles. Using websockets to update views etc.

3:04 bbloom: lynaghk: angular's "dirty checking" approach is interesting too

3:04 lynaghk: it's kinda like a game architecture with frames

3:05 Raynes: Gotcha. Yeah, I probably wouldn't take that stuff. But if it seems like fun, have at it, of course.

3:05 lynaghk: bbloom: yeah. After wresting with callback mess (manually constructed or automatically built via Reflex) I'm very interested in other approaches.

3:05 bbloom: lynaghk: 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

3:06 lynaghk: bbloom: the dirty checking strategy is independent of the DOM

3:06 bbloom: lynaghk: but i'm not so sure that the idea of a dependency graph is without merit in GUIs

3:06 abp: lynaghk: 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.

3:07 lynaghk: bbloom: 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.

3:07 abp: lynaghk: bbloom: If it's not about graphs I will find the right data structures. ;)

3:07 lynaghk: bbloom: 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.

3:08 abp: lynaghk: But dirty tracking is polling, right?

3:08 lynaghk: Oh, meant checking.

3:08 bbloom: abp: basically, but it doesn't sit in a busy loop, it waits for a stimulus event

3:08 lynaghk: abp: 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)

3:08 bbloom: lynaghk: cool, would love to see what you come up with

3:09 abp: lynaghk: How does that resolve dependencies?

3:09 lynaghk: bbloom: 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 =)

3:09 bbloom: abp: you just recompute every branch of the tree that changes

3:09 lynaghk: abp: http://docs.angularjs.org/guide/concepts#runtime

3:10 bbloom, abp: I'm out for tonight, though. Cya!

3:10 bbloom: lynaghk: cheers

3:10 abp: lynaghk: Cu

3:15 bbloom: 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.

3:16 bbloom: And it's an implementation detail, nothing you would ever do.

3:16 bbloom: abp: it can't be an implementation detail

3:16 abp: you need to worry about constraint hierarchies

3:17 abp: i'm not sure what this gist is supposed to do...

3:17 what's the wacky character after the x about?

3:17 what does :uncircle do?

3:18 abp: bbloom: it's :x€, the euro sign.

3:18 bbloom: uncircle is a typo, I'll correct to uncycle

3:18 bbloom: abp: there are two :x keys in your map

3:19 abp: bbloom: That's right, need to correct that.

3:20 bbloom: 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

3:21 bbloom: abp: can't really study it right now, but it's not clear to me, would need to see the implementation

3:22 abp: bbloom: But lynaghk was right, code samples are clearer and easier to grasp than theories.

3:22 bbloom: Yes, give me some weeks. :)

3:37 nightfly_: How can I call a different aritied form of an anonymous function from within itself?

3:39 abp: nightfly_: http://stackoverflow.com/questions/5626641/non-tail-recursive-anonymous-functions-in-clojure

3:41 nightfly_: Neat, thanks

4:22 tomoj: todofrp is uninteresting :(

4:23 abp: tomoj: Hm, yes, there is not much to it. But better than nothing.

4:45 tomoj: can you pass a fn as a Callable to java?

4:45 if there is an overload for Runnable

4:45 type-hinting doesn't seem to work

4:48 even casting to Callable doesn't work

4:49 ah

4:49 (let [^Callable f (fn [] ..)] ...)

4:54 bbloom: tomoj: use reify

4:54 oh nevermind

4:54 the hint worked

4:54 nice

4:54 tomoj: it worked in the repl, haven't gotten it to work for cljque yet

4:55 ah, yeah typehints fixed cljque O_o

4:55 promises were always deref'ing to nil because fns were being submitted as runnables

4:55 due to reflection

5:16 abp: bbloom: 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.

5:17 bbloom: Later on I could investigate on successive topological sorting, to make compiling and multiple compile passes more efficient.

5:34 bbloom: It works, got to use let-> :)

5:37 https://gist.github.com/4142595 Now with cached :topo-sort in compile-graph.

7:27 * Nocab is really starting to like sublime-edit for clojure dev

7:27 Nocab: I looked at one article posted on reddit about setting up sublime-text for clojure

7:27 I had no idea sublime edit could do that much :)

7:28 http://internistic.blogspot.ca/2012/11/clojure-quickstart-with-sublime-text-2.html

7:28 for those interested

7:53 ucb: Nocab: sure, but can it to M-butterfly ;)

9:04 Foxboron: Any good resources for learning to think with recursion?

9:05 Feeling i struggle alot with this.

9:07 daimrod: Foxboron: SICP

9:07 AimHere: It'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

9:08 There'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

9:09 ambrosebs: The Little Schemer

9:12 Foxboron: yeah

9:12 i was going to buy SICP

9:12 but i bought the wrong version, and can't cancle ._.

9:12 so i got the instructor version of SICP <.<

9:26 Nocab: lol

9:27 hughfdjackson: What's the favourite commandline argument/documentation lib in the clojure landscape?

9:28 * hughfdjackson is considering "clojure.contrib.command-line"

9:32 abp: hughfdjackson, don't use contrib. https://github.com/clojure/tools.cli That's current and I used it. Smooth sailing. ;)

9:32 $google where did clojure contrib go

9:32 lazybot: [Where Did Clojure.Contrib Go - Clojure Design - Clojure Development] http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

9:33 abp: hughfdjackson, ^

9:37 hughfdjackson: abp: :D thanks

9:38 that does look a lot cleaner..

9:39 also, just so i don't get entirely behind the times, what's the default emacs/clojure setup?

9:39 clojure-swank?

9:39 thorwil: hughfdjackson: nrepl

9:40 hughfdjackson: :| good job i asked, huh

9:40 thanks

9:40 thorwil: well, nothing bad happens if use slime/swank

9:41 but for a new setup, i think it makes little sense to not go with nrepl

9:41 hughfdjackson: :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

9:42 thorwil: i guess the leaving behind has just started

9:52 p_l: the bad things that happen with slime is that you lose up all other slime-supported languages

9:52 so probably better to go with nrepl

10:03 szhang: yeah, slime is a little old, but slime is sure working, fine.

10:04 the-kenny: Gnah, after updating to clojurescript "0.0-1535" I get com.google.javascript.jscomp.Compiler.newTracer in my private project :/

10:04 This cljs-version + newest lein cljsbuild works fine at work :/

10:31 solussd: does 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:33 I 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:16 tgoossens: has doseq anything to do with monads?

11:43 clojure-newb: hey 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:45 luxbock: if 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:45 technomancy: luxbock: it's best to put it in resources/ instead

11:46 you can still use slurp iirc

11:48 AimHere: If it's a really big file, you might want some option other than slurping it all in at once

11:48 luxbock: ok, 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:48 technomancy: luxbock: slurp looks on the classpath

11:49 raek: luxbock: if you have a file in resources/foo/bar.txt, you can slurp it with (slurp (io/resource "foo/bar.txt"))

11:50 where io is (:require [clojure.java.io :as io])

11:50 luxbock: in this case the file is 634kb text file, I assume that's still ok to slurp?

11:50 ah cool

11:51 raek: that will require at least 2 * 634kb bytes of memory

11:51 depending on the file format, you could possibly process the file piece by piece instead

11:52 thorwil: i 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:52 technomancy: nm; it looks like slurp doesn't check the classpath automatically

11:52 raek: yeah, I think converts string arguments to file system paths

11:53 oh, or maybe file path / URL dependening on its content

11:53 technomancy: right; it automatically calls c.j.io/reader on its arg

11:54 luxbock: the file contains a list of words

11:55 raek: how are you going to process it? word by word, or do you need to use all words at some point?

11:56 luxbock: I'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:56 I need to use all the words to check if a word entered by the user is a valid word

11:57 raek: ok, but after you have compared to one word you can forget about it?

11:57 in that case you could use line-seq

11:57 luxbock: the excercise is to build a hangman game

11:57 clojurebot: Alles klar

11:57 technomancy: clojurebot: forget the excercise |is| to build a hangman game

11:57 clojurebot: I forgot that the excercise is to build a hangman game

11:59 zilti: What can be the reasons for "namespace y not found after loading /x/y" except a wrong-named file?

11:59 technomancy: zilti: bad ns form

11:59 luxbock: raek: it's checked once everytime the user enters a word guess

11:59 zilti: technomancy: It evaluates fine.

12:00 technomancy: zilti: doesn't mean it's correct

12:01 luxbock: in the Python script all the words are just loaded into one big list

12:02 * zilti does not write his meaning of python in here

12:02 luxbock: which is used to set the initial word that the user tries to guess, and every time when a guess is made

12:03 zilti: Oh. It was a typo...

12:05 raek: luxbock: you could do it like this: https://www.refheap.com/paste/6972

12:07 luxbock: ah I see, thanks

12:08 raek: luxbock: another "in memory" version: https://www.refheap.com/paste/6973

12:08 this one buids a big set instead (which supports the 'contains?' function)

12:11 luxbock: 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:13 ambrosebs: dnolen: this currently works with type checking CLJS code :) Should be a good slide https://gist.github.com/4144347

12:14 dnolen: point out the type of "x" in each branch

12:14 luxbock: raek: what about choosing a random word from the list of words

12:15 seems like you can't really do that with sets

12:16 raek: luxbock: yes. in that case you would need a vector instead.

12:16 just replace (into #{} ...) with (vec ...)

12:17 luxbock: alright, great

12:17 just out of curiosity

12:17 with the approach you suggested first

12:18 raek: (also, (into #{} ...) can be written (set ...))

12:19 luxbock: since 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:19 raek: and the whole loop could be written as (boolean (some #{word} (line-seq reader)))

12:20 luxbock: 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:21 luxbock: so would it be anymore efficient?

12:22 raek: in terms of space or time?

12:22 it's a tradeoff

12:23 luxbock: in terms of memory, so space I suppose

12:23 raek: then I guess you want to keep all the data on the disk

12:24 luxbock: and if I wanted to read a random line from the line, how would that work?

12:25 thanks a lot for the help btw!

12:25 *from the file, even

12:30 raek: luxbock: I wrote this for fun / inpsiration: https://www.refheap.com/paste/6975

12:31 this variant only holds a single word at a time

12:33 luxbock: nice, thanks a lot

12:33 raek: have fun!

12:44 tgoossens: How much does TDD "live" in the clojure community? Concretely: is it a frequently used paradigm in clojure programming?

12:46 ucb: tgoossens: difficult to say, but check out midje by brian marick as a good example of a lib to support TDD

12:47 tgoossens: ucb: thanks

12:47 ucb: if i may ask, how do you write your code ? (repl, tests, etc)

12:48 zilti: I'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:52 tgoossens: i've heard and read about people using the repl a lot for testing (at the moment itself (after writing a function))

12:52 zilti: and then put it in a 'comment' function

12:52 at least i've seen rich hickey do it

12:53 at the bottom of this file: https://github.com/clojure/clojure/blob/master/src/clj/clojure/zip.clj

12:54 also (just quoting) rich is not a big fan of TDD

12:55 raek: midje works well for TDD

12:56 using the repl is a substitute for debugging, not testing

12:56 zilti: Hmm yes, it's cumbersome to do all that for each function manually...

12:57 How are you doing that stuff? One test per function I suppose? Like: Define functions -> Write tests for the functions -> implement the functions?

12:58 tgoossens: so far what i've done is

12:58 to write functions

12:58 raek: if the function involves conditionals, then you should have more than one test for it

12:58 tgoossens: and then tests for them

12:58 but recently i came across metadata

12:59 and you can "bind" some test with a function using metadata

12:59 raek: some examples of tests in midje: https://github.com/raek/ircumflex/blob/master/test/ircumflex/message_test.clj

12:59 (pure functions)

12:59 and: https://github.com/raek/ircumflex/blob/master/test/ircumflex/connection_test.clj

12:59 (effects)

13:00 zilti: nice, thanks for the links

13:00 tgoossens: cool

13:00 raek: tgoossens: yeah, core.test (one of the first clojure test libs) attached test cases in the metadata of the function vars

13:01 tgoossens: so far i(ve been using) jayf expectations, which i like so far

13:01 raek: but most people don't write tests in the same files as the implementation

13:01 tgoossens: but midje looks great as well

13:01 yeah

13:01 it makes it messy (in my opinion)

13:02 B-ratOK: There's something unique about Dutch people.

13:02 Something about their cuisine.

13:02 tgoossens: what?

13:02 clojurebot: what is exceptions

13:02 B-ratOK: Stroopwafels and Bitterballen, who invents that.

13:02 Brilliance I say.

13:02 tgoossens: stroopwafels zijn geweldig en bitterballen ook

13:03 (we have that to in belgium :D)

13:03 *too

13:03 B-ratOK: Stroopwafels his violent and bitterballen too?

13:03 My Dutch is a bit rusty.

13:03 his violence*

13:04 tgoossens: "stroopwafels zijn geweldig en bitterballen ook" -> "stroopwafels are great and bitterballen too"

13:04 B-ratOK: Oh wait, that's like 'the violence and of stroopwafels' right?

13:04 Oh yeah

13:04 Of couse, zijn can also mean 'are'.

13:04 raek: tgoossens: there are multiple fully useable test frameworks. find one you like (and check that it has reasonable editor integration)

13:04 tgoossens: raek: i will :)

13:05 are you in belgium/netherlands right now?

13:06 B-ratOK: Yeah.

13:06 Netherlands

13:06 tgoossens: ok cool

13:06 B-ratOK: I'm studying at the ILLC

13:06 tgoossens: cool

13:06 me at the university of leuven :)

13:07 btw

13:07 b-ratOk: you might find this interesting

13:08 i've been willing to go to such events but we don't have them in belgium

13:08 but in amsterdam

13:08 there is a clojure meetup group

13:08 http://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/

13:09 i'm sure you'll it will be cool

13:17 ucb: tgoossens: 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:18 tgoossens: I'm quite sold on midje btw :)

13:18 tgoossens: ucb: i'll take a look at it next time i write tests :)

13:19 ucb: cool

13:25 seangrove: dnolen: 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:41 i_s: I'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:41 anyone know how to fix?

13:41 pandeiro: i_s: i think that's a dependency issue in the latest CLJS release

13:41 i am developing against 1503 until it is fixed

13:41 i_s: ah

13:42 ill try that, thanks pandeiro

13:44 abp: seangrove, I want that fix too!

13:45 seangrove: abp: You have the same problem? I always get "Namespace 'goog.debug.Error' already declared." until I touch main.cljs

13:47 abp: seangrove, I get it when using shoreleave-remote-ring. On each incremental compile, http_rpc has no provide-statement generated.

13:48 seangrove: abp: shoreleave-remote-ring looks nice, have you used Fetch at all? Any high level comparison? I see that one inspired the other...

14:27 dnolen: seangrove: I can ping clojure-dev tomorrow, now's a good a time as any for another release.

14:44 thorwil: is there anything that makes error buffers in emacs less annoying (sudden creation of new windows, random placement in existing ones)? especially nrepl errors

14:45 ivan: thorwil: (setq nrepl-popup-stacktraces nil)

14:45 Raynes: Anger management classes, thorwil.

14:45 thorwil: heh

14:45 ivan: another thing is to always have two windows

14:47 thorwil: i 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:50 muhoo: thorwil: yes, turn it off

14:50 there's a switch in nrepl.el to turn pop-up windows off when in the repl

14:51 * muhoo looks

14:51 thorwil: muhoo: the (setq nrepl-popup-stacktraces nil) ivan posted? ty, btw

14:51 muhoo: thorwil: (defcustom nrepl-popup-stacktraces t ..

14:51 abp: seangrove, no I haven't used fetch, only shoreleave-remote-ring because I haven't tried Noir either

14:51 muhoo: aye, yes, looks like he did, great.

14:52 thorwil: my .emacs keeps growing :)

14:53 abp: dnolen, 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:54 dnolen, or some thing at all.

14:55 muhoo: hmm, can shoreleave be used without noir?

14:56 dnolen: abp: nope

14:58 Raynes: muhoo: Looks like you could probably write a remote package for Compojure.

14:58 Probably wouldn't be hard to port the Noir package.

14:58 muhoo: i see there's shorleave-remote and shoreleave-remote-noir. reading docs atm

14:58 weavejester: Or just Ring in general

14:58 muhoo: but it uses fetch, which presumes noir IIRC

14:59 "Shoreleave makes no assumptions about other libraries you might be using in your app" um. not true?

14:59 everything has dependencies :-)

14:59 Raynes: ibdknox: You wouldn't happen to be around, would ya

14:59 ?

15:00 muhoo: Raynes: did you make it back home OK?

15:01 Raynes: No, I'm currently sitting on a park bench in NC helping people out on IRC.

15:01 I made it home. ;)

15:02 muhoo: Last I heard from you, you were in a hospital room in NC helping people on IRC. So I figured I'd ask :-/

15:02 Raynes: Fair enough.

15:02 muhoo: your mom is ok now i hope.

15:02 Raynes: She's excellent.

15:03 Just your muscles don't like it when they run out of potassium to juice on.

15:03 muhoo: is that an anemia thing?

15:03 Raynes: They replaced it and she was fine within 24 hours. Problem is making sure it doesn't happen again (this was the second time).

15:04 muhoo: my grandmother used to take pottasium. i think it was thyroid or anemia, don't remember.

15:04 Raynes: No, she has Crohn's disease which sometimes flares up and causes a whole lot of… bordering on TMI, but you get the point.

15:05 You can lose potassium through your bowels remarkably fast.

15:06 muhoo: ah, i worked with someone who had that. not fun.

15:07 ok i see, shoreleave is based on fetch, not requires fetch.

15:09 not seeing a whole lot in here that looks like it wouldn't work without noir.

15:34 devn: https://github.com/devn/codeq-playground

15:48 Not 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:49 tomoj: is there an informal rule that, an non-value identity (IDeref) i, @i should always be a value? are there reasonable exceptions?

15:50 s/an/for a/

15:55 dnolen: devn: neat

16:13 abp: dnolen, do you have experience with dependency graph based computation and control flow systems? I'm working on something: https://gist.github.com/4142595

16:14 dnolen: abp: you keep asking me about things I know hardly anything about :)

16:15 abp: dnolen, 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:16 dnolen: abp: I do like reading papers, but mostly around programming languages & logic programming. It's a big world out there.

16:16 abp: gfredericks, my loop/recur problem from yesterday vanished via mapcat. ;D

16:17 dnolen, sure, probably I should start my own adventure.

16:33 gfredericks: abp: was that my prediction?

16:49 abp: gfredericks, yes.

16:54 seangrove: devn dnolen: wei_ and I have been working on http://jida.herokuapp.com/ with roughly the same goal, but for public clojure repos

16:55 dnolen: seangrove: hey, cool!

16:55 bbloom: seangrove: that's cool! can you put the schema on the site somewhere? like a quick reference cheetsheet?

16:55 seangrove: Provide a pastie/gist-like tool for exploring clojure repos

16:55 Sure

16:56 bbloom: seangrove: 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:56 seangrove: bbloom: Yeah, we need to provide pre-built queries that you can start exploring from

16:57 I think there's probably a gui-approach to make gettings started much more intuitive

16:57 bbloom: seangrove: would be cool. for now, i think a side bar with a list of attributes would be fine

16:57 seangrove: 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:57 seangrove: bbloom: Here's the codeq schema: http://cloud.github.com/downloads/Datomic/codeq/codeq.pdf

16:58 Wonder how to concisely represent that inline

16:58 bbloom: seangrove: 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:59 seangrove: Could use an accordion menu built from that, yeah

17:00 I'll just add a link to the pdf for now

17:00 bbloom: seangrove: that'll work

17:01 seangrove: while you're adding links: how about a link to the datomic query tutorial?

17:02 seangrove: http://docs.datomic.com/tutorial.html ?

17:03 I'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:03 bbloom: seangrove: whoops. executed a HUGE query. worked absurdly fast tho :-P

17:04 seangrove: bbloom: Nice :) There are a few that cause it to slow down badly, but nothing too terrible yet

17:04 Not totally sure about the use case for Jida yet, trying to figure out what benefit the community could get from it

17:04 bbloom: seangrove: 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:05 seangrove: yeah, it's one of those things that just seems like it would have to be interesting :-)

17:06 seangrove: A json-return might be nice for building C2 visualizations around the info... not sure

17:06 Looking at the schema, isn't :code/name scoped by the codeq?

17:06 Ah, I see, you mean if it weren't at all...

17:06 bbloom: seangrove: yeah, i was trying to find clojure.core/inc from just the name inc

17:07 seangrove: says :db/doc "A globally-namespaced programming language identifier", but it would be nice if the non-globally namespaced version was also indexed

17:11 seangrove: devn: Mind if we take some of those queries and put them on Jida?

17:40 bbloom: Ok, updated with some links for getting started: http://jida.herokuapp.com/

17:41 A stop-gap until we can bring in some of that into the tool itself in some more intelligent way

18:00 bbloom: seangrove: 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:01 seangrove: 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:01 seangrove: Haha, that's great though, good to have a use case to work towards

18:01 bbloom: seangrove: i think the first use case i'm interested in is vanity

18:02 i'm gonna query a bunch of stuff about myself :-P

18:02 useful use cases can come once people get excited, heh

18:02 seangrove: Mind 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:02 bbloom: sure, i'll see what i come up with

18:02 would 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:03 seangrove: bbloom: Yeah, would definitely love to have that personally as well

18:03 I'd like to extend codeq a bit to be integrated with CI systems too

18:03 So figure out which builds/authors broke which functions, which were teh most brittle, etc.

18:05 bbloom: seangrove: where is the list of aggregate functions?

18:05 like min/max

18:05 seangrove: bbloom: No idea, seems that you can use any clojure function as long as it's only one function-deep

18:07 bbloom: seangrove: hm ok, guessing seems to work :-)

18:07 seangrove: the results should label the output fields

18:07 seangrove: Ah, good idea

18:07 bbloom: seangrove: what's the delay on importing? i'd love to query clojurescript

18:08 seangrove: Maybe ~1-2 minutes?

18:08 More on bigger projects, but most clojure projects are tiny

18:09 https://github.com/yayitswei/jida/wiki <- place to list suggestions

18:10 Feel 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:10 bbloom: seangrove: I tried to add two repositories

18:10 one of mine cljs-cps

18:10 and clojure/clojurescript

18:10 about 5 min ago

18:10 neither has appeared

18:12 seangrove: I'll look at it right now

18:20 tomoj: does codeq work for cljs?

18:20 oh, well, those have clj too

18:20 bbloom: tomoj: I don't see why not. it's just reading clj forms and heuristically searching for forms that begin with "def"

18:20 :-P

18:21 tomoj: yeah, but the clj analyzer only advertises support for .clj

18:22 bbloom: tomoj: oh, trivial fix :-)

18:22 tomoj: not sure if there's a good reason.. guess they are waiting for a separate cljs analyzer?

18:23 there's nothing in .cljs that can't be read by the clojure reader, right?

18:23 * gfredericks assumes so

18:23 tomoj: obv

18:23 bbloom: tomoj: the clojurescript compiler's reader IS the clojure reader

18:23 tomoj: since cljs uses the clojure reader :)

18:23 gfredericks: I thought the clojure reader was what the compiler used

18:24 let's all three say it in unison now

18:24 tomoj: I guess it's tricky though

18:24 bbloom: seangrove: while you debug, i'm filling up your suggestions wiki :-)

18:24 tomoj: if you do that trivial fix, won't your codeq db get confused about cljs vs clj references?

18:25 bbloom: tomoj: i don't think analyzer goes that deep yet

18:25 seangrove: bbloom: 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:25 url => address

18:26 bbloom: seangrove: k, let me know when i should try again

18:26 seangrove: Pushing 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:27 bbloom: seangrove: odd. any idea why?

18:28 seangrove: Haven'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:28 Not much idea, not quite the cljs guru I'd like to be yet

18:29 bbloom: seangrove: hm

18:33 seangrove: bbloom: I queued those two repos myself from the repl while I redeploy the frontend fix

18:33 bbloom: seangrove: cool thanks

18:33 seangrove: Will let you know when it's finished

18:38 clj_newb_234: is there something like take, but returns the _last_ [n] elements of [coll]] instead?

18:38 I'd preer something shorter than (drop (- (count coll) n) coll)

18:39 seangrove: bbloom: Ok, imported

18:39 Waiting for the heroku dyno to come back up to see if the cljs compiled correctly on this push

18:40 bbloom: seangrove: glorious!

18:40 seangrove: Ok, and import is working again

18:40 bbloom: seangrove: I ran https://www.refheap.com/paste/6979

18:40 seangrove: Speaking of frontend failures, is midje compatible with cljs?

18:40 bbloom: no idea

18:41 seangrove: I'll check on it later, and use the normal tests first

18:41 Looks like that query works :)

18:42 bbloom: seangrove: I keep having ideas for you :-) check the wiki

18:42 seangrove: lots of work ahead ;-)

18:43 seangrove: bbloom: https://www.refheap.com/paste/6980 is pretty cool too

18:43 bbloom: seangrove: heh, yeah, all clojure contributors :-)

18:44 seangrove: need some way to sort the results....

18:44 seangrove: Oh, nice suggestions

18:44 bbloom: seangrove: need to plugin code mirror or some other extensible editor

18:46 i want a pivot table :-)

18:49 seangrove: Code-mirror sounds like a good idea

18:53 Pivot-table migh be a *bit* extreme for the next few iterations... :)

18:55 derrida: Is the "best practice" for using clojure from emacs to use nrepl.el+clojure-mode with nrepl instead of clojure-swank/slime altogether?

18:56 seangrove: derrida: I believe so, clojure-swank is deprecated now

18:56 I switched last week

18:56 derrida: yeah, I was surprised to see that last night

18:57 also, marmalade seems to have completely gone to hell. melpa is seeming great though! :D

18:58 seangrove: bbloom: Taking that last query and searching for dnolen's surname, you can see the number of commits from any given machine...

18:58 Hmm, I think I'm still using marmalade. Damnit emacs...

18:59 bbloom: seangrove: heh. that brings up the next issue: identity :-)

18:59 codeq needs a way to map multiple email addresses to the same person

19:00 seangrove: Could probably be a pre-built rule

19:00 A couple of implicit OR's

19:04 derrida: seangrove: melpa is *much* better

19:04 imho

19:05 seangrove: Will give it a try when marmalade breaks, thanks for the heads up

19:05 derrida: so much in marmalade is out-of-date, unstable, broken

19:05 seangrove: this blog post was my savior, http://batsov.com/articles/2012/04/06/melpa-homebrew-emacs-edition/

19:05 I was starting to blame M-x package

19:06 now that I've wasted a few days on that, time to start having fun with clojure! I want to check out Ritz!

19:13 seangrove: 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:14 seangrove: 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:15 seangrove: I have this in my .emacs: (add-hook 'clojure-mode-hook 'turn-on-nrepl-interaction-mode)

19:17 And a few other things too, I think I grabbed it from the nrepl.el github page

19:18 derrida: seangrove: thank you, that makes sense. I wish `package.el` would be more aggressive in telling me when an installed package requires additional configuration.

19:18 seangrove: Heh, emacs + user-experience... a wonderful dream :)

19:19 derrida: hehe, 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:40 crease: Hey, 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:43 abp: https://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:45 Sgeo__: crease, well, I think conj is supposed to put the item in the most efficient place for that collection

19:46 weavejester: crease: Why do you need it for make-node?

19:46 abp: Good luck! I've been thinking that a more deterministic routing library would be useful.

19:47 Sgeo__: Hmm ##(seq (conj 5 (map identity [1 2 3]))

19:47 :/

19:47 ,(seq (conj 5 (map identity [1 2 3]))

19:47 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

19:47 abp: weavejester, It's deterministic. Even in a visualizable way.

19:47 Sgeo__: ,(seq (conj 5 (map identity [1 2 3])))

19:47 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IPersistentCollection>

19:47 Sgeo__: (doc conj)

19:47 clojurebot: "([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:47 Sgeo__: ,(seq (conj (map identity [1 2 3]) 5))

19:47 clojurebot: (5 1 2 3)

19:47 weavejester: abp: Right, that's why I was saying good luck

19:48 abp: As in, that's a good idea you have

19:48 Sgeo__: ,(conj (seq (map identity [1 2 3]) 5))

19:48 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$seq>

19:48 Sgeo__: ,(conj (seq (map identity [1 2 3])) 5)

19:48 clojurebot: (5 1 2 3)

19:49 abp: weavejester, can I ignore trailing slashes in Compojure routes somehow?

19:50 weavejester, oh thanks. :)

19:50 weavejester, misread that before your clarification. :x

19:50 weavejester: abp: I thought they did, but maybe I'm misremembering

19:50 abp: weavejester, at least they were working once. But that commit got lost or whatever.

19:51 wingy: why do i get an error: https://www.refheap.com/paste/6981

19:51 weavejester: abp: Odd. Clout hasn't changed in a while.

19:53 abp: weavejester, https://github.com/weavejester/compojure/issues/68 has a good way to resolve that under the covers.

19:54 weavejester, have you looked into that: https://github.com/cgrand/regex I'm thinking about integrating it for route regex.

19:54 wingy: any datomic guru in here?

19:55 abp: Novice wingy.

19:55 weavejester: abp: 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:55 tomoj: wingy: refheap the full stacktrace?

19:55 abp: weavejester, yep just go for 301. :)

19:56 weavejester: abp: I hadn't noticed that, thanks for pointing it out

19:56 wingy: tomoj: that is all i got from the (light table) repl

19:56 crease: weavejester: 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:56 vectors, 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:56 tomoj: then run (clojure.repl/pst)

19:56 crease: order for everything else. Feels kind of hacky, though.

19:56 wingy: tomoj: perhaps its not showing me everything

19:56 crease: er, sorry about paragraph length

19:57 abp: weavejester, that's why I love open source. I'll come beg you to review my libraries around ring, hiccup and co!

19:57 tomoj: the only possible error I spot there is that :user/phone-number is not an attribute

19:57 try pst to see if the stacktrace says what the real problem is

19:58 wingy: tomoj: i wrapped it around the pst but it showed the same message

19:58 weavejester: crease: I thought (into (empty coll) …) always worked, but I guess I'm wrong

19:58 tomoj: wrapped?

19:58 wingy: tomoj: what do you mean its not a real attributed .. it is defined in the schema

19:58 tomoj: you did (try ... (catch Throwable t (pst t))) ?

19:59 wingy: no

19:59 tomoj: it should also work to just call (pst) after you get the exception

19:59 wingy: wait

19:59 i did this https://www.refheap.com/paste/6983

19:59 tomoj: that's not right, do one of the above two things

19:59 wingy: ill rewrite it

20:01 tomoj: it gave me nil: https://www.refheap.com/paste/6984

20:01 so its not an error? i dont know what "processing rule: (q__4151 ?user)" means

20:01 tomoj: huh, guess pst prints to stdout in light table?

20:01 try (datomic.api/entity (datomic.api/db conn) :user/phone-number)

20:03 wingy: tomoj: (datomic.api/entity (datomic.api/db conn) :user/phone-number)|| => {:db/id nil}

20:03 (datomic.api/entity (datomic.api/db conn) :user/phone-number) => {:db/id nil}

20:03 tomoj: yeah, your attribute isn't there

20:03 wingy: hm

20:03 tomoj: presumably you need to install your schema

20:03 going to be tough debugging if you can't figure out a way to see the stack trace!

20:04 or maybe that was one of those weird exceptions that doesn't have a stack trace, for reasons I don't understand?

20:04 clojurebot: exceptions is what

20:13 crease: ##(into {} [ (vec (into (empty (first {:k1 :v1})) [:k2 :v2]))])

20:13 lazybot: ⇒ {:v2 :k2}

20:14 crease: you need that vec in there, too, so I guess it needs a special case anyway

20:15 ##(into {} [(into (empty (first {:k1 :v1})) [:k2 :v2])])

20:15 lazybot: java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry

20:36 crease: man, what a pain

21:02 tomoj: bbloom: can you give an example of cancelling the whole async operation during an intermediate step?

21:03 bbloom: tomoj: consider a fan out task

21:03 crease: okay, 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:03 needs more testing, good enough for now though

21:03 bbloom: tomoj: let's say you have a web service that correlates several external data sources

21:04 tomoj: you execute correlate-data as a listenable future

21:04 tomoj: in turn, that issues query-service-a, query-service-b, and query-service-c

21:04 there may be a waterfall of extra queries

21:05 like after you get a and b, you want to query d

21:05 (query-service-d result-a result-b)

21:05 if you decide you're not interested in the result of the query and want to cancel

21:05 ou shouldn't bother service-d

21:05 crease: ha, (vdc children) also works for AMapEntry

21:05 vec

21:05 bbloom: so you should be able to cancel your root level future

21:05 tomoj: does that make sense?

21:09 tomoj: yes, excellent example

21:09 both the examples I'd come up with didn't reveal the problem

21:09 thanks

21:10 bbloom: tomoj: are you putting these examples somewhere?

21:11 tomoj: my notebook for now

21:11 I'll maybe respond to the groups thread eventually, still thinking..

22:00 hmm, so is stu suggesting creating a new promise-like ("task"?) for processes?

22:01 if you wanted to do RefCountDisposable craziness, you'd have to have tasks all the way down, no cljque.promises in the middle

22:01 all the way up, I should say

22:02 since a promise won't propagate remove-watch up

22:02 I guess he's not suggesting that tasks be promise-like - just that a task isn't a promise

22:04 this seems like a spot where auto-joining promises of promises might cause some trouble

22:06 if 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:06 right?

22:06 clojurebot: to 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:29 holo: hi

22:35 i 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:21 dnolen: source mapping is PITA

23:24 derrida: Is 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:39 nightfly_: ,"hello"

23:39 clojurebot: "hello"

23:46 crease: dnolen: looks pretty badass, though

Logging service provided by n01se.net