#clojure log - Jul 21 2011

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

0:13 goodieboy: matt

0:22 technomancy: are there any standalone libs that implement namespaces-matching like https://github.com/technomancy/leiningen/blob/master/src/leiningen/util/ns.clj ?

0:24 amalloy: technomancy: fwiw, clojure.tools.namespace is the new-contrib version, if pulling in all of contrib is what bothers you

0:24 technomancy: oh nice; I'll take a look

0:24 amalloy: or...org.clojure/tools.namespace, i guess

0:24 * amalloy can't keep that stuff straight

0:24 technomancy: the old contrib one had some behaviour that made it unsuitable for leiningen, but I don't remember the specifics

0:24 it might work for this

0:25 amalloy: technomancy: the new one has a (set! *warn-on-reflection* true) helpfully placed at the top of the namespace for you

0:25 (har har)

0:26 technomancy: ...

0:26 ok, so much for that.

0:26 amalloy: ninjudd asked for it to be patched like two weeks ago. that "remove a single line" diff is still waiting; in the mean time, you can depend on his fork if you want

0:27 technomancy: I'll stick with my copypasta till (if) it's fixed

0:28 amalloy: i can't say i disagree

0:35 technomancy: amalloy: where's the bug report?

0:35 looks like it's not even a project in jira yet, and it's not on the guthubs

0:35 it's no wonder people are reluctant to move off 1.2

0:36 amalloy: technomancy: oh, i misspoke. the bug is in java.classpath, on which tools.namespace depends

0:37 technomancy: aha

0:37 amalloy: https://github.com/clojure/java.classpath/pull/2 the pull request is closed but no release is forthcoming

0:39 technomancy: https://github.com/technomancy/Die-Roboter

0:40 ambrosebs: lol

0:56 technomancy: if any german speakers notice missing diacriticals or anything, please let me know

1:07 amalloy: i don't speak any german, but you can't go wrong with umlauts

1:07 technomancy: moar umlaüts!

2:18 dbushenko: hi all!

2:19 is clojurescript video available?

5:00 zakwilson: ,(contains? [-1 0 1] -1)

5:00 clojurebot: false

5:01 zakwilson: ,(contains? [-1 0 1] 1)

5:01 clojurebot: true

5:01 zakwilson: Why?

5:01 clojurebot: http://clojure.org/rationale

5:01 zakwilson: Thanks, clojurebot. That doesn't help.

5:02 Belaf: zakwilson: try "(doc contains?)"

5:02 clgv: zakwilson: because you can only ask whether an index is present

5:03 zakwilson: a vector is associative in mapping position index (key) to value at that position (val)

5:03 zakwilson: Oh. Right. That's why I wrote my own "member?". Is there one?

5:03 clgv: zakwilson: ##(some #(= -1 %) [-1 0 1])

5:04 ,(some #(= -1 %) [-1 0 1])

5:04 clojurebot: true

5:05 clgv: ,(contains? [10 11 12] 1)

5:05 clojurebot: true

5:05 clgv: ,(contains? [10 11 12] 3)

5:05 clojurebot: false

5:07 wjlroe: technomancy: Leiningen projects and deploying - are there any guidelines? Or pointers? Obviously want as simple a process as possible and am currently drowned in maven and so on...

5:08 talios: drowning in maven :( if I can help sing out...

5:08 I see Hugo's launched an alternative maven plugin to mine as well

5:09 zakwilson: clgv: yeah, member? is basically that, but I wanted it to have its own function.

5:26 Belaf: Sono via per un po'... ci sentiamo più tardi?

5:26 Sorry :(

5:26 ahriman53072: ÷¸

5:27 Belaf: wrong chat.

5:27 * ejackson stumbles, blinking, into this whole javascript / clojurescript discussion

5:28 ejackson: what does it all mean...

5:29 raek: ejackson: have you seen https://github.com/clojure/clojurescript/wiki ?

5:29 ejackson: busy reading it

5:30 raek: basically, they did CinC and now Clojure runs on the javascript platform!

5:30 ahriman53072: ÷¸

5:30 raek: using Node for command line applications is very interesting... no JVM startup delay...

5:36 Fossi: and now on to a dalvik port :]

5:36 talios: you see Oracles new InvokeDynamic based Javascript language announced today ( well, mentioned at the Language Summit ) - looks interesting

5:37 ejackson: sorry raek, lost connectivity there

5:37 talios: ClojureScript the new JS runtime via JVM over onto Dalvik ;p

5:37 sadly no ID on Dalvik

5:38 Fossi: hmm, it would make things a whole lot nicer

5:39 but it isn't really needed anyway

5:41 ejackson: i'm hampered by being so backendy that I have no idea what all the client stuff is about :)

6:01 raek: 11:29 < raek> basically, they did CinC and now Clojure runs on the javascript platform!

6:01 chitsubr: Hmm, can someone explain what clojurescript is? Is it that we can write clojure code and run it in the browser?

6:01 raek: 11:30 < raek> using Node for command line applications is very interesting... no JVM startup delay...

6:01 ejackson: ^

6:02 chitsubr: yes, in browsers and with node.js

6:02 https://github.com/clojure/clojurescript/wiki

6:03 chitsubr: so to use it I would have to first write clojurescript, then compile it to js, and call the js from a web-page?

6:03 so it's like coffeescript in that way

6:08 raek: yes, but with additional benefits. it uses the Google Closure minification compiler which removes the parts of the libraries that you don't use

6:17 dbushenko: raek: is the video about ClojureScript available already?

6:20 talios: dbushenko: you could try the ustream page - ustream often has their copy available.. so maybe there

6:21 romanroe: in emacs, using clojure-mode, is there a way to always hightlight the first form in a list? currently it seems to only hightlight well-known functions like map, reduce, etc.

6:21 err, I meant the first symbol in a list

6:23 raek: dbushenko: I don't think so. I expect it to show up at http://blip.tv/clojure eventually.

6:29 kjeldahlw: So any chance of having the ClojureScript compiler run in the browser, effectively allowing web apps to use clojure as a browser based repl language? Haven't had the time to dig into the "compiler" yet...

6:32 romanroe: kjeldahlw, as far as I understood it, ClojureScript is written in Clojure, not JavaScript. Hence you won't see a browser based compiler, eval, etc.

6:33 kjeldahlw: romanroe: Written in clojure, compile to javascript... ;-) Well, one could hope! :-)

6:34 raek: kjeldahlw: if you port the ClojureScript compiler to the ClojureScript subset of Clojure, you should theoretically be able to compiler the compiler to javascript :-)

6:34 kjeldahlw: Kind of similar to Coffeescript in that regard, only not quite yet. Yes, I've read the part about being a compiler versus "translator", so I realize the effort is a lot larger.

6:35 raek: *compile the compiler

6:35 kjeldahlw: raek: Yes, my thought exactly.

6:35 A good benchmark on how "complete" the clojure to javascript compiler is anway, "self hosting" or whatever it is called.

6:35 raek: as rhickey said, this was not a design goal, but he is certain that someone will do it eventually

6:36 kjeldahlw: Haven't seen it yet, still waiting!

6:38 But I did get the Closure book already...

6:45 tsdh: Hi. Can someone give me a hint why my fold-constants-with-choose is 450 times slower than my fold-constants? http://pastebin.com/5uYkBzL4

6:46 I somehow expected a worst-case slowdown of factor 3...

6:53 clgv: I need to pair the elements of two sequences but I do NOT want the pairing to stop as soon as one sequence has no elements anymore BUT when all sequences have no elements anymore. is there already a command for that?

6:54 opqdonut: no, not really

6:54 do you want the missing values to be nil or what?

6:54 clgv: yes.

6:54 opqdonut: I've sometimes implemented a map+ that is like map but goes on until all sequences are exhausted

6:54 clgv: ok. I might implement it myself via loop then ;)

6:55 opqdonut: mhmm

7:07 clgv: done: (defn pair-seq [c1 c2] (when (or (seq c1) (seq c2)) (lazy-seq (cons [(first c1) (first c2)] (pair-seq (rest c1) (rest c2))))))

7:07 no generalization on multiple arguments right now...

8:05 raek: aw! I was going to name my Gopher protocol client "Capybara" but someone else started a project with that name since last time I checked (at that time, there were no hits on github)

8:06 * raek browse Wikipedia for other names of rodent species

8:34 raek: when was defprotocol docstring support added to Marginalia?

8:34 doesn't seem to be recognized with [lein-marginalia "0.6.0"]

9:03 buddywilliams: Anyone know of a great article on clojure recursion? One which address the different types of recursion.

9:04 ,(println "good morning world!")

9:04 clojurebot: good morning world!

9:07 manutter1: Missed the live stream last night, is the video ready yet?

9:07 clgv: buddywilliams: what exactly are your questions? maybe we can answer them here

9:13 gfrlog: in leiningen, what's the standard way to handle jars that can't be gotten via maven? Obviously I'll have to check them into the repo, but wondering where to put them so that lein both knows what they are and doesn't delete them all the time.

9:17 raek: gfrlog: and this is not a java liv that you can find on jarvana.com?

9:17 (just checking that first)

9:18 joegallo: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

9:18 Just use maven to install the jar locally.

9:19 raek: gfrlog: you can add [your.private.domain/theproject "version"] to your project.clj and do lein deps. the maven error message will tell you what to do to make it work

9:19 there is a thread about this in the clojure and leiningen mail list

9:25 kumarshantanu: gfrlog: raek: is it something you can use lein-localrepo plugin for?

9:31 gfrlog: I'll look at all those options, thanks guys

9:38 ischyrus: Is there a clojure function to generate a unique id?

9:39 kumarshantanu: ischyrus: gensym

9:39 ,(gensym)

9:39 clojurebot: G__199

9:41 ischyrus: thanks

9:48 clgv: ischyrus: kumarshantanu's suggestion generates a unique symbol for use in macros. do you want unique ids for your business objects?

9:49 ischyrus: yeah, I ended up with '(.toString (java.util.UUID/randomUUID)))'

9:50 clgv: if that works for you it's fine. but that might not work as intended with persistence in several programm runs.

9:51 ischyrus: what would you suggest?

9:52 clgv: ischyrus: I don't know your complete scenario so I can't suggest anything. java.util.UUID/randomUUID looks good for generating UUIDs in a single run of a program

9:55 ischyrus: I'm essentially creating a key that can be given to someone that can be used for a basic authentication. Basically an api key

9:56 fliebel: Is the presentation about clojurescript up on the web somewhere?

9:56 stuartsierra: Video will go up at some point, but not yet.

9:56 fliebel: okay

9:57 abedra: stuartsierra, what do we need to do in order to get it downloadable?

9:57 stuartsierra: no idea

9:57 abedra: stuartsierra, is it just too big right now?

9:57 clgv: ischyrus: well then I would use java.util.UUID/randomUUID and store the results in a file/database for lookups regarding "true persistent uniqueness".

9:57 stuartsierra: abedra: ask Alan

9:57 fliebel: I though that streaming thing automatically recorded the stream.

9:57 abedra: stuartsierra, if so, I can grab it and run ffmpeg on it today

9:57 clojurebot: stuartsierra is volunteering

9:57 abedra: stuartsierra, ok will do

9:57 stuartsierra: dammit, Clojurebot

10:13 jodaro: hiya

10:20 maravillas: is a pull request or a google groups post preferred for a clojurescript patch?

10:22 stuartsierra: neither yet. We will have JIRA set up soon.

10:24 ejackson: ah, so the idea of ClojureScript is to allow Clojure to be deployed where the JVM cannot. I get it, I think.

10:25 Scriptor: also solves the slow startup time problem, so it should be great for small scripts

10:27 ejackson: with which engine ? (I'm not being sarcy, I genuinely don't know)

10:28 Scriptor: ejackson: v8 via node I guess?

10:28 ejackson: OK, interesting, thanks.

10:28 Scriptor: well, that's one of the intended uses, I think it might come with rhino as well

10:29 ejackson: and the mobile angle is that all phones have JS enabled browsers, or they can run JS natively ?

10:30 Scriptor: pretty much

10:30 ejackson: oh, I meant it as a question of which clause was true ?

10:31 Scriptor: well, like the rationale page says js is often the most portable language for mobile phones if you want to develop apps for them (would have to be web apps though)

10:32 and I think the major phone os's support js

10:32 clgv: hmm will all clojure code be compilable to javascript via clojurescript? or will it be like .Net vs silverlight?

10:33 Scriptor: not familiar with how it was with silverlight, but not all clojure code

10:33 in the talk Rich mentioned that porting higher-level libraries was very easy, but it still takes a bit of effort I guess, since only a subset of clojure is available

10:37 kumarshantanu: Scriptor: Has anybody given a thought to debugging w.r.t. ClojureScript? Is it possible to generate debugger steps in the emitted code?

10:38 Scriptor: kumarshantanu: I don't really know, I've of firebug integration with clojurescript though

10:41 jodaro: hi, quick n00b question/affirmation: i'm using proxy to get to a method in a Java class (which is implemented by someone else). the method I need access to, however, requires me to use 'this.data', which happens to be 'protected Object data;', and there is no accessor unfortunately. from the clojure docs, it looks like i'm out of luck with proxy.

10:42 raek: jodaro: yes, that is a limitation of proxy. you can't access protected fields.

10:43 jodaro: a simple work around is to write a small class in Java that exposes an accessor and then subclass that one instead

10:43 jodaro: yeah

10:43 that was my next plan

10:43 thanks

10:44 raek: in lein, just add :java-source-path "src/" to the project.clj, and then any java files there will be compiled when the app is built (or when you invoke lein javac manually)

10:45 jodaro: nice

10:45 i'm a scala refugee to some extent. lein reminds me a lot of sbt

10:45 which is a good thing

10:48 chouser: or do something similar with gen-class

10:48 * chouser is willing to suffer gen-class to avoid writing java

10:53 jodaro: yeah i was looking at gen-class as well

10:58 * raek is willing to suffer java to avoid binary incompability

11:00 jodaro: its not clear why the implementer didn't add an accessor for the data member

11:00 since there is a setter, and all of the other fields have them

11:23 clgv: is it true that I can speed up execution if I use the method of the interface generated by defprotocol directly?

11:32 dnolen: kumarshantanu: the solution will probably be source mapping - WebKit and Firefox are both working on it. Also I heard Google Closure already has a Firefox plugin for Google Closure transformed code.

11:39 kumarshantanu: dnolen: any URL/googleable_keyword for the ongoing effort on Webkit and Firefox?

11:42 found http://code.google.com/closure/compiler/docs/inspector.html

11:43 dnolen: https://bugs.webkit.org/show_bug.cgi?id=63940

11:43 https://docs.google.com/document/d/14AWiLDDxEuLaWuyG0X6deLRufrvxRu8HBP0LNJwvRZw/edit?hl=en_US&pli=1

11:46 kumarshantanu: dnolen: Thanks!

11:55 the-kenny: http://tarn-vedra.de/test.html <-- clojurescript is awesome :)

11:56 clgv: the-kenny: you should show the clojurescript source as well^^

11:57 ambrosebs: :D

11:58 the-kenny: clgv: You can find the source in test.js :)

11:58 :p

11:58 clgv: https://gist.github.com/1097505

11:58 clgv: yeah, well - considering this it is pretty ugly then :P

11:59 thx

12:00 the-kenny: It's pretty simple, but there are a few gotchas (like the syntax for (.method object args...)

12:00 Sorry for bothering you guys, I just got around playing with Clojurescript

12:00 clgv: dnolen: did you tell me that 2d double arrays were much slower than 1d double arrays?

12:02 dnolen: clgv: yes

12:02 clgv: dnolen: this seems to be not true at all, considering random read and write access on them.

12:03 dnolen: I just measured both implementations.

12:03 dnolen: clgv: interesting got a gist? could be wrong o course.

12:04 clgv: dnolen: I can make a gist in a few mins. Maybe I have overhead when calculating the index due to possibly not using primitives?

12:05 dnolen: clgv: that's probably it.

12:06 clgv: dnolen: does it matter if I use boxed Integer or int?

12:16 dnolen: with assuring all being Integer it still is slower.

12:17 I also have typehints in place

12:20 abhinavmehta: hi clojure tribe, suggestion for first-book to read about clojure.

12:20 any.?

12:20 pdk: programming clojure then joy of clojure probably

12:20 practical clojure is kind of just a ready reference for core functions and needs editing work

12:21 abhinavmehta: pdk: ahaa..looking at it(joy of clojure), seems good.

12:21 pdk: thank-you. :)

12:22 pdk: joy of clojure does assume some java/lisp understanding a bit of familiarity with clojure

12:22 though the stuff it does cover is missed by the others

12:24 frou: watching some of Rich's nice video talks might be the best step zero?

12:24 abhinavmehta: pdk: not a problem with Java/Lisp and second statement sounds more interesting...thats a good one

12:25 ohpauleez: fwiw, I swear by Joy of Clojure and have read it a good number of times

12:25 I think four or five total now

12:27 abhinavmehta: ohpauleez: clojure peeps seems badly loving it..huhh. :)

12:28 frou: Is there some Rich's video tutorial targeting beginners ? Any url's ?

12:36 frou: abhinavmehta: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey

12:36 abhinavmehta: frou: thank-you. :-)

12:37 frou: abhinavmehta: welcome, and http://blip.tv/clojure/clojure-for-java-programmers-1-of-2-989128

12:38 abhinavmehta: frou: thanks once-again.

12:48 * devn watched Are We There Yet..like..6 times

12:49 ohpauleez: yeah

12:49 clgv: devn: why?

12:49 ohpauleez: I still tell people to go and watch it

12:49 technomancy: devn: is that still only available on flash?

12:50 ohpauleez: clgv: It's a fundamental ideology that is a breath of fresh air, "There are better ways to achieve the things we've always wanted in a paradigm. We can solve real problems if we critically analyze them"

12:51 and it fully motivates the Clojure story

12:51 clgv: I wanted to know why 6 times ;)

12:51 ohpauleez: ohh

12:51 :)

12:55 ieure: http://i.imgur.com/58mjC.jpg

12:56 clgv: how do I create an unboxed integer?

12:58 frou: technomancy: at least in Safari, you can download the video file by looking in the "Activity" window while you're streaming it

12:59 technomancy: frou: that still requires flash

13:02 dnolen: clgv: boxed number will always be slower. what version of Clojure are you using?

13:02 clgv: dnolen: 1.2.1

13:02 dnolen: clgv: you can cast to a primitive in 1.2.1 (int n)

13:02 clgv: dnolen: I guess I have to convert my map to a defrecord then.

13:03 dnolen: clgv: but you also need to type your arrays as arrays of primitives, ^ints

13:04 clgv: dnolen: in the current version the 1d approach is about 40% slower

13:06 dnolen: I'll do the defrecord conversion tomorrow and see if I can get a speedup

13:07 mattmitchell: hmm, i have to namespaces. they both need to talk to each other. I'm using require :as, but getting a cyclical dependency errors. Anyone know a way around this?

13:07 sorry, i meant TWO namespaces

13:08 clgv: mattmitchell: refactor to avoid the cyclic dependency relation

13:08 mattmitchell: clgv: i was afraid to hear something like that :) any suggestions?

13:09 clgv: mattmitchell: decide on a clear relation where one of those namespace uses the second. you have to extract the entities in the first namespace that shall be used by the second into a third namespace that can be used by both.

13:09 mattmitchell: clgv: yeah makes sense. ok i'll give it a shot. thanks!

13:14 Vinzent: enlive question: how can I select the node that is in 3 elems after some element?

13:14 e.g. <div ...> <img ...> <p ...> <a ...>, I need to extract a

13:16 should I use {} syntax to select fragment between div and a?

13:27 another one: how to select node from the fragment returned by {}?

14:11 ambrosebs: how can I find the index number of the first value in a vector to pass a predicate?

14:12 [true true false], looking for false, returns 2

14:12 kumarshantanu: ambrosebs: (map f foo-vector (iterate inc 0))

14:14 ambrosebs: not quite what i'm after, I'll be clearer

14:14 (mystery false? [true true false]) => 2

14:14 what is mystery? :)

14:15 technomancy: ,(filter (comp not second) (map-indexed vector [true true false]))

14:15 clojurebot: ([2 false])

14:16 ambrosebs: technomancy: perfect thanks!

14:16 technomancy: not quite perfect, but sure

14:16 ambrosebs: :)

14:17 amalloy: usually if i care about indexes in a vector it's because i'm in the middle of doing something the wrong way :P

14:18 ambrosebs: I'm implementing an algorithm from a paper :)

14:18 so it must be right ;)

14:28 * technomancy lols at projects that use reverse-dns namespaces and still append .core

14:29 amalloy: technomancy: well, it's not crazy, if they have more than one ns. eg if i have org.malloys.akm.dnsutils.lookup, i kinda prefer ...dnsutils.core to ...dnsutils

14:30 technomancy: amalloy: really?

14:30 the only reason the .core convention was introduced was to avoid single-segment namespaces

14:31 amalloy: maybe it's a sick fetish i've developed as a result of that convention

14:31 * kumarshantanu agrees with technomancy - ".core convention"

14:32 technomancy: lein new in 2.0 will probably detect multi-word project names and create src/die/roboter.clj instead of src/die_roboter/core.clj

14:32 because that's the first thing I fix when I start a new project

14:32 kumarshantanu: +1

14:33 amalloy: i guess i'm probably also lying about my preference

14:33 since amalloy-utils has amalloy.utils and amalloy.utils.foo

14:35 kumarshantanu: technomancy: any tentative schedule for lein 2.0? Is 1.6 the last in 1.x series?

14:36 technomancy: kumarshantanu: right, 1.6 will probably see a couple bugfix releases

14:36 I don't know how long 2.0 will take. the big juicy bits are the aether switch and rewriting eval-in-project.

14:36 amalloy: the aether switch? that sounds fantastic, whatever it is

14:36 kumarshantanu: I guess Cljs support will coincide with 2.0

14:37 given that it is still alpha

14:37 technomancy: amalloy: I could explain, but I think whatever your imagination is coming up with is probably better.

14:37 kumarshantanu: I haven't looked at it enough to say for sure, but that would probably work fine as a plugin for 1.x

14:37 kumarshantanu: amalloy: aether is the Maven deps resolution functionality factored out of Maven (roughly speaking)

14:40 rhebus: (constantly 2)

14:43 Vinzent: http://paste.lisp.org/display/123413 - please correct me if I'm wrong, does this means "give me all spans with class italic those have parent with ::= in its content and class subhead2"?

14:46 bendlas: Hi, I've written an improved version of clojure.repl/dir https://github.com/bendlas/clojure.repl

14:46 I'd appreciate feedback

14:55 bpr: is there a "correct" way to write tests for private functions?

14:56 danbell: Anyone know the difference between replicate and repeat?

14:56 amalloy: bpr: my preference is to stop writing private functions

14:56 danbell: one of them's older. i always use repeat

14:56 &(doc replicate)

14:56 lazybot: ⇒ "([n x]); Returns a lazy seq of n xs."

14:56 amalloy: &(doc repeat)

14:56 lazybot: ⇒ "([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."

14:57 danbell: seems like replicate is redundant and not as powerful

14:57 amalloy: ~source replicate

14:57 ~source repeat

14:57 yeah, replicate is 100% redundant

14:58 danbell: well i'll be

15:00 amalloy: bpr: clojure gives you so many other options. a "private" namespace with public functions in it; functions which are actually private via closures: (letfn [(priv-fn [x] (inc x))] (defn pub-fn [x] (priv-fn (* 2 x))))

15:01 kumarshantanu: bpr: private functions have been termed "bossiness" in the past - you should consider creating a namespace called "internal" and put private stuff there

15:02 as in foo.bar and foo.bar.internal

15:05 bpr: I guess the internal namespace sounds good. Though it strikes me as rather heavy-handed compared to defn-. My issue with the closed-over functions is that I still wouldn't be able to test them.

15:06 Vinzent: what's wrong with plain private fns?

15:06 amalloy: people often argue you should only write tests for public APIs. i'm not really convinced, but it's something to think about

15:07 Vinzent: more consize way for testing is #' trick

15:10 bpr: thanks for the suggestions!

15:14 ibdknox_: Vinzent: what's the #' trick?

15:14 Vinzent: ibdknox_, you can access even private vars with var-quote

15:14 ibdknox_: ah

15:15 interesting

15:46 Scriptor: anybody know how to get the jdk on cygwin?

15:58 hmm, so I figured that out

15:59 but now, it says "no 'server' JVM at (path-to-JRE)\bin\server\jvm.dll

15:59 did I get the wrong java version or something?

15:59 *edition, not version

16:00 DethStryke: I had to point my path to the jdk version in order to get it to work.

16:00 Scriptor: argh

16:01 DethStryke: It might work if you remove the -server argument. I didn't try.

16:02 I'm assuming you are playing with ClojureScript..

16:03 Scriptor: yep

16:05 DethStryke: Also, the current arguments don't work with 32bit java either. I had to use 64bit. Or remove the -Xmx2G -Xms2G

16:15 tarcieri: ohai

16:15 suppose I should start chilling here

16:16 Scriptor: now if only I can find where in the path the java executable's location is stored...

16:17 raek: has anyone of you written something like this? https://gist.github.com/1098101

16:17 i.e. make a proxy like this so that you have have vars for its methods

16:17 so that when you redef the vars, the existing proxy object will change behaviour

16:18 jonasen: About dev.clojure.org, Does the login for confluence work for jira? Or do I (also) have to sign up for jira?

16:21 raek: should be the same, I think

16:21 amalloy: i've heard some people had problems though

16:22 jonasen: ok. I can login to confluence but not jira

16:22 mjg123: ls

16:25 jonasen: when I signed up for dev.clojure.org I clicked "use email as username" (or something like that). Maybe that messed with the jira login?

16:29 mjg123: "Runtime eval is not supported in ClojureScript"

16:30 not supported yet? or ever?

16:30 Scriptor: ever, I think

16:31 Raynes: Scriptor: Evers.

16:31 raek: jonasen: try sending an email to the clojure-dev list. shoudln't take very long to get it fixed.

16:40 jonasen: raek: I'll do that. Thanks.

16:43 Scriptor: ok, so how is java's path stored in windows's PATH (on xp)?

16:43 I tried looking for it, but it doesn't seem to be there

16:44 kumarshantanu: Scriptor: "c:\\temp\\foo.clj;c:\\temp\\bar.clj"

16:44 Scriptor: kumarshantanu: sorry, wasn't clear, I meant the path to JRE itself

16:45 kumarshantanu: C:\Program Files\Java\jdk_1.6.0_26\bin

16:46 or something similar

16:46 Scriptor: kumarshantanu: yes, but where does it store that path?

16:46 it's not in the PATH environment variable

16:47 kumarshantanu: in the PATH variable, or some scripts resolve it from JAVA_HOME

16:47 echo %PATH%

16:47 echo %JAVA_HOME%

16:47 and if nothing works, then there would be a java.exe in C:\Windows or C:\Windows\System32

16:48 because Java JRE installs a copy of java.exe in the Windows dir

16:50 Scriptor: ah, looks like it's under system32, thanks kumarshantanu

16:54 woohoo, graduated to the next error

16:59 mjg123: ClojureScript question: Is there example code for making an ajax call?

17:00 kumarshantanu: mjg123: you can probably use jQuery for that from within Cljs script

17:00 mjg123: ye - is that how the twitterbuzz demo was done?

17:00 would avoid jquery if I can.

17:01 Scriptor: they probably used google closure

17:01 so I'd recommend looking into their ajax lib

17:01 emacsen: so what was the big announcement yesterday?

17:01 dnolen: mjg123: you'll probably want to avoid jQuery as that code can't be optimized by Google Closure

17:02 kumarshantanu: FWIW this is a jQuery example - https://gist.github.com/1096382

17:02 Scriptor: emacsen: clojurescript, clj -> js

17:02 babilen: emacsen: clojurescript

17:02 emacsen: ok, even though rhicky doesn't seem to have many commits to the github

17:05 so why, other than coolness, is clojurescript a big deal?

17:06 dnolen: write Clojure for web, mobile, and shell scripts that don't take 7 seconds to even start up.

17:06 Raynes: One thing I'm excited about is that it gives Clojure a good CLI story.

17:06 tarcieri: emacsen: you can share code between client and server

17:06 jcromartie: how would I wrap up random numbers (for a game) in a functional way?

17:06 or really, wrap up the PRNG

17:06 Raynes: emacsen: https://github.com/clojure/clojurescript/wiki/Rationale

17:06 technomancy: I hope it doesn't mean JVM Clojure's CLI is considered a lost cause though

17:07 emacsen: tarcieri, sure. I guess I'm asking "What is the benefit of this in comparison to, say, straight node.js"

17:07 pjstadig: clojurescript is not a full clojure impl

17:07 dnolen: technomancy: certainly not.

17:07 emacsen: JS semantics are awful.

17:07 Raynes: technomancy: It doesn't. It's still a big focus of cake.

17:07 pjstadig: so i don't see how it's CLI could replace the JVM

17:07 tarcieri: emacsen: node.js kinda sucks? heh

17:07 Scriptor: emacsen: js is somewhat functional, but not wholely

17:07 Raynes: technomancy: We haven't given up on persistent JVMs.

17:07 technomancy: dnolen: well, more of a lost cause than the present

17:07 tarcieri: the JVM rules

17:08 technomancy: headius mentioned that at the JVM language summit oracle hinted at having a hotspot that could launch faster than the client JVM but still JIT better than the current server

17:08 emacsen: tarcieri, does it? I'm writing something in it. It doesn't suck to me.

17:08 tarcieri: orly

17:08 emacsen: node.js gives you callback soup

17:08 pjstadig: technomancy: right like a tierd compiler or something

17:09 dnolen: emacsen: it's little different than people writing Node.js in CoffeeScript. You like the underlying platform but you'd use a nicer language.

17:09 that's Clojure's whole story even on the JVM.

17:11 emacsen: dnolen, I hear ya, except that node.js's raison d'etre is "Look what we can do if we get rid of our love of threads.". I love Clojure, but it seems like a bit of mismatch? Clojure's biggest selling point for non-lispers is the concurency semantics.

17:11 Raynes: pjstadig: Even a subset of Clojure for CLI scripting is nice.

17:11 technomancy: emacsen: I think the only reason node is relevant is that V8 has awful CLI tools

17:12 I don't think anyone's seriously suggesting clojurescript for server-side work other than to avoid JVM flaws like boot time and UTF-16

17:12 emacsen: technomancy, I don't agree. If I weren't writing this current code in node, I'd be using python or ruby or clojure.

17:12 technomancy: emacsen: eh? I'm agreeing with you.

17:12 emacsen: technomancy, then I'm confused :)

17:13 but thanks for agreeing with me ;)

17:13 kylpo: or elnode! elisp nodejs :P

17:14 dnolen: emacsen: Clojure is not just about threads or concurrency.

17:14 emacsen: dnolen, no it's also about CLOS done right :)

17:14 Scriptor: dnolen: it's not, but for non-lispers who don't know about macros that's one of the selling points

17:14 technomancy: emacsen: I think clojurescript is interesting for 0) running in browsers and 1) niches where certain JVM flaws are really annoying. I don't think it makes any sense to run in V8 on the server side except for quick scripting tasks

17:14 emacsen: technomancy, hrm. ok

17:15 dnolen: I agree w/ technomancy

17:15 mjg123: I'd add 2) running on mobile platform

17:16 dnolen: it's funny I was investigating Scheme2JS which looked kinda cool ... but no macros. ClojureScript is a big step up from plain Scheme as well.

17:16 kumarshantanu: mjg123: you mean browser? mobie browser? that is 0

17:16 pjstadig: Raynes: sure, i was just saying it doesn't make sense to talk about replacement, when it's not a full impl

17:16 mjg123: well, yes

17:16 Raynes: Right

17:17 Scriptor: so...what's a likely reason for clojurescript hitting a NoClassDefFound error when looking for clojure/main?

17:17 dnolen: Scriptor: classpath not set

17:17 you need to set CLOJURESCRIPT_HOME and export it

17:17 Scriptor: same on windows?

17:18 dnolen: Scriptor: I would imagine so.

17:18 bpr: is the video of yesterday's talk available? I had to step out right when Rich was beginning to show the demo. I'd kinda like to see it

17:20 chouser: they're working on making the video avaliable

17:21 bpr: chouser: cool

17:21 chouser: I woudl guess it'll be up sometime tomorrow

17:24 mjg123: re: https://gist.github.com/1096382 - only works if cljs compiled with :optimizations :simple

17:25 I get a random js error if I use :advanced

17:25 Why would that be?

17:26 Scriptor: dnolen: set the environment variable, still doesn't work

17:26 I'm trying to run the repl from the clojurescript root directory, by the way

17:27 scottj: does clojurescript compiler call closure from the commandline or via java?

17:27 chouser: via java api

17:28 bendlas: Hey folks, would someone care to look at my (dir) macro and tell me if it's any good? https://github.com/bendlas/clojure.repl

17:29 I'd love to see something like that as the official clojure.repl/dir

17:30 because if i've learned something from python, it is that a good namespace-exploring tool is invaluable

17:30 dnolen: Scriptor: oh huh, repl should just work

17:31 scottj: is there a function that takes clojurescript code and returns js run through closure on maximum as a string?

17:33 s/maximum/advanced

17:33 lazybot: <scottj> is there a function that takes clojurescript code and returns js run through closure on advanced as a string?

17:33 Scriptor: dnolen: could it be a problem with cygwin?

17:37 chouser: Scriptor: you'd have to send the entire program through

17:37 Scriptor: chouser: what do you mean?

17:37 as in, which program?

17:37 scottj: I think maybe he meant to respond to me

17:37 Scriptor: I tried running it through the regular cmd and am still getting the same error

17:38 chouser: oh, yes, sorry. scottj

17:38 dnolen: Scriptor: perhaps, I'm not a Windows person. Might want to take it up on the ML.

17:39 scottj: chouser: if you're willing to give up advanced closure then can you do just part of the program?

17:40 chouser: scottj: simple should work

17:40 I don't know if there's a function that does all cljs and simple gclosure at once, but you could make one.

17:42 mjg123: How can I make a javascript map (ie {"a":"b"}) with ClojureScript?

17:43 chouser: (doto (js-obj) (aset "a" "b")) works -- not sure if it's the best or only way

17:44 mjg123: chouser: thanks :)

17:55 dnolen: hmm, in the ClojureScript REPL can you access the goog stuff?

18:03 Scriptor: in case it matters, I'm on a 32 bit machine, so someone suggested removing two of the flags from inside the repl command

18:18 mjg123: Would someone mind looking at this https://gist.github.com/1098372 please?

18:19 regarding making js maps in ClojureScript

18:45 ClojureScript, jQuery, ajax sitting in a tree... https://gist.github.com/1098417

18:48 ibdknox_: mjg123: seems like there's a big opportunity for someone to come in and clean up the experience of using JQuery

18:48 lol

18:48 mjg123: yeah!

18:48 * ibdknox_ adds it to his list

18:50 ibdknox_: actually we need something that wraps all of the JS standard lib I guess

18:51 mjg123: once you've got all ClojureScripty on top of it, it doesn't seem that useful to actually have jQuery underneath

18:51 ibdknox_: hm?

18:51 how would you expect dom manipulation to work

18:51 mjg123: there are google-closure libraries which would do that

18:51 ibdknox_: this is something I've been trying to think through

18:52 mjg123: unless you're really attached to something jQuey can do

18:52 ibdknox_: so it would compile into dom functions directly?

18:52 not particularly

18:52 mjg123: I suppose it would - I don't know much about the closure-libraries

18:52 ibdknox_: I'll have to look into that

18:52 mjg123: me too...

18:53 but I don't suppose (eg) gmail uses jQuery, does it?

18:55 jakedouglas: its not great for javascript users that know jquery to have to learn to use the closure library. jquery is pretty commonplace, whereas i have never met or heard of anyone who uses closure for real projects

18:58 chouser: jakedouglas: familiarity is not the same as quality

18:59 jakedouglas: chouser: so you're asserting that closure library is of a higher quality than jquery?

19:00 chouser: I'm saying the fact that more people use jquery doesn't mean it's higher quality than gclosure

19:00 jakedouglas: chouser: sure

19:01 Raynes: jakedouglas: They were pretty clear in the video and on the wiki as to why they choose to use Closure. Familiarity wasn't one of the reasons.

19:01 chouser: It may be reasonable to choose the more familiar and assume the quality is sufficient, but it seems unlikely that line of reasoning would end up with anyone being in the IRC channel. :-)

19:02 s/the/this/

19:04 but if jquery can be made compatible with the gclosure compiler, you're free to use that instead

19:04 jakedouglas: right

19:05 pmbauer: read-string, pr-str and friends in the browser is so sweet ... might be getting cavities just thinking about it

19:07 mjg123: pmbauer: as in (read-string somthing-got-by-ajax) ?

19:07 pmbauer: exactly

19:18 aaelony: i think gmail probably uses GWT

19:18 scottj: I think gmail is pre GWT. adsense stuff uses GWT though

19:19 Scriptor: so, note for any windows users trying clojurescript on cygwin, the string that's used for the classpath needs to use ; as the separator

19:19 does google still run the output of GWT through Closure?

19:20 pmbauer: Scriptor: right ... and set CLOSURESCRIPT_HOME using windows-style path (C:\...), but edit the path to use /cygdrive/c/.../bin

19:21 Scriptor: jeez

19:21 maybe I'll write a blag post about it :p

19:22 pmbauer: Maybe we can get MSFT to sponsor the ClosureScript port to windows a la node.js ;)

19:26 Scriptor: hmm, all that'd have to be done to port it is to fix the scripts, right?

19:27 pmbauer: That and there's some path mangling going on in the generated .js files if you don't use an optimization parameter (windows)

19:28 e.g. cljsc src {:optimizations :advanced} > twitterbuzz.js

19:29 ...otherwise all the generated paths passed to goog.addDependency are not resolvable (windows only)

19:30 Scriptor: why does adding an optimization parameter fix that?

19:30 pmbauer: the :advanced option puts everything in one .js file, so no need for the goog.addDependency calls

19:31 Scriptor: oh, makes sense

19:31 mjg123: when I compile the code at https://gist.github.com/1098417 with {:optimization :advanced} it doesn't work

19:31 with {:optimization :simple} it does

19:31 (doesn't work == JavaScript errors in the browser)

19:31 pmbauer: I believe that is because jquery is not compatible with Closure (google) advanced mode

19:32 scottj: has anyone used the closure firefox plugin for debugging? is it helpful with clojurescript?

19:32 mjg123: pmbauer: OK thanks

19:33 Scriptor: I feel like this is one of the big things you'll have to clarify about clojurescript

19:33 that it already comes with a js library, Closure's lib

19:34 * mjg123 agrees

19:48 mjg123: Same jsonp-ajax as before with gclosure instead of jquery - https://gist.github.com/1098521 - much nicer!

19:52 seancorfield: is there anyone involved with ClojureScript based on the West Coast?

19:52 in the preso, it looked like everyone involved was East Coast...?

19:52 pmbauer: devn is Wisconsin ... not west but not east

19:54 seancorfield: was hoping someone was close enough to come talk to the Bay Area Clojure User Group :)

19:54 pmbauer: seancorfield: So are you saying there's an "east coast bias" ;) ?

19:54 seancorfield: someone from core asked if i'd like to "drop by the office" one friday and do some group hacking on clojure.java.jdbc...

19:55 i was flattered but felt the 3,000 flight (each way!) was a bit too much for a day in the office :D

19:55 3,000 mile

19:55 pmbauer: mjg123: win

19:55 seancorfield: still, looking forward to that trip in november for the Conj...

19:56 pmbauer: Were at (first clojure-conj)?

19:56 seancorfield: no :*(

19:57 i had conflicts and couldn't make it (i was already committed to be in ABQ and then LA that week)

19:57 i did get the T shirt tho' :) (thanx to my friend Roger Austin)

19:57 pmbauer: seancorfield: so many crazy smart people in one room ... ridiculous

19:57 seancorfield: yeah, i was dead jealous!

19:58 i got an email asking if world singles wanted to submit talks for the conj but we're doing such ordinary stuff i didn't think it was a good fit...

19:59 persistence, logging, log file analysis... it's just kinda general purpose stuff

20:06 dnolen_: fun graphic, https://github.com/clojure/clojurescript/graphs/traffic

20:07 tarcieri: technomancy: you around?

20:11 jodaro: rad

20:11 :gen-class rescued me today

20:11 uh

20:11 i think

20:13 and i was just minutes away from giving up and writing java

20:14 mjg123: So do the google closure folks have their own IRC channel?

20:16 Scriptor: mjg123: there's a (very) small one at ##closure-tools

20:17 mjg123: Scriptor: ta

20:18 lol - kicked immediately - invite-only channel

20:20 Scriptor: just trying to find the event to listen for that indicates dom-has-loaded...

20:20 Scriptor: mjg123: are you sure? I'm still in it, maybe you have to be identified with nickserv?

20:22 mjg123: try this: http://groups.google.com/group/closure-library-discuss/browse_thread/thread/545fd2e335ba26d1

20:30 jodaro: sounds like some of you are here, so ...

20:30 where does the bay area clojure group meet?

20:47 technomancy: tarcieri: about to head out, but go ahead

20:53 tarcieri: technomancy: have you had any reports of emacs-starter-kit not working on Lion?

20:54 pmbauer: clojurescript really doesn't use any JS, github tells me so :) http://twitpic.com/5tqmdj

21:24 seancorfield: i'm working on code that seems to have a mix of ^String and #^String type hints - what's the difference?

21:27 tomoj: one is newer

21:28 dsantiago: ^String is the preferred way to do it.

21:28 seancorfield: does that work for 1.2 as well as 1.3?

21:29 i'm trying to keep this code 1.2 compatible :(

21:29 dsantiago: Yes

21:29 seancorfield: tx!

21:30 methods: how can an anonymous function call it self ? i believe that's what paul graham was saying in , 'the roots of lisp' when he talked about the y-combinator ?

21:31 dsantiago: Well, an anonymous function can give itself a name to call itself, if you look at the args to fn.

21:39 sritchie: ,({"one" 1 "two" 2} "three" 3)

21:39 clojurebot: 3

21:39 sritchie: cool, just checking

21:59 ahriman53072: just checking what?

22:19 ckirkendall: Quick question would we consider the following a bug. In the clojure documentation is says that if you don't implement a method of an interface when doing a gen-class it should throw an UnsupportedOperationException, however if you extend a abstract class that implements and interface but doesn't implement all the methods you will receive a java.lang.AbstractMethod.Error if you don't implement the method.

22:21 ambrosebs: anyone got vimclojure working for clojure 1.3?

22:22 sjl: If anyone wants to poke around with my pre-pre-pre-alpha Clojure Minecraft bot framework I'd love advice -- I'm pretty new to Clojure so I'm sure there are things I'm doing wrong.

22:22 It's at https://github.com/sjl/clojurecraft

22:44 technomancy: tarcieri: I haven't heard anything yet

22:45 methods: the y combinator is the classic way to get recursion with anonymous functions, but clojure can have anonymous functions that have internal names:

22:45 ,(let [f (fn anonymous [] anonymous)] (= f (f)))

22:45 clojurebot: true

22:46 tarcieri: technomancy: okay, so I have a totally clean computer here, just installed the latest "Emacs for OS X", cloning emacs-starter-kit, let's see if I get the same results

22:47 "Emacs" is an application downloaded from the Internet FEAR!#$!!

22:47 tufflax: methods: here's a goot explaination of the y combinator http://mvanier.livejournal.com/2897.html

22:48 tarcieri: uhh, wtf

22:48 yeah I have no idea what's going on at this point

22:53 so I got everything running earlier today on another computer by copying my coworker's config

22:53 he showed me over Skype what it's supposed to look like

22:54 when you start up for the first time

22:54 except when I tried to start from scratch it gibbed hardcore and continued gibbing

22:54 rimmjob_: i'm trying to set up lein and when i use lein swank i get "that's not a task"

22:54 did i do something wrong?

22:54 tarcieri: now it's like I don't even have a .emacs.d

22:56 technomancy: tarcieri: you could try the v2 branch

22:56 if you have emacs 24

22:56 tarcieri: it's 23.3

22:56 the latest on the "Emacs for OS X" site

22:57 which the readme says should work

22:57 I just can't fucking believe this

22:57 I'm seeing 3 different results in 1 day

22:57 for a clean install

22:57 technomancy: there's always nightlies for 24: http://emacsformacosx.com/builds

22:57 I've been running it since 23 was released

22:57 tarcieri: sure, WHY NOT

22:57 technomancy: yeah, well os x is not really known for supporting repeatable program installation

22:58 tarcieri: so far today my opinion of Emacs has gone from a mild distaste to "oh my god what the fuck is this shit"

22:58 uhh

22:58 dude

22:58 no?

22:58 technomancy: well, what you're describing sounds a lot like the last time I used a mac

22:58 tarcieri: my general experience with OS X is if you stay on the happy path all is well

22:58 technomancy: lasted three days

22:58 tarcieri: I'm trying to stay on the happy path here

22:58 and... uhh

22:59 technomancy: four full wipes of macports in three days and I gave up

22:59 tarcieri: macports sucks

22:59 seancorfield: i hear bad things about macports

22:59 tarcieri: that doesn't even factor into the equation here though

22:59 I just downloaded a .dmg

22:59 cloned a git repository

22:59 saw my coworker do the EXACT SAME THING

22:59 technomancy: what I'm saying is without a proper package manager, it's all guesswork

23:00 tarcieri: so far, works for him!

23:00 what's lacking about a "proper package manager"?

23:00 I insalled a NeXT bundle

23:00 seancorfield: must admit, i did not think much of any of the emacs distros on OS X

23:00 so i went back to Eclipse + CCW

23:01 * scgilardi has a fine time with macports and building emacs from its head via bzr

23:01 tarcieri: at this point I'm kind of like fuck it, I'll try my coworker's config again

23:01 but right now it feels like Emacs isn't even loading my .emacs.d

23:01 seancorfield: emacs was my core editor back in the 17/18/19 days... but it seems really primitive to me these days...

23:02 ckirkendall: @rimmjob_ you need to make sure you include the following in your project file. :dev-dependencies[[swank-clojure "1.2.1"]]

23:03 technomancy: rimmjob_: have you read through the swank-clojure readme?

23:03 tarcieri: usually that's caused by the presence of a ~/.emacs file outside ~/.emacs.d

23:04 ckirkendall: once you have set the :dev-dependencies then you need to make sure you lein deps before you do lein swank

23:04 tarcieri: technomancy: oh ho!

23:04 that may be the problem

23:05 holy fucking shit

23:05 I think it's working

23:05 ambrosebs: I remember that feeling :)

23:06 tarcieri: it's like, downloading and installing stuff

23:06 mattmitchell: anyone here familiar with midje? i can't figure out why this doesn't work: https://gist.github.com/1098809

23:08 just added the result as a comment to that gist...

23:11 qbg: I want to try ClojureScript, but I get java.lang.ClassNotFoundException: sun.org.mozilla.javascript.internal.Context *sigh*

23:11 tarcieri: hooooly crap

23:11 so after closing and reopening Emacs like 5 times

23:11 when various downloads failed

23:11 it now loads without errors

23:11 :D

23:12 that's how I was told it was supposed to work

23:14 technomancy: has anyone tried medusa?

23:15 aw geez. never mind. https://github.com/amitrathore/medusa/blob/master/src/org/rathore/amit/medusa/core.clj

23:17 kephale: oh neat… i've been looking for a way to control the size of the threadpool

23:18 technomancy: well, you can probably do that better without bringing in a library like this

23:21 I mean, it may work OK, but there are warning flags all over this; it looks sloppy.

23:21 kephale: mmm, it looks like most functions in medusa are just exposing Executors

23:22 technomancy: yeah, I wish Clojure exposed more flexibility with the agent pools

23:22 mattmitchell: ok, i was using wrong version of midje. only took an hour to figure that out. ugh.

23:22 kephale: wouldn't one actually want a concurrency library like this to replace existing clojure functions?

23:23 errr override

23:23 technomancy: kephale: yeah, like a flexible-agents/flexible-futures

23:24 * technomancy wanders off to watch kurosawa

23:25 kephale: sounds good

23:25 ckirkendall: technomancy: high on my list would be agents that had a fixed pool that we could set as demons.

23:25 daemons

23:25 ahriman53072: ÷¸

23:34 chouser: The video of Rich's ClojureScript announcement is up: http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498

23:35 Scriptor: by the way, what's the [ANN] tag, project release announcements?

23:43 rimmjob_: ckirkendall: thank you, that worked

23:50 ckirkendall: rimmjob_: your welcome

23:51 * ambrosebs is off by one again

Logging service provided by n01se.net