#clojure log - Jun 21 2012

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

0:40 brainproxy: anybody here using clojure to work w/ JSON-LD?

0:46 bbloom: hold on wait… i saw someone do this the other day….

0:46 $anybody

0:46 $anybody$

0:46 $anyone

0:46 $anyone$

0:46 hm… guess not

0:47 oh well

0:47 wmealing: LD ?

0:47 first time ive even heard of that

0:48 brainproxy: yeah, just learned about it tonight, read an interesting paper:

0:48 wmealing: i see http://json-ld.org/

0:48 brainproxy: http://ws-rest.org/2012/proc/a4-2-lanthaler.pdf

0:48 wmealing: and it mentions "web scale"

0:48 sets off my bullshitometer

0:48 brainproxy: heh, sure

0:48 brehaut: ~anyone

0:48 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

0:49 brehaut: bbloom: ^

0:49 bbloom: damn. wrong control character

0:49 i can never remember them all

0:49 next time, i'll check the source rather than guess :-)

0:49 brainproxy: brehaut: well in this case the question I really want the answer to is whether there is someone in chan working w/ JSON-LD, because I'm trying to grok it and would like to bounce some ideas of someone who understands it

0:51 wmealing: it seems to be one of a number of attempts to extend JSON as a hypermedia type

0:51 brehaut: i think ~ is just a shorthand for addressing clojurebot in full?

0:51 clojurebot: anyone

0:51 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

0:51 brehaut: yeah there you fo

0:51 amalloy: bbloom: it won't be in the source

0:52 bbloom: amalloy: i know not they keyword, but won't the control character be?

0:52 amalloy: oh, probably

0:52 bbloom: :-)

0:52 amalloy: $ activates lazybot, and i don't think it's in his source that way

0:52 because he reads it in from a config file at startup

0:53 brehaut: ~arrows

0:53 clojurebot: arrows is http://ro-che.info/ccc/12.html

0:53 technomancy: can we use the word "plist" to refer to [:key "value" :other-key "value2"] structures?

0:54 or is that gauche?

0:55 brehaut: thats almost like a common lisp associative list right?

0:56 amalloy: no, i think it's a common lisp property list :P

0:56 brehaut: hah ok

0:56 technomancy: right-o

0:56 brehaut: oh i see, it has both

0:57 technomancy: I'm gonna call it a plist

0:58 amalloy: technomancy: doesn't macos have this "plist" thing that's all xml nonsense?

0:58 brehaut: a plist in mac os x can be many things

0:58 technomancy: I believe so

0:58 wmealing: bbloom, it doesn't look like it'd be too hard to hack on from clj-json

0:58 technomancy: well, xml if you're lucky

0:58 brehaut: theres at least an xml and binary repr

0:58 * technomancy shivers

0:59 * technomancy invokes Michael Bolton's "why should I change the name; he's the one that sucks" defence

0:59 brehaut: it inherited that madness from next step, its effectively weird arse json

1:00 adu: technomancy: I think they have about a zillion names

1:01 brehaut: Apple plist = JSON+Date+Bytes

1:02 brehaut: adu let me be more precise then, plists are to objective-c/cocoa what json is to javascript

1:02 only weirder

1:02 adu: kinda no

1:04 I think plists(text) were used at NeXT before obj-c was invented (don't quote me). ObjC could exist without plists. Apple invented the xml and binary serializations of plist much later. JSON on the other hand, was inspired by an existing language

1:06 the textual form of plists is very similar to json, and I'm sure people convert to/from plists and json all the time

1:08 to make a paralell to java, Info.plist=build.xml, and java and ant could exist independant of eachother

1:11 tomoj: can an analogy ever be precise?

1:11 brehaut: i had presumed that it wasnt a requirement at least

1:12 adu: sorry for nit picking

1:13 ecosystems fascinate me

1:13 tomoj: imo nits being picked (with reasonable volume) on irc is generally positive, since you can just not read it if you don't care, and often someone will

1:13 brehaut: tomoj: are you comparing us to a bunch of uncivilized jungle apes?

1:15 technomancy: who's scruffy-looking?

1:15 brehaut: that would be those of us who do not have office jobs :P

1:16 adu: I have an office job & I'm scruffy-looking

1:16 tomoj: jungle apes? I don't follow

1:16 technomancy: the correct answer is "Han Solo"

1:17 brehaut: crap, so it is

1:17 * brehaut hands in his nerd badge

1:18 adu: lol

2:26 TheBusby: any tricks to apply a type hint to "this" when doing proxy-super to avoid reflection warnings?

2:41 amalloy: TheBusby: i tried to figure it out a while ago and couldn't do it

2:43 TheBusby: amalloy: doh, thanks for the heads up!

2:55 ro_st: anyone using cljs have a solution for OAuth/OpenID in place?

3:17 is there a channel on here for users of the google closure library?

3:20 in compojure, is there a way to set the root route to load up a file that would be resolved by route/resources? i have a static index.html that i want to make the home page

3:21 so "/" -> index.html

3:22 xeqi: you could stick middleware in that alters the :uri

3:24 muhoo: i'm pretty sure there's a ring middleware that checks resources/ for static files

3:26 ro_st: compojure.route/resources ?

3:41 msappler: hey, is it a bad idea to have nested refs

3:42 madsy: msappler: Nested how?

3:44 msappler: Right now I have robots with (ref {:position :goal :meeting-point :internal-grid})

3:44 for multi-robot exploration

3:45 and for performance reasons I want to have every cell of the internal grid an ref itsself so I can traverse it faster

3:45 like caching neighbour cells

3:47 amalloy: that sounds like an optimization made with no particular evidence that it will make things faster

3:48 make get-neighbor-cells a function, and then in the unlikely event that you find a ref dramatically speeds up your app, you can just change its implementation without affecting anything else

3:49 msappler: I know it will speed up because I did it before

3:49 10x

3:51 madsy: msappler: I didn't even know you could have refs inside refs. What would happen if you update parent and child inside the same transaction?

3:51 Sounds unsafe to me.

3:52 Clojure is smart enough to do partial updates anyhow

3:54 msappler: So I rather do {:state (ref {:position :goal :meeting}) :internal-grid (grid-with-refs-as-cells)}

4:05 ro_st: muhoo: i am using route/resources. i want to map the root route "/" to automatically load up /index.html - like Apache's default document

4:06 xeqi thanks, i'll try that

4:32 xeqi, muhoo: fyi: (GET "/" [] (ring.util.response/resource-response "public/index.html"))

4:44 amalloy: ro_st: https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/ring.clj#L33 is more general

4:44 michaelr525: hello!

4:44 amalloy: i mean, i guess that's for doing a slightly different thing. but you've only mapped / to /index.html, not also mapped /foo to /foo/index.html

4:45 but the point is if you want to treat URL x as if it were URL y, wrap your routes with something that transforms x to y before calling the rest of your server

4:45 ro_st: that makes sense

4:47 turns out i can restrict tomcat to /api/ within apache, which means i can serve the client side stuff 100% static

4:48 and get all the benefits of the html5boilerplate apache config

4:48 98/100 for pagespeed, that way!

4:51 whole frontend for the app loads in under 100k with gzip et al. that includes webfont and a 150kb (uncompressed) js 'binary'

5:21 augustl: hi folks. I'm building a HTTP that works with JSON data, and connects to a postgres db. Currently making some attempts in rails and nodejs, but struggling with the integration testing. I.e. doing http requests and resetting the DB in between tests. Anyone know of some solutions for this for clojure and/or the JVM in general?

5:28 kjetilv: augustl: why don't you just reset the DB between tests? drop schema, then re-run table create statements

5:31 augustl: kjetilv: for some weird reason I didn't think of that. Been struggling with "DROP DATABASE" which requires all connections to be closed first. thanks :)

5:32 kjetilv: augustl: easy does it :-)

5:33 kral: hi

6:13 clojure-newcomer: hi guys… anyone had an experience putting together Facebook login integration in a clojure web app ? particularly interested in Noir

6:14 clgv: augustl: the usual approach is "to mock out" the DB, if not the DB functionality is to be tested

6:14 michaelr525: clojure-newcomer: i'm doing it right now :)

6:14 clojure-newcomer: using this: https://github.com/metadaddy-sfdc/facebook-template-clojure

6:14 clgv: michaelr525: which oauth lib are you using?

6:14 clojure-newcomer: michaelr525: very interesting, I'd love to hear about how you go about it

6:15 https://github.com/cemerick/friend looks interesting

6:15 clgv: clojure-newcomer: friend is for authentication and authorization of your own webapp

6:16 michaelr525: clgv: the link i pasted is a full solution, it's using https://github.com/DerGuteMoritz/clj-oauth2

6:16 clgv: but someone mentioned an oauth plugin for friend

6:16 michaelr525: ah ok

6:16 clojure-newcomer: michaelr525: thanks for the link, interesting

6:16 michaelr525: yeah, no problem

6:16 clgv: michaelr525: didnt see it in the project.clj

6:16 clojure-newcomer: yeah, friend looks like it has room for this kind of thing

6:17 michaelr525: clgv: it's using this, https://github.com/maxweber/clj-facebook-graph and this is using the oauth

6:18 actually i have a problem with it connecting to facebook https, trying to solve by converting to the latest versions of all libraries used

6:18 clojure-newcomer: I'll watch your updates so I benefit from your solutions :-)

6:19 michaelr525: SSLPeerUnverifiedException peer not authenticated sun.security.ssl.SSLSessionImpl.getPeerCertificates (SSLSessionImpl.java:371)

6:19 i get this shit ^^

6:19 clojure-newcomer: it's not my solution, i'm using it as well :)

6:20 clojure-newcomer: sorry.. I should have been clearer… when you iron out the problems, I'll just follow along :-)

6:31 clgv: michaelr525: there was a discussion on the clj-oauth2 yesterday in #clojure.de

6:40 michaelr525: clgv: hmm

6:41 clgv: what's the deal with it?

6:41 clgv: michaelr525: if I remember correctly, the-kenny wanted to use it and ran into several problems - I think he mentioned that he is going to fork it

6:42 michaelr525: clojure-newcomer: solved this problem. had to add the certificates to the local key store. follow this post if you get a similar problem: http://davidjb.com/blog/2012/02

6:43 clgv: so far it's working well for me, i'm building a site with facebook integration.

6:45 clgv: maybe i should not have said that because i immediatly got this stacktrace :)

6:46 clgv: lets give you better karma ;)

6:46 (inc michaelr525)

6:46 lazybot: ⇒ 1

6:46 michaelr525: hehe

7:00 clojure-newcomer: michaelr525: sweet, good to know

7:03 edoloughlin: Any compojure users out there? I'm upgrading from 0.4.0 to 1.1.0 and it no longer likes my destructuring: (POST "/interviews/:id" [{{id "id"} :params} {{interview :interview} :params}] …) — I get "Unexpected binding: {{id "id"} :params}" when compiling.

7:03 Other bindings that use :params are accepted.

7:18 clgv: edoloughlin: how about [{{id "id", interview :interview} :params}] ?

7:22 Rakin05: hey guys. i've got a question. i hack java for about 5 years now and wanna learn a new language concept without loosing the jvm. is clojure a good bet for that task?

7:22 clgv: Rakin05: definitely

7:22 Rakin05: clgv: what about scala?

7:23 clgv: Rakin05: could be - didnt read much of it, yet

7:25 Rakin05: are there any bigger industry projects build with clojure?

7:27 clgv: Rakin05: with clojure you can learn lisp and function programming

7:27 Rakin05: twitter uses clojure

7:30 matessim: join #arch-linux

7:36 dabd: is there a better wrapper for jfreechart than incanter support? I think incanter jfreechart interface does not allow full customization of charts but I may be wrong.

7:37 edoloughlin: clgv: Thanks, will try it. Eclipse/CCW is acting up at the moment so I've got to fix that first...

7:38 clgv: edoloughlin: oh, what version? with leiningen-plugin?

7:38 dabd: yeah it does not

7:38 edoloughlin: Indigo with the CCW lein beta. Was working fine all morning and now it times out waiting for the REPL to start...

7:39 clgv: dabd: but you can come pretty far by starting with incanter.charts if it has your desired chart and then modify it with JFreeChart API via Java interop

7:39 edoloughlin: oh. refresh your whole workspace

7:40 edoloughlin: there is still an issue with missing "classes" folder although it gets generated and such

7:41 dabd: clgv: ok seems viable

7:42 edoloughlin: clgv: Thank. That worked even though restarting Eclipse didn't!

7:42 clgv: s/Thank/Thanks/

7:45 clgv: No luck with the destructuring change though :(

7:45 I've tracked it down to a change between compojure-0.5.3 and 0.6.0

7:50 cshell: cemerick: What tool do you use to create the flow charts like the one for how you choose between defrecord, protocol, etc?

7:51 cemerick: Omnigraffle.

7:53 cshell: ah very nice

7:53 thanks

7:53 if you werne't using a mac, do you know what you'd use?

7:54 cemerick: also, are you using someting that detects when someone uses your name in chat? You're always quite responsive

7:54 lpetit: It's official, Counterclockwise (Eclipse plugin for Clojure) now ships with Leiningen 2 support!

7:54 cshell: yay!

7:54 lpetit: See http://t.co/PGvOAbcc and http://t.co/SQ9fWqqw

7:55 logaan1: i'm looking for a function that tests a value against a predicate and returns that value if the predicate returned true, otherwise returns a fallback value

7:55 does something like that exist in core?

7:55 cshell: there's identity

7:55 which returns the value

7:56 lpetit: logaan1: not that I'm aware of

7:56 logaan1: (ifpred empty? "me" "fallback") ; => "me"

7:56 (ifpred empty? "" "fallback") ; => "fallback"

7:56 lpetit: thx. guess i'll roll my own

7:57 edoloughlin: lpetit: Congratulations and thanks! Is there any reason to keep on the beta version now or do you recommend switching back to STABLE?

7:57 lpetit: loogan1: do you want something special? Test for true true, or truethiness ?

7:58 edoloughlin: thanks. As you want. I've already upgraded the beta "channel" with a 0.9.1beta which is really just the 0.9.0 with updated metadata

7:59 the beta channel is not fed by CI, and if you also don't have automatic upgrade from software updates enabled in your Eclipse installation, I guess you're quite safe staying on the beta channel.

7:59 logaan1: lpetit: sorry i don't understand

8:00 lpetit: logaan1: do you consider nil as a false value, as does clojure ?

8:01 logaan1: if so, what you're after don't deserve a function: (if (pred x) x :default)

8:02 patrkris: hi folks. inspired by SICP, I wrote the sqrt approximation function using newton-rhapson. i've used loop-recur, but is it better/more idiomatic to rewrite using reduce somehow? here it is: http://patrkris.dk/~patrick/code/newton_sqrt.clj

8:03 logaan1: lpetit: yep that's exactly what i've been doing. was just hoping to avoid the repetition of x. by moving that if statement into a function that takes two values and a predicate I can save myself needing to use let to bind x.

8:04 lpetit: logaan1: oh yes

8:53 the-kenny: michaelr525: Ping. Still there?

8:54 clgv: Yeah, I forked it. There were some issues in combination with Google.

8:56 Oh, his problem is solved. Nevermind :)

8:56 clgv: lpetit: great! is something like :project-init supported?

8:57 lpetit: in general I mean executing custom code before the repl starts and begins to load namespaces...

8:58 michaelr525: the-kenny: i'm here

8:59 Chiron_: Hi all! would you please have a look at this: http://pastie.org/4126179

9:00 the-kenny: michaelr525: I was just pinging you about the clj-oauth2 problem

9:01 lpetit: clgv: is :project-init in Lein2 ? not supported yet, but would be easy to do so, IMHO

9:02 michaelr525: the-kenny: oh, it wasn't a problem with clj-oauth2 :). just clgv asked which oauth lib i'm using so it looked like i have a problem with oauth

9:02 hehe

9:02 foxdonut: "Clojure: The Definitive Guide" book review: "Sadly, unrelated to breaking up... I thought I'd get some kind of relief from reading this. But no, it's about some computer thing. Sad. Guess I'll have to go back to stalking..."

9:02 clgv: lpetit: it was in lein1 - I do not know if there is an equivalent in lein2. I hope so and I am wanting this for Eclipse since a while.

9:02 foxdonut: Reply: "If you need to find a new girlfriend and have issue talking to people: 'Smalltalk Best Practice Patterns.'"

9:03 *Closure

9:03 clgv: lpetit: advanced repl search with partial lines of code didnt make it into stable builds yet?

9:03 cshell: lol

9:03 lpetit: clgv: please find its lein2 equivalent, and create an issue for this with some detail you can thing of

9:03 clgv: still in cemerick's todo list, afaik

9:05 clgv: I don't see :project-init in lein2's sample project.clj: https://github.com/technomancy/leiningen/blob/master/sample.project.clj

9:05 clgv: lpetit: yeah, I do not as well :(

9:06 lpetit: clgv: oh, there's :repl-options

9:06 clgv: yeah but :project-init was different from :repl-init afaik

9:07 lpetit: clgv: see, that's not really clear atm. Feel free to start recording the state of this by creating an issue and starting accumulating knowledge.

9:08 clgv: lpetit: but that feature could be implemented independent of lein2 in Eclipse as well.

9:12 lpetit: hmm maybe the :repl-options :init is sufficient. I have to check that.

9:12 lpetit: but that is not supported at,?

9:14 lpetit: clgv: atm, :repl-options :init is not supported. What is supported is launching "clojure applications". And you can modify the associated launch configurations so that you start any code you want

9:14 clgv: for instance, start from the project's root a repl. then find the associated aunch configuration via run > run as …

9:15 clgv: lpetit: ah. good to know. where the thousands of run configuration superseeded by a single one?

9:15 lpetit: clgv: and then, open the "arguments" tab, and in the "program arguments" for the JVM, enter -e "(require 'clojure.string)" and voila, -e … will be added to the command line used by eclipse to launch your repl

9:15 clgv: lpetit: I still have one for every file in my workspace ;)

9:16 lpetit: clgv : well, you'll have to test it :)

9:21 clgv: lpetit: tested with println. works! but would be neat to have it on the clojure page with a clojure editor :)

9:21 lpetit: clgv: no, still as many launch configurations as "selected resources" when asked to launch

9:22 clgv: didn't understand

9:22 "to have on the … with a … " ???

9:22 lazybot: lpetit: Oh, absolutely.

9:22 clgv: lpetit: executing code with the jvm argument "-e"

9:22 lpetit: oh :)

9:23 clgv: lpetit: ah, the clojure tab of the run configuration

9:23 lpetit: Well, indeed currently, let's say it's the "most generic" solution :)

9:23 clgv: yeah.

9:24 lpetit: clgv: if I add support for lien's :repl, I'm not sure I will also work more on the launch configurations

9:25 clgv: lpetit: yeah. that would be redundant. having it in lein's :repl is a single source of configuration :)

9:27 lpetit: now that I deleted the thousands of run configurations, finally "load file in repl" works like it is supposed to :)

9:27 ohpauleez: Thanks for everyone who came last night to ClojureNYC

9:27 lpetit: clgv: thousands, really ? ;)

9:27 clgv: lpetit: they did not fit on one page. ;)

10:24 AWizzArd: I would like to use Clojure as a scripting language (JSR 223) in a JavaFX app, to be specific: in a .fxml file.

10:26 lpetit: AWizzArd: good luck

10:26 AWizzArd: In that file I can specify <?language javascript?> and this is accepted. When I say however <?language clojure?> I get a NPE. Is some specific "definiton file" required to be on the CP to let the JVM know that a JSR 223 compatible language is available?

10:34 lpetit: it seems something such as http://code.google.com/p/clojure-jsr223/ would be required as a dep.

10:37 Chiron_: I'm calling map (that its function calls str function) inside doseq , why the result of map isn't displayed on repl?

10:41 tbaldridge: Chiron_: doseq doesn't return anything IIRC

10:43 Chiron_: look at doall, I think that's what you're looking for

10:43 Chiron_: wrap do all around map?

10:43 tbaldridge: (doall (map #(do (print %) %) (range 10)))

10:45 Chiron_: not working for me: http://pastie.org/4126713

10:47 tbaldridge: I think you're missing a println there, something like this? http://pastie.org/4126726

10:47 I guess I'm not exactly sure what you want this function to do, is it supposed to print data, or return data, or both?

10:48 Chiron_: true, missing println

10:48 it is a prototype

10:49 I want to extract data and insert into db

10:51 N8Dawg: help, does anyone here have experience with swank-cdt?

10:52 i'm using lein 1.7.1 and swnak-clojure 1.4.2

10:54 the-kenny: Chiron_: If you want to iterate over a seq for side effects, you should use "doseq". It's like for, but throws away the result and is not lazy.

10:54 N8Dawg: when i run (use 'swank.cdt) I get the error: com.sun.jdi.Bootstrap [Thrown class java.lang.ClassNotFoundException]

10:54 Chiron_: i feel bad to use deseq inside another doseq

10:56 the-kenny: Chiron_: doseq supports the same "nesting" as for: (for [x (range 3), y (range 3)] [x y]) -> [[0 0] [0 1] [0 2] [1 0] [1 1], ...]

10:56 for ist list comprehension :)

10:56 VickyIyer: Hi there I am newbe to the clojure language, just wanted to know how common is it that we have inter-ops apps where we have clojure code embedded into the java code. or is the common sense approach to use only pure clojure code and call java library functions when required.

10:57 jsabeaudry: VickyIyer, I'd say pure clojure calling libs

10:58 the-kenny: But you can easily generate classes out of namespaces for use in Java.

10:59 VickyIyer: yeah, but I just thouught that might be difficult, cause would a function name my-name in clojure get translated to java as - is not valid for a function name in java

11:03 TimMc: VickyIyer: It gets converted into my_name or somesuch.

11:05 &(munge 'my-name*!?)

11:06 lazybot: ⇒ my_name_STAR__BANG__QMARK_

11:06 jsabeaudry: VickyIyer, keep in mind that you can name your clojure functions MyName if your objective is to have them fit in the java world

11:07 TimMc: You can also use gen-class and defrecord and such to ease interop from the Java side.

11:17 gfredericks: VickyIyer: you might find lib-2367 interesting

11:17 $google lib-2367

11:17 lazybot: [fredericksgary/lib-2367 · GitHub] https://github.com/fredericksgary/lib-2367

11:22 TimMc: &(apply str "lib-" (repeatedly 4 #(rand-int 10)))

11:22 lazybot: ⇒ "lib-9791"

11:22 gtrak: ibdknox: do you have any thoughts on light-table plugins/api guidelines yet?

11:26 VickyIyer: Thanks a lot all, it was very helpful

11:33 gfredericks: &(format "%04d" (rand-int 10000))

11:33 lazybot: ⇒ "7235"

11:33 gfredericks: &(format "lib-%04d" (rand-int 10000))

11:33 lazybot: ⇒ "lib-7198"

11:34 TimMc: hrmph

11:35 gfredericks: TimMc: I've been doing this for a while

11:38 Shambles_: I'm using Eclipse with Counterclockwise for Clojure support. Is there some way I can get it's REPL to use Clojure 1.4.0 rather than 1.3.0? I'm using the latest version of Counterclockwise (0.9.0).

11:39 timvisher|work: Shambles_: It doesn't honor the version of clojure defined in your project?

11:41 Shambles_: timvisher|work: I've made a 'hello world' project, and have this in my project.clj ([:dependencies [[org.clojure/clojure "1.4.0"]]]) When I "Run As" and pick "Clojure Application" I still get the 1.3.0 REPL.

11:42 timvisher|work: is that all you have in your project.clj?

11:42 Shambles_: timvisher|work: I wouldn't be surprised if I was doing something wrong, since I've had some significant difficulty getting this far, but I had to give up with this problem because Googling and trying to figure it out myself wasn't working.

11:42 timvisher|work: that doesn't look valid

11:43 something like this would make more sense

11:43 https://gist.github.com/2966538

11:43 Shambles_: That's all I have in there yes. It's the same thing it started with as a default Leiningen project, only the version number was originally 1.3.0.

11:44 timvisher|work: i use emacs, so i'm not sure the nuances of counterclockwise, but the REPL defaults to 1.3.0 I believe

11:44 have you run lein deps?

11:44 it's possible that counterclockwise doesn't update your dependencies automatically, though that would be counterintuitive

11:44 Shambles_: timvisher|work: I have not run lein deps yet.

11:45 timvisher|work: you should never have to

11:45 not with the latest versions of leiningen, which i understand counterclockwise just upgraded to

11:46 are you sure it's 1.3.0?

11:46 what's *clojure-version* end up as?

11:46 Shambles_: timvisher|work: The REPL says this: ;; Clojure 1.3.0

11:47 => *clojure-version*

11:47 {:major 1, :minor 3, :incremental 0, :qualifier nil}

11:47 Running lein deps had no effect.

11:49 You mentioned he had 'just upgraded to the latest version'. Perhaps me using leiningen 1.7.1 (the last stable version) is the problem.

11:50 I am running the latest Eclipse and Counterclockwise and Clojure, so that's all I can think of, given I'm not using anything else at the moment.

11:54 dgrnbrg: how do I write a lein1 plugin that gets executed during init for every plugin?

11:55 lynaghk: ping: ohpauleez

11:55 ohpauleez: lynaghk: pong

11:56 lynaghk: hey dude; how did your talk go yesterday evening?

11:56 ohpauleez: Really well, slides are up on my blog. dnolen kovasb and I talked about the "process problem" and getting better concurrency in the browser

11:57 A lot of great questions about ClojureScript in production - concerns, risks, things I would have done differently

11:58 lynaghk: ohpauleez: rad! Yeah, I am thinking I need to get a blog and start writing that kind of stuff down

11:58 ohpauleez: Showed some demos of Shoreleave-enabled apps

11:58 lynaghk: For sure, it helps for personal docs too - I used to swear by my research notebooks. But now I just do a quick search on my blog to pull something up

12:00 lynaghk: ohpauleez: are you planning on submitting your TodoMVC to the core project? I was thinking about doing that, if only to see what their reaction would be to something so completely different

12:01 dgrnbrg: Does anyone have any idea why a simple project.clj with :eval-in-leiningen and 3 :dependencies in lein1, would not include those dependencies in the jar when I do "lein uberjar"?

12:01 timvisher|work: Shambles_: even leiningen 1.7.1 should honor what's in your project.clj file. sorry to say i'm at the end of my ability to help. :(

12:01 dgrnbrg: best to paste your project.clj file up somewhere

12:01 ohpauleez: lynaghk: I was on the fence leaning towards no, but if it got a lot of traction, I would consider it

12:02 I would hate for it to navy,Z"

12:02 wow, apple, stop auto typing

12:02 X, Y, Z*

12:02 dgrnbrg: timvisher|work: I can't paste all of it, but with just one dep, it's (defproject foo "1.0.0" :eval-in-leiningen true :dependencies [[conch "0.2.1"]])

12:02 lynaghk: ohpauleez: you mean Shoreleave traction?

12:02 dgrnbrg: it's extremely minimal

12:02 ohpauleez: ok, second take: I would hate for the conversation to spin off into - "Why the hell does CLJS do X, Y, Z"

12:03 lynaghk: Yeah. Because the TodoMVC just highlights my opinions about how to build CLJS apps, not how CLJS should be used to built TodoMVC

12:03 timvisher|work: dgrnbrg: if you uberjar a fresh project, does it include what you expect?

12:03 scriptor: wait, there's a cljs TodoMVC?

12:03 dgrnbrg: timvisher|work: it appears to be due to the :eval-in-leiningen

12:04 ohpauleez: lynaghk: (my opinions, as expressed via Shoreleave)

12:04 lynaghk: ohpauleez: ah, right. Yeah, I wanted to run my version by some folks before submitting

12:04 dgrnbrg: if i remove that, it uberjars everything

12:04 unfortunately, i need both :/

12:04 lynaghk: to see if they thought it's idiomatic cljs (or as close as something like that could be)

12:04 timvisher|work: i've never used that feature of lein so i can't tell you anything about what's happening

12:04 :(

12:04 ohpauleez: scriptor: lynaghk and I both are working on TodoMVC demos of our CLJS stack technologies

12:04 timvisher|work: 0/2

12:04 scriptor: nice

12:04 ohpauleez: lynaghk: exactly

12:04 lynaghk: scriptor: https://github.com/lynaghk/c2-demos/tree/master/todoMVC

12:04 scriptor: I'd be so happy if I could figure out a way to use cljs here

12:05 looking at backbone for now

12:05 ohpauleez: I abuse protocols, and I force this weird pubsub thing - etc. I'm not sure that's worth showing the JS community at large

12:05 lynaghk: ohpauleez: well, mine is pretty much all standard CLJS except for data-binding from C2.

12:05 ohpauleez: scriptor: I would say it's VERY possible to use CLJS in place of Backbone

12:05 scriptor: how weird? I thought pubsub was generally used for updating models

12:06 ohpauleez: scriptor: Weird as in - not a normal interaction you'd see in CLJ perhaps. But definitely a nicer way to bind up the internals of a CLJS app (again, totally my opinion)

12:07 Far superior to littering event related code in your functions

12:07 Which is a tax on cognition when building sizable apps

12:07 scriptor: hmm, one issue I have with cljs is that even with advanced optimization on, compiling a simple alert() leads to a 114kb js file

12:08 ohpauleez: Right, then gzip that file

12:08 and it's 32kb'

12:08 Which is 1/3 the size of jQuery

12:08 through the same compilation process

12:08 scriptor: true, but backbone's only 5kb :/

12:08 ohpauleez: That's not true

12:08 when you glom on all the other libraries you need to make it go

12:09 you end up with 100's of kbs

12:09 easily

12:09 scriptor: hmm

12:09 lynaghk: scriptor: if you are working with a designer, they will probably just put an unoptimized JPEG on the page that's 700kB anyway, so don't sweat the JS =P

12:09 ohpauleez: And really, if you have a CDN, does 50-100 KB for one request, that's going to be cached client side matter?

12:09 Also, what lynaghk said

12:10 scriptor: yea, size won't be that big of an issue in the end

12:10 it's more the training people to move away from jquery and learn cljs

12:10 ohpauleez: I've found the easy path to CLJ and CLJS is using JavaScript as the mind-migration language

12:10 scriptor: also, I've only been here less than 2 weeks, so I don't think I have much influence :)

12:11 ohpauleez: Python/Ruby + JavaScript is enough for people to get over the hump with Clojure. At least in my experience

12:11 scriptor: Just shout louder than everyone else

12:11 haha

12:11 :)

12:16 technomancy: clgv: :injections does what :project-init used to do, but better

12:19 clgv: technomancy: oh interesting. gotta tell lpetite ;)

12:19 technomancy: thanks for the info :)

12:20 nDuff: lpetit: I'm using clojure.aav updated to 1.4.0; should I fork/rename? Submit the updated manifest back? ...?

12:21 Shambles_: timvisher|work: I tried updating to the latest Leiningen code on github, and it solved the problem. I'm sorry to have troubled other people with it. I just couldn't figure out the source of the problem. I normally run stable versions is all.

12:22 timvisher|work: Shambles_: no problem! glad you got it sorted out. don't be afraid to ask questions! :)

12:22 technomancy: dgrnbrg: what's the use case for :eval-in-leiningen together with uberjar? I've never heard of anyone using the two in the same project.

12:22 Shambles_: timvisher|work: I'm not used to friendly IRC channels, though it seems /some/ of the Lisp channels are okay. It's just taking some getting used to.

12:23 timvisher|work: you should see some of the things i've asked here :)

12:23 clojure's community is maybe its best feature

12:24 cgag: yeah i don't think i've seen anyone be anything but nice since i started hanging out in here

12:25 technomancy: there are a few you have to watch out for; I don't want to name any names but it starts with cloj and ends with urebot.

12:25 timvisher|work: true-

12:25 no one likes dealing with that guy

12:25 cantankerous to the core

12:25 gfredericks: ~botsmack

12:25 clojurebot: Owww!

12:26 technomancy: nothing like this guy thankfully though: http://groups.google.com/group/comp.lang.lisp/msg/4c95766a8bdda347

12:28 Shambles_: I suspect I may have some trouble installing all these libraries I've found. I've managed to figure out that leiningen is what you use to build things with, but some of the packages don't have instructions for building them, and I'm not exactly sure what happens when I "lein install" something. I suspect it will involve having to change my CLASSPATH though.

12:28 technomancy: Shambles_: the goal of Leiningen is to ensure you never have to think about your classpath

12:28 timvisher|work: Shambles_: Have you gone through https://github.com/technomancy/leiningen/blob/c155dd1e25f7db756787f630b33504f2b79ca649/doc/TUTORIAL.md ?

12:29 technomancy: ^ aka `lein help tutorial`

12:29 timvisher|work: might be worth your time

12:29 technomancy: you tricky devil you

12:29 technomancy: timvisher|work: even just `lein tutorial` on the latest

12:29 partially-applied aliases ... <3

12:29 uvtc: Shambles_, maybe have a look at http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ to explain how things fit together.

12:30 timvisher|work: Shambles_: unfortunately, clojure startup is still really rough

12:31 Shambles_: technomancy: I skimmed it, mostly to find out that what I wanted to know wasn't in there. I have had to do a lot of CLASSPATH fiddling, and even write a 'cute' batch file (doing something I didn't know could be done) just to get to where I am. Clojure and tools don't install that easily on Windows.

12:31 uvtc: timvisher|work, if you see any improvements that could be made to the Brief Beginner's Guide, ^^ please let me know.

12:31 Shambles_: technomancy: From what I can tell installed things end up somewhere under .m2 or .lein in my profile directory.

12:32 technomancy: that's a local cache, yeah. you shouldn't have to think about that unless things go horribly wrong though

12:32 what did you find missing from the tutorial?

12:32 timvisher|work: Shambles_: install puts local projects into your local .m2 and can get in the way of repeatability

12:32 technomancy: `lein help repeatability` ?

12:32 technomancy: timvisher|work: not a bad idea

12:33 at first it felt a bit too ranty for the official docs, but it comes up so often

12:33 timvisher|work: i'll get right on that after i make my other contribution…

12:33 :)

12:33 Shambles_: technomancy: To get Clojure and Leiningen working I had to manually modify my CLASSPATH to point to the directories of the appropriate JAR's. I learned the hard way that you could not include the JAR's themselves in the classpath. That made Clojure easy to run, but made Leiningen throw an exception.

12:34 technomancy: Shambles_: that's awful. so I guess there are some serious problems with the Windows installation instructions?

12:34 timvisher|work: Shambles_: You shouldn't have to install any jars at all

12:34 Shambles_: technomancy: After getting that settled, I had to write a batch file to launch Clojure. The trick was finding some way to make the batch file only care about the /relative/ path. The 'cute' part of that was finding out that variable expansion can occur within double quotes (necessary to handle the spaces in the pathnames).

12:34 timvisher|work: the bat file should just work. does for me any way

12:34 technomancy: you needed a batch file to launch Clojure?

12:35 you mean to launch a Clojure repl?

12:35 Shambles_: Then I had to add them manually to my path variables, not that that's anything unique to this experience, nor was it hard to figure out. The former *did* take a while though.

12:35 technomancy: Yes, to the needing a batch file.

12:35 technomancy: sure; I don't think there's any way around the PATH issue

12:35 timvisher|work: Shamles_: something is going very wrong with your system. :)

12:35 Shambles_: ^

12:35 technomancy: Shambles_: why did you need to "launch Clojure"?

12:36 Clojure is not an end-user application, it's a library

12:36 Shambles_: technomancy: So I could type (+ 2 2) at the REPL and see it working before moving on to greater things like getting Eclipse working with it.

12:36 technomancy: did you try `lein repl`?

12:37 Shambles_: Also, I might someday want to run it from the command line. People do this sort of thing all the time with most Lisps.

12:37 lein wasn't on the system at the time. I didn't even know it existed until I found stuff I wanted to install requiring it.

12:37 Namely, seesaw.

12:37 technomancy: oh, ok; so this is before you found lein.

12:38 timvisher|work: Shambles_: most people I've heard at this point recommend just using lein or cake and not bothering to write all your own bootstrapping code

12:38 if you had to do all of that bootstrapping work yourself i definitely appreciate your pain

12:38 i'd recommend getting rid of all of it and just using lein

12:38 technomancy: if you have any details about the specifics of the install instructions that didn't work it would be great if you could open a bug report

12:39 Shambles_: timvisher|work: Oh I've learned more than I expected to need to to be able to type stuff at Clojure. Cake, for instace, has been integrated into Leiningen, and seems to no longer be recommended for that reason (thank God... the last thing I need is more stuff to install just so I can install stuff that I actually want :P ).

12:39 technomancy: clojurebot: yo dawg I heard...

12:39 clojurebot: java.lang.SecurityException: You tripped the alarm! def is bad!

12:39 technomancy: o_O

12:39 timvisher|work: and in fact all of that goes away as far as i know if you're using ccw. i don't think you're even supposed to be required to have clojure or lein on your system

12:40 cake got integrated in to lein?

12:40 Shambles_: Well, here's how I got to this point...

12:40 timvisher|work: when'd that happen? :)

12:40 technomancy: timvisher|work: announced at the last conj

12:40 timvisher|work: good stuff

12:40 i've still yet to watch all the videos

12:40 * timvisher|work dreams of the day he might actually get to attend

12:41 timvisher|work: so how awesome was bodil's video, eh?

12:41 Shambles_: Once upon a time I wanted to mess with a Scheme, with nice I/O facilities. Unfortunately, I ran into some snags... things it just couldn't do, or be made to do, without dealing with the FFI and (if I want the patch accepted) writing code for a OS I don't have access to.

12:41 timvisher|work: pretty freaking awesome

12:42 technomancy: still need to watch that one

12:42 timvisher|work: haha! i'm watching cemerick's what sucks video _literally_ right now and _literally_ he's talking about crossing the chasm of installing clojure

12:42 apropos…

12:43 Shambles_: Eventually I settled on something that would run on the JVM or CLR. While there's several Lisp and Schemes that do this, a lot of them have /other/ limitations. Eventually I ended up picking Clojure.

12:43 So I go to the Clojure website, download it, and try to make it do something.

12:43 Hence the BAT adventure.

12:43 timvisher|work: yep

12:43 i don't think anything you did was non-sensical

12:43 foxdonut: timvisher|work: link to video list?

12:44 timvisher|work: i think you just got unlucky with your search results and got some bad starting advice

12:44 foxdonut: http://www.infoq.com/presentations/What-Sucks-about-Clojure-and-Why-You-ll-Love-It-Anyway

12:44 Shambles_: Then I start looking for something with acceptable paren matching that doesn't randomly hang on Windows like the Cygwin EMACS port has done for about 2 years. Extra points for the ability to do things like display trees without resorting to ASCII art.

12:44 timvisher|work: but the full 2012 conj is up on blip, no? http://blip.tv/clojure

12:44 cgag: you should just run linux in a vm

12:44 uvtc: ~getting-started

12:44 clojurebot: Maybe have a look at http://dev.clojure.org/display/doc/Getting+Started .

12:44 Shambles_: Then I find out all these nifty libraries, like the one I found before picking Clojure which adds continuations back in, require this Lein thing...

12:45 So... more 'fun'. :P

12:45 timvisher|work: Shambles_: why don't you just use emacsw32?

12:45 it's stable as all get out and works great within the whole eco-system

12:45 foxdonut: timvisher|work: thanks! combination of two links is what I was hoping for :)

12:45 timvisher|work: i do full slime/swank/lein clojure all the time on windows

12:45 foxdonut: yessir

12:46 technomancy: oh nice; when did vimeo start offering video downloads without logging in?

12:46 Shambles_: timvisher|work: I do believe it would have the same 'hangs at random' issues the Cygwin port does, since I think it is in fact the Cygwin port. Also, it doesn't do the "displays trees without resorting to ASCII art" and other such things. It does a dandy job matching parens and auto-reformatting code, at least.

12:46 timvisher|work: technomancy: always had if uploader allowed it, i thought

12:46 metajack: I'm watching a vimeo video now and it doesn't have a download link. So it must depend on something other than login state.

12:47 foxdonut: technomancy: I always just find the videos in the browser's cache ;)

12:47 timvisher|work: Shambles_: what feature displays trees?

12:47 and it's definitely not the cygwin port

12:47 technomancy: timvisher|work: oh, so now I know who to blame =)

12:47 foxdonut: there's a trick you can do with the RSS feed

12:47 or maybe that's blip.tv

12:47 foxdonut: technomancy: vimeo, blip.tv, youtube, whatever, it doesn't matter, I just find them in the cache!

12:47 timvisher|work: it can't be because cygwin is emulating linux system calls to it's sub-processes

12:48 Shambles_: I could run Linux in a VM, but I have a Linux box next to me. I just happen to like to be able to develop on whatever I please. Really "switch operating systems" isn't a great answer for something that's supposed to have write-once run-anywhere as a feature. :P

12:48 Wild_Cat: also, blip.tv currently fails miserably with recent versions of Chrome dev.

12:48 technomancy: foxdonut: handy

12:48 cgag: Shambles_: ha i know, sorry... it just sounds so much more painful on windows

12:48 timvisher|work: Shambles_: that's one of the big reasons i chose emacs, because it does work so seamlessly across my windows box and my mac

12:48 Shambles_: timvisher|work: There's some elisp code to display trees in EMACS to make it closer to a modern IDE. It has to do it with ASCII art.

12:49 timvisher|work: is that CEDET?

12:49 i've never gone back to wanting trees even since i found textmate-minor-mode's find-file-in-project

12:49 so much faster

12:49 technomancy: for the record, I've never claimed Leiningen is write-once-run-anywhere =)

12:50 timvisher|work: besides when i was using eclipse, I inevitably configured it to hide the project tree because clicking through that is just so darn inneficient

12:50 technomancy: but it's been that so far ;)

12:50 technomancy: timvisher|work: it's more like "it currently happens to mostly work on Windows due to the efforts of some volunteers"

12:51 Shambles_: timvisher|work: I don't recall. I haven't attempted to use EMACS for anything more complex than editing text files in quite some time. I do like it for that. I just don't like it much for anything that actually needs more than text mode.

12:51 timvisher|work: Shambles_: more than acceptable, of course. whatever tool fits you best is the tool you should use. my major point from before this discussion is that all of the tools, ccw/lein/cake/etc. are all trying to stop you from ever having to write your own bat files to run a repl

12:52 Shambles_: When working in IDE's I tend to double click the title bar of the code window when I want to edit code, then double click again to get the various browsing windows back. Avoids the whole inefficient use of space thng.

12:53 timvisher|work: i got very used to navigating to them via their various alt-* hotkeys if i needed them to pop up and navigating around my source with things like their class or symbol search functions

12:53 Shambles_: timvisher|work: Given Clojure doesn't come with anything to allow you to use it, and tells you itself that to get a REPL you can work with you can type <long command line>, its really a pretty obvious thing to do.

12:53 timvisher|work: which is basically what find-file-in-project gets me

12:53 Shambles_: timvisher|work: On my adventures I encountered 'Lispbox' equivalents, but all were horribly out of date.

12:54 cgag: that long command was a pretty big turn off when i first tried to get started with clojure, before lein

12:54 Shambles_: timvisher|work: But hey, you can do GUI's and sound with them, at least! ;)

12:54 timvisher|work: you can do guis and sound with clojure too. :)

12:54 Shambles_: Well, my 'long command line' is now "clojure", so it acts just like the Python I'm used to. :P

12:54 technomancy: Clojure needs to stop telling people to launch it with java -cp [...]

12:54 Shambles_: Though I'm told I probably should have named it "clj".

12:55 technomancy: that's a crappy experience

12:55 timvisher|work: watched the overtone presentation from the conj?

12:55 hiredman: technomancy: it works fine

12:55 timvisher|work: Shambles_: better might be `lein repl`

12:55 and possibly having an alias set up or a bat file

12:56 technomancy: hiredman: discerning hackers insist on rlwrap-brand console interaction.

12:56 cgag: Shambles_: yeah, i didn't know much about writing bash scripts/functions at the time, or anything about classpaths, it took me forever to get to the point of being able to just run "clj"

12:56 hiredman: technomancy: that's just not true

12:56 Shambles_: technomancy: It would be crappier if there was no REPL at all. What would be better is saying "Clojure is meant to be run through one of these fine interfaces <big list>" and for those 'fine interfaces' to come pre bundled with nice installers/packages, or at least with a explanation of the necessary CLASSPATH fiddling.

12:56 timvisher|work: and pomade for their hair

12:57 Shambles_: I mean, after getting past writing the batch file, it's easy enough to use, it just doesn't /come/ with a reasonable batch file or shell script.

12:57 timvisher|work: Shambles_: lein doesn't require any CLASSPATH fiddling

12:57 all the batteries are included

12:57 cgag: now i pretty much never run clojure outside of lein though

12:57 hiredman: discerning hackers started using clojure before there was any tooling

12:57 technomancy: if the word classpath appears on the splash page of clojure.org we might as well go home =(

12:57 Shambles_: timvisher|work: lein definitely *does* require CLASSPATH fiddling to get set up.

12:57 hiredman: technomancy: as you know I work from home

12:58 technomancy: hiredman: convenient, innit? =)

12:58 timvisher|work: did you follow the install via the bat file?

12:58 hiredman: people complain and complain

12:58 Shambles_: timvisher|work: Try running it on Windows without having your CLASSPATH aimed at the directory you unzipped Clojure in. For extra fun, try running it with the CLASSPATH aimed at the JAR, rather than the directory.

12:58 timvisher|work: without having your CLASSPATH set, which you should almost never do anyway on a systemwide basis?

12:58 hiredman: and guess what, they would complain and stumble around no matter what

12:58 timvisher|work: Shambles_: that is how i run it every day

12:58 i've never directly downloaded the clojure jar files

12:59 i don't have them anywhere but in the .m2 directory of my home directory

12:59 Shambles_: timvisher|work: I just spent several hours getting it to work on Windows XP, so I'm quite convinced it's necessary.

12:59 timvisher|work: i'm on windows xp too

12:59 technomancy: Shambles_: for the record you're the first person to report so

12:59 clojurebot: Records (and, long ago, structs) are "advanced features", which can cause significant pain if you don't get all the subtleties. If you're using them to create "classes" because classes are awesome, then you are probably better off just using plain old hashmaps, possibly with a :type key if you want to be clear about what type they are.

12:59 timvisher|work: if you're system is working for you, that's great. i'm just saying that it doesn't have to be quite so complicated. :)

12:59 hiredman: so going on and on about the classpath and hiding it is such a waste

13:00 timvisher|work: clojurebot: always a contributor

13:00 clojurebot: excusez-moi

13:00 timvisher|work: clojurebot: exactly

13:00 clojurebot: Huh?

13:00 timvisher|work: clojurebot: i know right. talked to elisa lately?

13:00 clojurebot: Excuse me?

13:00 technomancy: timvisher|work: he's like the kid who's trying to be part of the conversation so he interjects because he hears a word he recognizes even though it's not relevant.

13:00 hiredman: it is a basic feature of the runtime

13:01 timvisher|work: technomancy: you're making fun of me again, aren't you…

13:01 technomancy: timvisher|work: no, it just literally reminds me of my kids

13:01 Shambles_: I'm aware that the CLASSPATH is just how the JVM works. I haven't used many Java applications before, and the few that I have used actually got launched via a batch file or shell script that came with the program.

13:02 timvisher|work: lol

13:02 tbaldridge: The classpath stuff delayed my Clojure experience by about half a year. I picked it up, got insanely frustrated, and gave up. Once I found lein, I picked it up again.

13:02 timvisher|work: Shambles_: the CLASSPATH is maybe one of the least understood and there-be-dragons part of the java start up experience in any language on the jvm

13:02 S11001001: ,'[a: b]

13:02 timvisher|work: thus most tools desperately try to hide you from it

13:02 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: a:>

13:03 timvisher|work: take Eclipse and how it works

13:03 S11001001: ,'[a : b]

13:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :>

13:03 timvisher|work: lein does a great job of making it totally unnecessary, on any system, to mess with your classpath directly

13:03 foxdonut: (inc timvisher|work)

13:03 lazybot: ⇒ 1

13:03 timvisher|work: technomancy: actually, if your CLASSPATH _is_ set, will that mess with lein or does it ignore it?

13:04 technomancy: timvisher|work: newer versions ignore it entirely because nearly 100% of the people who set it are confused.

13:04 timvisher|work: it sounds like Shambles_ had already set the CLASSPATH up before trying to get in to lein, so perhaps that's one of the problems?

13:04 Shambles_: I don't give up easily. I can generally get through anything, no matter how bad the UI. So far I've survived X-Window during the time it required manually written modelines, set up pppd and diald when it had to be done manually, used ML-Donkey (worst UI I've ever seen, even worse than X's old configs), and gotten rather good with Blender.

13:04 timvisher|work: what about 1.7.1?

13:04 technomancy: I think 1.7.1 still checks it

13:04 timvisher|work: Shambles_: you said you started with 1.7.1?

13:05 technomancy: but yeah, if there was stuff that was interfering it already in the env var then you would have to mess with it to get things working

13:05 timvisher|work: my favorite window manager remains toms

13:05 technomancy: which is why it's best just to skip it entirely

13:05 timvisher|work: that gorgeous green they chose is wonderfully soothing

13:05 Shambles_: timvisher|work: Yes, I was trying to use 1.7.1. After switching to the 2.0.0-preview6 it solved my problem of forcing me to use Clojure 1.3. It now uses whatever I tell it to.

13:05 * timvisher|work dreams of the grainy grey background

13:07 timvisher|work: Shambles_: so it sounds, perhaps, like the progression was: 1. Download clojure and follow core's awful instructions for getting set up. 2. Realize you need your CLASSPATH set and set it in your environment. 3. Realize that it's crazy to do that and find out about lein. 4. Use 1.7.1 which honors the CLASSPATH which is probably at this point in an undefined state. 5. Use lein latest which ignores the CLASSPATH and now everything

13:07 zach_: Can anyone recommend a good clojure noir project to look to for testing inspiration? I'm a bit new to testing in general, and would love an example.

13:07 timvisher|work: so i bet now if you were to unset your CLASSPATH completely and run lein repl, you'd be right as rain

13:07 zach_: what kind of testing are you doing?

13:08 zach_: timvisher|work: at the moment, pretty basic unit

13:08 timvisher|work: eventually integration

13:08 Shambles_: timvisher|work: Close. You left out the "decided I needed a reasonable IDE" and flailing about until I decided on Eclipse and Counterclockwise.

13:08 timvisher|work: of what part of the code?

13:08 unit testing the pages themselves or your functions?

13:08 zach_: models

13:08 Shambles_: timvisher|work: Also, something I haven't mentioned yet, just for fun...

13:08 gfredericks: anybody have an opinion on if (def-wrapper-macro ...) would be an appropriate addition to clojure.tools.macro?

13:08 zach_: so, functions

13:08 timvisher|work: have you looked in to simply using http://richhickey.github.com/clojure/clojure.test-api.html

13:08 lazybot: Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure/clojure.test-api.html and try to stop linking to rich's repo.

13:09 Shambles_: timvisher|work: Counterclockwise actually has extensions for working with Leiningen, but will only offer to install them if it can find Leiningen *already installed*. ;) Yes, I found this out by having to reinstall it.

13:09 timvisher|work: lazybot: good job

13:09 duckduckgo: bad!

13:09 Shambles_: ah! i thought it was fully integrated at this point

13:09 foxdonut: duckduckgo?

13:10 timvisher|work: http://duckduckgo.com/

13:10 zach_: timvisher|work: Yes, I was planning on using clojure.test :). I was more thinking along the lines of organization, etc; but maybe I don't need to be worrying about that.

13:10 timvisher|work: if you simply do a `lein new`, that gives you a pretty good organization to start with

13:10 but it doesn't provide great names for your test namespaces

13:10 Shambles_: So basically apparently what you're supposed to do is magically know you need this weird installer thing (that particular weird installer, not any of the less popular ones). Put it on. The 2.x ones, not the 1.x ones, because they're busted with Counterclockwise. Then put on Eclipse. Then put on Counterclockwise. If you do that, maybe you'd only have to fight your PATH, which isn't so bad.

13:11 foxdonut: timvisher|work: geez, ok.. :)

13:11 Shambles_: I haven't figured out what to do about installing these fun addons yet, so I may be in for more adventures.

13:11 technomancy: Shambles_: I hope the 1.x/2.x confusion can be reduced soon; I recently switched over the docs to point all new users at 2.x

13:11 timvisher|work: foxdonut: what you don't like it? ;)

13:12 zach_: timvisher|work: What kind of namespacing would you recommend? project.test.models.model, for example?

13:12 foxdonut: timvisher|work: don't get me wrong, I love ducks!

13:12 zach_: timvisher|work: Or is that getting too specific?

13:12 Shambles_: technomancy: In my opinion if lein is going to be this vital, and supposed to be installed before everything else, Clojure should just ship with it.

13:12 timvisher|work: i've been writing things ilke project.test.it-should-allow-users-to-authenticate

13:12 following BDD a bit more, perhaps

13:12 technomancy: Shambles_: it's more a question of getting the right links on clojure.org I think

13:13 zach_: timvisher|work: Interesting, okay. Thanks for the ideas :)

13:13 timvisher|work: but the standard project.foo tests being located in project.test.foo gets you pretty far

13:13 technomancy: since "ship with it" doesn't really make sense; clojure.org shouldn't ship anything

13:13 Shambles_: technomancy: I also think it should ship with working batch files and shell scripts so you can just run Clojure without having some other environment, to at least let you know it's working (e.g. that your JVM isn't horribly out of date or something).

13:13 technomancy: Shambles_: most of the wiki pages that are editable by the community already point you to the right place, but clojure/core has been very slow in getting updates to clojure.org and doesn't seem to prioritize "getting started" issues very highly

13:14 Shambles_: If you don't like the word "ship", how about "include it in a installer".

13:14 timvisher|work: zach_: do keep in mind, if you're newer to clojure, that namespaces with `-`s have to have all of them translated to `_` in the file itself

13:14 i shoot myself in the foot with that semi-regularly

13:14 arrdem: is there some way I can make the Clojure compiler ignore unbound symbols?

13:15 *not ignore, but not error on.

13:15 timvisher|work: Shambles_: the thing is that clojure isn't really an installable thing

13:15 at least not at this turn

13:15 although i'd agree with you if you said that that's a bit confusing

13:15 technomancy: maybe someone should write a setup.exe wizard installer type thing for leiningen

13:16 having to manually hunt down curl is kind of silly

13:16 timvisher|work: technomancy: it shouldn't really be needed. the bat file works fine

13:16 well-

13:16 that's true

13:16 i do think it's more of a question of the clojure.org pointers all being outdated at this poin

13:16 point*

13:17 zach_: timvisher|work: oh, cool! Thanks for the tip

13:17 dgrnbrg: technomancy: is there a way in lein1 to have a plugin run stuff when init.clj is run, even if that plugin wasn't chosen?

13:17 technomancy: dgrnbrg: no, closest thing is adding hooks

13:17 dgrnbrg: it's on the table for 2.x though

13:18 dgrnbrg: technomancy: what is a hook? you mean to robert.hooke some random init fn?

13:18 Shambles_: timvisher|work: I know every language has the right to do its own thing, like Smalltalk thinking that OS's shouldn't exist, so it provides its own window manager and is rather filesystem hostile... but really, when someone says "I want to install Python (or Perl, or Ruby, or whatever)" they go download a installer or .rpm or .deb, stick it on, then there's /at least/ a command that brings up a REPL or spews a help page (for

13:19 dgrnbrg: technomancy: I did add-hook to the function I wanted to hook in my plugin, which should modify the behavior of eval-in-subprocess, but it doesn't get loaded unless I explicitly call

13:19 timvisher|work: Shambles_: I really couldn't agree more. i'm just saying that so far clojure hasn't chosen to do that, and it leads to conversations like this if the person wasn't lucky enough to find leiningen first

13:19 technomancy: dgrnbrg: yeah, no way getting around the explicit :hooks declaration so far

13:19 dgrnbrg: is that in project.clj?

13:19 Shambles_: timvisher|work: At no point when starting out with any other language would a package installer be the first thing I thought about. I wouldn't have said, you know, py2exe is really kick ass... Then install it, and realize... "Oh, I need that Python language thing, so I can write programs in it." It's kind of like picking out nice wagon wheels before you own a horse.

13:19 technomancy: yeah

13:20 Shambles_: even if that's the right way to do it, that would require buy-in from clojure/core who have been very resistant so far. plus it would mean improvements on that would all have to go through the slow CA/patches-on-jira process; yuck

13:20 timvisher|work: Shambles_: agreed, again, but i would say that lein is much more than a package installer

13:21 it's like gem + rake combined, or something

13:21 or gradle or maven if you've used those

13:21 S11001001: interesting, I always look for build tools first

13:21 timvisher|work: i think that may be a source of confusion for you

13:21 dgrnbrg: technomancy: is the :hook namespace in a :dependency of the project, not a lein plugin? and do I need to set eval-in-leiningen to true if the hook is coming from a project I have listed as a dependency?

13:21 Shambles_: technomancy: Since Clojure is very distributed (not necessarily a good thing... everything in one place, like CPAN, makes it easy to browse), maybe the best solution would be a installer that queried (at least) the Clojure and Leiningen websites, and downloaded/installed them in the appropriate places. Then no cooperation would be necessary.

13:22 foxdonut: Just use lein. It does everything. It even keeps your coffee hot and your beer cold :-)

13:22 Shambles_: After that, the rest wouldn't be that painful.

13:22 technomancy: I don't get it; why would you want that?

13:22 timvisher|work: foxdonut: it makes great table conversation with my wife and kids, as well

13:23 dgrnbrg: technomancy: to me or Shambles_ ?

13:23 * timvisher|work hugs technomancy for improving his life and encouraging weight loss in us all

13:23 technomancy: dgrnbrg: that was to Shambles_; I don't follow your question.

13:23 foxdonut: timvisher|work: yeah, but nothing beats Smalltalk for that!

13:23 Shambles_: technomancy: Why would I want Clojure to come with Leiningen?

13:23 technomancy: the namespace for the :hooks entries need to come from plugins

13:23 Shambles_: it already does

13:23 Shambles_: technomancy: Let me reword that.

13:24 technomancy: "Why would I want it to be impossible to install Clojure without Leiningen?"

13:24 S11001001: I don't see an issue with that

13:24 timvisher|work: Shambles_: simplicity ;)

13:24 Shambles_: technomancy: The answer is "to avoid what I went through, because I didn't psychically know I needed a obscure piece of software I would never have installed willingly otherwise".

13:24 timvisher|work: it's not impossible, any way, you appear to have succeeded in doing so

13:25 but the tool does make it much nicer

13:25 S11001001: I think obscure might be a little extreme

13:25 technomancy: Shambles_: sounds like a documentation problem to me

13:25 dgrnbrg: technomancy: i need to hook eval-in-subprocess to use lein in my environment, which requires running java classes with a weird, custom jvm-ish thing that needs a bunch of arg-munging. I have an init.clj that does the "right thing" and makes lein work, but i want to bundle it up into a lib/plugin, so that it's repeatable for everyone else in the firm. Since I can't force a plugin to get loaded every time lein is loaded, i need to use a hook. Is

13:25 :hook referring to a namespace in the :dependencies of the project (so that my init.clj code can be in a separate project)?

13:25 S11001001: you know, typesafe did a super-fancy installer package for scala

13:25 Shambles_: technomancy: Honestly I'm a fan of 'download a file, and run the installer'. I wouldn't go looking for programs to fetch stuff off remote repositories and build it. I know Clojure does things that way now. I know it would have avoided me needing to do some work. But it's extremely unintuitive.

13:25 S11001001: they also left out scala; it just installs the build tool

13:26 timvisher|work: S11001001: you're name is the one i fear most while i'm here typing into web irc

13:26 foxdonut: Shambles_: what piece of software are you referring to?

13:26 timvisher|work: but i'm getting pretty good at typing it nonetheless ^_^

13:26 technomancy: it's hard enough to get clojure/core to pay attention to issues when they're focused on making clojure a library. if you turn it into a user-level application too that just puts more work on their plate that they've repeatedly shown they're not interested in.

13:26 Shambles_: technomancy: Criticizing is really like yelling at the guy for not having bought nice wagon wheels before he bought a horse off you. It's irrational. If Leiningen is necessary to use Clojure, it should come with Clojure. Maybe you don't wanna deal with the Clojure guy directly for every little thing. The 'fetch and install the latest version of both' installer would avoid the need.

13:27 timvisher|work: Shambles_: the thing is that it's not necessary

13:27 Shambles_: foxdonut: Leiningen. It's not something I knew about until later on. It's not something I would ever have wanted normally.

13:27 timvisher|work: clojure works fine without leiningen

13:27 it actually works like all the other java library out there, where you need to muck with your classpath and get your dependencies right etc.

13:27 your criticism is more of the jvm and how it works, which sadly isn't changing any time soon

13:28 foxdonut: Shambles_: it's not hard to run clojure without lein. With or without lein, the vast majority of people don't seem to have a problem getting up and running. So I wouldn't say it's "extremely unintuitive".

13:28 technomancy: I agree the instructions on clojure.org are not very good, and I wish we could do something about them.

13:28 Shambles_: timvisher|work: So long as you don't want to install anything that uses it, yes. Also, mind you you didn't think you should be able to use the REPL without some other environment (Clojure is a library), so without other software Clojure would be a nice file taking up space on your hard drive.

13:28 timvisher|work: Shambles_: you mean without the jvm?

13:29 because as long as you do have the jvm, installing other libraries for clojure to use is as intuitive as anything else on the jvm without a tool

13:29 Shambles_: timvisher|work: I mean without a batch file or shell script to make it into a reasonable command you could use to bring op the REPL.

13:29 timvisher|work: but things like ant, maven, gradle, etc. exist because everyone hates that

13:29 Shambles_: like i said, that's just not what clojure is trying to be

13:29 technomancy: this is bigger than clojure anyway; the `java` command-line launcher is a joke to begin with

13:30 timvisher|work: you need a tool to make it nicer, as you do with most things in java

13:30 foxdonut: I wouldn't call Leiningen an "obscure piece of software", either.

13:30 Shambles_: foxdonut: You may need to read scrollback.

13:30 timvisher|work: technomancy: exactly

13:31 Shambles_: foxdonut: To someone that "wants to write in Clojure" Leiningen is likely to be the last thing on their mind. Downloading Clojure, and some IDE for it, is likely to be the first order of business. Doing that before Leiningen results in the problems I was trying to talk about, but seems nobody here wants to here it so I'll quieten down.

13:32 dgrnbrg: technomancy: if I want to use an ns with :hooks in lein1, can that ns be provided by a package in my :dependencies or :dev-dependencies?

13:33 technomancy: dgrnbrg: it has to be visible to leiningen's process, so :plugins or :dev-dependencies

13:33 dgrnbrg: technomancy: do I need to set :eval-in-leiningen to be true in the package containing the hook?

13:33 timvisher|work: Shambles_: it's fine to gripe. i don't think anyone here thinks that clojure startup is all that intuitive

13:33 technomancy: dgrnbrg: no, :eval-in-leiningen is only relevant when developing on that project itself

13:33 timvisher|work: the point is that there are things that make it nice and there aren't many good ways to fix what lead you to here

13:33 technomancy: once you're consuming it as a dependency it's ignored

13:34 Shambles_: timvisher|work: Rather than agreeing with me All I heard was you, technomancy, and now foxdonut criticizing me for not psychically knowing I should have installed something I would have had no reason to look for.

13:34 foxdonut: Shambles_: "Doing that before Leiningen results in problems"-- again, I disagree, because many, many people have done that successfully. Now, being familiar with Java, the JVM, and the classpath certainly helps, and that is probably the target of your discontent, not Clojure itself.

13:35 technomancy: uh no, I said it sucks that the documentation is bad and I wish I could fix it.

13:35 dgrnbrg: technomancy: I have the :hooks set, and the project as a dev-dependency, but I do not think that the hook is running when i do "lein nailgun"

13:35 is there a way to debug the hooks?

13:36 technomancy: throw a few printlns in the hook defn I guess

13:36 Shambles_: timvisher|work: There's good ways to fix what lead me here, yes. Python has Eggs. You download a file, then run the built in (comes with Python) egg installer. Racket has the (planet path/packagename:major:minor:file) 'inclusion' that goes and fetches packages off the central repository if it's not in your cache... All these work out of the box with little to no effort.

13:37 timvisher|work: The package handler needs to come with the basic programming environment, however the problem is solved.

13:37 That doesn't mean it has to be in the same file, or that the authors have to cooperate much, but both need to end up on the user's system at the same time.

13:38 foxdonut: Shambles_: at the very basic, you could just download clojure.jar and run "java -cp clojure.jar clojure.main" to get a REPL. Done. What's so hard about that?

13:38 Shambles_: foxdonut: Try making it work on Windows such that you aren't dependent on the directory name.

13:39 foxdonut: And that it can be launched by including whatever directory it's in, in your path.

13:39 foxdonut: Though again that only solves the getting the REPL working, not all the rest of this stuff, which was due to me not installing Leiningen first.

13:46 TimMc: Basically, clojure.org is a complete mess.

13:46 * foxdonut has left #clojure

13:46 TimMc: foxdonut: Nice try.

13:46 dgrnbrg: Shambles_: it is a shame that clojure.org doesn't refer to leiningen

13:47 it's the most awesome tool i've ever used

13:47 foxdonut: (inc TimMc)

13:47 lazybot: ⇒ 8

13:47 Shambles_: So far I've been fairly pleased with the language itself. The stuff it didn't come with that I wanted, I was able to find libraries for. It's just the installation that's been painful.

13:47 arrdem: Shambles_: which is where lein comes in...

13:48 with beer and deps.

13:48 dgrnbrg: Shambles_: once you rock out with lein, you'll realize how productive you can be. With lein vimclojure, lein test, lein deps, lein swank

13:48 * arrdem looks up lein swank

13:48 dgrnbrg: or lein clojars, lein hadoop, lein guzheng (shameless plug)

13:48 i just listed deployment, testing, code coverage, and repl tools

13:49 TimMc: Shambles_: Unfortunately, clojure.org is controlled by folks who don't have the time+inclination to maintain it.

13:49 arrdem: Okay. so it's nailgun for EMACS

13:50 Shambles_: Things I liked that I found on clojure.org was a description of how it differs from other Lisps, the cheat sheet, and the special forms list (mostly due to the discussion of the threading operator, which I haven't seen elsewhere).

13:50 dgrnbrg: Shambles_: have you seen clojuredocs.org?

13:50 that's better for documentation, imo

13:50 Shambles_: dgrnbrg: I haven't.

13:50 dgrnbrg: it's my favorite for user contributed examples + good organization

13:50 arrdem: clojuredocs is way better... mostly due to the examples

13:50 dgrnbrg: but it's only useful for the core

13:51 scriptor: clojuredocs has good search too

13:52 Shambles_: I know about Clojars. It's your rough equivalent to CPAN, Python Cheese Shop, or PLaneT. Hadoop is familiar for some reason, but I don't know why, and I haven't seen that last one.

13:52 Clojars should be a lot more 'visible' IMO, but that'd require clojure.org cooperation.

13:52 redwire: I'm having some trouble with some code. http://pastebin.com/ZaxzTixE For some reason when load this I get java.lang.Exception: Unmatched delimiter: ) (wordtree.clj:17) though I'm sure the parens are matched and everything runs when I take out the println call.

13:53 hiredman: redwire: 't'

13:53 aaelony: use one single quote

13:53 redwire: Oh shoot it's \t in Clojure, isn't it?

13:53 hiredman: also 'a'

13:53 and 't' again

13:53 and use of structmaps

13:53 uvtc: TimMc, re. "time and inclination to maintain it", that doesn't make sense to me --- wouldn't they just delegate it to whomever's interested in getting it updated?

13:53 redwire: What's wrong with the use of structmaps?

13:54 dnolen: redwire: deprecated.

13:54 redwire: Really? I see. Normal maps, then?

13:54 dgrnbrg: Shambles_: clojars is just a maven repo--it's very hard/impossible to search for content, as it's just a thin view of maven. Plus, lein automagically searches it for you, so you almost never need it

13:54 and if you use lein outdated, it'll tell you which libs have newer version available

13:55 uvtc: Shambles_, btw, re. Python eggs, they're going away I think.

13:55 arrdem: redwire: deftype if possible...

13:55 dnolen: redwire: normal maps work great, also defrecord

13:56 arrdem: defrecord closer to what structmap provides.

13:56 arrdem: dnolen: can you extend a deftype? I know that defrecord will let you spec a minimum key set..

13:57 TimMc: uvtc: I dunno, it seems like they don't trust the community to be a good resource. clojure.org is so self-contained, insular... I don't recall seeing any outbound links to community resources.

13:57 SO that's a factor as well.

13:57 dnolen: arrdem: deftype is primitive, defines nothing.

13:57 Shambles_: uvtc: They've talked about the setuptools being replaced for quite some time, but in practice, nothing seems to ever be done. If that does happen, something else egg compatible will replace them. There's too much on the Python Cheese Shop to just get rid of support for it.

13:58 redwire: Thanks for the help, guys. Works just fine, now.

13:58 ystael: dgrnbrg: i'm trying out lein-guzheng ... would you have any insight into a Exception in thread "main" java.lang.RuntimeException: No such namespace: color , given that nothing named "color" appears anywhere in my code?

13:58 uvtc: Shambles_, should change once 3.3 is released.

13:58 foxdonut: redwire: cool nick

13:58 raek: arrdem|lunch: you can assoc as many key-value pairs as you like with records

13:58 redwire: Thank you.

13:59 raek: (so they are not limited to the ones you declare)

13:59 dgrnbrg: ystael: could you post the whole stack trace on paste bin?

13:59 arrdem|lunch: raek: thanks that's what I thought.

13:59 uvtc: TimMc, Ah. Hm. Reminds me ... I think I recall discussion on clojure-dev about removing the link to the wiki.

13:59 dgrnbrg: ystael: how are you invoking it?

13:59 usually you want something like "lein guzheng myproject.core -- test"

14:00 ystael: dgrnbrg: yes, precisely, though with 'midje' in place of 'test'

14:00 dgrnbrg: ystael: i've never tried it with midge, but i don't know why it wouldn't work...

14:00 lein1 or lein2?

14:00 raek: midje uses colored text output by default

14:00 Shambles_: uvtc: I see mention of new packaging tools, but nothing saying packages are going away. Sane package management supplied with the language is a pretty popular feature.

14:01 raek: so the color thing could be from midje

14:01 ystael: lein2.

14:01 uvtc: TimMc, yeah, here: http://groups.google.com/group/clojure-dev/browse_thread/thread/8ec1a5fc5e5f1a2f#

14:01 raek: ystael: you use the 2.0.0-SNAPSHOT version of lein-midje?

14:01 ystael: raek: yes

14:02 dgrnbrg: ystael: i'm going to open an issue on guzheng to add a test for midje

14:03 if you'd like to follow it: https://github.com/dgrnbrg/lein-guzheng/issues/2

14:04 Shambles_: dgrnbrg: Do you have plans for using guzheng?

14:04 ystael: dgrnbrg: cool, thanks much

14:04 TimMc: uvtc: Hmm, that's not so bad. And I just found that I can find out about Lein in 2 clicks from the main clojure.org page, although it should only be one click.

14:05 ystael: stack trace is at https://gist.github.com/2a56d48f9e771c6d3b64

14:05 dgrnbrg: Shambles_: what do you mean? I wrote it for giving test coverage info, and i use it in my projects

14:05 Shambles_: dgrnbrg: I wasn't sure if you had a particular use in mind. I can think of something to use it for, but that wasn't it, though that's a good use too.

14:06 dgrnbrg: Shambles_: guzheng is a tool for writing clojure transformations by hooking into the loader

14:06 Shambles_: dgrnbrg: I was thinking about something like http://groups.csail.mit.edu/pag/daikon/

14:06 dgrnbrg: i wrote a branch coverage analyzer for it, and a lein plugin to use it

14:06 uvtc: There should be a note at the top of http://clojure.org/downloads saying, "though, for regular use, install [Leiningen] and have it take care of getting Clojure for you".

14:06 TimMc: Oof, that too.

14:07 Shambles_: uvtc: Yes. What you just said would have avoided a lot of difficulty on my part.

14:07 Wild_Cat: I gotta admit leiningen is fairly awesome.

14:07 Shambles_: What uvtc said is exactly what's needed.

14:07 technomancy: Shambles_: maybe if you make some noise on the clojure mailing list it would help

14:07 dgrnbrg: i suppose it'd be doable to do so, but i'm probably going to stick with the branch analysis--it's all i need, and i have other projects

14:07 Wild_Cat: compared to most languages' built-in dependency managers/build utilities, it's the only one that comes close to maven.

14:07 cmajor7: is there a way to get both {:published "2008-02-13" :title "clojure is the best lisp yet"} in a single call to "xml->" from http://bit.ly/NnT3mE? e.g. I can easily get one as "(xml1-> books :entry :title text)"

14:09 Shambles_: technomancy: I'm still getting used to being able to do basic things in the language, and I tend to be both a bit uncomfortable on mailing lists and not real pleased with the mail volume. I could deal with it, but I'm not sure how much good I'd do at this point, especially since it sounds like the person in charge of the website doesn't care about the issue.

14:09 technomancy: part of the reason they don't care is probably that they don't understand the newcomer's perspective

14:10 uvtc: Will post that to the ML right now.

14:10 TimMc: Thanks, uvtc!

14:10 Shambles_: I can't really be the first one that's come here wondering what's up with the classpath mess, or how everything seems to require lein, or how installing anything before lein tends to not work very well (e.g. that Counterclockwise behavior I mentioned).

14:10 TimMc: Shambles_: You're not.

14:11 redwire: I've been there. I've been very frustrated sometimes about only being told "use lein" when my first install of clojure via aptitude didn't work well.

14:11 TimMc: I don't think anyone's arguing against you, there...

14:12 xclite: Shambles_: Those same thoughts annoyed me when I tried to dive in recently - been on the back burner since due to other priorities

14:13 Shambles_: Well, since I've battled through that on my own, and someone here (I now forget who, I think it was timvisher) helped me figure out why I couldn't launch a REPL in anything but 1.3.0... will I be able to build/install most anything with "leiin install", even if it doesn't come with instructions?

14:14 gtrak`: looks like the riddell guy took down his site finally

14:14 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.finally

14:14 Shambles_: For example, this: https://github.com/swannodette/delimc

14:15 raek: Shambles_: are you going to hack on the delimc code or just use it?

14:15 TimMc: Shambles_: lein install doesn't do what you think it does -- see `lein help install`

14:15 Shambles_: raek: I'd like to just use it, for now at least.

14:16 foxdonut: Shambles_: sorry if you've been having some trouble, and for my coming off negatively earlier. that wasn't cool and I apologize.

14:16 uvtc: TimMc, y/w!

14:16 raek: then you don't need to install anything. you add it to your :dependencies in your project.clj

14:17 Shambles_: foxdonut: I'm used to getting worse on other programming channels. I'd just decided I was either a jerk, and/or most programmers were, and you sort of have to grin and bear it to get the information you need. I've been pleasantly surprised on a few channels, though I haven't figured out why they're different from others.

14:17 raek: is "lein install" mostly used by library authors to try a library before publishing it

14:18 *"lein install" is

14:18 Shambles_: raek: I see.

14:18 gtrak`: lein install is equivalent to mvn install, Shambles_ lein has a lot do with maven in java-land

14:18 foxdonut: Shambles_: we'll never be the worst as long as there is #hibernate ;-)

14:19 gtrak`: a lot to do*

14:19 Shambles_: I was basing that on this: Clone Seesaw from github. Fork if you like. Switch to the "develop" branch. In your Seesaw checkout, run lein install to build it In your project's project.clj file, change the Seesaw version to X.Y.Z-SNAPSHOT to match whatever's in Seesaw's project.clj. Run lein deps

14:19 So I thought it was for building. I still don't have much experience with it yet.

14:20 gtrak`: I know very, very little about Java. I'm more here for "a lisp with really good I/O support" than the Java aspect.

14:20 gtrak`: Shambles_: yea.. github pages might assume you already know how everything works

14:22 Shambles_: I hope you're ready to learn a little java :-D

14:23 a lot of things will make more sense that way

14:24 Shambles_: gtrak`: I got the impression I'd only need to know what to call in the standard library. I've used C++, so I doubt it'd be very difficult. I'd just rather not spend much time on it beyond the "what I need to know to call things" part.

14:25 gtrak`: gotcha, yes, it's much less soul-crushing than C++ but there's a lot to think about as well

14:26 TimMc: Shambles_: Clojure is not stand-alone -- you still ahve to live with some poor choices from Java-land. THe nice thing is that you get to build cleaner abstractions over them.

14:26 Shambles_: gtrak`: I like Lisp macros, but I hope to never have to deal with any code using template metaprogramming again, or preprocessor macros for that matter.

14:27 gtrak`: yes, gawd...

14:28 Shambles_: TimMc: I know about the "have to tell it when you want tail recursion" part, and that there's no restarts like in most Common Lisp (but you can add that back if you can get continuations going...). Is there anything else I should know about?

14:29 gtrak`: &(macroexpand '(let [[a b] [1 2]] [a b])) ; Shambles_ , wheeeeeeeeeeeee

14:29 lazybot: ⇒ (let* [vec__8134 [1 2] a (clojure.core/nth vec__8134 0 nil) b (clojure.core/nth vec__8134 1 nil)] [a b])

14:29 Shambles_: Mostly it seems to be really hard to find any Lisp with pretty complete GUI and sound support, and Clojure should have that nailed for me.

14:29 TimMc: ~pitfalls

14:29 clojurebot: It's greek to me.

14:29 borkdude: I don't like GUIs

14:29 TimMc: Oh, that was for something else, bad fn names.

14:32 gtrak`: Shambles_: you'll probably want to check out overtone and upshot at some point

14:33 Shambles_: TimMc: Bad function names due to Java? You mean worse than cadadaaadaadr ? ;)

14:34 TimMc: Shambles_: Nope, in Clojure! Look at the definitions of contains?, for instance.

14:34 &(doc contains?)

14:34 lazybot: ⇒ "([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constan... https://www.refheap.com/paste/3277

14:35 Shambles_: TimMc: I guess you mostly see those in the macroexpansions?

14:37 TimMc: Shambles_: I wouldn't say that. Dunno if I've used it in my code, though.

14:37 clojurebot: contains

14:37 clojurebot: contains is gotcha

14:37 TimMc: ~gotchas

14:37 clojurebot: Pardon?

14:37 TimMc: ~gotcha

14:37 clojurebot: gotcha is contains

14:37 TimMc: >_<

14:37 gfredericks: Is this your fault? ^

14:41 Shambles_: Some of the weird names can be fun, at least. I approve of "uberjar". :P

14:42 nDuff: Hrm.

14:43 It's a bit unfortunate that clojure.core.incubator shows up in package clojure.core -- in an OSGi context, it's expected that each package is provided by one and only one jar, and that doesn't apply here.

14:46 TimMc: nDuff: 1-1 package and jar? o.O

14:46 arrdem: does anyone here know a good tutorial on detecting and loading jars in Clojure?

14:46 nDuff: TimMc: n:1; each jar can provide multiple packages, but each package must be provided by only one jar.

14:47 TimMc: Oh, got it.

14:47 So what's happening with incubator then?

14:48 nDuff: TimMc: since packages are mapped by directory structure, clojure/core/incubator.clj is part of the clojure.core package

14:48 TimMc: ...and clojure.core, of course, is provided by Clojure itself.

14:49 Shambles_: uvtc: The Brief Beginner's Guide is nice.

14:49 uvtc: Shambles_, thanks. Share and enjoy. :)

14:50 TimMc: nDuff: Not getting it. The clojure.core.incubator package comes in as a separate jar from clojure.core, but is a subpackage, that's the issue?

14:50 nDuff: TimMc: That's the problem; it's *not* a subpackage inasmuch as OSGi is concerned.

14:50 TimMc: ...so an OSGi loader tries to find clojure/core/incubator.clj in the primary Clojure bundle, ignoring the fact that a separate core-incubator bundle is installed.

14:51 TimMc: Why does it try to find it there? Prefix?

14:51 nDuff: TimMc: ...now, if it were clojure/core/incubator/.clj, this would be a non-issue...

14:52 TimMc: the manifest for OSGi bundles specifies which packages (in the Java sense) that bundle provides. Only one bundle can be wired to a given package in a single context.

14:52 TimMc: Oh! I think I see. clojure/core/incubator.clj is a resource in clojure.core, whereas clojure.core.incubator.init (or whatever it is) is a class in the clojure.core.incubator package.

14:52 nDuff: Right!

14:55 ...given as clojure.osgi is already wrapping load-resource, it'd actually be pretty easy to modify it to also search clojure/core/incubator/.clj, but then I'd have to put together build infrastructure to create jars munged that way in the first place, and it seems a really ridiculously awful hack.

14:56 cmajor7: is this the best way to combine several seqs in a map with given keys (e.g. :title :published)? https://www.refheap.com/paste/3278

14:57 feels to verbose.. might have overlooked a known builtin

15:05 tbaldridge: Shambles_: I agree, I'd love to see better Clojure GUI support. The bad thing is, it's hard to do functional programming with GUIs

15:07 Shambles_: tbaldridge: Well, all of AWT and SWING should be accessible by Clojure out of the box, and then there's SWT. There's even wrappers like Seesaw. That's far better than most Lisps.

15:07 pandeiro: cmajor7: you could eliminate a pair of parens and brackets by using hash-map instead of zipmap, but that's all i got

15:08 tbaldridge: Agreed, but you still end up getting into more of a OOP situation than I would like

15:10 cmajor7: pandeiro: how would switch it to hash-map?

15:10 Shambles_: tbaldridge: As for functional GUI's, I'm not sure it's important. I don't think a lot of bugs exist because of mutable values within GUI's. It may be a bit of a PITA to hook everything up, though, and Cells is probably what you want there. There seems to be a dataflow DSL for Clojure named dgraph you could use to implement something like that.

15:10 pandeiro: cmajor7: (map #(hash-map :title %1 :date %2) titles dates)

15:11 TimMc: nDuff: So when you're running in an OSGi context (I hope "context" isn't jargon for anything surprising) Clojure tries to load a namespace clj file for on-the-fly compilation, and fails. Is that what's happening?

15:12 cmajor7: pandeiro: was has-mapping over %1 %2 together… makes sense => thx, it is indeed cleaner

15:12 nDuff: TimMc: correct.

15:23 solussd: I know this is vague, but I'm getting a classnotfoundexception in a namespace$function only when running via 'lein run', works fine in the repl. I can verify that the namespace and function exist and I'm not AOT compiling… any ideas?

15:24 further, I do not get the error when running 'lein test'

15:24 gtrak`: solussd: are you importing before requiring somewhere?

15:24 solussd: gtrak`: probably. :D

15:24 gtrak`: perhaps some records have not yet been code-gen'd

15:24 or protocols?

15:24 solussd: ill check

15:27 ibdknox: How do I change the context of macroexpansion? binding *ns* doesn't seem to do it

15:28 solussd: gtrak`: sadly, that doesn't seem to be it. :/

15:28 TimMc: ibdknox: Example?

15:29 ibdknox: TimMc: (binding [*ns* (create-ns 'woot)] (postwalk macroexpand-1 '(defmacro m [] `q)))

15:29 gtrak`: solussd: weird

15:30 TimMc: ibdknox: Where is postwalk again?

15:30 ibdknox: clojure.walk

15:31 no matter what I do that seems to always expand into (quote user/q)

15:31 amalloy: ibdknox: what would it mean to change the context?

15:32 oh, no, of course you can't do that. syntax-quote happens at read time, before macroexpansion

15:32 ibdknox: ah

15:32 hm

15:32 TimMc: Ooh, that'll do it.

15:33 amalloy: (defmacro m [] (read-string "`q")) ;; lol?

15:33 ibdknox: lol

15:33 I wonder how that ends up working in a repl then

15:34 TimMc: &'`q ;; I think this would turn into '(syntax-quote q) in Scheme.

15:34 lazybot: ⇒ (quote clojure.core/q)

15:34 amalloy: ibdknox: at the repl, *ns* is bound while reading

15:34 ,(binding [*ns* (create-ns 'woot)] (read-string "'q"))

15:34 clojurebot: (quote q)

15:34 amalloy: ,(binding [*ns* (create-ns 'woot)] (read-string "`q"))

15:34 clojurebot: (quote woot/q)

15:35 ibdknox: got it

15:35 thanks :)

15:36 lancero: I'm trying to encode a string to base64 with this: http://pastebin.com/h29BuhEp

15:36 I get this error: clojure.lang.LineNumberingPushbackReader cannot be cast to java.io.InputStream

15:37 gtrak`: lancero: call input-stream on it?

15:37 amalloy: dnolen: so it's my understanding that negation is somehow "hard" in logic programming. is implication hard too, because P->Q is effectively ~P v (P ^ Q)?

15:42 lancero: gtrak`: not sure what you mean

15:42 gtrak`: lancero: actually, from looking at clojure.java.io, I suppose you can't

15:43 dnolen: amalloy: implication is easy, otherwise you would haven't logic programming at all. negation is hard.

15:43 amalloy: tho I read a pretty interesting paper today about getting negation into CiaoProlog ...

15:44 amalloy: i was thinking a solver for http://rooms.jmpup.com/#manual would be a fun first logic program, but i'm hoping to find out whether it's impossibly ambitious first :)

15:44 cmajor7: is there a way to parse a section of XML selectively into a map? with "xml->" I can get to the end values/tags, for the "first", for "all", but am looking to get e.g. a 3rd (whole) section.

15:47 amalloy: there's negation, but it's all limited enough that i think i could get around it be explicitly specifying "x is true implies XYZ" and "x is false implies [the opposite of XYZ]"

16:02 gtrak`: lancero: there's this though: http://commons.apache.org/io/apidocs/org/apache/commons/io/input/ReaderInputStream.html

16:05 dnolen: amalloy: that looks like fun. sounds like a reasonable approach.

16:05 amalloy: thanks!

16:05 dnolen: amalloy: my Prolog chops are not that great - but my experience it that Prologists are fiendishly clever at getting Prolog to do interesting things.

16:05 amalloy: haha

16:07 dnolen: amalloy: which is to say there's probably a good approach - worth popping in the Prolog channel if you're looking for tips on approach. Also Stack Overflow hasn't been bad.

16:08 hiredman: there is a prolog irc channel?

16:08 dnolen: hiredman: yes, pretty friendly too if not very chatty.

16:08 amalloy: dnolen: are you saying that core.logic lacks some feature prolog has that would help with this and i should use prolog, or that prologgers would have good advice that applies equally to core.logic?

16:08 borkdude: hiredman if you give answers in that channel, they will ask the corresponding questions

16:08 dnolen: smart cookies in there that mostly get homework questions :P

16:09 amalloy: they would give advice that could be readily applied to core.logic.

16:18 arrdem: what is the standard for writing and naming lein tests?

16:18 clojurebot: meh

16:20 TimMc: clojurebot: You're trouble.

16:20 clojurebot: I don't understand.

16:20 arrdem: clojurebot just hates me.

16:21 TimMc: arrdem: I've never heard of a naming convention for the individual deftests.

16:21 arrdem: TimMc: I just looked at some git repos to get an idea... seems that you use test/<packages>/test.clj

16:22 that was all I was asking for.

16:22 hiredman: test/first-part-of-namespace/test/other/parts.clj

16:22 TimMc: Sort of. Namespace a.b.c is tested with a.b.test.c

16:22 hiredman: lein new will generate test/projectname/test/core.clj

16:23 TimMc: Anything other than putting test at the end.

16:23 arrdem: duely noted.

16:23 and makes sense from a naming standpoint.

16:31 TimMc: It's a little irritating to work with when you want to rename namespaces (e.g. right after project setup), but not much trouble after that.

16:31 amalloy: TimMc: bash, find, and perl are your friends there

16:34 TimMc: merrr

17:10 nDuff: Hrm.

17:12 solussd: any ideas what might cause a NoClassDefFoundError only when skip-aot: true is set w/ leiningen? never get the error in the repl though. :/

17:13 TimMc: Are you defining any protocols, using gen-class, defrecord...

17:14 solussd: yes to protocols and defrecords. I made sure records are imported last in my ns macros at the top of each file…

17:14 i'm extending protocols in several places as well.

17:14 hiredman: have you restarted your repl recently?

17:14 solussd: yes, and I can reproduce on another system w/ a clean checkout of the repo

17:15 hiredman: how are you loading the code in to the repl?

17:15 and how are you loading it when you get the exception

17:15 solussd: (require '[my.namespace :as blah]

17:15 )

17:15 (in the repl)

17:16 lein run -> access page via web browser that kicks off some code

17:16 it works with AOT enabled though..

17:16 but then I have all kinds of issues w/ clojurescript [but that's another story]

17:22 brehaut: PeregrinePDX2: do you know about https://github.com/Sagelt/Dungeon-World ?

17:23 wrong channel sorry

17:24 solussd: brehaut: ha. didn't stop me from clicking the link and checking it out.

17:25 brehaut: solussd: incase its confusing, its a tabletop roleplaying game that happens to have its source in github

17:25 solussd: brehaut: yeah, i see that now-- I was at first confused by the lack of source-code.

17:54 Chiron_: Guys check this http://stackoverflow.com/questions/11139041/better-ways-to-traverse-a-map-of-maps amalloy is amazing!!

17:56 Raynes: amalloy: Did you hear that? You're amazing and stuff.

17:57 I think amalloy is less awesome than Chiron_ is overly excitable.

17:57 Cocaine is bad for you, just fyi.

17:57 amalloy: clojure, man. clojure is the awesome thing

17:59 Chiron_: amalloy: Thanks :D I need a lot to learn this functional style . clojure is awesome but you too

18:13 TimMc: Chiron_: 'for is a pretty excellent macro to know, too.

18:15 Chiron_: but I really needed a lot of time to understand the snippets

18:15 extremely terse. imagining doing that with imperative language

18:34 gtrak`: dnolen: heather from baltimore betascape sent ktcoders an e-mail yesterday. She totally found you guys independently, I swear :-). We had a meeting yesterday and I laughed about it.

18:34 dnolen: gtrak`: haha, funny :)

18:35 gtrak`: i think she was looking around for microcontroller hackers

18:35 dnolen: gtrak`: yeah the other ktcoder Ted Hayes does a lot of that. Arduino & Raspberry Pi

18:37 gtrak`: well, it should be fun, but it's the sat/sun before strange-loop so I'll be having a busy few days

18:38 technomancy: who was in here asking about a step-by-step guide to building a clojure web app earlier?

18:39 beffbernard: How do you turn on debugger info for the reader?

19:31 zach_: Could anyone give me some advice on dynamically binding vars for the sake of testing? Here's what I'm currently trying to do (https://www.refheap.com/paste/3282), but it's erroring out because 'collection' was defined in a different context.

19:35 brehaut: zach_: you probably dont want dynamic vars for testing. theres function specifically for modifying a var for testing

19:35 zach_: brehaut: Okay, cool -- probably found in clojure.test?

19:35 brehaut: err

19:35 i dont think so

19:35 technomancy ussually pipes up with the answer

19:36 zach_: :)

19:36 technomancy: you mean with-redefs?

19:36 brehaut: thats what i mean!

19:37 (inc technomancy)

19:37 lazybot: ⇒ 25

19:37 zach_: technomancy: brehaut: Awesome! Thanks guys

19:37 brehaut: zach_: i dont know if it will fix your problem though

19:38 zach_: brehaut: It's a start. I'll come back complaining if it doesn't ;)

19:39 brehaut: zach_: it probably doesnt help that you were trying to bind 'collection' rather than 'd/collection'

19:40 zach_: its also good style to slap earmuffs around any dynamic var you do create

19:40 eg *collection*

19:43 technomancy: but don't make it dynamic just for testing purposes

19:44 RickInGA: technomancy: do you have a minute to help with a swarm coding setup question?

19:45 technomancy: sure

19:46 RickInGA: thanks… I have run the script and it says launch TERM=xterm-256color tmux

19:46 I do that, and it looks like it works, but when I ssh in, and try to attach, it says no seesions found

19:46 I am using a mac, if that makes a difference

19:47 technomancy: that should work

19:49 RickInGA: when I ssh in, I get a message telling me to run TERM=xterm256color tmux attach, whether I type that or just tmux attach, I just get no sessions

19:50 is there a way from within the host process I can confirm that a session is running?

19:51 technomancy: you can always grep through ps awx

19:53 RickInGA: ok, I can see that it is running. Do you know, is there someway I have to identify the session I want to attach to?

19:53 technomancy: once you've already attached, you can change sessions with C-z S

19:54 I don't know about before you've attached

19:54 wkelly: tmux list-sessions

19:55 RickInGA: i wonder if I am getting a permissions problem… list-sessions worked in host window, not in remote

19:55 got 'failed to connect to server: connection refused"

19:55 zerokarmaleft: or `tmux ls` for short

19:55 technomancy: are you running the client and server as a different user?

19:56 I would not recommend that for swarm coding

19:56 RickInGA: for server, I am running as 'swarm' that I got to with sudo -u swarm -i

19:56 for client, I am as me, then did ssh swarm@host

19:56 wkelly: the tty is likely owned by the original login user

19:56 RickInGA: so in both windows, I should be running as swarm

19:57 wkelly: ssh in directly as swarm and start a tmux session, and your life will be good

19:57 technomancy: odd that it would make a difference, but yeah I always SSH in

19:57 RickInGA: ah, you are saying do both 'remotely' I will try it.

19:59 ok, cool, now I am in same sesson

19:59 hmmm, typing 'emacs' at that point was apparently not the right thing to do

20:00 technomancy: what? typing emacs is always the right thing to do

20:00 aperiodic: yeah, you should try 'vim'

20:00 * aperiodic ducks

20:00 RickInGA: I got some error, FAILED TO establish the default connection to the Window Server

20:01 my emacs icon is bouncing, but I can't switch to it

20:01 my terminals are blocked

20:01 technomancy: oh, maybe a macintoshy issue

20:01 aperiodic: well, you'll need to use a terminal version of emacs

20:01 technomancy: try emacs -nw

20:01 y3di: is anyone else getting spammy pms?

20:05 RickInGA: wow, cant kill emacs… rebooting....

20:05 technomancy: o_O

20:05 brehaut: maybe emacs has expanded to replace his OS

20:05 RickInGA: that wouldn't be all bad :)

20:06 brehaut: id hoped it would happen after they got multithreading sorted

20:06 gtrak`: brehaut: you mean like python?

20:06 brehaut: gtrak`: i most assuredly do not ;)

20:07 technomancy: brehaut: apparently there's a library floating around that does async futures in a subprocess

20:07 only 0.3s overhead

20:07 brehaut: technomancy: for emacs or python?

20:07 technomancy: emacs

20:08 brehaut: thats kind of amazing

20:08 gtrak`: i think generally it's easier to do threads upfront than tack it on later

20:09 brehaut: gtrak`: yeah that would be my though too

20:09 * brehaut is a survivor of python threading

20:09 gtrak`: hey look guys, now we're 'multi-threaded'! awesome, huh? nope

20:09 technomancy: brehaut: what's amazing is it's 100% elisp and can send closures to subprocess

20:10 brehaut: technomancy: that is actually amazing

20:10 technomancy: elisp has serializable-fn built-in

20:10 brehaut: nice!

20:10 technomancy: even works with byte-compiled defuns

20:10 RickInGA: Thanks guys for helping me get this running. 2 key points were to even have the 'host' ssh in to swarm and then emacs -nw

20:10 brehaut: for some reason i think even erlang doesnt have that?

20:10 * brehaut expects to be proven wrong about that claim

20:10 technomancy: oh snap; take that erlang

20:11 RickInGA: And there will be swarm coding happening in Atlanta on monday night!

20:11 technomancy: RickInGA: I hope to put together a better blog post on doing your own swarming

20:11 gtrak`: RickInGA: you met my buddies Jesse Bickel or Eric Caspary down there?

20:12 the atlanta clojure?

20:13 I used to go to GaTech, but I didn't know of clojure then :-/

20:13 RickInGA: gtrak`: yep, met Jesse at the first meeting (monday is the 2nd) and I have met Eric a few times now

20:13 gtrak`: awesome! they're both really cool

20:14 I roomed with Jesse

20:14 RickInGA: technomancy: my plan was to get this working, and then in the next week or so write some instructions, and then submit them to you to either approve before I posted it somewhere, or post yourself if you would rather

20:15 gtrak`: I was talking to another GT grad I knew at conj about heightened GT crime rates, and Eric's ears perked up, that's how I met him, haha

20:15 technomancy: RickInGA: are you building off anything in particular, or just my notes from my talk?

20:16 RickInGA: technomancy: notes from your talk, the seajure repository and a respoitory called nuclearsandwich/swarming, which is a fork from seajure

20:17 technomancy: thanks; I'll take a look at that

20:18 nuclearsandwich: hey RickInGA I started that on a plane. Still lots of work to do with it, I got distracted

20:18 RickInGA: everything takes me a little longer because I am clueless on osx… for example, the instruction 'use this key' for the encryption, took me about 20 min :)

20:19 nuclearsandwich: that gave me some guidence, but neither your script would work for me initially, because I was running emacs 23, without package manager… switched to the seajure one at that point, because it seemed to have fewer moving parts

20:20 after upgrading to emacs 24.1, of course :)

20:20 technomancy: yeah, 23 screwed up a few people at the conference; I hadn't even thought of it

20:21 goodieboy: I have a question about function argument pre-conditions. It feels redundant to define a bunch of pre-conditions, and then check arguments before calling the function. Is it better to not check the args when calling the function, but wrap in a try/catch for assertion errors? OR, always check the args before calling?

20:22 RickInGA: technomancy I was running 23 at the conference, but I was not a host

20:22 nuclearsandwich: RickInGA: yeah, I was trying to modularize the swarming stuff a little bit to make it easier to use non-emacs editors

20:25 technomancy: nuclearsandwich: dude... I just got a siphon pot =D

20:26 RickInGA: thanks again for the help…. brain fried from talking to recruiters all day *shudder*

20:26 see you guys next time

20:26 nuclearsandwich: technomancy: niiiiice have you tested it out yet?

20:27 brehaut: technomancy: aeropresses are available in new zealand again :D

20:27 technomancy: nuclearsandwich: I'm still figuring it out. seems like it has a lot of ... variables involved.

20:28 brehaut: sweet

20:28 nuclearsandwich: I haven't really made a cup I'm happy with yet

20:28 zerokarmaleft: technomancy: do you order beans online?

20:29 nuclearsandwich: technomancy: for sure, I've pretty much fallen back on the simpler methods. French Press and chemex

20:29 technomancy: zerokarmaleft: no, I pick them up from local roasters when I work out of their shops.

20:29 nuclearsandwich: and espresso when I'm at the office

20:29 technomancy: nuclearsandwich: yeah, the siphon is definitely more work. lots of fun to watch though.

20:29 nuclearsandwich: but espresso is only simple because I worked at it every day for five years

20:29 technomancy: heh

20:29 nuclearsandwich: technomancy: put your siphon in a window and be a mad coffee scientist!

20:30 technomancy: yessss

20:30 goodieboy: I guess I'm generally wondering how useful pre-conditions are to most clojure programmers? Are ya'll using them? When to use them?

20:30 nuclearsandwich: you also need a bright white lab coat which will, in time, turn brown with coffee spills

20:31 technomancy: goodieboy: I think people are still figuring out how they fit into the big picture

20:31 nuclearsandwich: time to hit the train. technomancy sometime soon I want to pick your brain about using mosh insecurely instead of having an insecure ssh pair for swarming

20:31 amalloy: goodieboy: i don't

20:32 technomancy: yeah

20:32 brehaut: technomancy: do you play the portal theme while making siphon ?

20:32 technomancy: heh; next time

20:32 goodieboy: interesting ok, glad I'm not alone in trying to figure out where/when they fit in

20:37 djur: Would anyone be up for looking at a little Clojure program I wrote and giving me some tips on how to make it more idiomatic?

20:38 gtrak`: djur: sure I can spare a couple mins

20:39 djur: gtrak`: Thanks! The code is here: https://github.com/mboeh/mass-download

20:39 gtrak`: And my rationale is halfway down through here: http://mboeh.com/2012/06/21/development-notes.html

20:40 gtrak`: idiom 1: write tests :-)

20:41 djur: gtrak`: I ended up approaching it by passing a lot of functions as callbacks, but I feel like it would be easier and clearer with seqs... but I'm not sure how to apply them here

20:41 I'm not even sure how to test this

20:42 I literally just picked up Programming Clojure yesterday and banged this out based on an existing chunk of code I have

20:42 gtrak`: umm, if you use an editor that handles indentation and closing-parentheses for you, you won't have to manually do them. Doing the unnesting like curly-brace langs is bad.

20:42 djur: OK, good to know. I'm not doing them manually

20:42 gtrak`: like this: (dorun (map action (line-seq rdr)))))))

20:42 wmealing_: which reminds me, i must find rainbow braces that look clear for emacs.

20:42 not sure if current theme or just font that sucks.

20:43 steveo_: Does ring have websockets support? I've seen lots of talk about adding it but I don't know what the results of those threads were.

20:43 djur: I figured out I was using the wrong paren style by the time I wrote the blog post, but haven't amended the original code yet

20:44 weavejester_: steveo_: Ring is a HTTP abstraction, and websockets are a separate protocol with very different properties. There are libraries like Aleph that can cater to both, however.

20:44 gtrak`: djur: you can just use slurp on the file to get a string, or make-reader to make a reader

20:45 java.io/make-reader

20:46 urls-from-file is misleading, it's doing too much and isn't named right. I'd call it map-on-urls or something

20:46 steveo_: yeah aleph looks cool, I'll check it out, thanks

20:47 djur: I feel like I should be able to dispense with urls-from-file entirely and work directly with line-seq instead -- have that argument being a seq of URLs instead of a function which generates them

20:47 gtrak`: sure

20:48 in general, the callback-style is hard to follow

20:49 if you want asynchrony, consider agents or futures

20:49 djur: My next goal is to make it download the files in parallel, though, and I'm not clear if there's a way to have multiple threads pulling work off a seq

20:50 gtrak`: agents or futures do that

20:50 maybe switch to push instead of pull

20:51 djur: I know how I'd implement this with a blocking queue and a big mess of mutable state. I'm not sure how to keep track of the result of a lot of little jobs without maintaining a lot of state

20:51 gtrak`: if you want to compose functions and handlers, consider just using lazy seqs instead of doing it yourself

20:52 ie... (defn a [args handler]) is kinda the same as (map handler (map a urls)) or (map #(comp handler a) urls)

20:52 oops... forget the #

20:53 (map (comp handler a))

20:53 djur: Great, I thought there'd be something like that

20:53 gtrak`: if it's just a tail recursion anyway, it's equivalent

20:54 that'll get it down to like 5 lines...

20:54 :-)

20:55 djur: Thanks! I'll go hack on that for a while. I appreciate the help!

20:55 gtrak`: no problem

22:58 metajack: is there something like xml-seq or xml/parse that doesn't require the whole input in memory at once? I basically wan to handle top level children individually.

22:58 (aside from using SAX in java directly)

23:03 benolee: coming from ruby, and having no background with java, how best to learn the java stdlib for interop?

23:06 cmajor7: metajack: in case you worry about the XML file size, there is "lazy-xml" (http://bit.ly/LkuIzy), as well as "clojure.data.xml" (http://bit.ly/LkuWH0) which is its successor

23:07 metajack: benolee: I make judicious use of "!java foo" search modifies at DuckDuckGo for that. It generally works pretty well.

23:09 cmajor7: thanks!

23:10 cmajor7: sure

Logging service provided by n01se.net