#clojure log - Feb 21 2012

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

0:00 ibdknox: when you define a function with defremotes

0:00 it's picking that up and storing it a reference to it

0:00 tjgillies: im trying to make a system that performs a task x number of seconds after an event occcurs, i also want to add y to x if the event happens again so the task is performed (y +x) seconds after the most recent event

0:00 ibdknox: that way when you call a remote, it'll be able to call that function

0:00 tjgillies: the best way ive found to do timers is Thread/sleep but i don't know how to add to that time

0:00 pandeiro: ibdknox: in some map? call the fn by a key?

0:00 ibdknox: the middleware intercepts those calls and does the right thing with them

0:00 yep

0:03 pandeiro: ibdknox: i dig low contrast schemes btw, maybe you could implement an "I'm blind" button that changes the css to all #000/#fff? i will use it when my eyesight is shot in a few years

0:04 ibdknox: I'm considering adding a b/w theme to all my sites given how much people complain about real colors

0:04 it's getting annoying

0:04 lol

0:04 TimMc: Scriptor: Where did you find "atom?"?

0:05 Scriptor: TimMc: it's in clojure.inspector apparently http://clojuredocs.org/clojure_core/clojure.inspector/atom_q

0:05 TimMc: OK

0:05 Scriptor: I haven't compiled it yet so not sure if it'll work

0:06 TimMc: ,(meta (the-ns 'clojure.inspector))

0:06 Scriptor: how do you fix the indentation of some highlighted code?

0:06 clojurebot: #<Exception java.lang.Exception: No namespace: clojure.inspector found>

0:06 Scriptor: oh come on

0:06 (in emacs for my question)

0:07 TimMc: ,(meta (the-ns 'clojure.inspector))

0:07 clojurebot: nil

0:07 TimMc: bah

0:07 pandeiro: Scriptor: you mean indent-region?

0:08 Scriptor: pandeiro: yep, just googled it

0:22 alexbaranosky: muhoo, perhaps https://github.com/Raynes/tentacles ??

0:22 lazybot: alexbaranosky: Definitely not.

0:23 tjgillies: how do you do (!= 3 4)

0:24 Scriptor: tjgillies: (not= 3 4)

0:24 tjgillies: Scriptor: thnx

0:30 amalloy: Scriptor: just press tab, right?

0:30 for what it's worth, C-M-q is bound to indent-sexp by default, and paredit adds M-q, which i love: reindent the whole function

0:31 Scriptor: ooh, M-q sounds useful

0:31 I was looking for ways to indent sections of code rather than line-by-line

0:31 like vim's =

0:33 muhoo: tentacles looks like interface to gitHUB API. i'm talking about raw git, no hub.

0:33 amalloy: Scriptor: you'll want to get used to the sexp-oriented commands in emacs, like C-M-SPC to mark a sexp

0:35 Scriptor: amalloy: ah, didn't know about that one, that's really handy

0:35 thanks!

0:35 amalloy: have a look at the output of `C-h a sexp RET` for all the commands with "sexp" in the name

1:07 arohner: I don't suppose anyone remembers the idiom for mapping a macro over a seq of arguments, in another macro?

1:12 amalloy: `(do ~@(for ...))?

1:19 arohner: amalloy: yeah, I forgot about how 'do' is handled slightly differently. thanks

1:22 and I forgot you could do (map #(my-macro %))

1:46 Scriptor: huh, cljs just prints the code as it generates it

1:46 I guess it's captured somewhow

1:46 *somehow

1:46 ibdknox: ,(doc with-out-str)

1:46 clojurebot: "([& body]); Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any nested printing calls."

1:47 tjgillies: im getting a stack overflow when i run the last s-exp again after this compiles: https://refheap.com/paste/790

1:47 ibdknox: ,(with-out-str (println "yo") (println "sup?"))

1:47 clojurebot: "yo\nsup?\n"

1:47 ibdknox: Scriptor: ^

1:47 Scriptor: ibdknox: got it

1:50 bbloom: has anyone worked with multi-repl environments? looking for kinda a survey of the practice: multiple hosts, environments, languages (clj vs cljs), etc. — I'm thinking I can hack something up pretty quick for my particular use case, but does anyone have any first hand tips?

1:50 amalloy: that soup of mutability is probably creating a circular reference somewhere, tjgillies, which causes a stackoverflow when you try to print it

1:51 tjgillies: amalloy: the reason im moving to clojure is im tired of being a slave to improper state mentality ;)

1:52 bbloom: tjdillies: first order of business is to make new-neuron stop returning a ref

1:53 tjgillies: bbloom: any particular reason?

1:53 bbloom: two reasons:

1:53 firstly, it's not it's responsibility

1:53 a "neuron" in your world is a map

1:54 if someone wants a mutable pointer to a neuron, that's that caller's responsibility

1:54 secondly, you could pretty easily make a fully immutable neural net, with only a single top-level atom for the "current" net

1:55 however, if you want to be able to reuse sub-nets you can't have circular references on the objects themselves

1:55 amalloy: the back-propagation (ie, cycles in the graph) make it a little bit more complicated than you're saying, bbloom, but in general that's true

1:55 tjgillies: bbloom: whats easy for you is not easy for me

1:55 bbloom: so instead, split the graph into two parts:

1:55 it's not easy for me either :-)

1:56 basically, remove the subneurons from the neuron itself

1:56 make a map of parent/child relationships

1:56 that lets you not mutate the nodes themsleves, only the mapping between them

1:56 which eliminates the circular references

1:57 tjgillies: bbloom: thnx

1:58 Raynes: Sorry for spottiness in anyone who has been using refheap in the past few hours. I've been toying with fonts. Should be nice and stable now.

1:58 hiredman: clojure.set has some useful functions for that kind of thing (building sets of maps with indices for fast lookup for values of certain fields)

1:59 bbloom: tjgillies: no problem! would love to check it out after you've reworked it. do come back and share

1:59 georgek: hi, I'm looking into prevalent style persistence, so far I've found Simple-Persistence, Prevayler, some other small projects...others?

2:00 hiredman: https://github.com/hiredman/sunyata

2:03 georgek: interesting! thanks hiredman, I've never heard of infinispan either

2:07 emezeske_: bbloom: regarding your question about multi-repl environments, I've been working on making things easier for ClojureScript: https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/doc/REPL.md

2:07 bbloom: not sure if that is relevant to your question

2:07 bbloom: emezeske: looking...

2:09 emezeske_: bbloom: note: that doc is for 0.1.0 which I have not released yet

2:11 bbloom: emezeske_: I'm not sure this helps. I've already got a browser-connected cljs repl working. one issue is that I want my clj repl and cljs repl to share the same environment, so that I can eval defmacro forms & have the cljs repl pick up the new definition…

2:12 I've been doing :cljs/quit

2:12 and then (myapp.repl/repl)

2:12 and running multiple repls

2:12 and hacking around it

2:13 emezeske_: bbloom: that's an intersting problem, I haven't thought about that much

2:13 bbloom: definitely something to think about

2:14 bbloom: ideally, i'd have one repl & be able to seamlessly eval code from my editor in the right env & namespace

2:14 extra wrinkle: I'm a big time vim guy :-/ still kinda avoiding trying emacs/slime

2:14 emezeske_: how would the REPL know whether the code was clj or cljs?

2:14 * emezeske_ is a vim guy.

2:14 bbloom: fiie extension? heh

2:14 emezeske_: heh, yeah, that makes sense

2:16 bbloom: better yet: `:echo &filetype`

2:16 emezeske_: right

2:17 bbloom: but i had to hack the ftdetect for cljs anyway in vimclojure to detect *.cljs

2:17 emezeske_: yeah I have an autocmd to do that

2:17 meh

2:17 bbloom: the vimclojure developer doesn't seem to monitor the github repo for pull requests& i haven't tracked him yet

2:18 emezeske_: thanks for the food for thought

2:18 I gotta go!

2:22 tjgillies: wow just by updating the variable instead of mutating the state i got rid of a lot of code

2:22 i need to stop trying to use refs as objects in OO style

2:22 its really tempting

2:22 bbloom: :-)

2:22 amalloy: tjgillies: pretend you're working in a version of clojure that has no mutable state at all

2:23 once you've climbed up the walls for a couple hours over a particular problem and you feel state would solve it...go another hour, then ask in here if state would help

2:24 amro: getting help from state is for communists

2:24 wait what are we talking about?

2:24 Scriptor: hah

2:25 tjgillies: Clojure: state is for communists

2:27 bbloom: amalloy: I've found it useful to play a whiteboard game: draw an object graph & then figure out the absolute minimum number of new lines i have to draw to "mutate" the world: those are my vars/refs/atoms

2:28 amalloy: that number is always zero, at a certain level

2:28 bbloom: but that level is below practicality :-)

2:29 amalloy: not really. you can work entirely with immutable objects and have your only side-effects be input and output

2:29 bbloom: hence the existence of atoms/vars/refs ;-)

2:31 of course you can. you can view the entire universe as a pure function of a previous universe… but it turns out that is a confusing way to model many problems

2:44 tjgillies: i want to change the def of a variable from inside a function e.g. (defn foo [something] (def variable-name-of-something (assoc something :key value)))

2:45 do i want state for that?

2:48 Scriptor: whee, first actual clojure project https://github.com/Scriptor/phunc

2:49 tjgillies: Scriptor: nice

2:49 Scriptor: tjgillies: thanks :)

2:51 bbloom: tjgillies: I'm far from the expert, but i'd imagine you'd have two top level vars: 1 for the set of nodes & 1 for the set of edges. I'd probably make that two (ref) objects if you want to be able to coordinate updating both of them at once

2:54 tjgillies: bbloom: im not so much working on a neural network for machine learning, but rather trying to model how a single neuron works on a biological level and how it triggers one or two neurons around it

3:22 zawzey: hi, how do can you mix 2 defrecords of the same name in 2 different namespaces together. I tried to exclude the other defrecord using [:use other-namespace :exclude [defrecord-name]] but that doesn't work

3:29 osa1: is there a clojure library to inspect java AST ? like eclipse's AST library

3:32 Fossi: hi all

3:42 osa1: I'm searching for a way to inspect some java code via AST. is there a library for it (like Eclipse AST but for clojure) or do I have to use ANTLR ?

3:51 jtoy: anyone using clojurescript, wanted to hear how you like it

3:54 ibdknox: jtoy: I like it well enough :)

3:55 jtoy: ibdknox: i saw you wrote some libraries, what do you recommend for doing some ajax ? I'm doing my first clojure in clojurescript, i haven't done much clojure

3:55 ibdknox: I'm not sure that I would start learning Clojure with clojurescript

3:56 I would go the other direction

3:56 Scriptor: jtoy: also, for doing ajax I think google closure provides just about everything

3:56 ibdknox: buuut the blog post I just posted today might be of interest to you: http://www.chris-granger.com/

3:56 eh

3:56 jtoy: i currently don't need any clojure, i'm using ruby for backend stuff, but i do need to write some brand new js code

3:56 ibdknox: I suggest not doing that lol

3:56 Fossi: yeah, <3 g closure

3:56 ibdknox: fetch has very simple xhr in it

3:57 Fossi: but since you are using g closure anyway..

3:57 Scriptor: jtoy: learn clojure for your own stuff first, clojurescript is still newish and will be harder to deal with

3:57 Fossi: you do, right? right? ;)

3:57 jtoy: oh, i saw that title on hacker news, but didn't read it, awesome

3:58 hmm, ok , i guess ill wait on the clojurescript then

3:58 ibdknox: for someone brand new to Clojure, it's like to be a frustrating experience

3:59 it's getting better every week

3:59 but it's definitely early days

3:59 Fossi: why?

3:59 clojurebot: Why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

3:59 jtoy: i did play a little with the clojurescript one stuff

4:00 ibdknox: the errors you get are completely unintelligible and often don't point to the actual problem

4:00 jtoy: i think clojurescript if clojurescirpt is ready to go out of the box, its the perfect gateway to doing a lot more clojure

4:00 osa1: what is the syntax for (import .. :as ..) ?

4:00 I've tried (import '[lib :as name]) but didn't work

4:00 Fossi: ibdknox: didn't keep me from using clojure either ;)

4:00 ibdknox: osa1: it's require, not import

4:00 jtoy: since you could use clojurescript in small amounts to start with

4:00 ibdknox: Fossi: this is far, far worse than Clojure

4:00 raek: osa1: import does not support :as

4:01 so you're stuck with the java class names as they are

4:01 osa1: ok, thanks

4:01 ibdknox: don't get me wrong, CLJS is awesome. I just don't think it's the best starting point for someone :)

4:02 Scriptor: how's cljs debugging nowadays?

4:02 Fossi: okay. last time i dabbled with cljs the problem was more getting oauth2 to run on node

4:02 jtoy: i just want to run clojurescript from my browser, not nodejs

4:03 ibdknox: jtoy: well

4:03 what I've done in that blogpost will show you some of that

4:03 tjgillies: whats the point of clojurescript? if you want javascript, why not write javascript?

4:03 Fossi: then again, i have quite some clojure under my belt

4:04 tjgillies: because js is ugly ;)

4:04 at least in some parts

4:04 jtoy: whats the point of clojurescript at all then? the only point for me to use clojurescript here is to learn some clojure, i don't like to code just for fun , i like fun/work mixed together :)

4:05 tjgillies: i thought rich hickey was a big fan of saying superficial stuff like semicolons and how beautiful the language looks is bullshit

4:05 its about constructs not artifcats

4:05 artifacts*

4:05 Fossi: tjgillies: i didn't mean visually

4:06 more like in: type conversions, unexpected mutables, etc

4:06 Scriptor: jtoy: it's more for people already experienced with clojure who need to work with js, you can start with cljs for sure, but expect trouble from that extra hurdle, that's all

4:07 tjgillies: clojurescript is a separate language from clojure for certain definitions of language anyway

4:07 ibdknox: tjgillies: by that notion why use clojure at all?

4:07 Scriptor: I'd recommend at least getting set up with regular clojure, so you know what's clojure and what's clojurescript

4:07 ibdknox: tjgillies: might as well just use Java

4:08 tjgillies: ibdknox: good point

4:08 Scriptor: tjgillies: what's the point of using anything but C? ;)

4:08 tjgillies: ibdknox: im a fan of java though ;)

4:08 Fossi: assembler

4:08 machine code

4:08 raw power

4:08 ibdknox: lol

4:08 Fossi: oh, wait ;)

4:08 aperiodic: bah, i edit inodes by hand with magnets

4:13 zawzey: sorry i got d/c

4:13 osa1: how can I list all methods/fields of a class in clojure?

4:14 zawzey: (use 'clojure.reflect 'clojure.pprint) (pprint (reflect "hello"))

4:15 osa1: zawzey: thanks

4:15 raek: osa1: if you use emacs, you can use C-c I

4:15 zawzey: hi, how can you mix 2 defrecords of the same name in 2 different namespaces together? I tried to exclude the other defrecord using [:use other-namespace :exclude [defrecord-name]] but that doesn't work

4:16 osa1: raek: it's output is unreadable

4:16 raek: full of T__x's

4:17 yeah looks like reflect just printed same thing with C-c I

4:18 zawzey: osa1: is that a java class? u can enter (pprint (refect obj))

4:19 osa1: it's a class generated by antlr

4:20 (pprint (.getMethods (.getClass obj))) worked fine

4:32 fbu: hi, i'm struggling with clojure and jna

4:32 is it the right place to find help ?

4:35 callen: would anyone be willing to toss me a hint or a train of thought to follow for http://www.4clojure.com/problem/21#prob-title ? I've been pondering using the for or while macros.

4:36 amalloy: neither of those are good choices, i'm afraid

4:36 callen: for can only look at one element at a time, so it can't know when it's done. while could conceivably work but side effects are evil

4:37 personally, i like to solve the earlier 4clojure problems with just raw recursion, no interesting library functions, because that's something i need more practice on

4:38 * tsdh just discovered C-c M-o (slime-repl-clear-buffer) which is incredible handy when the slime repl gets slow because you've printed a huge seq.

4:39 lypanov: whats the current suggested way to do "project in project" dev?

4:39 callen: amalloy: that's what I'm trying to do, is avoid side-effects. the obvious answer is nth. I'm wondering if I should be doing a fold or reduce or something.

4:39 it feels like that kind of problem.

4:40 amalloy: a reduce would be fine - anytime you want to produce one result from a collection, that's not a terrible choice

4:40 lypanov: as in, i need to edit the source to a project i depend on. i'm using leiningen. lein deps is so incredibly slow its making my work flow very difficult.

4:40 amalloy: it's not very appropriate to this particular problem since you have to walk the whole seq, but it would work

4:40 eg, (fn my-nth [coll n] (if (zero? n) (first coll) (my-nth (rest coll) (dec n))))

4:41 raek: lypanov: would checkout dependencies work in your case?

4:41 callen: amalloy: a recursive solution with a countdown. That's much better.

4:41 amalloy: the zeroth element of a seq is just its first, and otherwise you can look up the N-1th of all but the first

4:41 lypanov: raek: as in git submodules? or thats something else?

4:41 callen: amalloy: I kinda wish you hadn't shown me that though :(

4:41 lypanov: raek: in rails/bundle i just say "gem in path". just need that.

4:41 raek: no, you can add symlinks to the source of other projects to the checkouts directory

4:41 amalloy: so now solve it with reduce

4:42 lypanov: ah!

4:42 callen: amalloy: hokay.

4:42 lypanov: raek: something to google for :D trying!

4:42 amalloy: the fun part of 4clojure is you can solve the problem any way you want, whatever challenges you currently. or, whatever's easy for you currently if you need a break

4:42 raek: you still need the dep in the project.clj, and it has to exist in a repo

4:42 lypanov: raek: (google suggested completion on checkout dependencies -> leiningen)

4:42 raek: lypanov: it's in the leiningen readme or tutorial

4:43 lypanov: yup just reading now thanks for the pointer!

4:43 raek: also, lein deps should only be slow when you have SNAPSHOT deps

4:44 (since it will look for new versions then)

4:51 lypanov: raek: i have lots of SNAPSHOT deps. that explains. thx for info.

4:51 callen: amalloy: uh...I found a way simpler/faster solution.

4:51 amalloy: just use vec.

4:51 amalloy: drop/first?

4:51 lypanov: raek: checkouts works perfectly. thank you! already making progress :)

4:51 callen: amalloy: no, I think vec is better.

4:51 amalloy: #((vec %) %2)?

4:51 callen: amalloy: that's not how I wrote it, but it's the same idea.

4:52 amalloy: that's definitely not faster

4:52 callen: amalloy: no? oh.

4:52 amalloy: is the conversion to vec slow or what?

4:52 I can't imagine the fetch from the vec is the slow part.

4:52 amalloy: it has to look at every element

4:52 callen: so the conversion is O(n) is what you're saying.

4:52 amalloy: yes

4:53 callen: the (first (drop... solution would be equivalent to yours, I believe.

4:53 amalloy: *nod*

4:53 callen: in the sense that it's going to look at some value less than n of the data structure.

4:53 amalloy: thanks for batting this one around with me. I feel more comfortable with it now.

4:54 4clojure is so amazing...

4:54 every language should have this.

4:54 it's like inverse Stack Overflow.

4:55 amalloy: it's a lot more like SO, for the people who answer questions instead of asking them :P

4:55 lypanov: callen: http://euler.net/

4:55 callen: I know about project euler

4:56 I just don't care for it.

4:56 lypanov: y?

4:56 callen: preference.

4:56 amalloy: project euler is a great tool. but if you want something less-mathy and more language-tailored/hand-holdy, 4clojure is more for you, i suspect

4:57 callen: I don't want hand-holdy per se, I just don't like the mathiness of it.

4:57 if it's going to be abstract, I'd rather it not seem custom-made for Haskell programmers.

4:58 amalloy: *boggle* what about project euler is abstract OR haskelly?

4:58 it's all very concrete

4:58 Scriptor: I think he means the mathiness of it, which some equate with haskell's math focus

4:59 well, not focus

4:59 mathematical nature

4:59 callen: I might've misused the term abstract, I wouldn't fixate on that too much.

4:59 Scriptor: if I use binding to rebind a function f to something else, but call f inside the new function, will it use the old value of f or the newly rebound one?

4:59 callen: However, the puzzles appear to have been designed to give Haskell users an excuse to gloat about their lazy language.

5:00 amalloy: heh. i've done that too, but for clojure

5:00 lypanov: amalloy: aye maybe i should try it also i did a fair few euler tasks a while back in clojure but still find basic programming tedius because of my lack of knowledge of eg using other projects, string manip, etc.

5:00 amalloy: most of the euler problems can easily be done in terms of sequences

5:00 callen: plenty of ways to do infinite/lazy seqs in Clojure, but it seems like Haskell users do a lot more crowing about their laziness.

5:00 it seems to be taken for granted that laziness is an option in Clojure.

5:00 * lypanov wonders if callen was attacked by a viciously lazy haskeller at some point

5:00 Scriptor: because the whole language is lazy, so it's often emphasized

5:00 raek: Scriptor: I don't think so. (defn foo [] ...) expands to (def foo (fn foo [] ...)) -- note the extra foo

5:01 Scriptor: yea...dammit

5:01 raek: inside the function, foo will always refer to this particular function

5:01 Scriptor: I guess if I did (def bar foo) beforehand I could use bar?

5:04 raek: Scriptor: sorry I answered your "X or Y" question with a "no", I misinterpreted it a bit

5:04 amalloy: funny coincidence, because i suspect Scriptor is asking an XY problem: "i'm trying to do X, and i think the solution is Y, how do i do Y?"

5:04 raek: you wonder what happens if you have (defn ^:dynamic *f* [] ...) and (defn g [] ... *f* ...) and then do (binding [*f* g] ...)?

5:05 amalloy: why do you want to rebind f and have it call itself? memoized self-calls?

5:06 Scriptor: something like python's decorators, have a function that intercepts the call to the function you want, do something else, and then continue the call

5:06 amalloy: blech

5:06 Scriptor: I don't think it'll do what I need anyway

5:07 raek: probably better to change to root binding in that case

5:07 Scriptor: have you checked out technomancy's robert.hooke library?

5:08 amalloy: (defn wrap-logging [name f] (fn [& args] (pr-str (cons name args)) (apply f args))) (def logged-inc (wrap-logging inc)) (logged-inc 1)

5:08 raek: its focus is a bit different from python decorators, but I think you can achieve the same thing

5:08 amalloy: or, i guess it's (def logged-inc (wrap-loggin 'inc inc))

5:08 Scriptor: raek: nope, I'm still trying to figure out if anything like decorators is even what I want

5:09 amalloy: Scriptor: the usual functional way to wrap things is just creating a function. it takes a function in, and returns a new function with the wrapped behavior (see above)

5:11 Scriptor: amalloy: yes, but that'd require changing the code that called the original function in the first place to call the HOF I just created, right?

5:12 amalloy: yes. you don't want to mutate the underlying function; it will wreak havoc with library code in general, and readability as well

5:12 Scriptor: yea, that's why I'm dropping the idea, it's hard to predict the results

5:13 no wonder everyone picks javascript as a target, its anonymous functions makes emulating some things really nice

5:18 amalloy: you're looking at it upside down: many languages provide tons of heavy tools to help you emulate functions

5:18 (i'm just trolling, mostly)

5:20 callen: amalloy: java.lang."I'm" cannot be cast to clojure.lang.IFn

5:20 amalloy: [Thrown class java.lang.ClassCastException]

5:20 s/I\'m/i\'m/

5:21 I still say -> and --> should be named little winnie and big win.

5:21 short for "winchester"

5:21 amalloy: ->>

5:21 callen: or that.

5:21 either way, loading data into a cannon and firing it.

5:22 amalloy: just makes me think of honey-loving bears

5:25 callen: I don't think that'd be a negative association to make with Clojure.

5:25 I will say this though, we need to start a petition to get Hickey to grow a beard.

5:26 Clojure cannot possibly be taken seriously until Hickey is bearded up.

5:26 kitofr: w0rd

5:27 callen: we don't want to fall by the wayside like Prolog.

5:28 http://i.imgur.com/9e9Pp.jpg not enough hair.

5:29 just found the Fogus interview, it doesn't surprise me that Hickey was a music comp major. Musicians seem to make the best programmers.

5:31 Scriptor: not the best commenters, though :p

5:32 callen: Scriptor: *scratches head and laughs* perhaps. :)

5:32 it's my greatest regret that I never really mastered a musical instrument.

5:32 Fossi: never too late :>

7:53 samaaron: afternoon all

9:03 timvisher: hi all

9:06 i seem to remember there being a function or macro that allowed me to list about a bunch of functions that were to be applied to an argument so that (f a b c d) would be become a( b( c(d)))

9:06 i that ringing a bell for anyone else?

9:06 is*

9:09 raek: timvisher: maybe 'comp'?

9:10 timvisher: raek: exactly!

9:10 thank you

9:10 :)

9:10 TimMc: timvisher: Specifically, that would be ((comp a b c) d)

9:10 raek: (comp a b c d) = (fn [& args] (a (b (c (apply d args)))))

9:19 jsabeaudry: I want to execute a sequence of actions, and I want that sequence of actions executed in a thread to be pausable, resumable or cancellable. Anyone has ideas on which facilities would be most appropriate for this?

9:23 stuartsierra: jsabeaudry: Agents can do that. Example: http://stuartsierra.com/2010/01/08/agents-of-swing

9:24 If you actually want to be able to pause a thread mid-calculation, you can't do that.

9:26 jsabeaudry: stuartsierra, thanks for writing that blog post, I'm off to devour it

9:26 stuartsierra: jsabeaudry: You're welcome. That post has frequently been useful to me.

9:47 beffbernard: How do you inspect what classes an object implements?

9:48 …through the REPL

9:52 vijaykiran: (supers java.lang.String)

9:52 ,(supers java.lang.String)

9:52 clojurebot: #{java.lang.Comparable java.lang.CharSequence java.io.Serializable java.lang.Object}

9:52 vijaykiran: beffbernard: ^^

9:57 beffbernard: vijaykiran: cool, thanks

9:58 vijaykiran: What about things that can't be casted into java.lang.Class? Like what a function implements

10:02 cemerick: ,(ancestors (class #()))

10:02 clojurebot: #{clojure.lang.AFn clojure.lang.AFunction java.lang.Runnable java.io.Serializable java.util.concurrent.Callable ...}

10:02 cemerick: beffbernard: ^^

10:03 beffbernard: cemerick: thanks

10:17 octe: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn

10:17 why would i get that when i try to use 'name' on they keyword :unknown?

10:18 i can do it in the repl, but inside my function it throws that exception on the line

10:18 printing the (class thevar) verifies that it is a keyword

10:18 printing it with println prints :unknown

10:19 tmciver: octe: name returns a string; perhaps you trying to store it in a list without quote?

10:19 TimMc: octe: Because you have a local binding called "name"

10:19 tmciver: ,((name :unknown))

10:19 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>

10:19 octe: of course TimMc!

10:19 that's the problem, hah

10:19 tmciver: TimMc: sniped!

10:19 TimMc: :-)

10:20 Experience gives you psychic powers.

10:20 octe: yes

10:20 thanks :)

10:20 TimMc: (experience in writing that same damn bug in one's own code over and over)

10:20 tmciver: TimMc: ah, that must be it. I write code without bugs. ;)

10:21 TimMc: haha

10:21 How will you ever learn, then?

10:22 gtrak`: anyone made an overtone interface for android multi-touch yet?

10:23 bitrot: gtrak`: There's TouchOSC for android

10:26 gtrak`: ah

10:28 perfect. I'm going to be having fun the next few weeks. overtone is awesome

11:11 kij: Hi, whats a good way to interact with git repos from clojure ?

11:13 vijaykiran: kij: clj-jgit

11:13 it isn't complete, but you can commit - get logs etc.

11:14 kij: vijaykiran: Perfect - thanks!

11:19 drewr: b

11:19 sry

11:55 dnolen: hmm, I don't suppose there is a Clojure style guide anywhere on Confluence

11:57 TimMc: dnolen: I've seen one for lib contributors.

11:58 Can't say as I agreed with everything.

11:58 ibdknox|away: me neither

11:58 unwrapping options is an anti-pattern

11:59 dnolen: ah http://dev.clojure.org/display/design/Library+Coding+Standards

12:00 that list could use a little more meta organization

12:03 TimMc: dnolen: http://dev.clojure.org/display/design/Library+Coding+Standards perhaps?

12:03 dnolen: TimMc: yeah I found it :)

12:07 TimMc: ibdknox|away: I wouldn't object if there were a mapply in core.

12:08 Maps are the weird two-headed uncle of the collections family.

12:53 scour: ! (+ 11)

12:54 clojurebot: (+ 1 1 1)

12:54 clojurebot: It's greek to me.

12:54 gfredericks: ,(+ 1 1 1)

12:54 scour: (π ∂)

12:54 clojurebot: 3

12:55 scour: ^^^^^-___-%%%%%%

12:57 AimHere: ,',(+ 3 3)

12:57 clojurebot: (+ 3 3)

12:57 AimHere: ,"!(+ 3 3)"

12:57 clojurebot: "!(+ 3 3)"

12:58 AimHere: Gah

12:58 mdeboard: ,(identity ಠ_ಠ)

12:58 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ಠ_ಠ in this context, compiling:(NO_SOURCE_PATH:0)>

12:58 mdeboard: :-\

12:59 ibdknox|away: TimMc: mapply? what would that do exactly?

12:59 scour: ^_^

12:59 ibdknox|away: TimMc: my problem with unwrapping option maps is that it completely breaks ->

13:00 AimHere: .(println ",(println 345)")

13:07 scour: seyton!

13:10 Luyt_: For clarity, http://dev.clojure.org/display/doc/Getting+Started+with+Cake could mention that cake and lein were merged; I learned this from the bottom answer on http://stackoverflow.com/questions/3906276/whats-the-difference-between-cake-and-leiningen

13:10 muhoo: what's the difference between comp and -> ?

13:11 dnolen: muhoo: comp is a function, -> is macro

13:13 gfredericks: (-> x foo bar) will actually call (bar (foo x)), while (comp bar foo) will just return you a function that you could pass x to

13:14 muhoo: oh, ok. thatnks.

13:15 that makes a lot of sense, hence the name "composition"

13:15 gfredericks: yep

13:16 muhoo: so instead of (defn fu [x] (-> bar baz quux)), i could do (def fu (comp bar baz quux)) ?

13:17 sorry (defn fu [x] (-> x bar baz quux))

13:17 Bronsa: yes

13:17 gfredericks: yes except in comp the order is reversed, so (comp quux baz bar)

13:17 Bronsa: but this way you'll lose some metadata

13:17 muhoo: ah, thanks

13:17 gfredericks: I think a lot of people prefer -> over comp when all else is equal, since the order is more readable

13:17 Luyt_: Hmmm, I added it myself. Long live Confluence!

13:19 muhoo: agree i, important usually is order the

13:20 Bronsa: which way loses metadata?

13:26 gfredericks: oh I think he meant using def instead of defn

13:26 muhoo: aye

13:27 gfredericks: I believe defn adds a bunch of metadata and def does not

13:30 muhoo: yep, like the source

13:32 TimMc: ibdknox|away: (mapply f a b {:c 3, :d 4}) => (f a b :c 3 :d 4)

13:33 ibdknox|away: (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))

13:33 (Dare you to make that point-free.)

13:33 ibdknox: TimMc: I see

13:33 that would be nice, but nicer would be just not unwrapping them :p

13:34 gfredericks: ibdknox: would that same argument apply to varargs in general?

13:34 TimMc: It's a Haskeller! Get him!

13:34 ibdknox: no, I don't think so

13:34 varargs aren't affected by ->

13:35 at least not in the same way

13:35 muhoo: ,guard

13:35 TimMc: (-> {:c 3 :d 4} (mapply f a b c))

13:35 ibdknox: though that's because of idiom, mechanically they have the same issue

13:35 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: guard in this context, compiling:(NO_SOURCE_PATH:0)>

13:35 * TimMc pluralizes muhoo

13:35 ibdknox: ~guards

13:35 clojurebot: SEIZE HIM!

13:38 dnolen: it's funny how often native-deps crops up

13:38 gfredericks: cljsbuild keeps having file permission problems when writing its crossovers :/

13:40 ibdknox: I've not used crossovers

13:40 so I'm no help :(

13:41 gfredericks: I've been looking at the code lately, so maybe I'll be able to diagnose/fix myself

13:45 emezeske: gfredericks: what version are you using?

13:52 gfredericks: I changed cljsbuild to set its crossover output files as RO, which made it barf the next time it tried to overwrite them X_X

13:53 gfredericks: I... released that?

13:56 gfredericks: emezeske: :plugins [[lein-cljsbuild "0.0.13"]] is what I have in my project.clj

13:56 * emezeske checks the commit history real quick.

13:57 gfredericks: cljs doesn't like two NSes in one file does it?

13:57 emezeske: gfredericks: bah! that "feature" did get released in 0.0.13

13:58 gfredericks: emezeske: at least the number was appropriate

13:58 emezeske: I probably released it on a fridy!

13:58 I should probably do a quick 0.0.14 release to fix that, that's bad...

13:58 * gfredericks wouldn't object

13:59 gfredericks: emezeske: on another note, I think my JS-API idea would work as a simple macro if cljs would allow me to emit a ns

13:59 (rather than a cljsbuild feature/add-on)

13:59 emezeske: gfredericks: oh, awesome

13:59 gfredericks: I was thinking about whether that could be a macro, but wasn't sure

14:00 gfredericks: unfortunately I want it to work right now, so I'm debating what the easiest way to do that is

14:00 I could write a cljs source file from within my macro! that'd be a totally normal thing to do

14:00 everybody writes to files from their macros

14:02 emezeske: haha

14:03 gfredericks: I just pushed a 0.0.14 branch of lein-cljsbuild

14:03 gfredericks: Might you be able to pull that down and test it?

14:03 gfredericks: you betcha

14:03 emezeske: gfredericks: I could also upload it to clojars if that would be easier

14:03 ibdknox: apparently building ocaml is extremely taxing on my poor little laptop

14:04 gfredericks: maven barfed; seems to think it can't find 0.0.14

14:05 emezeske: ibdknox: Hey, great job on your overtone thingie by the way

14:05 gfredericks: oh

14:05 you just explained that

14:05 I read the words but didn't put too much effort into inference

14:05 emezeske: haha

14:05 ibdknox: emezeske: thanks :)

14:05 gfredericks: emezeske: yes well I don't quite know how to use it otherwise; so if you want me to test, either upload to clojars or explain me how to use it from its repo

14:06 emezeske: ibdknox: I'm sure you noticed, but lots of people have been wanting to see how to put together a *simple* project like that

14:06 gfredericks: oh, I'll upload it then, one sec

14:06 shaolynn: Any VimClojure users in here? I get the following error when I try to start the REPL:

14:06 Could not determine the Namespace of the file.

14:07 emezeske: ibdknox: as opposed to some of the more.. heavy-handed massive examples of working applications that are hard to distill for a beginner

14:07 ibdknox: emezeske: yeah, that's why I built it :)

14:07 emezeske: gfredericks: okay, give it a shot now

14:08 ibdknox: You picked a cool example project, too -- not too much code, but you get a really neat result

14:08 ibdknox: Not just another blog engine or something

14:09 ibdknox: pfft who wants to build boring things? ;)

14:09 gfredericks: emezeske: Unable to resolve symbol: temp-file in this context

14:09 (cljsbuild/core.clj:147)

14:09 pbostrom: I'm wondering if I can do the following in cljs without eval or load: I have a file on my server with some forms: (def foo {:a 1 :b 2}) (def bar {:c 3 :d 4}), I want to fetch the contents of the file from my cljs app, and, well, load them

14:10 emezeske: gfredericks: derp.

14:10 gfredericks: pbostrom: so you want to use the reader?

14:10 pbostrom: or you want it to run the code as well?

14:11 if you want it to run the code, that requires the compiler and so can't be done from cljs; but if it is always of the form (def x y), then you could perhaps handle that manually without much trouble

14:12 shaolynn: problem solved - VimClojure doesn't work with clojure 1.3.0 - switched to 1.2.1 and now it's fine.

14:12 emezeske: shaolynn: I use VimClojure with 1.3, no problem

14:13 shaolynn: The jar I use is [org.clojars.oskarkv/lein-vimclojure "1.0.0-SNAPSHOT"]

14:13 ibdknox: shaolynn: that latest one does

14:13 shaolynn: emezeske: thx! I'll try that right now.

14:13 emezeske: shaolynn: actually, ibdknox I think has a better one maybe

14:13 shaolynn: (like, it might get updated ever)

14:15 gfredericks: ok, try 0.0.14 again. Since I'm dumb and didn't use a SNAPSHOT, you might need to "rm -rf ~/.m2/repository/emezeske/"

14:15 gfredericks: emezeske: what, no 0.0.14.1?

14:15 ^ joke

14:15 emezeske: O_o

14:15 gfredericks: :)

14:16 the-ignorati: how should I route a url to a static file with compojure? should I just use slurp?

14:16 gfredericks: no there's a thing or something

14:17 weavejester: the-ignorati: It depends how the file is stored

14:17 shaolynn: emezeske: it works :D

14:17 weavejester: Whether as a resource, or a literal file

14:17 * TimMc counts his versions in Gray Code: 0, 1, 1.1, 1.0, 1.1.0, 1.1.1, 1.0.1...

14:17 emezeske: shaolynn: okay, good!

14:17 the-ignorati: as a resource

14:17 weavejester: You can return a java.io.File or java.net.URL object from a Compojure route

14:17 So (io/resource "blah") will work

14:18 emezeske: TimMc: Nice, now I can use a mechanical selector for your library versions, and it will be robust

14:18 gfredericks: emezeske: I think I might be having trouble clearing the cache -- can you give me a hash for the jarfile?

14:18 emezeske: gfredericks:

14:18 TimMc: emezeske: No more bounce errors when dialing up the version!

14:18 weavejester: You can also use (route/resources "/") to serve all static resources in "/public"

14:18 emezeske: gfredericks: oh, I told you to delete the wrong dir

14:18 gfredericks: oh noes! was it my os?

14:18 emezeske: gfredericks: rm -rf ~/.m2/repository/lein-cljsbuild ~/.m2/repository/cljsbuild

14:18 pbostrom: gfredericks: I want to run the code so that foo and bar are available as symbols in my cljs app, but I'm thinking I'll have to use some workaround like read-string a giant map string or something: {:foo {:a 1 :b2} :bar {:c 3 :d 4}}

14:18 ibdknox: you just deleted /usr

14:19 emezeske: gfredericks: haha

14:19 ibdknox: gfredericks: you're screwed

14:19 emezeske: gfredericks: I forgot the jars are released under their own GIDs instead of emezeske

14:19 the-ignorati: thanks

14:20 gfredericks: alright here we go again

14:20 emezeske: work!

14:21 gfredericks: oh it totally works

14:21 emezeske: excellent!

14:21 * emezeske is embarassed that he released that bug.

14:21 gfredericks: we've all released that bug before

14:22 emezeske: ^_^

14:22 gfredericks: actually I've never written a useful library on which to release bugs

14:23 ibdknox: I accidentally pushed a version of Noir in which routes didn't work at all once lol

14:23 kind of defeats the purpose really

14:23 emezeske: rofl

14:23 makes me feel better ;)

14:23 gfredericks: git commit -a -m 'no more routes'

14:24 ibdknox: git commit -m "no ones needs to build sites anyways..."

14:25 devn: git commit -m "Remove all useful functionality"

14:26 gfredericks: makes it more secure, really

14:26 rm -rf ./* && git commit -a -m "no more bugs"

14:27 devn: haha

14:29 gfredericks: I am becoming increasingly confused as to what cljs lets you do with (ns)

14:30 (do (ns foo.bar) (defn baz [] 8)) has weird results

14:30 even though the compiler seems to treat it as a regular special form

14:31 ibdknox: it's safe to assume that you can only use (ns ..) at the top level

14:31 gfredericks: oh it defines baz in the old namespace....hrmmm

14:31 stuartsierra: `ns` is totally a special case in the CLJS compiler.

14:31 ibdknox: yeah

14:31 gfredericks: I suck at reading the compiler then

14:31 okay, back to writing to files from macros

14:32 TimMc: ibdknox: At the top level or the "top level"?

14:32 ibdknox: hm?

14:32 TimMc: ibdknox: The CLJ compiler collapses (even nested) (do ...) forms at the top level so that their contents are top-level too.

14:33 I guess CLJS isn't doing that?

14:33 ibdknox: correct

14:33 gfredericks: "doing that" HA

14:33 TimMc: HAR

14:34 devn: "Don't do dat."

14:36 emezeske: I think "top level" literally means "at the top of a file"

14:37 ibdknox: yeah

14:37 in this case

14:37 gfredericks: is it correct that the ns more or less has to be implemented that way so that goog.provide is only called once?

14:38 ibdknox: yep

14:38 gfredericks: oh well I guess you could maybe allow for more ns's per file as long as you never repeated...

14:41 ibdknox: has anyone built jark from source before?

14:53 muhoo: ~awesome

14:53 clojurebot: awesome is retiring

14:56 muhoo: heh. well, i guess this is pretty awesome: http://awesome.naquadah.org/images/6mon.medium.png note the recursion there too

14:56 * muhoo wonders when someone will write a window manager in clojure

14:56 ivan: it's too bad the java code in Clojure is a horrific mix of tabs and spaces

14:57 bsteuber: I think there should be an rcons function

14:57 sometimes one just has to append single elements to a seq, even if it is slow

14:58 and then, it should follow ->> convention

14:59 because now, I have to write

14:59 (->> xs (map foo) ((fn [xs] (concat xs [42]))

14:59 osa1: is there a way to define functions for namespace from multiple files?

15:01 devn: this Atea thing is pretty neat.

15:01 arohner: osa1: you can use in-ns or contrib.with-ns

15:01 ibdknox: but don't do that

15:01 osa1: devn: yeah, I need a KDE version of it

15:01 ibdknox: why?

15:01 devn: osa1: i was just interested to see that it was for OSX honestly.

15:02 ive never seen people take clojure and distribute as DMG with native UI stuff.

15:02 ibdknox: because you won't be able to require it

15:02 osa1: ibdknox: why? then what's `in-ns` function for?

15:02 ibdknox: you're breaking the pattern that a file exists for that namespace

15:03 ,(source ns)

15:03 clojurebot: Source not found

15:03 ibdknox: meh

15:03 osa1: it's part of what (ns ..) does, but that's primarily for use in the context of a repl

15:11 stuartsierra: osa1: Do you want to split the content of a namespace across multiple files? You can use `load` to do that.

15:13 brehaut: ivan: from memory, i think the java code in clojure is in the whitesmiths indent style.

15:14 ivan: brehaut: true. I'm just complaining about the tab/sp mix. I'll just pretend that tabs are 4 spaces or use IntelliJ's reformatter

15:16 amalloy: i don't think there's any particular named style for the atrocities in clojure's java code

15:17 Scriptor: hahaha

15:17 ha

15:17 * Scriptor cries

15:17 brehaut: lets just assume that its a disincentive for anyone to add new java code

15:18 TimMc: "ugly things should be ugly"

15:18 hiredman: I dunno, it doesn't really seem to be any more or less readable than general java code

15:18 gfredericks: TimMc: go in there and start mixing underscores and camelcase in the variable names

15:20 Raynes: amalloy: I think it's called omgwtfdude style.

15:20 brehaut: hiredman: java is a disincentive to write any more java code too though

15:21 amalloy: hiredman: have you done much java programming? maybe i'm just spoiled by having worked primarily with the much more popular K&R-based styles, but i have a terrible time reading that stuff

15:21 (compared to if it were formatted more familiarly)

15:22 brehaut: you're right though, it's pretty close to whiteheads, according to wikipedia. the main difference seems to be the curiously-placed {s

15:22 brehaut: perhaps we can blame the difference on time spent with C++ ?

15:22 weavejester: We'll probably need to wait for Clojure-in-Clojure before we can get a nicely-formatted compiler :)

15:24 aidy: is there an idiomatic way to do error handling in clojure?

15:24 dnolen: weavejester: CLJS compiler is already nicely formatted ;)

15:24 muhoo: are there any examples of music made with overtone anywhere?

15:24 TimMc: aidy: Avoiding it.

15:24 hiredman: amalloy: not a lot, and I would generally stick with a k&r style myself, the hard part about reading the compiler is not figuring out what lines up where

15:24 amalloy: *chuckle* true enough

15:24 aidy: TimMc: just returning false?

15:24 Raynes: To be fair, clojure.core isn't really nicely formatted sometimes.

15:25 amalloy: i guess the style mostly bothers me when i want to edit/commit, not just read

15:25 weavejester: CLJS hasn't been something I've looked into a lot… I have this irrational perception that it's somehow less than Clojure.

15:25 samaaron: muhoo: the best examples are in the examples dir in overtone itself

15:25 hiredman: weavejester: well, it is

15:25 Raynes: Well, I guess I can't say it isn't formatted nicely. Just inconsistently.

15:25 samaaron: muhoo: there are other bits and pieces linked in the mailing list

15:25 TimMc: aidy: What I mean is, it isn't idiomatic to catch and inspect exceptions in Clojure.

15:25 Raynes: There is some vim-like indentation in there as well as plenty of Emacs-like indentation.

15:25 TimMc: aidy: You can throw them all you like.

15:25 samaaron: muhoo: one day we hope to have a gist-like site for people to place/reference/showcase their overtone sources

15:25 aidy: TimMc: okay :)

15:26 amalloy: i kinda feel like TimMc is talking nonsense, aidy. catch the exceptions you need to catch

15:26 Raynes: TimMc makes nonsense sound like sense.

15:26 aidy: amalloy: talking about signalling an error though

15:26 TimMc: Hmm.

15:26 dnolen: weavejester: there's a lot there including a sensible analyzer written in Clojure that emits the beginning of something that could be generally consumed by tools

15:27 TimMc: aidy: The trouble is distinguishing recoverable and non-recoverable exceptions. The Java throwable system is not great for that.

15:27 weavejester: I have been meaning to get around to looking at CLJS...

15:27 TimMc: aidy: I *do* recommend looking at slingshot and friends if you want to do that.

15:27 brehaut: aidy: the right tool for signaling the error kind of depends on the context. exceptions can make pure functional code a bit more awkward. on the other hand, they can make side effecty / io-ish code much clearer

15:28 hiredman: the internals of cljs are nicer, but thats really all there is

15:28 dnolen: weavejester: it's also not that tied to CLJS, someone with some free time could easily make it pluggable to emit something else

15:28 hiredman: js isn't really a nice platform

15:29 it's a target of necessity

15:29 dnolen: hiredman: not just the internals, you start with a larger chunk of the language available.

15:30 hiredman: not sure what other platform it should have targeted that useful to most people.

15:30 aidy: breh

15:30 TimMc: thanks I'll look into that

15:30 hiredman: dnolen: thats what I meant by "target of necessity"

15:30 aidy: brehaut: it's db code indeed

15:30 dnolen: hiredman: ubiquity factors into nice, same as the JVM

15:30 hiredman: not so

15:31 dnolen: hiredman: for you

15:32 brehaut: aidy: depending on your DB, you might already be having to handle exceptions. It'd be silly to have two mechanisms to worry about

15:32 hiredman: on jvm in many cases you can make different decisions on how to handle things from what java made

15:33 with js you are tied to js or more code to execute to emulate waht you want in js

15:33 aidy: brehaut: true

15:33 dnolen: hiredman: you have same problems on the JVM - protocols vs. interfaces

15:37 hiredman: dnolen: sure, I am not saying everything is 1:1 on the jvm, I am saying the jvm is a great known platform with all kinds of tools and libraries etc, while js has stuff in the pipeline here and there by and large it sucks, and isn't a great platform, except somehow it's everywhere

15:38 the ubiquity is the only selling point of js as a platform

15:38 which is kind of sad, you'd hope something that is everywhere would have a compelling reason for being everywhere

15:39 weavejester: hiredman: If that were true we'd all be using Lisp Machines or Plan 9 ;)

15:39 dnolen: hiredman: JS is reasonably fast, has tools, libraries - it's telling that it simpler to debug ClojureScript in many cases.

15:39 Raynes: I'm waiting for the dnolen hiredman deathmatch at Conj 3.

15:39 hiredman: dnolen: I find that unlikely

15:41 dnolen: hiredman: I've yet to have a good debugging experience in CLJ, in CLJS I can just look at the emitted source and using a real stepping debugger.

15:41 hiredman: dnolen: on clj I can just look at the emitted bytecode

15:42 (to be fair I've only ever had to do that once for work)

15:42 muhoo: samaaron: i meant ogg/mp3 files not source

15:42 samaaron: muhoo: not yet

15:42 dnolen: hiredman: you're making my point for me, in browser debugging tools for JS are pretty good now.

15:43 samaaron: who needs debugging? println FTW! (ducks for cover)

15:43 dnolen: hiredman: that said, I don't think debugging emitted source is a good user experience either just an improvement for me. Would prefer a sexpr level debugger.

15:43 hiredman: dnolen: and your making mine for me, the only reason js is a reasonable target is because you know js

15:43 Scriptor: but you'll still have to manually trace the js line to the clojure line, right?

15:43 weavejester: println has a few things going for it :)

15:44 hiredman: which of course you get on the jvm for free in stacktraces

15:44 not that people read stracktraces anyway

15:45 dnolen: Scriptor: yes, but a good set of things are in place to do source mapping - we already track line #s for all top levels.

15:45 Scriptor: nice

15:47 aperiodic: hiredman: why did you need to look at the bytecode? just curious because i've always found debug

15:47 debug-repl to be sufficient

15:49 hiredman: a complication deriving from a runtime require, compile time var resolution, and aot compilation

15:51 aperiodic: ah. sounds messy

15:52 hiredman: well, as soon as I saw the string constant in the byte code was the wrong namespace the lightbulb clicked

15:53 aperiodic: but you wanted it to be from the namespace that was being required at runtime?

15:53 hiredman: yes

15:57 aperiodic: neat, i should try to replicate that sometime

16:00 rplevy: is there an existing script/tool to poll changes to files and then re-running lein-cucumber? it would be easy to roll one in a second, but maybe someone has already made something nice with growl integration and such...

16:07 samaaron: are there any linux/windows users in here interested in tryign clj-processing out?

16:09 pjb3: Hello, I'm looking to process a bunch of records from a SQL DB table

16:09 I'd like to do something similar to ActiveRecord's find_each, in case anyone is familiar with that

16:09 http://api.rubyonrails.org/classes/ActiveRecord/Batches.html#method-i-find_each

16:10 which calls a function once for each row in a result set

16:10 but it doesn't do "SELECT * FROM huge_table"

16:10 and then call it on each in the result

16:10 it does "SELECT * FROM huge_table WHERE id > ? and id < ?"

16:11 where on the first batch, you use 0 and 1000, then 1000 and 2000, etc.

16:11 so you avoid loading the entire dataset into memory, but you don't execute a separate query for each row either

16:11 seems like a perfect use case for a lazy seq

16:11 does something like this already exist?

16:12 compj: should not be too hard to implement, look at lazy-cat

16:12 pjb3: Like, here's a SQL query, order it/paginate it by the primary key?

16:13 compj: ok, thanks, yeah, didn't think it would be too hard, just wanted to check to see if there's already something for it in clojure.contrib.sql that I was missing

16:14 compj: just for the information, you might like clojureql being a nice db api

16:20 hiredman: stuartsierra: http://groups.google.com/group/clojure-dev/msg/37df97495f0cea16?hl=en

16:20 stuartsierra: are you volunteering?

16:21 We can add contrib committers.

16:21 muhoo: do hiredmen volunteer? or do they need to be.... hired?

16:22 nickmbailey: < guy that sent the email here btw

16:22 stuartsierra: do you want to be a contrib committer?

16:22 nickmbailey: sure

16:23 i wasn't sure what kind of bar was set there since I've only fixed the few jmx bugs

16:23 but i will gladly help out with the jmx lib

16:23 stuartsierra: email clojure-dev with a clear subject line

16:23 say you're volunteering to take over maintenance of JMX. You've signed a CA right?

16:23 nickmbailey: yep

16:23 will do

16:24 stuartsierra: great!

16:25 hiredman: excellent

16:34 TimMc: stuartsierra: Is there a list of contribs that need a maintainer and are in demand?

16:34 stuartsierra: TimMc: That would be most of them.

16:35 TimMc: clojure.contrib.complex-numbers?

16:35 ckirkendall: dnolen: David I saw you comments on the binding and vars in clojurescript. I was wondering if people we also aware that "let" has similar issues with async code.

16:35 TimMc: ckirkendall: let in CLJS?

16:36 ckirkendall: yep

16:36 TimMc: phew

16:36 ckirkendall: TimMc: phew for you :)

16:36 dnolen: ckirkendall: I don't see how you could encounter than problem outside of loops

16:36 ckirkendall: dnolen: I not saying the issue exists outside of loops

16:36 dnolen: ckirkendall: and loops in CLJS are handled

16:37 ckirkendall: dnolen: if you do a doseq and let inside with a settimeout you get the last binding

16:38 dnolen: ckirkendall: shouldn't be the case on master, if it is then it's a bug

16:38 ckirkendall: was this fixed recently as in the last week

16:39 dnolen: ckirkendall: there's an old ticket for it that I fixed, please include the case that fails

16:39 ckirkendall: no months ago

16:42 ckirkendall: dnolen: hmmm

16:42 dnolen: I have a test case that shows the issue but I need to clean it up a bit

16:43 dnolen: ckirkendall: I just tested the basic case and it works just fine

16:43 ckirkendall: I'm curious what your example case looks like.

16:46 ckirkendall: dnolen: (doseq [x (range 1 20)] (let [y x] (js/setTimeout #(.log js/console y))))

16:47 you get 19 - 19 times

16:50 dnolen: I can dig into what is going on just didn't know if you were aware

16:51 dnolen: ckirkendall: that's actually an interesting problem.

16:52 ckirkendall: if you just used x it would work, since is a x loop binding

16:54 ckirkendall: dnolen: it seems to exist anytime you are referencing directly or indirectly the loop binding in the let binding.

16:54 dnolen: ckirkendall: not even sure if that can be solved in a good way w/o dependency analysis

16:57 TimMc: ckirkendall: What does that expand into?

16:57 dnolen: ckirkendall: actually, this one is probably easy. If we're in a loop context we could just automatically preserve any internal locals found inside fns

16:57 ckirkendall: currently only loop locals belong to that list, we should include anything introduced by internal lets as well

16:58 ckirkendall: dnolen: yes I think that is the issue

16:58 dnolen: ckirkendall: please open a new ticket w/ your case

16:58 ckirkendall: will do

16:58 TimMc: What does what expand into?

16:59 TimMc: ckirkendall: I was curious what JS was generated by that CLJS snippet you pasted at :46

16:59 if you happened to have it on hand

17:00 ckirkendall: TimMc: give me a sec I have it

17:00 dnolen: what should we title this ticket so it make sense

17:00 dnolen: TimMc: it converts into a while loop w/ (JS) var renaming

17:01 ckirkendall: let scoping broken inside loop/recur

17:01 ckirkendall: shouldn't be to hard are you going to take a crack at it?

17:03 ckirkendall: dnolen: I won't get a chance to even look at it before this weekend but I give it a shot

17:03 dnolen: I noted it was only for async calls that this case caused problems

17:05 dnolen: ckirkendall: if it looks like a quick one I might get to it later this evening

17:05 ckirkendall: dnolen: cool

17:38 muhoo: heh, i thought clj java tracebacks were impenetrable, but the stuff that floats back and forth in firebug in cljs is even weirder: https://refheap.com/paste/794

17:40 mgm7734: I wish people would use namespaces as intended. Try to find the repository for clj-oauth.jar: there are 6 different implementations and you can't tell which corresponds to a given jar.

17:41 muhoo: file a bug with the maintainers of those packages?

17:42 emezeske: mgm7734: It's also unfortunate when people forget to fill in the :url in their project.clj

17:42 mgm7734: Clojars will display that URL on the JAR page if it's filled in

17:44 mgm7734: File a bug with all 6 implementers? I'm way too lazy

17:44 emezeske: mgm7734: Write a blog post explaining the intended use of namespaces, and link it where they might read it? ^_^

17:45 mgm7734: I know I'd be interested to read such a post

17:45 mgm7734: Or, just find clojure related chat rooms and start bitching?

17:45 ;)

17:46 ibdknox: In the beginning there was one file...

17:46 emezeske: Well I'll admit that's effective for steam-blowing

17:46 mgm7734: The purpose is the same as hierarchical domain names on the internet.

17:47 To give everyone control over a piece of the nameuniverse

17:48 Scriptor: why does emacs keep going into hi-lock-mode

17:49 even after I turn it off

17:52 callen: muhoo: @traceback: @_@ "MOONSPEAK"

17:53 muhoo: mgm7734: do you have a list of the names of the 6 packages? maybe someone else (me perhaps even) could email them all for you

17:53 technomancy: muhoo: that kind of thing could be automated with clojuresphere data

17:55 emezeske: technomancy: Is that something lein could warn about? Compare the project's group-id with the files that end up in the JAR?

17:56 technomancy: "Reduce the time required to build the JDK and enable incremental builds by modifying the Java compiler to run on all available cores in a single persistent process" <- http://openjdk.java.net/jeps/139

17:56 emezeske: yeah, sure. maybe start a thread proposing it?

17:57 devn was complaining about that a few days ago; maybe he could write it =)

17:57 emezeske: technomancy: sure. I'll read up on the topic a bit first; I'm not an expert in java stuff

17:57 hiredman: complaining about what exactly?

17:57 that jar names don't match namespace names?

17:57 technomancy: hiredman: "it's hard to guess what to require when library authors do crazy things"

17:57 emezeske: hiredman: basically, group ids differing from provided namespaces in JARs

17:57 technomancy: afair

17:58 emezeske: yeah, what technomancy said

17:58 hiredman: emezeske: group ids or artifact ids?

17:58 technomancy: personally I would rather just have tab completion on require and ns calls

17:58 emezeske: hiredman: the combination, I think

17:58 technomancy: warnings are easier to implement, but don't apply retroactively

17:58 emezeske: technomancy: well, and people can ignore them

17:58 muhoo: it bit me too. i was confused why jar names and ns were orthogonal at times. but then, i see the same thing in java-land, so it's not a clojure thing.

17:58 hiredman: lein tends (and most clojure projects) have the same group id and artifact id

17:59 technomancy: enlive is weird because it has a normal group-id but a reverse-domain namespace

17:59 muhoo: i have plenty of java libs called FooBar-1.9.jar or similarr, when the java ns is like com.blah.doh.foobar

17:59 hiredman: emezeske: clojure namespaces and the maven repo namespace are not the same thing

17:59 technomancy: usually it's either both or the other way around

18:00 emezeske: hiredman: hmm, I should do more reading on the topic, I think I'm out of my depth

18:01 muhoo: clojuresphere is very cool, thanks for whomever did that.

18:01 ibdknox: it just needs to crawl more often :)

18:02 devinus: Before

18:02 emezeske: ibdknox: seconded!

18:02 technomancy: you can run it locoally

18:02 heh

18:02 locally

18:03 hiredman: it would be interesting to have lein extract class/namespace information from dependencies and keep an index that could be injected into, say emacs, for completion purposes

18:03 devinus: insertBefore

18:03 oops

18:04 technomancy: hiredman: yeah that would be slick

18:04 hiredman: *cough*

18:04 muhoo: and integrate that with pomegranate

18:04 technomancy: we should talk someone into writing such a thing

18:04 * technomancy glances around

18:04 muhoo: so if you reference a namespace that isn't available, it can pull down the clojar for you :-)

18:04 hiredman: first thursday is coming round

18:04 technomancy: there would be a leiningen sticker in it for whoever implemented such a thing, that's for sure

18:05 possibly two

18:05 brehaut: technomancy: how much work would that be?

18:05 kij: Hey. Is there an good way to pull out multiple fields from an java object. Like the reverse of an doto. EX: (map #(vector (.getFullMessage %) (.getCommitTime %) ) (git-log repo))

18:05 brehaut: technomancy: (for someone who hasnt worked on lein at all)

18:05 technomancy: brehaut: wiring the completion into slime might be difficult. making it available textually in the repl would be a few hours of work I'd guess

18:06 muhoo: look, i'd be happy for a database somewhere. on clojars, on clojuresphere, somewhere

18:07 brehaut: if someone was willing to give me a hand, id like to contribute to lein in some way

18:07 bsteuber: kij: there's a nice new contrib lib for java interop: https://github.com/clojure/java.data

18:07 technomancy: muhoo: you should check out the clojuresphere codebase; it's pretty approachable

18:07 brehaut: can I pm?

18:07 * muhoo clones

18:07 bsteuber: kij: well from-java is like an extendable, recursive bean

18:08 kij: so it can cast your obj into a map and you can use all clj goodies ta take many

18:08 if that's not too slow for you

18:09 (map [:full-message :commit-time] (from-java log)) seems pretty clean to me

18:10 erm the arguments must be swapped

18:11 kij: bsteuber: That does indeed look more pleasent. Thanks!

18:12 muhoo: heh, i keep reading prn-str as porn-star

18:12 Bronsa: lol

18:12 your dirty mind

18:12 hiredman: technomancy: you've seen https://github.com/cosmin/class-finder?

18:13 bsteuber: kij: you can stick to plain old bean, though - but I don'e really like that anymore

18:13 muhoo: Bronsa: nothing dirty about it; it's a friend's band's name

18:13 technomancy: hiredman: I hadn't seen that; handy

18:14 hiredman: has a bizarre amount of java code

18:15 kij: bsteuber: and you lost me. Sorry, old beans ?

18:16 pbostrom: ,(def (symbol "foo") "bar") ;seems like it would work

18:16 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

18:18 muhoo: heh (def graph-data-file "project_graph.clj")

18:18 the whole project database is stored in a clj file, and committed to git!

18:18 bsteuber: kij: there's a function called bean turning a java object into sth. map-like already

18:18 muhoo: all like 16MB of it

18:19 bsteuber: kij: but from-java is better ^^

18:21 technomancy: muhoo: yeah, the checking-stuff-in part is crappy

18:24 kij: bsteuber: from-data it is!

18:28 muhoo: technomancy: git rm -f project-graph.clj

18:29 but i can see why he'd want the file available when people check out the codebase, so that they don't have to run a crawl and populate the whole db just to make the thing work

18:29 technomancy: muhoo: yeah, it's a caching issue. it would be better to keep on s3, but then deployment would involve another set of credentials.

18:30 muhoo: what's his goal here? to have it be one database, or to let people fork it and have a million clojurespheres running around?

18:31 technomancy: long-term: the data should just be exposed via clojars.org

18:32 clojuresphere would just be a library that clojars uses

18:32 short-term: I think he'd prefer it if changes made their way back upstream

18:34 muhoo: if the data is exposed read only, i can't see why not put onto s3 with -M -P and let everyone read it from there

18:34 callen: anyone else who's watched the clojure conj videos gotten tired of the musical jingle in the intro?

18:34 muhoo: if it's going to be read-write, then you're going to have to deal with credentials somehow anyway

18:34 technomancy: muhoo: yeah, that would make sense

18:35 Nathell: ,(eval `(let [f# (with-meta #(do %) {})] f#))

18:35 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

18:35 technomancy: muhoo: jkkramer is pretty responsive; you should open an issue on the gut hubs

18:35 muhoo: it's always fun to remember that clojurescript is still javascript: what should this do? (+ [1 2 3])

18:35 Nathell: meh, no luck

18:36 muhoo: &(+ [1 2 3])

18:36 lazybot: java.lang.ClassCastException: Cannot cast clojure.lang.PersistentVector to java.lang.Number

18:36 muhoo: of course. but, not in cljs...

18:36 it does... something else.

18:37 Scriptor: wha does it do?

18:37 muhoo: Scriptor: try it :-)

18:38 Scriptor: man, now I need to get a cljs repl set up

18:38 muhoo: it's fun, and worth the 2 minutes.

18:39 technomancy: thanks, will do.

18:39 Nathell: &(eval `(let [f# (with-meta #(do %) {})] f#))

18:39 lazybot: java.lang.SecurityException: You tripped the alarm! eval is bad!

18:39 * muhoo whacks eval over the nose with a rolled-up newspaper

18:39 muhoo: bad eval, bad!

18:39 (eval whimpers)

18:40 Nathell: muhoo: lol. anyway it doesn't work with clojure 1.3 and I can't see any reason why it shouldn't

18:41 muhoo: cljs is a little too bleeding-edge for my tastes, but stuff like fetch, and ibdknox's overtone tutorial, is so goddamned cool that i keep getting tempted into playing with it.

18:43 Nathell: i tried it on 1.3 and it gave me #< clojure.lang.AFunction$1@380fe8c4>

18:43 i have no idea what it is supposed to do, thou

18:47 Bronsa: works fine for clojure HEAD too http://i.imgur.com/UsHq1.png

18:49 Nathell: ok, i meant this one: (eval `(let [f# ~(with-meta #(do %) {})] f#))

18:50 triggers an ExceptionInInitializerError

18:51 a closure with metadata on it is created and smuggled inside the let form passed to eval

18:51 hiredman: :(

18:51 don't do that

18:52 a function object is not an s-expression, don't pass it to eval

18:52 Nathell: shouldn't it evaluate to itself?

18:53 it used to in 1.2.1

18:53 hiredman: Nathell: why should it?

18:53 technomancy: most JS environments actually have a really nice decompiler

18:53 but Clojure does not

18:54 hiredman: technomancy: well, they are interpreted, they don't decompile anything

18:54 they keep the soure around

18:54 amalloy: Nathell: functions happened to work in eval (and macroexpand) in very limited circumstances under 1.2. it was never a good idea to actually do it on purpose

18:55 technomancy: I thought they were able to work backwards from compiled functions, but I may be confusing that with their pretty-printing behaviour

18:55 amalloy: and that wasn't a closure with metadata - it was just a function with metadata. closures didn't work in 1.2, even. eg, stuff like (let [x 1] (eval (fn [] x)))

18:56 technomancy: amalloy: depends on whether fn resolves to clojure.core/fn or serializable.function/fn =P

18:58 amalloy: &(->> ' ^:x (foo bar) (rest) (cons 'baz) (meta))

18:58 lazybot: ⇒ nil

18:59 amalloy: aw. i thought those might preserve meta

19:00 Nathell: amalloy: (let [x 1] (eval (fn [] x))) works in 1.2

19:01 the way I'd expect

19:02 amalloy: does it? that's a bit surprising. anyway, you really shouldn't do that or rely on it. macros and eval are for code (ie, sexps), not objects (eg, functions)

19:02 technomancy: Nathell: it's catching an earlier (def x 1)

19:03 oh wait

19:03 no, it's just that the eval is still in the let block

19:03 amalloy: technomancy: doesn't matter

19:03 technomancy: never mind; misread

19:04 right; if it works, it works by accident rather than by design

19:04 amalloy: right

19:04 though those four misfires in a row remind me of those days when i should have just stayed in bed

19:06 aperiodic: the local x shouldn't matter because eval only cares about vars in the namespace?

19:07 Nathell: aperiodic: eval never sees the x, it gets a function objects

19:08 aperiodic: ah, right

19:08 hiredman: clojure doesn't have reified environments, forms passed to eval or effectively always eval'ed at the toplevel in the given namespace

19:08 are

19:08 Nathell: okay, thanks, understood.

19:09 aperiodic: that's what i was after, thanks

19:09 technomancy: if you quote the fn, it'll break

19:09 sritchie: Raynes: have you had any issues with lein newnew and Leiningen 1.7.0?

19:10 "lein templates" is working properly, but "lein new cascading projectname" is generating a basic project named "projectname" with a namespace of "cascading.core"

19:11 Nathell: i'm just toying around, anyway, so if the toy relies on 1.2's behaviour it doesn't matter.

19:12 sritchie: technomancy, you might know better w/ this

19:12 technomancy: sritchie: it may be that user-level plugins are getting placed too low on the classpath. is this a problem with 1.6.2?

19:13 sritchie: nope, everything worked fine w/ 1.6.2, lein-newnew overrode the lein new task

19:13 technomancy: ok, could you open an issue then?

19:13 might have to get a 1.7.1 out before 1.7.0 is officially announced

19:13 sritchie: sure, on leiningen

19:13 I'll do it now

19:14 * technomancy will be very happy when the user-level plugins dir goes away

19:17 sritchie: technomancy: done, thanks! https://github.com/technomancy/leiningen/issues/415

19:19 kij: Hey, i can only find java.data on oss.sonatype.org, how can i add that to leiningen repositories?

19:20 nwm, found :repositories

19:26 and the cake was an lie, is java.data gone?

19:28 nollidj: what is the up-to-date way to depend on bits of clojure-contrib? i've been out of the loop since 1.2, and i am uncertain as to how to depend on contrib libraries in a lein config. i'd like to try out clojure.contrib.graph, but i don't see "graph" anywhere at https://github.com/clojure

19:29 thearthur: I need to tell leiningen not to use ~/.m2 as its local maven repo and settings,

19:29 can I pass maven options to leiningen?

19:32 technomancy: thearthur: I'm not sure if this is supported. what's the use case?

19:32 brehaut: ~contrib

19:32 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

19:32 brehaut: nollidj: ^

19:33 ibdknox: my googling is failing me, does anyone know what necessary for a script to be used as a #! interpreter? I can't figure out how input is passed in

19:34 brehaut: i was sure it was just stdin

19:34 ibdknox: calling read doesn't seem to do anything

19:35 I can't get the jark client to do the right thing, so it seemed like I could trivially write an nrepl client as a node script :)

19:36 technomancy: I couldn't get jark to build when I tried it a few months ago =(

19:36 replaca: how hard would it be to write a pprint dispatch for defproject?

19:36 ibdknox: technomancy: I couldn't either, ended up doing some magical things to make it work

19:37 nollidj: brehaut: thanks. so it looks contrib.graph has no maintainer. but the docs on the clojure-contrib api reference still refer to it. is this because the docs are out of date?

19:37 technomancy: also, anyone want to try lein-swank 1.4.1-SNAPSHOT before I cut a release?

19:37 ibdknox: I kept getting assumption mismatches

19:37 removed the included camlp5 dep and used my own

19:37 that somehow made it work

19:38 technomancy: the whole ocaml build chain makes me depressed

19:38 it's all "I HOPE YOU LIKE APT_GET BRO"

19:39 hiredman: but, hey, guys, there is a bencode encoder/decoder for ocaml, so it's cool

19:39 ibdknox: unfortunately I don't know ocaml well enough/don't really want to, to try and fix whatever is broken in the client

19:40 technomancy: I've spent an order of magnitude more time screwing with ocaml builds than I have actually writing code

19:40 ibdknox: I got that feeling

19:40 which is why I am now avoiding it :)

19:41 technomancy: did you try downloading the precompiled client though?

19:41 ibdknox: yeah

19:41 it didn't work at all

19:41 technomancy: oh

19:41 ibdknox: talked to the guy, he said there was a bug that he fixed

19:41 so I tried building it

19:41 lol

19:41 technomancy: ಠ_ಠ

19:41 ibdknox: got it built, it does slightly more, but doesn't seem to work still

19:41 brehaut: i really hope my released projects arent causing anyone this amount of pain :S

19:41 hiredman: but guys, bencode!

19:41 ibdknox: lol

19:42 technomancy: brehaut: to be fair, it isn't being offered as either stable or a release

19:42 ibdknox: jark is such a fun idea

19:42 I want to be able to write clojure scripts :p

19:42 brehaut: technomancy: sure, but some of mine are :S

19:43 technomancy: ibdknox: and I want to be able to delegate "lein interactive" so I don't have to maintain it mysef =\

19:43 ibdknox: yeah

19:43 I'm not sure I understand why this isn't just written in Clojure

19:43 the client can't be

19:44 technomancy: there's ocaml in the server‽

19:44 ibdknox: the server was implemented as a plugin I thought

19:44 ah, just starting it is

19:46 thearthur: technomancy: our build systems have a .m2/settings file that is configured to ONLY build our product

19:46 technomancy: leiningen can't run on this box with that settings file in place

19:46 if I move it then leon works and our product can't build

19:46 s/leon/lein

19:48 technomancy: you could try tweaking leiningen.util.maven/make-settings I guess

19:50 pyr: ibdknox: it's definitely stdin

19:50 ibdknox: hm

19:51 I must be doing something wrong then

19:52 pyr: ibdknox: i agree that on paper node.js + cljs sounds like a nice script in clojure solution

19:52 ibdknox: ah actually, I just want a node script to run something that sends stuff to the jark server

19:52 so it'd be clojure

19:52 technomancy: I dunno; node isn't packaged very widely yet, plus it's changing at a fairly rapid pace.

19:52 ibdknox: I just need an intermediary

19:52 thearthur: is there an environment variable that controls where maven looks for it's local repo?

19:52 ibdknox: this is just so I can play :p screw everyone else!

19:52 technomancy: so instead of dropping a single binary into bin, you've got to drag a bunch more runtime with you

19:53 hehe

19:53 carry on then =)

19:53 ibdknox: hehe

19:53 technomancy: thearthur: IIRC maven honors M2_HOME, but I have no idea if maven-ant-tasks checks it

19:56 ibdknox: I guess I could learn haskell and see if kotarak's new vimclojure client will work :)

20:16 aperiodic: technomancy: i'm getting a NPE when i try to lein deploy (never had any issues deploying this project before)

20:18 technomancy: aperiodic: lein 1.7.0?

20:19 aperiodic: technomancy: 1.6.1.1

20:19 technomancy: can you try the latest?

20:20 aperiodic: technomancy: it's the exact same NPE as this issue: https://github.com/technomancy/leiningen/issues/350

20:20 technomancy: sure

20:23 technomancy: upgrading did the trick!

20:23 technomancy: great

20:37 bsteuber: just read the william byrd interview

20:37 that guy must really be into macro hygene

20:38 technomancy: bsteuber: no idea what his deal is

20:38 he really wants Clojure to solve problems that only occur in CL?

20:39 bsteuber: yes to me it also seems rich solved "all problems" in that area

20:40 so either he didn't really get the clojure system

20:40 or I am overlooking something

20:40 technomancy: his conj talk made me suspect he hasn't spent a lot of time in Clojure

20:41 bsteuber: or maybe he just thinks #-suffixes are ugly :)

20:41 technomancy: http://p.hagelb.org/riker.gif

20:42 ...is all I have to say

20:42 bsteuber: lol

20:42 technomancy: I'll be here all week

20:42 aperiodic: i can't help but note that the last four letters in your site's domain + TLD are borg...

20:43 technomancy: uh oh... the secret is out.

20:43 ~guards

20:43 clojurebot: SEIZE HIM!

20:43 * aperiodic greps leiningen source

20:43 aperiodic: hmm, don't see any references to the assimilation of all life-forms

20:58 TimMc: Putting var metadata maps between the doc-string and args: Terrible style or excellent style?

20:59 (defn foo "Does stuff" {:since "1.4.5"} [x] (str x))

20:59 instead of

21:00 (defn ^{:since "1.4.5"} foo "Does stuff" [x] (str x))

21:00 pipeline: depends on indenting ?

21:01 TimMc: Well, if there's a crapload of metadata, I'll definitely do the format.

21:01 *former

21:01 The latter, (defn ^metastuff name \n ...)

21:02 aperiodic: i had no idea you could do that

21:02 i vote for excellent style

21:03 TimMc: Just a couple minutes ago I realized I had forgotten to put :since on a public API fn, then discovered I had done it in the former style.

21:03 So, there's something to be said for the latter, which is more well-known.

21:05 bsteuber: technomancy: just had to leave a comment for Mr. Byrd :)

21:08 brehaut: TimMc: somehow i knew you could put the metadata for functions after the docstring, and yet have always done the former despite not liking it.

21:09 bsteuber: first time I see a page ordering comments not by date per default

21:16 Wraithan: So redis-clojure seems to be the blessed lib on redis.io but clj-redis appears to have more complete support of features... are there other ones I should be aware of, preferably something with docs and pub/sub support?

21:21 aperiodic: Wraithan: i'd recommend using clj-redis. can't vouch for the pub/sub personally, but it's there

21:30 Wraithan: ok

21:30 It is unfortunate that is has no docs

21:31 aperiodic: thanks

21:33 aperiodic: Wraithan: should be pretty simple to use... get a connection with redis/init, and pass that as the first arg to any command; the rest of the args are what you'd expect for that redis command

21:34 Wraithan: if you have any issues feel free to ping me here and i'll do my best to help

21:34 Wraithan: aperiodic: simplicity or code are not an excuse for no docs. For example, I have to look up the connection args to verify what they are called.

21:35 I'll probably fork it and fix the documentation problem. Once I get used to using the lib.

21:36 aperiodic: Wraithan: I was about to suggest that ;). Awesome!

21:37 Wraithan: Though I am in disagreence with most of the community in that so far all the docs I've seen are monolithic .md files viewed on github. Something like sphinx where you can host on readthedocs.org or something is much preferable and looks far nicer with ToC and such

21:38 I'm new to clojure though, so maybe I am wrong and you guys have a service that is like that, but in my experience that doesn't exist.

21:39 aperiodic: well, good clojure libraries should provide docstrings for all of its functions, which can be accessed in the repl with (doc some-fn)

21:40 clj-redis doesn't have any docstrings, though

21:40 Wraithan: Which is still not real docs.

21:44 brehaut: Wraithan: marginalia is a relatively common tool for better docs, although if you want it all split up you'll probably be disappointed.

21:44 ibdknox: codox ftw

21:44 brehaut: Wraithan: however, a lot of clojure libraries (even complex ones) are small enough to not need to be split into multiple pages

21:45 Wraithan1: I don't think that is true at all

21:45 There are things like dev docs, so you can say recommended practice for contributing and lib docs, they should be separate

21:45 also having a ToC is really handy

21:46 As well as install, as well as tons of other little caveats that come up

21:48 brehaut: For python, sphinx lets you use docstrings and embed them in your docs

21:49 brehaut: im quite familiar with the out put of sphinx / python. djangos docs for instance are a popular example

21:53 i do agree that as a community we could do better at documentation, i dont think its as dire as you make out.

21:54 for one thing, its rare that a libraries installation is more complex than adding a dependancy to your project.clj

21:54 vs python where packaging and dependancy resolution are only a semi-solved problem

21:54 Wraithan: Its a mostly solved problem unless you have C deps.

21:55 pip install blah

21:55 brehaut: i use python for my day job. pip has not solved the problem.

21:55 Wraithan: brehaut: But I do see your point about the installation, doesn't mean you shouldn't document it. It only takes a minute to do so and verifies that your lib is one of the simple to install ones.

21:55 brehaut: certainly not to the extent as lein / maven

21:56 it does mean you dont need a whole page devoted to installation though

21:57 Wraithan: You say whole page like it is a big deal. You say you are familiar with sphinx, a 'whole page' is create a single file and reference it from your TOC

21:58 brehaut: But we can agree to disagree on this point.

21:58 brehaut: i dont agree to disagree

22:01 jtoy: can someone point me to the concept of building 2 out of 3 factors in software speed/completion/ i forget the 3rd , my google skills are bad today

22:02 brehaut: good fast cheap ?

22:02 Wraithan: brehaut: ok, that is fine too

22:02 amalloy: working, beautiful, fast?

22:03 i just made that one up but it's solid gold

22:03 seancorfield: jtoy: http://en.wikipedia.org/wiki/Project_triangle ?

22:03 ibdknox: it's usually defined as cost, scope, and time

22:03 Wraithan: Cheshire is the recommended json lib?

22:03 brehaut: amalloy: thats not a triangle though is it? thats a process

22:04 ibdknox: Wraithan: yeah

22:04 amalloy: naw. if it works and is fast, it ain't beautiful

22:04 ibdknox: lol

22:04 amalloy: if it's beautiful and fast, it probably doesn't work

22:04 Wraithan: ibdknox: thanks

22:05 jtoy: yes, thanks

22:05 ibdknox: I don't think I've worked anywhere that has fully understood those tradeoffs

22:06 despite the fact that they were talked about at great length :p

22:06 hiredman: https://gist.github.com/1880975 for poping up an emacs buffer narrowed to a single top level form from a namespace

22:06 brehaut: ibdknox: sales or marketting always think they are immune ;)

22:07 ibdknox: brehaut: and it wasn't always just them ;)

22:07 brehaut: ibdknox: lol

22:08 muhoo: fast, cheap, or reliable, pick any two

22:08 brehaut: ive never worked in a place where there was any way that they could be eliminated as a variable :P

22:08 ibdknox: Microsoft was big enough that those guys were relatively foreign concepts, though that was less true toward the latter part of my tenure there

22:09 brehaut: yeah ive never worked anywhere that large

22:09 (by orders of magnitude)

22:10 ibdknox: guessing game time :D How many people do you think worked on VS?

22:11 brehaut: well, i think x-code is about 4, so im going to say 50

22:11 ibdknox: other guesses from the channel?

22:11 aperiodic: 30

22:11 * ibdknox grins

22:11 aperiodic: we could play binary search

22:12 ibdknox: The VS alias had over 2000 people on it

22:12 aperiodic: woah

22:12 brehaut: does that include all the language guys?

22:12 also: explains a lot

22:12 ibdknox: they make up a very small portion of it actually

22:12 but yes

22:12 Now the best one, how many LoC is VS?

22:12 brehaut: 20 million

22:13 wait

22:13 too few zeros

22:13 200

22:13 ibdknox: 200 million? lol

22:13 3 times the size of windows?

22:13 aperiodic: 5 million

22:13 ibdknox: well, not quite

22:13 brehaut: its the only reason i can think of that its so slow to launch

22:13 ibdknox: haha

22:13 55 million

22:13 when I left

22:15 aperiodic: so VS is ~20% smaller than windows?

22:16 brehaut: to be fair to VS, its boot time has come down a long way

22:18 ibdknox: yeah they did a ton of work on it while I was there

22:18 I don't remember the windows 7 line count

22:18 I thought it was around 80ish

22:18 brehaut: yeah, 2010 was actually a decent product

22:19 its boot time was better than windows 7 on the same machine (which was the first time VS had ever beaten Win for me)

22:19 ibdknox: haha

22:43 bitrot: randym: /cl

22:45 duck1123: did anyone ever find a solution for clojurescript adding a request for deps.js when building with lein-cljsbuild

22:47 mrno: Is there a built in function to swap two elements of a vector, or is using two assocs the best way?

22:53 brehaut_: ,((fn [v ks] (apply assoc v (mapcat #(-> [% (v %2)]) ks (reverse ks)))) [:a :b :c] [0 1]) ; so ugly

22:53 clojurebot: [:b :a :c]

22:57 callen: brehaut_: I'm impressed anyway.

22:59 mrno: ((fn [v i1 i2] (assoc (assoc v i1 (v i2)) i2 (v i1))) [:a :b :c] 0 1) ;looking for something more concise :)

23:00 brehaut_: ,((fn [v i j] (assoc v i (v j) j (v i))) [:A :B :C] 0 2) ; then at least use just one assoc ;)

23:00 clojurebot: [:C :B :A]

23:01 mrno: that's better

23:02 emezeske: duck1123: Do you have any idea why it requests deps.js when you have optimizations enabled?

23:02 duck1123: I just found an interesting thread: http://groups.google.com/group/closure-compiler-discuss/browse_thread/thread/6fabcb4562317519

23:05 duck1123: emezeske, thanks for that link. So if I use simple, is it still readable?

23:06 dnolen: duck1123: simple + pretty-print is a pretty good combo.

23:06 emezeske: duck1123: Simple renames locals I think, which isn't that bad

23:07 duck1123: I am just now getting going with clojurescript

23:07 emezeske: duck1123: It looks like you can just put this above your script tag for the js: <script type="text/javascript">var CLOSURE_NO_DEPS=true</script>

23:07 I might add that to the lein-cljsbuild simple example

23:11 ibdknox: I always just do simple + pretty print myself

23:12 emezeske: I guess the locals that simple renames probably are not named descriptively in the first place ;)

23:15 Hmm, function params seem to be relatively useful in :whitespace optimized code

23:18 duck1123: :whitespace gave a pretty clear indication of what was going on, which is good because I'm still learning it

23:19 Of course, my attempts to get websockets working with the latest aleph failed miserably today

23:21 emezeske: duck1123: My solution to the deps.js problem: https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/example-projects/simple/src-clj/example/views.clj

23:21 duck1123: I can confirm that it works.

23:23 duck1123: Thanks, I'll try that out

23:24 that works

23:25 emezeske: w00t

23:27 dnolen: another sad day for FP, http://www.science.uva.nl/math/#item1329781416 just recently learned how neat lexical addresses are.

23:39 amalloy: brehaut_: #(-> [% (v %2)]), really? i'm starting to think you actually like that pattern

23:48 brehaut_: amalloy: bahaha

23:48 id never use it in real code

Logging service provided by n01se.net