#clojure log - Oct 11 2011

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

0:00 ibdknox: it saves the day again!

0:00 amalloy: the unsung hero

0:00 scottj: I wonder if arc has ssyntax for juxt

0:20 replaca_: Q: what's the latest version of swank for clojure-jack-in?

0:20 *swank-clojure

0:20 dnolen: not surprising that Dart output is so similar to ClojureScript's https://gist.github.com/1277224

0:22 scottj: oh I didn't realize dart was going to compile to js

0:23 amalloy: all the cool kids are doing it

0:24 replaca_: but it seems like chrome will have a native interpreter

0:24 or something

0:24 (maybe auto-compile on-load)

0:33 cemerick: dnolen: and just as large, too! :-P

0:33 dnolen: cemerick: pre advanced optimizations, sure

0:33 I just ran that through advanced mode, down to 2000 lines *pretty-printed*

0:33 cemerick: Right, cljs is exporting stuff it doesn't necessarily need to, right?

0:34 * cemerick seems to remember a discussion about exposing cljs to better optimization results…

0:34 justicefries: ugh. working htrough 4clojure.

0:34 realizing I don't "get" clojure yet.

0:35 dnolen: https://gist.github.com/1277285

0:37 cemerick: eh, so same magnitude as hello-world in cljs

0:37 justicefries: i want my side effects and objects. ;)

0:38 dnolen: justicefries: you're in luck, you have both in Clojure.

0:39 justicefries: haha! i'll be a purist at least for a little while.

0:41 i just hope by the end of joy of clojure I get FP.

0:41 and practice.

0:44 symbole: justicefries: Some would say FP is a lifestyle choice, or an attitude. :-)

0:55 justicefries: I'm okay with that. :)

0:55 I'd like to wrap my mind around it...

0:57 pdk: if you want to get fp you probably won't just by learning one functional language, learn a handful

0:57 hell toss prolog in there since it's technically still pretty functional

0:57 justicefries: i'm switching over from Smalltalk, Ruby, and Objective-C.

0:58 about as opposite as one would like to be.

0:59 pdk: ruby should have stuff like lambdas/closures

0:59 justicefries: yup

1:19 amalloy: heh. java should too

1:23 mvid: is there a built in function that takes a number of arguments and returns the first one that isn't nil?

1:25 amalloy: &(some identity [nil nli 4 8])

1:25 lazybot: java.lang.Exception: Unable to resolve symbol: nli in this context

1:25 amalloy: &(some identity [nil nil 4 8])

1:25 lazybot: ⇒ 4

1:25 mvid: cool

1:25 thanks

1:26 justicefries: pdk: I totally get lambdas/closures in Ruby.

1:27 pdk: (doc identity)

1:27 clojurebot: "([x]); Returns its argument."

1:27 pdk: ,(doc identity)

1:27 clojurebot: "([x]); Returns its argument."

1:28 justicefries: &(identity [4 8])

1:28 lazybot: ⇒ [4 8]

1:32 mvid: (or nil nil 4 8)

1:32 &(or nil nil 4 8)

1:32 lazybot: ⇒ 4

1:42 tarcieri: anyone attempted to apply STM to the DOM in ClojureScript?

1:42 like facilitating a protocol to let multiple web workers manipulate the DOM concurrently with STM semantics?

1:43 amalloy: tarcieri: seems pretty unlikely. javascript ain't got threads, right?

1:43 tarcieri: it has web workers, which unfortunately are more like IPC than threads

1:44 it's the Unix model, in the browser, with text as the universal interchange format

1:44 :(

2:03 TheMantis: hey guys, what's a good java IRC? the one here on freenode is invite only...

2:03 #java is invite only, that is

2:04 amalloy: ##java

2:11 tarcieri: i didn't really know about web workers. but it looks pretty trivial to turn a web worker into an agent

2:15 mrbendy: Heya everyone. I would like to take a string like "Foo Bar Baz" and make it "foo_bar_baz"

2:15 tarcieri: amalloy: yeah web workers would map to agents nicely, aside from the fact you have to round trip all state you send them through strings

2:15 mrbendy: I want to replace all non-ascii characters with _'s

2:26 tarcieri: mrbendy: (.toLowerCase str) and use a regex to replace the non-ascii characters?

2:26 mrbendy: tarcieri: that's what I'm doing

2:27 I'm trying to find a good way to replace non-ascii characters

2:29 dnolen: tarcieri: I don't know about the string bit moving forward, I've heard that implementation will probably leverage freeze

2:30 matt00: any good reason why clojure (str 'foo) -> "foo" whereas cljs (str 'foo) -> foo ?

2:31 dnolen: sometimes I think about how awesome ClojureScript is then I read threads like this http://news.ycombinator.com/item?id=3097105, JS.fail

2:34 matt00: seems like a bug, you should file a ticket

2:40 mrbendy: dnolen: anyone in particular

2:43 devn: sigh...

2:43 dnolen: the guy referencing the "stupidity" of reddit happens to have one of the dumber comments in the thread

2:44 matt00: dnolen - issue CLJS-84 filed

2:49 dnolen: matt00: fixed in HEAD

2:49 sleep time for moi.

2:49 tomoj: http://moo4q.com/ I found the h2's here funny

2:50 I bet I don't really understand what they're saying

2:50 but.. "Immutable Functions #ftl / Stateful Objects #ftw"

2:56 matt00: w00t

2:56 devn: tomoj: heh

2:57 tomoj: welcome to 2004

3:01 tomoj: dammit

3:01 I knew I'd be disappointed by dart

3:01 but I was secretly hoping..

3:32 Blkt: good morning everyone

3:42 thorwil: good morning!

3:58 * Raynes is hardcore working on his book at 3AM.

4:06 Fossi: well, it's not 3 am here, so don't feel bad :>

5:30 shanmu: is clojure/data.xml ready for use - the readme says otherwise, is there anything I can do to help get it ready for use?

5:38 \bye

5:41 eiro: (hello)

6:25 shanmu: any one have an idea reagarding the status of clojure/data.xml? Is there anyhting I can do to help it get ready for use?

6:36 clgv: shanmu: you might try to use it

6:36 I dont know it's status or why the readme discourages using it

7:16 shanmu: clgv: thanks! I have started using it - not yet run.. will keep the Channel posted

7:40 jcromartie: (= (fn [x] (+ x 1)) (fn [x] (+ x 1)))

7:40 I wish that were true

7:44 babilen: +1

7:44 zilti: ,(identical? (fn [x] (+ x 1)) (fn [x] (+ x 1)))

7:44 clojurebot: false

7:45 zilti: meh

7:49 clgv: jcromantie: it cant since these are two distinct objects, but you can compare their type

7:49 but that works only for defns

7:50 you could as well annotate their definition in meta-data and compare thos

7:50 lucian: hmm, = should work i think

7:50 if can just compare the s-exps

7:58 zilti: ,(identical? '(fn [x] (+ x 1)) '(fn [x] (+ x 1)))

7:58 clojurebot: false

8:00 jcromartie: well

8:00 ,(= '(fn [x] (+ x 1)) '(fn [x] (+ x 1)))

8:00 clojurebot: true

8:01 jcromartie: no problem

8:01 but

8:01 zilti: ???

8:01 lazybot: zilti: How could that be wrong?

8:01 jcromartie: ,(doc identical?)

8:01 clojurebot: "([x y]); Tests if 2 arguments are the same object"

8:01 zilti: ,(doc =))

8:01 clojurebot: "([x] [x y] [x y & more]); Equality. Returns true if x equals y, false if not. Same as Java x.equals(y) except it also works for nil, and compares numbers and collections in a type-independent manner. Clojure's immutable data structures define equals() (and thus =) as a value, not an identity, comparison."

8:02 zilti: I see. So identical? is even worse than =

8:02 jcromartie: "worse?"

8:02 no it's just specific

8:03 ,(map #(identical? %1 %2) [[1 1] ["hi" "hi"] [:foo :foo] [{:x 1} {:x 1}] [(Object.) (Object.)]])

8:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval129$fn>

8:03 jcromartie: derp

8:03 ,(map #(apply identical? %1 %2) [[1 1] ["hi" "hi"] [:foo :foo] [{:x 1} {:x 1}] [(Object.) (Object.)]])

8:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval159$fn>

8:03 jcromartie: DERP

8:03 ,(map #(apply identical? %) [[1 1] ["hi" "hi"] [:foo :foo] [{:x 1} {:x 1}] [(Object.) (Object.)]])

8:03 clojurebot: (true true true false false)

8:46 tdrgabi1: reddit.clj?

10:27 jcromartie: what's so hard about "reporting" that it requires all of these big crazy libraries?

10:27 (like Crystal ReportS)

10:28 mattmitchell: anyone have experience with amazon's beanstalk and clojure ?

10:28 jcromartie: (totally off topic, sort of...)

10:32 mvdir: I am getting the following error: "Unable to resolve symbol: -?> in this context" when trying to use storm-deploy. Can someone help me understand how to debug this?

10:33 I am in a lein repl,

10:33 jcromartie: mvdir: what's your current namespace?

10:33 mvdir: but am unsure how to import the class to attempt to debug it.

10:33 jcromartie: I am not sure.

10:34 I tried doing (in-ns backtype)

10:34 jcromartie: it says on the line, before =>

10:34 for example "user=?"

10:34 err "user=>"

10:34 mvdir: Ah, thanks.

10:34 jcromartie: by default

10:34 mvdir: It's one I created, woo

10:34 I tried doing this:

10:35 (ns woo (:import backtype.storm.security))

10:35 But I got a classnotfoundexception.

10:36 Like I said, I'm in the lein repl, which I thought would have all the classes automatically.

10:36 :-/

10:36 jcromartie: hm

10:37 no

10:37 you want (:require backtype.storm.security)

10:37 mvdir: jcromartie: Sorry, total n00b here.

10:37 jcromartie: or better: (:require [... :as foo]) so you can use the shortcut foo/whatever to refer to that namespace

10:37 to shorten it

10:38 (:use some-ns) imports *everything* in the specified namespace

10:38 which might be more than you need or want

10:38 or there might be collisions

10:38 which is why you should use require instead

10:38 and require with :as to shorten references when necessary

10:39 does that make any sense at all? :)

10:39 mvdir: Definitely.

10:39 clgv: jcromartie: you can also do (:use foo :only (bar))

10:39 mvdir: I think a ns collision is the real problem I am trying to address.

10:39 jcromartie: that's true

10:40 mvdir: jcromartie: Hmmm, I am still getting no source file.

10:41 I tried ie. (:use pallet.compute)

10:41 TimMc: clgv: "Only use :use with :only" :-)

10:41 as they say

10:42 clgv: well sometimes thats annoying when you start implementing a new namespace ;)

10:42 TimMc: Nothing wrong with :require :as

10:47 raek: mvdir: when you are in the repl, it's probably more convenient to use the require, use and in-ns functions instead of the ns macro

10:48 mvdir: for example, to load a namespace and "enter it": (require 'the-ns) (in-ns 'the-ns)

10:48 or (doto 'the-ns require in-ns)

10:48 mvdir: raek: Thanks

10:48 raek: not the quote that you have to use for these functions

10:48 *note

10:50 clgv: thats a good combination "note the quote" :D

10:50 raek: mvdir: this explains everything about require, use, import and ns: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

10:51 heh. "note the quote"... it would be a nice name for a podcast!

10:53 mvdir: Does -?> mean anything in clojure?

10:53 clgv: mvdir: yes

10:54 jcromartie: mvdir: it's not part of the standard included functions though

10:54 clgv: it's from clojure.contrib.core and escapes the series of function calls if a nil is encountered

10:54 mvdir: jcromartie: I am getting "Unable to resolve symbol: -?> in this context"

10:54 How do I include it?

10:55 clgv: (:use clojure.contrib.core :only (-?>))

10:55 raek: mvdir: do you want to use it in your own namespace, or are you trying to run someone else's code?

10:55 mvdir: raek someone else's code.

10:55 Specifically the jclouds 1.2.0-SNAPSHOT

10:55 For storm-deploy

10:55 https://github.com/nathanmarz/storm-deploy

10:56 raek: ok, and you just want to call a function in someone else's namespace?

10:56 duck1123: -?> is in core.incubator as well, I believe

10:56 mvdir: raek: Yes, I would like to fix the issue, if possible.

10:57 raek: I'm confused about how you are trying to run it

10:57 (and I'm not familiar with that specific library)

10:58 mvdir: raek: sorry,

10:58 I am trying to run some command line utilities.

10:58 Which automatically create ec2 stuff.

10:59 raek: all the error tells me is that you are trying to evaluate something at the repl that should be evaluated inside some file (e.g. copy-paste the contents of a file out of context)

10:59 mvdir: jclouds is a library which automates some of the ec2 rest calls.

10:59 When I try to run it, I get this stack trace.

10:59 raek: ok, so it generates the code which conatains the -?> usage?

10:59 mvdir: raek

11:00 raek: mvdir: ah, so you didn't put the -?> there?

11:00 mvdir: I think that code is just in a jar I am trying to use.

11:00 No

11:00 ,

11:00 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

11:00 mvdir: Let me see if I can get a link.

11:00 Whoops.

11:01 raek: "Unable to resolve symbol" means that someone (perhaps not you in this case) tries to use a var that hasn't been used or required in the curent namespace

11:02 mvdir: raek: Looks like it was this commit:

11:02 https://github.com/jclouds/jclouds/commit/9d30fde37511b0b7dad39378e93da1a88ad253fa#apis/ec2/src/main/clojure/org/jclouds/ec2/ebs.clj

11:03 raek: that would explain it

11:03 mvdir: raek: Excellent, thanks.

11:03 I will see if they can fix it in their channel.

11:04 Whoof, this yak is particularly hairy when it requires you to learn a whole new lang.

11:04 raek: strange that they didn't test this

11:04 simply loading the namespace would have signalled an error...

11:04 mvdir: I dunno, where I work we mostly deploy hadoop/cassandra.

11:05 Which is all << 1.0

11:05 So I guess I'm used to broken $#!7.

11:06 TimMc: mvdir: What has led to this yak-shaving?

11:07 mvdir: TimMc: trying to deploy storm (https://github.com/nathanmarz/storm-deploy)

11:09 I guess my ec2 is behaving differently from what they have at twitter.

11:11 raek: mvdir: a simple fix is to add (:use [clojure.core.incubator :only [-?>]]) to that file (they already have the incubator lib as a dependency)

11:12 mvdir: raek, thanks very much.

11:12 If I were in front of my github account, I would upstream this...

11:12 :-/

11:14 raek: if one of their devs simply requires every namespace they have, it will be clear for them what to do (this should be a really simple bug for them to analyze and fix)

11:15 mvdir: raek: I agree, sloppy,

11:16 but it is a development snapshot.

11:19 xiaolongxia: mvdir: are you still having problems?

11:20 if so, why don't you come into #pallet since it seems like you are having problems more specific to pallet

11:26 ljos: Hi - I'm having some classpath issues. I have a previous java project that I would like to continue on in Clojure. The project has two source folders one for each side of the project. I add both of the source paths in :java-source-path, but when I try to compile the clojure program I get package not found from only one of the source folders. Any ideas? I might not have made myself very clear...

11:28 I created a new clojure project in the same folder as the source folders for the java project.

11:28 clgv: ljos: how does the part of the project.clj with the :java-source-path exctly look like?

11:30 ljos: clgv :java-source-path [["source1"] ["source2"]]

11:31 The source folders are inside the same folder as the project.clj

11:32 dnolen: hmm, the fact that keywords and symbols are actually represented as JS Strings makes it tricky to make (str ...) work on them ...

11:33 clgv: ljo: I dont thing the inner array brackets are needed

11:33 *think

11:33 dnolen: cemerick: I'm rooting for the no ClojureScript releases. Download a dated jar or work against HEAD.

11:33 ljos: It's written that way in the tutorial for lein.

11:34 mvdir: raek: clgv: jcromartie: Thanks for all your help!

11:34 cemerick: dnolen: Stone ages. Apply that to every project in central or clojars, and see what happens. :-(

11:34 ljos: But maybe not needed, they don't do anything though as it still finds source1

11:34 clgv: ljos: from a logic point of view I dont know what those additional vectors are needed for. so try removing those brackets

11:34 cemerick: Or, just apply it to Clojure itself, and see what happens.

11:36 dnolen: cemerick: I do not think the world we live in today is appreciably better than pre 1.2.0, many people tracked HEAD then.

11:36 ljos: clgv: then I get an illegalArgumentException.

11:36 cemerick: dnolen: tracked HEAD via snapshot artifacts obtained via maven repositories

11:37 ljos: clgv, I think they are there so you can set flags if you need to.

11:37 clgv: ljos: ok. hmm maybe they are for additional options

11:37 dnolen: cemerick: and?

11:38 ejackson: fear... and suffering :)

11:38 cemerick: dnolen: snapshots at least take care of distribution.

11:38 IMO, releases and reasonable use of repositories have to be the null hypothesis in discussions like these.

11:39 dnolen: cemerick: I'm just trying to figure what has actually improved? seems like most Clojure library version fragmentation and feet dragging. If you can call those improvements.

11:40 cemerick: dnolen: Improved since, what, 1.2 was released?

11:40 ljos: clgv: it seems like lein only looks in the same source folder for the packages as the class it is compiling comes from. Could this be correct?

11:41 clgv: The class that is being compiled references a class in the other source folder. This is where it fails and cannot find the package.

11:41 cemerick: Clojure is in no way a role model for how to manage releases and distribution, IMO. Lots of gnarly history and hard battles have preceded where things stand today.

11:41 clgv: ljos: oh. no idea. maybe you should file a ticket for that

11:42 ljos: clgv: ok. I am not sure if it is a bug. I might just be doing something wrong :P

11:42 clgv: ljos: then you could also write to the mailing list

11:56 dnolen_: cemerick: good chance a principled argument will be needed ;) Google Closure Compiler tools themselves don't do releases, are widely used, and the complaints don't seem more or less pronounced.

12:00 cemerick: oy

12:00 dnolen_: just as a thought experiment, what if clojars, maven central, and apt didn't exist? #rhetorical

12:01 Google is widely mocked for not doing proper releases of all sorts of libraries, FWIW.

12:02 dnolen_: cemerick: and Maven is mocked in general.

12:02 cemerick: w.r.t. dependency management, it's the worst…except for all the other options.

12:03 dnolen_: cemerick: I'm mostly playing devil's advocate here ;) Clojars, Maven + Lein makes life much easier in the short term - but perhaps harder in the long term as we've seen.

12:04 cemerick: In that case, I'll save my ammunition for larger bosses. ;-)

12:04 dnolen_: what hardships though?

12:04 KirinDave: dnolen_: Could be worse

12:04 dnolen_: Could be SBT.

12:04 dnolen_: cemerick: dead libraries, people resolving 1.3.0 changes now.

12:04 KirinDave: heh

12:04 * KirinDave shudders.

12:05 arohner: dnolen_: IMO, 1.3 issues are due to AOT compilation, not maven/clojars/lein

12:05 cemerick: dnolen_: compared to tarballs and tracking HEAD? Easy choice, IMO.

12:05 dnolen_: arohner: binary compat for AOT was non-goal as far as Iknew.

12:05 I never heard anything mentioned about binary compat moving forward.

12:05 arohner: dnolen_: sure, but whether it was chosen as a goal doesn't change whether it's a problem :-)

12:05 dnolen_: switching to ASM 4.0 will probably break it again.

12:06 arohner: only shipping source would also work

12:06 dnolen_: arohner: I'd consider it a non problem. See JavaScript, only shipping source.

12:06 cemerick: It's been mostly proven that source compat is not sufficient. Whether we can do anything about it is another story.

12:07 arohner: cemerick: why is source compat not sufficient? seems to me source-only would be just fine. It's the shipping non-compat binary that's a problem

12:07 cemerick: Shipping source only works if you can pay the costs of loading it at runtime, and if the code doesn't actually hold much value.

12:07 arohner: what do you mean "hold value"? everything downloading off public maven is OSS

12:08 cemerick: arohner: source doesn't work for e.g. android, and everything lots of people get paid for never touches a public maven repo :-)

12:08 dnolen_: cemerick: what costs? How long does it take load 60K of production Clojure? I can't imagine it being any amount of time worth caring about. certainly nothing to care about given Java/C/C++ compile times.

12:08 cemerick: Clojure doesn't work that well on Android in it's current form, right?

12:09 cemerick: right, because of the runtime code-gen and GC overhead

12:09 thus, AOT is a must to cure at least half

12:09 arohner: cemerick: I'm not saying abandon compilation. I'm saying do AOT "privately".

12:09 cemerick: right

12:10 Which is what I do, exclusively.

12:10 But that doesn't mean that its problems go away — they just get seen by fewer eyes.

12:10 arohner: right

12:11 cemerick: Just ask me sometime about the instance where a customer tried to upgrade one library of mine, but not the other. :-)

12:12 Puts a real dent in that "hey, Clojure is just another .jar file" deployment/reach story.

12:43 technomancy: lots of the problems with AOT do go away if it's solely done at the endpoints

12:43 (once you have nailed down which clojure version is going to be used)

12:44 another 45% goes away when #322 is fixed

12:45 hugod: cemerick: fwiw, I have a pom that jars clojurescript, and another for the closure library, and have artifacts for them on clojars

12:47 had to do that to get the zi-cljs maven plugin working

12:51 cgray: hi, is there a function that takes multiple seqs and alternates between them? (f '(1 2 3) '(4 5 6)) => (1 4 2 5 3 6)

12:51 arohner: ,(flatten (map vec (range 0 3) (range 4 6))

12:52 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

12:52 arohner: ,(flatten (map vec (range 0 3) (range 4 6)))

12:52 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>

12:52 cgray: i see what you're going for, thanks

12:52 arohner: ,(flatten (map vector (range 0 4) (range 4 7)))

12:52 clojurebot: (0 4 1 5 2 ...)

12:52 arohner: there

12:53 I always get vec and vector confused

12:53 Chousuke: (doc interleave)

12:53 clojurebot: "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."

12:54 cemerick: hugod: Sure. I think my bottom line in that department is, one should keep shit from running downhill to your users.

12:55 Even if someone provided cljs as a dependency, there'd be many of them, and many people having to track changes and make calls from an outside perspective w.r.t. version numbers, etc.

12:57 technomancy: dnolen_: out of curiosity, do you check clojurescript jars into git?

12:57 (just trying to determine what the alternative is)

12:57 hugod: cemerick: I agree

12:58 cemerick: hugod: at least we have our coping strategy planned out!

12:58 a pom, a whiteboard, github, and a bottle of tequila.

12:58 :-P

12:59 technomancy: I'm for it! http://m.assetbar.com/achewood/uuavvRhdS

12:59 hugod: nah, a nice single malt here please

12:59 * cemerick will make sure the sidebar is well-stocked

13:00 cemerick: technomancy: thanks for that :-)

13:01 technomancy: BTW, do you always have a buffer full of links to useful comics and memegenerator sites? ;-)

13:02 dnolen_: technomancy: I do not. it's not clear to me what the best way is to package CLJS files. I think there will be many cases where CLJ doesn't need to be involved at all.

13:02 technomancy: cemerick: I do have some help: https://github.com/technomancy/dotfiles/blob/master/.conkerorrc#L47

13:03 pjstadig: technomancy: the truth finally comes out

13:04 technomancy: pjstadig: well that doesn't cover penny arcade, xkcd, or smbc

13:12 ibdknox: dnolen_: does that preclude just using jars?

13:13 dnolen_: ibdknox: not that I see no. Just haven't gotten that far as there are few libraries beyond things like Pinot that I would even want to include in a CLJS project.

13:14 shipping w/ Google Closure also means there's a lot of useful functionality you don't need to go hunting for in an external lib.

13:14 ibdknox: technomancy: dnolen_: mkay, so far having pinot up on Clojars has worked out well

13:14 dnolen_: true, but using those APIs directly is gross

13:16 technomancy: the whole "force a stable release on a project that doesn't want to do it for themselves" has worked out surprisingly well for slime; the only time it's an issue is when people want to use other things that depend upon CVS trunk, which seems very unlikely for gclosure.

13:17 I guess it also depends on what gclosure's policy on backwards compatibility is. if it's like slime (everyone should use trunk always and forever) then bringing stability upon it becomes more important; if they are really good about maintaining backwards compatibility always, then it's not going to hurt so bad not having releases

13:19 cemerick: I don't think anyone's said anything about 'stable'.

13:20 srid: does anyone else have problems with aleph.http suppressing stacktraces?

13:21 technomancy: cemerick: stability of clojurescript and stability of gclosure are different questions though.

13:22 cemerick: Certainly, but I don't think it's even up for discussion at this point.

13:23 gclosure will be shipped in tarballs until the end of time; I take that as a given.

13:23 tarballs, with the potential for huge upheavals at any time, I should say

13:23 duck1123: srid: That happened to me too

13:24 cemerick: And ClojureScript is too young and is bleeding too profusely to think it's time to lock it up.

13:24 ibdknox: cemerick: I hope it doesn't bleed to death :p

13:24 cemerick: But distribution and repeatability are paramount.

13:25 arkh: fleetdb id question: is there a better way to find the next available id for a given collection than by hand? e.g. checked-write w/ (client ["select" "asdf" {"order" ["id" "desc"], "limit" 1}])

13:25 dnolen_: cemerick: a lot of rhetoric not many facts ;)

13:25 duck1123: srid: I was using the ssl patch and it was failing on me because the site I was hitting's cert was being rejected, so it was just returning nil

13:26 technomancy: are people able to hobble along with submodules? that at least locks you to a specific sha.

13:26 cemerick: dnolen_: sounds like classic irc! :-D

13:26 ibdknox: technomancy: gclosure is svn

13:26 cemerick: technomancy: git submodules are sooo sad.

13:26 ibdknox: and I agree with cemerick

13:26 technomancy: cemerick: I know =(

13:27 I have been able to avoid them for 4 years, but that has come to an end this week.

13:27 cemerick: ouch

13:27 technomancy: they're enough to make a man gaze fondly at hg

13:27 cemerick: hrm, not sure about that…

13:27 technomancy: apparently hg can have subrepos in a _foreign_ vcs

13:28 * licenser wavies

13:28 cemerick: the last time I tried to do a checkout in an hg repo, it took _an hour_

13:28 TimMc: Sounds not unreasonable for a fairly large repo.

13:28 technomancy: you sure it wasn't bzr?

13:28 cemerick: nope, never used bzr

13:29 TimMc: (a fairly large svn repo, specifically)

13:29 cemerick: ~140MB working directory, one hour

13:29 clojurebot: namespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it

13:29 technomancy: on the emacs-devel mailing list there's a thread every month or so going "I tried to check out Emacs and it's taken 3 hours so far and isn't done yet; what did I do wrong?" / "nothing, that's how it's supposed to work." / "..."

13:32 mtm: arkh: not that I'm aware of; seems like I nice feature to have for fleetdb, basically some meta-data on the collection

13:39 arkh: mtm: there's a meme there somewhere - 'scumbag fleetdb: requires unique id's per collection, doesn't provide them'

13:39 srid: duck1123: for me, no stacktraces were being printed in the console. the browser returns some ERR_NOT_FOUND or something.

13:39 no matter what the error is

13:52 licenser: Has anyone managed to put static files in ring/compojure jar?

13:55 amalloy: arohner, cgray: augh do not use flatten for that. of course interleave is best, but if you were reinventing it flatten would be wrong. you want ##(mapcat list [1 2 3] [4 5 6])

13:55 lazybot: ⇒ (1 4 2 5 3 6)

13:56 amalloy: specifically because things like ##(flatten (map list '[[a b] [c d]] [1 2])) break

13:56 lazybot: ⇒ (a b 1 c d 2)

13:58 jcrossley3: technomancy: dude, the built-in swank clojure jack in stuff is very sweet, thanks for that!

13:58 justicefries: anybody using clojure in large production environments?

13:58 on a daily basis?

13:58 technomancy: jcrossley3: great! I'm pretty happy with the way byte-compiling works now.

13:58 pjstadig: several

14:00 justicefries: nice.

14:08 pdlogan: the clojurescript bootstrap pulls down clojure 1.3-beta3 --- an harm changing that to the 1.3 release?

14:08 ^y

14:13 cemerick: licenser: I just put them into the .war file where they should be, and let the app server serve up the static resources on its own.

14:14 licenser: cemerick: hmmm thanks :) I tried that but I failed so far - but if that should work I will retry it

14:15 cemerick: licenser: I've personally never used ring to serve static assets.

14:16 devn: licenser: for some reason I remember needing to serve static assets with moustache

14:16 licenser: I see, I just slapped together a compojure/ring thing and I kind keep failing ^^

14:19 this ain't easy ^^

14:20 gtrak: pdlogan, why's it matter?

14:21 pdlogan: gtrak - not much that I know of.

14:31 devn: licenser: I might have my code around, let me look for you

14:31 licenser: it will be old, but it might be what you need

14:31 licenser: that'd be great :)

14:32 devn: licenser: ring.util.response

14:32 you need (file-response)

14:32 licenser: I also have a call to (wrap-file)

14:32 you may need that as well

14:33 licenser: wrap-file is kind of icky because it checks for the existence of the file beforehand

14:33 ghiu: hi, how can i call a function whose name i have in a string? is eval the only way?

14:34 amalloy: ghiu: did you ask a question about this recently on SO? if not, you should look because someone else did

14:34 licenser: ghiu: I know that isn't the answer, why?

14:34 devn: licenser: https://gist.github.com/1278941

14:34 licenser: you could write your own wrap-file i suppose

14:34 amalloy: licenser: shouldn't compojure.route/resources Just Work?

14:34 ibdknox: amalloy, yes

14:35 or just use Noir and the whole point is moot

14:35 :)

14:35 amalloy: *shakes fist* damn you, noir...

14:35 ghiu: for reference, http://stackoverflow.com/questions/7715800/clojure-determine-if-a-function-exists

14:35 ibdknox: bwahahaha

14:36 ghiu: yes, i'm reading

14:36 licenser: amalloy: I try that thanks and devn thanks too :) I will dig around that all

14:36 ghiu: but this seems about checking for existence, not actually calling it

14:36 amalloy: so what. same task

14:36 ghiu: (eval (symbol s))

14:37 devn: amalloy: this? https://github.com/weavejester/compojure/blob/master/src/compojure/route.clj#L23

14:37 licenser: ^^

14:37 TimMc: ghiu: Read the first answer.

14:38 ibdknox: ,((resolve (symbol "inc")) 1)

14:38 clojurebot: 2

14:38 devn: ibdknox: noir is nice, but it could use more docs ;)

14:38 ibdknox: devn, what?

14:38 devn, Noir is probably one of the best documented Clojure libs out there...

14:38 ghiu: oh, right. thank you

14:38 ibdknox: devn, http://webnoir.org/

14:38 amalloy: maybe the docs are too...dark to read? help me out here, i need more puns

14:39 ibdknox: lolol

14:39 ordnungswidrig: hi all

14:39 ibdknox: amalloy, I'm not sure if I should inc or dec you for that...

14:39 devn: ibdknox: i was kidding buddy, your docs are good

14:39 TimMc: needs more cowbell

14:39 devn: ibdknox: that's usually the first thing i say to anyone in the clojure community

14:39 "i like your project. write more docs"

14:39 ibdknox: hshs :)

14:39 fail

14:39 haha*

14:40 amalloy: ,(doseq [x '[inc dec]] (println (list x 'amalloy)))

14:40 clojurebot: (inc amalloy)

14:40 lazybot: ⟹ 17

14:40 clojurebot: (dec amalloy)

14:40 lazybot: ⟹ 16

14:40 ibdknox: lol

14:40 TimMc: cute

14:40 cemerick: devn: evil :-)

14:41 TimMc: ,(println '(inc clojurebot))

14:41 clojurebot: (inc clojurebot)

14:41 lazybot: You can't adjust your own karma.

14:41 TimMc: :-)

14:41 ibdknox: lol

14:41 (inc clojurebot)

14:41 lazybot: ⟹ 4

14:43 devn: haha

14:44 Raynes: That arrow is almost long enough to be obnoxious in this font.

14:44 No wonder people complained about it.

14:44 devn: what arrow?

14:44 ibdknox: it is kind of ugly

14:44 Raynes: The unicode arrow that lazybot prints when you inc or dec karma.

14:44 amalloy: New arrow, plz.

14:45 amalloy: Raynes: you're the one who told me you had it totally handled when you changed the arrow in clojure-mde

14:45 devn: I thought I was in a unicode terminal

14:45 amalloy: man. the clojure plugin. not clojure-mode

14:45 devn: apparently not

14:48 licenser: hussa :D

14:48 devn amalloy! :) you are my heros!

14:48 ibdknox: licenser, you should check out Noir. http://webnoir.org/ ;)

14:50 Raynes: ibdknox: Donate time and make try-clojure run on Noir.

14:50 licenser: ibdknox: I don't have much of actual web serving to do just a few js files and a few json files :) but I will look at it

14:50 * ibdknox goes to look at the try-clojure codebase

14:52 ibdknox: wow it is a lot simpler than I expected :)

14:53 Raynes, I'll do that this weekend, maybe before if I magically find some time

14:53 Raynes: Cool. Note that I didn't actually expect you to be willing.

14:54 amalloy: yeah, seriously. ibdknox, how do you feel about updating 4clojure to use 1.3 too?

14:54 ibdknox: It'll be an interesting exercise, I haven't used mustache

14:54 amalloy, hah mustache -> noir = easy.... 1.2 -> 1.3 = unknown :p

14:54 Raynes: Do lazybot and related projects while you're at it.

14:55 I'm using moustache? I could have swore I rewrote that code to use compojure at some point.

14:55 ibdknox: Raynes, we should just teach lazybot how to do it and then have him run over github when he's not busy doing important IRC things

14:55 Raynes: Maybe I'm a stoner and just haven't noticed.

14:55 That'd never work. The bot is lazy.

14:56 ibdknox: cattle prod?

14:56 Raynes: We can give it ago.

14:56 a go*

14:57 ibdknox: Raynes, yeah it uses Moustache

14:57 oh

14:57 there's a compojure branch

14:57 even easier then :p

15:00 Raynes: ibdknox: Yeah, the compojure branch appears to be more up-to-date and is likely the branch the actual site is running off of.

15:01 ibdknox: ibdknox, given the site fits in a single file and doesn't look ridiculous, there's probably no real benefit to moving it to Noir, except for being part of the club of course.

15:01 damnit

15:01 I do that a lot

15:01 Raynes: ^

15:01 Raynes: Club membership is enough of a benefit.

15:01 ibdknox: amalloy is not a part of the club, so you know it has to be good ;)

15:02 amalloy: ibdknox: your docs should include a screencast: filmed noir

15:03 ibdknox: hahaha

15:04 amalloy, I think I would have a hard time taking it seriously

15:04 because that would clearly be serious business

15:04 Raynes: Or, srs bsns.

15:04 ibdknox: indeed.

15:04 justicefries: wait, templating in noir is done with a series of macros?

15:05 ibdknox: justicefries, templating is done however you want it to be done. By default my examples use hiccup

15:05 justicefries: aah.

15:05 i like it.

15:05 ibdknox: justicefries, it has the lowest cognitive load

15:05 enlive is scary at first

15:09 jcromartie: are there any caveats to really really really big data structures?

15:09 ibdknox: blanket statement: yes

15:09 jcromartie: for example: are there any limitations to the number of values in a hash-map

15:09 justicefries: yeah, this is pretty cool.

15:10 it's like sinatra. :D

15:10 amalloy: jcromartie: try not to have more map keys than there are electrons in the universe

15:10 i don't think clojure supports this usage

15:10 jcromartie: amalloy: good tip

15:11 I'm designing an architecture where clients (organizations) are segregated into their own refs

15:11 and the ref holds a map

15:11 the map will need to hold potentially up to 2M invoices

15:11 invoices being fairly small bits of data

15:12 obviously I need to be sure to set *print-length* on my REPL :P

15:12 I wish there was a good measure of object size in Clojure...

15:13 ibdknox: jcromartie, you need to hold 2M items per client... in memory?

15:13 jcromartie: well that is a future "worst case"

15:13 amalloy: jcromartie: no such thing exists in a garbage-collected language. profilers, at least, can show you shallow-size and retained-size, which are fairly close

15:14 but you need to work with the internal implementation of the heap to be able to get numbers like that - you couldn't do it in a running process

15:14 ibdknox: I'm not sure why you'd ever need to use that much data all at once

15:15 it'd be a lot easier to chunk it and work on the chunks, retrieving when necessary

15:15 jcromartie: ibdknox: potentially

15:15 (chunk it)

15:15 well

15:16 the system that this is replacing has served about 900K invoices over 12 years for our largest client

15:16 Raynes: This is why I never visit #clojure while sick. All the talk about chunks makes me nauseous.

15:16 jcromartie: so that 2M might be an exaggeration

15:16 ibdknox: lol

15:16 #clojure, not for the weak of stomach

15:17 jcromartie, even if it's exaggerated by an order of magnitude, I have a feeling you'd actually be better off splitting it up and storing intermediate results if you need to aggregate them back together

15:17 justicefries: i realize the more and more I play with Clojure the more and more I don't "get it" when I think I do.

15:18 ibdknox: jcromartie, to be fair, I know nothing of your problem, so grain of salt and all that :)

15:18 zerokarmaleft: jcromartie: cgrand just posted about comparing megarefs to something more granular that might apply to your situation

15:18 jcromartie: yes :)

15:19 well these aren't quite megarefs

15:21 ibdknox: justicefries, like what?

15:23 mattmitchell: I need to store clojure data structures and read them back later. Using eval is super slow. Is there another way?

15:23 jcromartie: the system that this is replacing goes back a long way though

15:23 ibdknox: ,(doc read-string)

15:23 zerokarmaleft: jcromartie: why not offload to a database so you're not having to deal with keeping 2M items in memory?

15:23 clojurebot: "([s]); Reads one object from the string s"

15:23 ibdknox: mattmitchell, ^

15:24 mattmitchell: awesome thanks!

15:24 jcromartie: zerokarmaleft: well like I said 2M is probably a big exaggeration

15:24 we're not building this system for the biggest client

15:24 we're building it for the other 500

15:24 brehaut: (doc *read-eval*)

15:24 clojurebot: "; When set to logical false, the EvalReader (#=(...)) is disabled in the read/load in the thread-local binding. Example: (binding [*read-eval* false] (read-string \"#=(eval (def x 3))\")) Defaults to true"

15:24 justicefries: ibdknox: all the joys of functional, side effect free programming that isn't necessarily a feature in ruby. ;)

15:25 amalloy: *ponder* ibdknox, mattmitchell - aren't eval and read-string orthogonal? if he was using eval, he must have already had something parsed by the reader

15:25 ibdknox: amalloy, hah

15:25 amalloy, yes

15:26 jcromartie: zerokarmaleft: but interestingly, the design is quite friendly to migrating to a database later

15:26 zerokarmaleft: since I'm journaling changes, it could be adapted to write into a DB

15:27 mattmitchell: amalloy: i'm attempting to store simple data structures using the str function. Then bring them back to life using eval. Eval feels slow, I guess I'm trying to avoid using something like json.

15:27 jcromartie: anyway it's an experiment in prevalent system design

15:27 amalloy: mattmitchell: do you have it actually working? because i don't think your description makes sense, in the sense that it shouldn't work

15:28 brehaut: mattmitchell: eval invokes a compiler on an sexp (not text), read-string (and the other reader functions) are very similar to a json reader

15:29 mattmitchell: amalloy: it does seem to be working

15:30 brehaut: so eval would definitely have more overhead and probably not even work for what I'm trying to do?

15:30 brehaut: mattmitchell: correct

15:30 mattmitchell: i see

15:31 brehaut: ,((just read-string eval) "(+ 1 2)")

15:31 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

15:31 brehaut: hah of course

15:31 try that in your own repl

15:31 mattmitchell: ok :)

15:31 amalloy: brehaut: he should also change just to juxt :P

15:31 brehaut: goddamn autocorrect

15:31 amalloy: hah. mac user?

15:31 brehaut: yeah

15:32 autocorrect has double the number of typos i make

15:32 mattmitchell: ahh that helps a lot... to illustrate what's happening. thanks.

15:32 brehaut: mattmitchell: you should make sure you understand what is happening with *read-eval* too if you plan to employ the reader yourself

15:33 mattmitchell: brehaut: well, i basically want to store simple data structures (no function calls), and de-serialize them as fast as possible. So not sure if what I'm doing is the right approach or not?

15:34 brehaut: mattmitchell: text formats are typically not the fastest possible, but getting faster is going to crystalize data concerns much earlier than is ideal

15:36 mattmitchell: do you have the rest of this program written already?

15:43 duck1123: What library should I be using if I need to do things like list, move, delete files? c.j.io seems limited. Should I just use File? lancet?

15:45 mattmitchell: brehaut: sorry had to step away... not entirely. Currently the data is stored as json in a search engine but the de-serialization from json is slow. So looking for alternatives.

15:46 i should mention... the data stored does not need to be readable, it's only stored for retrieval

15:46 cgray: is there any way to get the locals in the slime debugger?

15:46 brehaut: mattmitchell: which json library are you using?

15:47 mattmitchell: brehaut: it was clj-json, now we're trying out cheshire

15:49 TimMc: duck1123: Yeah, "move" seems to be missing.

15:49 daniel___: hi all, another evening of trying to get a repl in vim for me

15:49 Bronsa: duck1123: try fs

15:49 TimMc: (from c.j.io)

15:50 mattmitchell: brehaut: actually, eval of clojure data is looking pretty good, compared to the json de-serialization

15:52 jcromartie: I'm playing with searching 50K records in a hash-map right now

15:53 that covers 99.6% of our clients after 12 years of business

15:53 ordnungswidrig: search among 50k or for 50k hits

15:53 ipostelnik: searching over 50K shouldn't be a big deal

15:54 i've used a hierarchical map that had 350K leaf-level maps as a poor-mans DB

15:54 jcromartie: :P

15:54 mean # of bills: 3400

15:54 media: 1097

15:54 median*

15:54 ordnungswidrig: ipostelnik: I use this with event sourcing and it works great

15:55 jcromartie: anyway, the aversion to a DB at this point is part curiosity (asking "do we need it?") and part practicality: getting a prototype up and running as fast as possible

15:55 ordnungswidrig: jcromartie: so it's ,(* 50 3400) orders in total?

15:56 jcromartie: ordnungswidrig: 429 organizations, 3400 invoices (mean)

15:56 but they will be segregated

15:56 ordnungswidrig: jcromartie: what's you memory footprint?

15:56 jcromartie: each organization in its own collection

15:56 ordnungswidrig: server is effectively unlimite

15:57 64-bit machines, we can spare any amount of RAM

15:57 and the design is highly shard-able

15:57 so the refs can actually be distributed easily

15:58 the API can transparently map requests

15:58 ordnungswidrig: nice. what is the scope of a ref in your case?

15:58 jcromartie: the current state of an organization's data

15:59 ordnungswidrig: Ah, I thought of clojure refs

15:59 jcromartie: hm?

15:59 what do you mean

15:59 by "ref" I mean a clojure ref

16:00 ordnungswidrig: ok, so a ref contains an orgainsation and everything it points to?

16:00 jcromartie: yes

16:00 duck1123: TimMc: commons.io's FileUtils seems to have everything I need

16:00 jcromartie: one organization <--> one ref

16:00 ordnungswidrig: I see. Do you use event sourcing or something like that?

16:00 jcromartie: that's the idea

16:01 journaled events for each organization

16:01 ordnungswidrig: So an organization is an aggregate root in DDD speach?

16:01 jcromartie: yes

16:01 daniel___: I'm getting this error after pressing \sr to start my repl:

16:01 Error detected while processing BufWinEnter Auto commands for "*":

16:01 E32: No file name

16:02 jcromartie: the only things outside of organizations are logins and some internal reporting stats

16:03 ordnungswidrig: I'm building a similar system at the moment. Do you use a message bus? I don't care about sharding and distributing at the moment but I like to plan ahead.

16:03 arohner: does lein have a flag that tells maven to "go check all snapshots, even if you already checked today"?

16:03 duck1123: lein pom; mvn dependency:tree -U

16:04 jcromartie: ordnungswidrig: there's nothing actually running distributed right now :)

16:04 amalloy: lein -D fffffuuuuuuuu_maven

16:05 jcromartie: it's very early

16:05 ordnungswidrig: jcromartie: hehe. I thought mirroring the events on multiple hosts, sharded by aggregate root / log. This would give me redundancy on storage and scale on read.

16:05 jcromartie: it would

16:06 you just have to make sure they end up in sync

16:06 but I think maybe we're both getting excited and putting the cart before the horse :P

16:06 1. make it work; 2. make it right; 2. make it fast

16:06 oops

16:06 let's try step 2 now

16:06 1. make it work; 2. make it right; 3. make it fast

16:07 ordnungswidrig: yes, it'd be easier to use cassandra or like that for event storeade.

16:07 storage...

16:07 or whatever you're needs regarding CAP are.

16:07 s/you're/your/ (damn, it's late)

16:10 gtrak: why does this happen?

16:10 ,1 2 3

16:10 clojurebot: 1

16:10 ordnungswidrig: gtrak: nice, in my repl 1 2 3 give me 3

16:11 gtrak: in mine it gave 1\n2\n3\n

16:11 in tryclojure, it gives 1

16:12 ordnungswidrig: slime repl in my case

16:12 gtrak: lein repl from windows in mine

16:12 daniel___: I'm getting this error after pressing \sr to start my repl:

16:12 Error detected while processing BufWinEnter Auto commands for "*":

16:12 E32: No file name

16:12 Raynes: gtrak: tryclojure evaluates the first form it sees.

16:12 daniel___: anyone ever had this?

16:12 Raynes: I think.

16:13 gtrak: Raynes, I'm gusesing lazybot/clojurebot does too?

16:13 Raynes: &1 2 3

16:13 lazybot: ⇒ 1

16:13 Raynes: Apparently.

16:15 gtrak: ,()()() I was trying this one <--

16:15 clojurebot: ()

16:20 daniel___: wow, i fixed my problem

16:20 au BufWinEnter *.* silent loadview

16:20 *.* instead of *

16:20 in case anyone comes across it again ^^

16:21 can i now select code and run it in the repl, or do i need to write it out again?

16:26 technomancy: arohner: the maven API has a flag which claims to do that.

16:26 unfortunately it doesn't.

16:26 arohner: technomancy: really? I thought I just got it to work

16:26 mvn dependency:resolve -U

16:27 technomancy: arohner: I mean the maven-ant-tasks API that leiningen uses

16:27 arohner: ah. ok

16:27 technomancy: it will probably be fixed in 2.0 with Æther

16:30 cemerick: I should have called pomegranate "f'n aether".

16:31 Stupidw

16:31 StupidWagonProviderAdapter

16:31 that is

16:32 * technomancy wonders if UTF-8 artifact-ids are kosher

16:32 ordnungswidrig: technomancy: as long a you can use them as filenames?!

16:32 * cemerick should write a macro that expands classname acronyms using classpath scanning (SWPA. …) => (StupidWagonProviderAdapter. …)

16:34 chouser: cemerick: yes!

16:35 compiler error if ambiguous. perfect.

16:35 cemerick: chouser: I wonder if I could reflect my way into modifying the reader so it works without a macro context… :-P

16:36 chouser: heh

16:36 * cemerick mentions these things only so that chouser will go mad and be forced to implement them himself

16:36 chouser: you know me too well

16:37 * chouser closes LispReader.java

16:37 amalloy: cemerick: c'mon, just wrap your whole codebase in (with-awesome-hacks ...)

16:37 * ibdknox does that, except it's called (with-SUPREME-AWESOMENESS ...)

16:38 cemerick: chouser: s'ok, you'll be back at it. The idea will crawl its way up your medulla when you least expect it.

16:38 ;-)

16:38 chouser: amalloy: I tinkering with a 4clojure problem submission. Because that's more important than finishing data.xml

16:38 ibdknox: lol

16:40 chouser: we really don't have drop-nth?

16:40 devn: ,(doc drop-nth)

16:41 clojurebot: It's greek to me.

16:41 devn: chouser: apparently not!

16:42 chouser: (defn drop-nth [i coll] (keep-indexed #(when (not= % i) %2) coll))

16:51 MrMc: How do I read a file line by line I have seen examples with line-seq and what about specifying a format like utf-8

16:55 daniel___: whats the most elegant way of squareing a number?

16:56 without writing (* x x)

16:56 x in my case is a long statement

16:56 amalloy: um, put it in a let statement? or write a square function, which is effectively the same thing?

16:56 ugh, i just said "statement". someone kill me

16:57 anyway, of course you *can* do it with none of these approaches, by manhandling built-in functions until they do what you want, but that's really just a lame way of reinventing a let

16:57 * ibdknox pulls out a gun

16:57 daniel___: hmm (let [x (my 'statement')] (* x x)) ?

16:58 amalloy: right

16:58 daniel___: ok, just checking...there might have been a really clever way

16:58 amalloy: (->> (+ 1 1 1 1 1 1 1) (repeat 2) (apply *))

16:58 &(->> (+ 1 1 1 1 1 1 1) (repeat 2) (apply *))

16:58 lazybot: ⇒ 49

16:58 ibdknox: lol

16:58 amalloy: there are lots of clever ways. they are mostly not good ways

16:59 ibdknox: ,(Math/pow (+ 3 3) 2)

16:59 clojurebot: 36.0

16:59 brehaut: gentlemen, start your peano numbers

17:00 daniel___: ah, i could use Math/pow, that's shorter/easier than let

17:00 amalloy: hope you don't mind floating-point numbers

17:01 ibdknox: daniel___, ^

17:01 daniel___: well i stick an int in front if need be

17:01 i already have a Math/sqrt in there

17:01 brehaut: woo precision

17:02 daniel___: dont need precision

17:02 brehaut: daniel___: in that case, try (def square identity)

17:03 it'll be close enough

17:03 ;)

17:03 amalloy: hah

17:03 (def square (constantly 0))

17:03 ibdknox: lol

17:04 amalloy: daniel___: you're aware that int always rounds down, right? "sticking an int in front" doesn't cause actual useful rounding

17:04 ibdknox: all of those physics problems in school would've been so much easier in a world without precision.

17:04 I mean we already didn't have friction

17:04 daniel___: amalloy: thats fine

17:05 i think i'm gunna have to scrap this anyway, can't work out a decent way of modifying a string by one character and making sure it's a real character....getting errors when the unicode codepoint reaches -1

17:06 amalloy: have you tried hiredman's suggestion of only working with characters at the beginning/end, and working with a vector of numbers in between? it would make several steps of your algorithm a hundred times easier

17:07 daniel___: amalloy: how would that help if the vector of numbers don't translate to characters

17:07 thats the problem im having

17:08 ibdknox: anything that has an invalid char in it dies immediately

17:11 amalloy: daniel___: you also wouldn't have this problem if you stopped trying to get an algorithm you know to be bad to "work" before you "add complexity" by using a decent algorithm. you couldn't get characters so far away from your initial input if you threw away mutations that go in the wrong direction

17:11 daniel___: https://gist.github.com/1279450 - eventually i pass an int to char that it doesn't like (-1 for instance)

17:11 amalloy: maybe i need to study my fitness algorithm some more, because i dont understand why it is deviating so much tbh

17:12 amalloy: i told you this weekend, it's because your evolve function allows mutations in the wrong direction to propagate

17:12 where's your git repo again?

17:13 daniel___: i don't understand why...im filtering for (<= fitness child parent), a lower fitness being better

17:14 https://github.com/danielstockton/evolve/blob/master/src/evolve/core.clj

17:14 if i try it in the repl: ((fitness-fn "bob") "bob") = 0 and ((fitness-fn "bob") "jim") = 221

17:15 and so on in between...so it appears to work correctly

17:20 amalloy: your fitness function is fine

17:28 jcromartie: lol http://colinm.org/language_checklist.html

17:29 daniel___: does iterate keep pluggin the return value back in each iteration? is that the problem

17:29 ibdknox: hahaha "You have reinvented Brainfuck but non-ironically"

17:30 daniel___: i thought iterate ran the same function over and over

17:30 but it uses the return value as the new argument each time?

17:30 amalloy: &(take 10 (iterate inc 1))

17:30 lazybot: ⇒ (1 2 3 4 5 6 7 8 9 10)

17:31 daniel___: i see

17:31 that is the problem then, in this case i dont want iterate

17:32 i know amalloy. does repeatedly only work for numbers? evolve.core$mutate cannot be cast to java.lang.Number

17:33 amalloy: its signature is different from iterate

17:33 ordnungswidrig: daniel___: (take-while odd? (repeatedly #(rand-int 10)))

17:33 ibdknox: ,(doc repeatedly)

17:33 clojurebot: "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"

17:34 daniel___: hmm i'm passing a function with args

17:35 ordnungswidrig: daniel___: you can either use partial (repeatedly (partial rand-int 10)) or an anonymous function #(rand-int 10) like above

17:36 dafra: in clojurescript, how to read a property of a dom node (textContent, style, etc.) ?

17:38 ibdknox: dafra, you'll need to read up on the google closure library

17:38 dafra, pinot had most of that though

17:38 dafra: ibdknox: i already use it in javascript

17:38 ibdknox: has*

17:38 https://github.com/ibdknox/pinot/blob/master/src/pinot/dom.cljs

17:39 daniel___: danke schoen ordnungswidrig

17:41 jetzt funktioniert es wie ich wollte

17:42 can i use an 'or' in my filter function? i need it to stop repeating if (= 0 (fitness %))

17:42 ibdknox: lol sind Sie Deutsch?

17:42 daniel___: nein aber ich spreche gerne Deutsch

17:43 dafra: ibdknox: looks like (. node property) works fine

17:43 amalloy: as would (.property node)

17:43 daniel___: I am from Burkina Faso

17:43 ibdknox: dafra, yep, the only problem is crossbrowser differences

17:43 I see

17:43 dafra: ibdknox: just like you showed me (.body js/document) yestaerday

17:44 ibdknox: Ich hab's bei der Uni studiert

17:44 dafra: ibdknox: some properties are best accessed throuh goog.dom, for sure

17:44 daniel___: Ich auch

17:46 etosch: has anyone noticed an issue with lein run binding standard error to standard out?

17:47 technomancy: etosch: which version?

17:47 daniel___: (filter (or #(< % 5) #(= % 8)) (iterate int 1))

17:47 etosch: 1.6.1.1

17:47 daniel___: ,(filter (or #(< % 5) #(= % 8)) (iterate int 1))

17:48 clojurebot: (1 1 1 1 1 ...)

17:48 daniel___: oops

17:48 ,(filter (or #(< % 5) #(= % 8)) (iterate inc 1))

17:48 technomancy: etosch: that may be outside lein's control due to the JVM's crappy unix support. you could try "lein trampoline run [...]"

17:48 clojurebot: Execution Timed Out

17:48 daniel___: erm?

17:48 ibdknox: ,(take 10 (filter (or #(< % 5) #(= % 8)) (iterate inc 1)))

17:48 clojurebot: Execution Timed Out

17:49 ibdknox: oh wow

17:49 I should've read the code

17:49 etosch: technomancy: ick. It's still binding out to err

17:49 ibdknox: lol

17:49 ordnungswidrig: ,(take 10 (filter #(or irc://chat.eu.freenode.net:6667/#(%3C % 5) irc://chat.eu.freenode.net:6667/#(= % 8)) (iterate inc 1)))

17:49 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 3C >

17:49 ibdknox: ,(take 10 (filter #(or (< % 5) (= % 8)) (iterate inc 1)))

17:49 clojurebot: Execution Timed Out

17:51 etosch: technomancy: rather, it's still doing something I don't expect; I'll have to do a few more tests first

17:51 ordnungswidrig: &(take 10 (filter irc://chat.eu.freenode.net:6667/#(or (< % 5) (= % 8)) (iterate inc 1)))

17:51 lazybot: java.lang.ClassNotFoundException: irc://chat.eu.freenode.net:6667

17:51 ordnungswidrig: ???

17:51 lazybot: ordnungswidrig: How could that be wrong?

17:51 ibdknox: ,lol

17:51 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: lol in this context, compiling:(NO_SOURCE_PATH:0)>

17:51 daniel___: ,(filter #(or (< % 5) (= % 8)) (iterate inc 1))

17:51 clojurebot: Execution Timed Out

17:52 daniel___: now i see why you're adding take 10

17:52 dafra: in cljs, how to require objects (not modules) like goog.debug.Logger ? to call getLogger*

17:52 ibdknox: hah

17:52 daniel___: ,(take 10 (filter #(or (< % 5) (= % 8)) (iterate inc 1)))

17:52 ibdknox: it goes forever

17:52 daniel___: yeah :/

17:52 ibdknox: because there aren't 10 values that fit that

17:52 clojurebot: Execution Timed Out

17:52 ibdknox: so it continues looking

17:52 ordnungswidrig: ibdknox: bingo

17:52 ibdknox: daniel___, what is it you actually want to do?

17:53 daniel___: well there should be only 5 values that fit that...but i imagine it keeps looking anyway just in case? :/

17:53 a filter with an or

17:53 ibdknox: no

17:53 that's a solution, not a problem :)

17:53 daniel___: https://github.com/danielstockton/evolve/blob/master/src/evolve/core.clj line 21/22

17:53 ibdknox: a filter with an or will work over a finite set

17:54 daniel___: once fitness reaches 0 the iterate (actually, its now repeatedly) runs forever

17:54 ibdknox: so you want an and

17:54 daniel___: ok, (and (blah) (!= % 0))

17:54 ibdknox: you want all values where the fitness is <= and > 0

17:55 daniel___: no, i want to include = 0

17:55 wait

17:55 ibdknox: but you want to stop once it reaches there?

17:55 daniel___: what do i want? lol

17:56 yeah, stop once it reaches 0

17:56 ibdknox: ,(doc take-while)

17:56 clojurebot: "([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."

17:59 daniel___: this is what i thought i wanted https://github.com/danielstockton/evolve/blob/master/src/evolve/core.clj

17:59 anyway, its been a relatively production evening, now 1am

17:59 gotta get some sleep

18:00 ,(println "night world")

18:00 clojurebot: night world

18:01 ordnungswidrig: good night

18:08 dafra: how to require an object like goog.debug.Logger ?

18:10 etosch: so what is the best way of capturing standard error to redirect into a file?

18:10 i can use java calls and make normal java errors redirect properly

18:10 but when I rebind *out* to *err* locally, I lose information

18:11 cgray: I'm having trouble upgrading my slime setup. I installed clojure-mode and have been trying to use clojure-jack-in, but I get "error in process filter: Symbol's value as variable is void: Warning:"

18:11 etosch: for example, I have some test code (binding [*err* *out*] (print 'test') (/ 9 0))

18:11 and I run it using the direct java call

18:11 where I redirect stdout to filename out and stderr to filename err

18:12 but out has 'test in it and the java error is lost

18:13 If I run the script without the binding call, 'test gets printed to out and the divide by zero error gets printed to err

18:13 so what is the proper way of locally binding data from standard out to standard error

18:14 ordnungswidrig: If it's java code that uses stdout, then you'll need to use System.setStdOut / System.setStdErr

18:18 etosch: it's clojure code, but I'm running it with the java call, rather than the lein call

18:18 ordnungswidrig: hmm, then (binding [*err* *out*] …) should be ok

18:19 but if you mean the exception, this is printed by a java handler I think.

18:20 etosch: that's still printing to stdout

18:20 ordnungswidrig: in any case it's caught outside you (binding …) form, and I think Exception.printStackTrace() will be called — which Java and does not know of *out* and *err*

18:21 I'd suggest catching the Exceptions inside the binding and the stacktrace from clojure.

18:21 etosch: I want to bind some data to *err* and then in my shell script redirect

18:21 I don't care so much about the proper errors; I just threw one in there to see if I couldn't figure out what's happening to it

18:22 ordnungswidrig: so try if (binding … (.write *err* "goes to err")) works.

18:25 good night, everyone.

18:26 etosch: got it

18:30 ghiu: l

18:31 i know that it's behind the dynamic nature of clojure, but is there a way to accept only a specific type as a function parameter?

18:32 cgray: when i do a C-x C-e on a form with a swank server started by "lein swank", the swank server crashes with "exception in read loop". does anyone know of a workaround for that?

18:32 aaelony: select-keys grabs the keys/vals I want but doesn't preserve the order in which I asked for them. I checked the source and tweaked it to do this, but is there a ready made function that already does this?

18:33 ibdknox: aaelony, the order?

18:33 aaelony: yes, for example: (select-keys {:a 1 :b 2 :c 3} [:b :c])

18:33 I wanted to see :b then :c

18:34 instead of {:c 3, :b 2}

18:34 ibdknox: maps don't guarantee order

18:34 aaelony: exactly

18:34 I cahnged it to a vector

18:34 but wondered if there is already a function out there

18:34 ibdknox: ah

18:35 brehaut: what about using a sorted map?

18:35 aaelony: is there a select-keys that returns a sorted map?

18:35 brehaut: ,(select-keys (sorted-map :a 1 :b 2 :c 3) [:b :c])

18:35 clojurebot: {:c 3, :b 2}

18:35 brehaut: hmm

18:36 aaelony: that wouldn't preserve the order

18:36 ibdknox: lol

18:36 you shouldn't be using a map if the order matters was my main point

18:36 buuut

18:36 brehaut: im a little surprised; i would have thought it would maintain the map type

18:36 aaelony: I'm not using the map, it is select-keys that returns it

18:37 ibdknox: so you just want values?

18:37 aaelony: that would work too

18:37 brehaut: ibdknox: sorted and ordered maps are useful in rare situations

18:37 ibdknox: brehaut, I agree, but not in this one :)

18:38 aaelony: basically, I want to ask for specific keys from a map and I am looking for the output to be the way I asked for it to be.

18:38 ibdknox: ,(map {:a 1 :b 2 :c 3} [:b :c] )

18:38 clojurebot: (2 3)

18:38 aaelony: I tweaked the select-keys function, but thought there might exist something that does this too

18:38 ibdknox: aaelony, ^

18:39 aaelony: ibdknox: that would work too

18:39 but wasn't what I was asking... :)

18:39 * brehaut thinks more functions should use empty rather than {} literals

18:40 amalloy: it's really the only solution that's correct, though

18:40 if you want something that has ordering, then you don't want a map

18:40 ibdknox: :)

18:40 amalloy: ibdknox's solution gives you exactly what you wanted: a sequence in the order you asked for

18:41 aaelony: right, I want a select-keys function that returns the order of the keys a request

18:41 its easy to write, I just thought I'd ask

18:41 amalloy: aaelony: what do you find unsatisfying about the solution using map?

18:42 ibdknox: you have the keys

18:42 aaelony: I need the output in exactly the order I ask for...

18:42 amalloy: it is!

18:42 ibdknox: lol

18:42 aaelony: :)

18:42 ibdknox: it's in the exact order

18:42 aaelony: I am not arguing

18:42 brehaut: it even works if the keys have no sensible ordering

18:42 srid: best way to create an one-off function that returns a hash-map? (to be used in (map ..) )

18:42 ( #(assoc {} :key "val") )

18:42 ?

18:43 ibdknox: ,(let [my-order [:b :c] (map {:a 1 :b 2 :c 3} my-order))

18:43 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

18:43 ibdknox: ,(let [my-order [:b :c]] (map {:a 1 :b 2 :c 3} my-order))

18:43 clojurebot: (2 3)

18:43 bsteuber: srid: (constantly {:key val})

18:43 srid: I mean, *create* a map

18:43 ibdknox: ,(doc hash-map)

18:43 clojurebot: "([] [& keyvals]); keyval => key val Returns a new hash map with supplied mappings."

18:43 srid: val will differ based on what is passed to the function

18:43 ibdknox: ,(hash-map)

18:43 clojurebot: {}

18:43 brehaut: srid: (partial hash-map key)

18:43 srid: more like: ( #(assoc {} :key %) )

18:44 brehaut: err (partial hash-map :key)

18:44 amalloy: or (fn [v] {:key v})

18:44 which seems simplest to me

18:44 srid: ok, hash-map is good enough.

18:44 ibdknox: or #(hash-map :key %)

18:44 or

18:44 lol

18:44 srid: ,(map #(hash-map :key %) (range 5))

18:44 clojurebot: ({:key 0} {:key 1} {:key 2} {:key 3} {:key 4})

18:44 brehaut: or #(-> {:key %})

18:44 ibdknox: sounds like a (for) waiting to happen

18:45 amalloy: haha (dec brehaut) that's horrible

18:45 ibdknox: amalloy, I figured you'd be all over that :p

18:45 brehaut: amalloy: thats from the joy of clojure, so blame fogus and chouser :P

18:45 ibdknox: srid: consider using for, it's probably cleaner

18:45 (for [x (range 5)] {:key x})

18:45 srid: ibdknox: yup

18:50 https://gist.github.com/1279714 <- is there a better way to write the (loop ... (recur ...)) pattern in this code?

18:50 amalloy: srid: this looks like a reduce

18:51 srid: fyi, "running-hosts" is an agent of hash-map of hostname -> a lazy-seq that represen\ts "tail -f /some/log/file" on that host

18:51 (the code has a bug in that old hosts are not removed)

18:51 amalloy: interesting

18:52 reduce is one of those functions I tend to avoid subconsciously

18:52 ibdknox: you shouldn't :)

18:52 amalloy: you're reducing hosts into newhosts, right?

18:52 and sending to an agent as a side effect

18:52 srid: yes, but more like, reducing hosts and newhosts into (another state of) newhosts

18:53 amalloy: mmmmnope, not really. you're reducing hosts with an initial value of newhosts

18:54 srid: i was confused. i take "hosts" and update the agent by adding hosts that are only in 'hosts' to the agent.

18:54 reduce will work, let me think

18:57 sjl: I don't suppose anyone knows a version of lein-marginalia that will parse docstrings, as well as comments inside functions?

18:57 I really want to use it, but I don't have time to dive in and fix that myself...

19:00 srid: reduce does simplify it https://gist.github.com/1279714#gistcomment-55857

19:35 jcromartie: I'm really seeing the benefits of deferring changes as late as possible

19:35 i.e. functional programming in the small-to-medium

19:38 also a cool bonus feature: I can make a "test mode" by very cheaply "pushing" the state of the system into a user's session

19:38 so you can use the system as if it were fully functional, but not make any permanent changes

19:51 archaic: any ideas how to (set! *print-length* 25) automatically when I start repl using clojure-jack-in?

20:39 todun: new to clojure. trying to get clojure up and running in terminal, does any know of a good(easy) tutorial or steps to do this? thanks.

20:39 brehaut: todun: have you got leiningen?

20:39 ibdknox: todun, https://github.com/technomancy/leiningen

20:40 todun: brehaut: what's that? let me google..

20:40 brehaut: https://github.com/technomancy/leiningen

20:40 ibdknox: :p

20:40 todun: brehaut: ibdknox looking at it now. thanks.

20:40 brehaut: todun: see also: http://dev.clojure.org/display/doc/Getting+Started

20:42 technomancy: http://dev.clojure.org/display/doc/Getting+Started+for+Beginners might be better

20:45 todun: technomancy: looking at that now. thanks.

20:46 are there any places to find a repo of clojure solutions of concurrency problems(jumping in the deep end i know)?

20:48 technomancy: nah, concurrency's easy.

20:48 the solution to concurrency problems usually revolves around a correct understanding of state and identity: http://clojure.org/state

20:49 there's no cookbook for "you're having this problem; here's a a problem to apply", it's more "design it right up-front and concurrency isn't very difficult"

20:49 *pattern to apply

20:50 todun: technomancy: what else should I know? Also, where do I learn to design right by concurrency?

20:50 at least clojure style?

20:51 technomancy: the state url above is the best place to start

20:52 todun: technomancy: ok. thanks.

20:54 technomancy: I'm following the emacs setup here and it seems to suggest that I have to ditch my current installation of emacs if I have one(yes). Is this necessary?

20:57 technomancy: todun: not at all

20:57 you may have trouble if it's currently configured to connect to common lisp using slime, but that's the only conflict. just install clojure-mode and swank-clojure, and do M-x clojure-jack-in

20:58 todun: technomancy: maybe I'm misunderstanding the directions there then.

20:58 technomancy: maybe the directions are wrong... let me see =)

20:58 todun: do I have to always run clojure mode with M-x?

20:59 technomancy: no, clojure-mode will activate automatically when it's installed

20:59 M-x clojure-jack-in is to start a repl session

20:59 todun: technomancy: they're probably right

20:59 technomancy: I don't see anything in the directions that indicate needing to throw away your current setup

21:00 todun: technomancy: ok.

21:00 technomancy: unless you use aquamacs or xemacs or some other fork

21:01 todun: technomancy: just emacs that comes with terminal

21:02 brehaut: lets be honest, those apps are more like sporks than forks

21:02 technomancy: I have no idea what that means, but I like it.

21:02 brehaut: todun, thats possibly a very old version of emacs

21:02 todun: technomancy: what goodies does the emacs starter-kit give that the default osx emacs doesn't have?

21:03 brehaut: do you recommend I get the emacs starter kit then?

21:03 brehaut: todun: OS X lion appears to have emacs 22.1.1 ?

21:03 todun: emacsformacosx.com/ and the starter kit

21:03 todun: brehaut: not on lion yet, sadly.

21:03 technomancy: todun: hard to explain succinctly, I'd recommend just going with clojure-mode for now since you can waste a lot of time on your elisp without getting anywhere on clojure.

21:03 brehaut: eep

21:04 brehaut: technomancy: really?

21:04 technomancy: that's practically antediluvian

21:04 brehaut: oh right, the emacs version

21:04 yeah. breaks horribly with the starter kit too

21:04 technomancy: brehaut: well, assuming he's already got an emacs config

21:05 brehaut: todun: the app that you get from emacsforosx has the terminal version in Emacs.app/Contents/MacOS/Emacs and if you flick it the -nw flag it runs as a terminal app. (i aliased it in my .profile)

21:06 todun: brehaut: checking it out now.

21:06 technomancy: emacs config?

21:07 brehaut: todun: just a warning, i hate emacs so take everything i say with a grain of salt

21:08 technomancy: todun: I mean if you haven't used emacs before you probably want the starter kit because the defaults are terrible. if you have an existing setup then I assume you're comfortable enough with it that you should just go with what you know.

21:09 oh, maybe I misread your original question; you're talking about the version you have installed rather than emacs config you have already set up?

21:09 todun: brehaut: ok.

21:10 technomancy: I was wondering what you meant by emacs config.

21:10 if you were referring to .emacs

21:11 technomancy: yeah, I just misunderstood what you were asking

21:11 todun: technomancy: np

21:12 technomancy: 22 is pretty old (circa 07 maybe?); I would recommend upgrading

21:12 the 24 pretests on http://emacsformacosx.com/builds have been very stable

21:12 todun: brehaut: so in a sense this emacsformacs is just like a text-editor but with emacs mode...

21:12 technomancy: in fact, I've been running 24 since 23 was released, and it's never crashed, while 23 has actually crashed for me a few times.

21:13 todun: brehaut: making an alias for it is what you suggest or that those commands will make the cli emacs open this emacsformacs?

21:13 brehaut: todun: re alias, correct

21:14 todun: in every way it is a proper build of emacs, rather than a spork

21:14 todun: brehaut: ok.thanks. spokr?

21:14 *spork?

21:14 brehaut: so calling it a text editor under sells it a little

21:15 sporks are half way between a spoon and a fork

21:15 todun: technomancy: ok. I'll try that.

21:15 technomancy: 24 has the package manager built-in, so there's a bit less hassle there

21:15 brehaut: aquamacs is halfway between emacs and a mac native application

21:16 todun: technomancy: gotten it. thanks. so does this already have clojure mode?

21:17 brehaut: todun: i have alias "emacs=/Applications/Emacs.app/Contents/MacOS/Emacs -nw" in my ~/.profile which means 'emacs' opens a new editor, and 'open -a emacs' opens the app version

21:17 todun: brehaut: which is better?

21:18 brehaut: for you at least?

21:18 brehaut: todun: it depends

21:18 if you use the app, you can use the mouse to flail around if you cant remember a key chord

21:18 but everything opened with the app exists within one process; its a bit harder to hive off projects

21:19 the app also lets you set readable fonts differently from your terminals

21:19 todun: hive?

21:20 brehaut: i cant explain it any better :/

21:20 todun: brehaut: ok. thanks for the tips all the same.

21:20 brehaut: no problem, just remember my caveat

21:20 todun: brehaut: you never mentioned why you hated it.

21:21 brehaut: i hate all text editors

21:21 oh, terminal emacs in lion means you can take advantage of full screen terminal to get a tiling window manager for your emacs windows (and shells and repls)

21:21 todun: brehaut: I'm not sure what that means but it sounds cool.

21:23 brehaut: http://haskell.org/haskellwiki/Xmonad/Screenshots#Tiled_layouts

21:24 todun: brehaut: ok. thanks.

21:26 jcromartie: how is Java/Clojure on Lion?

21:26 brehaut: fine?

21:26 jcromartie: I assumed as much

21:26 but I wasn't sure if there were any weird issues

21:26 technomancy: todun: the package manager in emacs 24 lets you easily pull from marmalade, the community package repository, which has clojure-mode

21:26 brehaut: not that ive encountered

21:27 technomancy: but it's not configured as a source out of the box

21:27 todun: technomancy: after getting emacsformacs, I try M-x clojure-mode don't find it

21:27 brehaut: jcromartie: it might be more annoying for java programmers than clojure programmers; its 1.6.0 rather than 1.7

21:27 technomancy: todun: right, you can either add marmalade as a package source and install from there, or just get clojure-mode from github.

21:28 jcromartie: brehaut: I'm an OS X user and what is Java 1.7? :)

21:28 technomancy: https://github.com/technomancy/clojure-mode/

21:28 jcromartie: :P

21:29 todun: technomancy: ok. I'll try that.

21:30 technomancy: so at the repl, all I have to do is add to ~/.emacs.d/init.el ?

21:32 technomancy: clojure-mode gets you syntax highlighting, indentation, etc., and allows you to start a repl session with swank-clojure

21:32 but that requires leiningen: https://github.com/technomancy/swank-clojure

21:34 todun: technomancy: so leinnigen first?

21:34 technomancy: yeah, you can spend hours on the elisp rabbit trail and not really learn anything

21:35 leiningen will get you straight to writing clojure

21:35 todun: technomancy: back to the beginning of our convo with brehaut

21:35 :)

21:35 technomancy: zactly

21:36 todun: technomancy: it says download the script. it is named lein. what is it's extension?

21:40 amalloy: nil? it has no extension

21:41 if you read the first line it probably says something like #!/bin/bash, which probably answers the question you actually meant to ask?

21:42 jcromartie: i've heard you can run into trouble trying to run the Lion JVM in 64-bit mode

21:42 jcromartie: interesting

21:43 I thought Java defaulted to 64-bit, though

21:43 amalloy: clojurebot: spork is <reply> <brehaut> sporks are half way between a spoon and a forkf

21:43 clojurebot: Ik begrijp

21:43 jcromartie: what does "java -version" say?

21:43 amalloy: dang it. stupid typo

21:43 jcromartie: mine (Snow Leopard) says Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)

21:55 todun: technomancy: when it says place it on your path in the leiningen install directives, doesi t mean put it in say your home dir?

21:56 technomancy: if so can I change the name of the file to .lein ?

22:00 amalloy: todun: to your second question: you can do whatever you want, but you're unlikely to be happy with the results of doing that. to your first: it's common to have a directory named bin in your home, which is on your PATH

22:00 then you can just dump lein in there, and tada

22:01 todun: amalloy: oh ok. I don't have one. is creating it ok on osx?

22:01 amalloy: sure, go for it

22:01 todun: amalloy: thanks.

22:02 amalloy: you have to actually add it to your PATH, eg by editing your ~/.profile - it doesn't just magically get there.

22:02 todun: amalloy: for ~/bin or for lein ?

22:03 amalloy: for ~/bin, if i understand your question

22:08 todun: amalloy: so something like this?

22:08 export BIN_HOME=~/bin

22:08 export PATH=$BIN_HOME/:$PATH

22:09 amalloy: sure

22:17 todun: amalloy: by the way, what does putting it in my path do?

22:17 ie. putting bin in my path.

22:18 technomancy: I've done the step 1 of leiningen, for step 2 it says Place it on your path and chmod it to be executable. how so?

22:19 do I chmod `/bin/lein at the repl?

22:19 * chmod ~/bin/lein

22:22 amalloy: todun: chmod +x ~/bin/lein

22:23 anyway, putting it in your path means that when you type lein (or any command) in the shell, your OS will look in ~/bin to see if a command with that name is there, and run it if so

22:28 todun: amalloy: thanks. trying that now.

22:29 amalloy: by the way, is lein like sbt?

22:29 amalloy: $google sbt

22:29 lazybot: [SBT Homepage] http://www.statebankoftravancore.com/

22:29 amalloy: well, it's not like that sbt, and i don't know any others

22:30 todun: amalloy: Simple Build Tools

22:30 amalloy: *shrug*

22:30 todun: amalloy: ok. at the repl, I've simply typed lein

22:30 amalloy: it downloaded a bunch of stuff.

22:30 amalloy: cool beans

22:31 try lein repl

22:31 todun: amalloy: I'm not sure about lein but I was hoping to get the emacs-mode for clojure.

22:31 do I now do the swank?

22:32 at https://github.com/technomancy/clojure-mode/ , it says to update package.el

22:33 but then it says to ;; add to ~/.emacs.d/init.el if you aren't already using Marmalade.

22:33 amalloy: meh. talk to technomancy about that, not me. my emacs setup is old and crusty, and not really recommended

22:33 todun: amalloy: ok. thanks though.

22:33 amalloy: todun: does lein repl work?

22:34 todun: technomancy: having lein, how to I follow steps at clojure-mode to make my emacs have clojure-mode?

22:34 amalloy: do you mean does typing lein in the repl do anything?

22:34 amalloy: no, typing lein repl into your shell

22:34 todun: amalloy: typing lein in the repl did soome download

22:34 lein repl ?

22:35 amalloy: indeed

22:35 lein is, in some ways, like make, or git: a main command with subcommands

22:35 todun: amalloy: I get a user=> prompt

22:35 amalloy: there you go, you're coding clojure, hooray

22:35 todun: oh

22:35 so lein is the clojure erpl?

22:35 *repl

22:35 amalloy: no

22:36 todun: why call it lein?

22:36 scottj: read the lein readme

22:36 amalloy: but lein[ingen] is a convenient way to manage clojure environments, including getting a repl

22:37 todun: scottj: the readme is flying over my head.

22:37 amalloy: ok. does that mean that lein[...] is like an environment for development clojure?

22:37 scottj: todun: ok well it explains the name. basically lein managed dependencies for your projects and has many features including loading a repl up for a project

22:38 amalloy: i guess? maybe? it's not really very clear how to answer the question :P

22:39 seancorfield: todun: what languages have you worked with before? (sorry if you already said - i only just signed on) maybe we can figure out what lein is "like" in your experience...

22:40 todun: scottj: so this repl will treat your project as packages to its namespace?

22:40 amalloy: ok. thanks all the same.

22:41 scottj: if you're inside a project when you do lein repl it will have your dependencies that are listed in project.clj on the classpath and you'll be able to reload/use them

22:41 todun: seancorfield: uhm..lets go with scala since it too is pseudo-functional. but I'm just familiar with it

22:41 scottj: if you're not in a project when you do lein repl it just gives you a clojure repl without (generally) any other libraries

22:42 todun: sbt I think is similar

22:42 seancorfield: todun: did you use a build tool with scala? maven? sbt?

22:42 todun: scottj: I suspected.

22:42 duck1123: If you use Ruby, it's like using RVM with bundler

22:43 todun: seancorfield: I used sbt. but didn't understand many things about it expect that it was used to build the project.

22:43 duck1123: that's news to me. but I'll check it out. thanks.

22:44 so it's a bad idea to make lein repl have an alias of clojure ?

22:44 meaning, is there a clojure repl out there I can independently install?

22:44 brehaut: amalloy_: "my emacs setup is old and crusty" thats basicly the definition of emacs isnt it?

22:45 duck1123: It's usually best to always have a project, even if you have a project only for random repl use

22:45 seancorfield: todun: the clojure libraries include a bare bones REPL - see http://clojure.org/getting_started

22:45 lein repl wraps that and takes care of library dependencies and the java classpath

22:45 scottj: todun: about 10 minutes after you get a bare clojure repl running you're going to realize you want a feature that lein provides so just use it :)

22:45 brehaut: todun: clojure has a curiously equal relationship with the rest of the language ecosystem; its less of a thing above all others

22:48 todun: scottj: so it's just best to make my clojure alias lein repl then, it will safe a newbie like moi allot of headache...

22:48 brehaut: I don't follow.

22:48 brehaut: todun: thats because i failed at english

22:48 todun: seancorfield: ok. thanks.

22:48 scottj: todun: are you talking about a shell alias clojure="lein repl"?

22:48 duck1123: todun: just learn to love lein and all the subcommands. You'll be happier

22:48 todun: duck1123: having a project?

22:49 brehaut: todun: clojure is a library not a 'full' enviroment like you might expect with other languages

22:49 todun: lein fills the common enviromental roles

22:49 todun: brehaut: yes, I saw that in the docs.

22:49 duck1123: todun: create a project where you can set up the dependencies you want and always cd to that dir before you start a repl

22:49 seancorfield: yup, you could add clojure to a scala project just by adding the clojure.jar file to the classpath

22:49 todun: brehaut: that's why I can get clooj.jar, right?

22:49 brehaut: i have no idea what clooj is

22:50 but i guess so

22:50 duck1123: clooj is an ide in clojure

22:50 seancorfield: and then in scala you could do new clojure.lang.RT and have access to the clojure runtime inside scala :)

22:50 duck1123: it's neat, but no emacs

22:51 todun: seancorfield: that's interesting. sounds like a though install for me though.

22:51 brehaut: todun: the thing with aliasing lein repl to clojure is that its not just clojure, its lein and it reacts differently in the presence of a project frinstance

22:51 todun: brehaut: ok. how so?

22:51 brehaut: well if you are ina project, the repl will have the dependancies and verson of clojure that the project requests

22:52 whereas if you are out of a project its just going to have clojure and whatever lein wants it to have

22:52 duck1123: when you're in a project directory, lein repl runs with the declared version and dependencies

22:52 seancorfield: that means you can have one project that uses clojure 1.2.1 and another project that uses clojure 1.3.0 and lein automatically manages the libraries etc

22:52 brehaut: todun: clojure and clojure deps is not installed system wide, but are managed per project by lein

22:53 todun: so if I am in ~/proj1 , I will launch lein repl then test my first_app.clj there?

22:54 and have all the dependencies I need.

22:54 duck1123: if you do: lein new proj1 it'll set up everything for you

22:55 todun: brb. changing internet locations...

22:55 * srid has 3 invites to irccloud.com

23:04 todun: duck1123: ok I'll try that. thanks.

23:04 hope I didn't miss anything.

23:04 last I got was duck1123 suggestion

23:09 amalloy: todun: http://www.raynes.me/logs/irc.freenode.net/clojure/2011-10-11.txt

23:10 todun: amalloy: thanks. I didn't know that was avialbale.

23:10 *available.

23:10 amalloy: there are a number of public logs of this channel; that's one

23:11 todun: amalloy: where is the list?

23:12 brehaut: huh the zsh autocomplete for lein is pretty cool

23:13 amalloy: i can't imagine why anyone would bother to publish a list of the different logs of #clojure

23:13 ibdknox: for fame, of course

23:13 clojurebot: then its perfect. but of course, there are a lot of other parts too that changes. so after I make assoc :show, is there a problem I make again (def data (assoc data :list ...)

23:14 ibdknox: very relevant clojurebot.

23:14 amalloy: clojurebot: ?

23:14 clojurebot: #<ClassCastException java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;>

23:14 ibdknox: lol

23:14 amalloy: sensible

23:17 todun: trying to follow https://github.com/technomancy/clojure-mode/ do I put package.el in bin too?

23:17 or add to ~/.emacs.d/init.el ?

23:21 brehaut: emacs packages are managed inside emacs

23:22 M-x package-install starter-kit-lisp should get you there?

23:22 srid: that requires emacs 24 though

23:22 brehaut: ah yes it does

23:22 srid: but I agree that starter-kit is the easiest route

23:22 starter-kit v2

23:28 todun: brehaut: ok will try

23:28 srid: I got that by technomancy suggestion

23:28 srid: technomancy wrote starter-kit as well

23:28 todun: brehaut: srid so I should use emacs 24 or starter-kit v2?

23:29 srid: todun: yes

23:29 and, not or.

23:29 brehaut: both :)

23:29 todun: srid: ok. let me look into starter-kit.

23:30 srid: starter-kit keeps ~/.emacs from getting dirty

23:30 todun: srid: actually, I downloaded stater-kit if I'm reading this right...https://github.com/technomancy/emacs-starter-kit

23:31 I went to http://emacsformacosx.com/builds and got 24

23:35 brehaut: trying M-x, then package-install, then starter-kit-lisp doesn't work for me.

23:35 it says no matcg

23:35 *match

23:35 brehaut: im not an emacs expert sorry

23:36 i just followed the instructions o nthe starter kit page

23:36 todun: brehaut: oh ok. thanks all the same.

23:36 amalloy: probably package-refresh-packages or something

23:37 todun: amalloy: ok. let me try that.

23:38 amalloy: I do M-x, package-refreshcontents is all that shows up. should I use that instead?

23:39 amalloy: see "or something". that's as promising-sounding as anything else

23:42 todun: amalloy: in emacs or in the readme for emacs-starter-kit?

23:42 amalloy: huh?

23:42 todun: amalloy: you said see "or something"

23:43 amalloy: <amalloy> probably package-refresh-packages or something

23:44 todun: amalloy: oh ok. thanks. I'm trying package-refresh-contents

23:45 brehaut: what else did you do when you followed the readme for emacs-starter-kit?

23:45 brehaut: nothing

23:46 it worked fine for me

23:46 srid: did you add the marmalade repo as per README?

23:46 brehaut: i guess so

23:46 i just did what it said

23:47 oh, your probably talking to todun, my bad

23:48 todun: srid: that is what was confusing

23:48 srid: I assumed brehaut was indicating that step by his instructions.

23:48 srid: add init.el and restart emacs

23:48 add to*

23:49 todun: srid: init.el does not exist for me in ~/.emacs.d/init.el

23:49 srid: create?

23:49 todun: do I put package.el into init.el?

23:50 srid: package.el? emacs 24 includes package.el.

23:50 todun: get the 'pretest' build from http://emacsformacosx.com/builds

23:51 brehaut: todun: indeed, but you need to require it

23:51 srid: or 'nightly'

Logging service provided by n01se.net