#clojure logs

2011-07-21

00:13goodieboymatt
00:22technomancyare there any standalone libs that implement namespaces-matching like https://github.com/technomancy/leiningen/blob/master/src/leiningen/util/ns.clj ?
00:24amalloytechnomancy: fwiw, clojure.tools.namespace is the new-contrib version, if pulling in all of contrib is what bothers you
00:24technomancyoh nice; I'll take a look
00:24amalloyor...org.clojure/tools.namespace, i guess
00:24technomancythe old contrib one had some behaviour that made it unsuitable for leiningen, but I don't remember the specifics
00:24technomancyit might work for this
00:25amalloytechnomancy: the new one has a (set! *warn-on-reflection* true) helpfully placed at the top of the namespace for you
00:25amalloy(har har)
00:26technomancy...
00:26technomancyok, so much for that.
00:26amalloyninjudd 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
00:27technomancyI'll stick with my copypasta till (if) it's fixed
00:28amalloyi can't say i disagree
00:35technomancyamalloy: where's the bug report?
00:35technomancylooks like it's not even a project in jira yet, and it's not on the guthubs
00:35technomancyit's no wonder people are reluctant to move off 1.2
00:36amalloytechnomancy: oh, i misspoke. the bug is in java.classpath, on which tools.namespace depends
00:37technomancyaha
00:37amalloyhttps://github.com/clojure/java.classpath/pull/2 the pull request is closed but no release is forthcoming
00:39technomancyhttps://github.com/technomancy/Die-Roboter
00:40ambrosebslol
00:56technomancyif any german speakers notice missing diacriticals or anything, please let me know
01:07amalloyi don't speak any german, but you can't go wrong with umlauts
01:07technomancymoar umlaüts!
02:18dbushenkohi all!
02:19dbushenkois clojurescript video available?
05:00zakwilson,(contains? [-1 0 1] -1)
05:00clojurebotfalse
05:01zakwilson,(contains? [-1 0 1] 1)
05:01clojurebottrue
05:01zakwilsonWhy?
05:01clojurebothttp://clojure.org/rationale
05:01zakwilsonThanks, clojurebot. That doesn't help.
05:02Belafzakwilson: try "(doc contains?)"
05:02clgvzakwilson: because you can only ask whether an index is present
05:03clgvzakwilson: a vector is associative in mapping position index (key) to value at that position (val)
05:03zakwilsonOh. Right. That's why I wrote my own "member?". Is there one?
05:03clgvzakwilson: ##(some #(= -1 %) [-1 0 1])
05:04clgv,(some #(= -1 %) [-1 0 1])
05:04clojurebottrue
05:05clgv,(contains? [10 11 12] 1)
05:05clojurebottrue
05:05clgv,(contains? [10 11 12] 3)
05:05clojurebotfalse
05:07wjlroetechnomancy: 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...
05:08taliosdrowning in maven :( if I can help sing out...
05:08taliosI see Hugo's launched an alternative maven plugin to mine as well
05:09zakwilsonclgv: yeah, member? is basically that, but I wanted it to have its own function.
05:26BelafSono via per un po'... ci sentiamo più tardi?
05:26BelafSorry :(
05:26ahriman53072÷¸
05:27Belafwrong chat.
05:28ejacksonwhat does it all mean...
05:29raekejackson: have you seen https://github.com/clojure/clojurescript/wiki ?
05:29ejacksonbusy reading it
05:30raekbasically, they did CinC and now Clojure runs on the javascript platform!
05:30ahriman53072÷¸
05:30raekusing Node for command line applications is very interesting... no JVM startup delay...
05:36Fossiand now on to a dalvik port :]
05:36taliosyou see Oracles new InvokeDynamic based Javascript language announced today ( well, mentioned at the Language Summit ) - looks interesting
05:37ejacksonsorry raek, lost connectivity there
05:37taliosClojureScript the new JS runtime via JVM over onto Dalvik ;p
05:37taliossadly no ID on Dalvik
05:38Fossihmm, it would make things a whole lot nicer
05:39Fossibut it isn't really needed anyway
05:41ejacksoni'm hampered by being so backendy that I have no idea what all the client stuff is about :)
06:01raek11:29 < raek> basically, they did CinC and now Clojure runs on the javascript platform!
06:01chitsubrHmm, can someone explain what clojurescript is? Is it that we can write clojure code and run it in the browser?
06:01raek11:30 < raek> using Node for command line applications is very interesting... no JVM startup delay...
06:01raekejackson: ^
06:02raekchitsubr: yes, in browsers and with node.js
06:02raekhttps://github.com/clojure/clojurescript/wiki
06:03chitsubrso to use it I would have to first write clojurescript, then compile it to js, and call the js from a web-page?
06:03chitsubrso it's like coffeescript in that way
06:08raekyes, but with additional benefits. it uses the Google Closure minification compiler which removes the parts of the libraries that you don't use
06:17dbushenkoraek: is the video about ClojureScript available already?
06:20taliosdbushenko: you could try the ustream page - ustream often has their copy available.. so maybe there
06:21romanroein 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.
06:21romanroeerr, I meant the first symbol in a list
06:23raekdbushenko: I don't think so. I expect it to show up at http://blip.tv/clojure eventually.
06:29kjeldahlwSo 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...
06:32romanroekjeldahlw, as far as I understood it, ClojureScript is written in Clojure, not JavaScript. Hence you won't see a browser based compiler, eval, etc.
06:33kjeldahlwromanroe: Written in clojure, compile to javascript... ;-) Well, one could hope! :-)
06:34raekkjeldahlw: if you port the ClojureScript compiler to the ClojureScript subset of Clojure, you should theoretically be able to compiler the compiler to javascript :-)
06:34kjeldahlwKind 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.
06:35raek*compile the compiler
06:35kjeldahlwraek: Yes, my thought exactly.
06:35kjeldahlwA good benchmark on how "complete" the clojure to javascript compiler is anway, "self hosting" or whatever it is called.
06:35raekas rhickey said, this was not a design goal, but he is certain that someone will do it eventually
06:36kjeldahlwHaven't seen it yet, still waiting!
06:38kjeldahlwBut I did get the Closure book already...
06:45tsdhHi. Can someone give me a hint why my fold-constants-with-choose is 450 times slower than my fold-constants? http://pastebin.com/5uYkBzL4
06:46tsdhI somehow expected a worst-case slowdown of factor 3...
06:53clgvI 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?
06:54opqdonutno, not really
06:54opqdonutdo you want the missing values to be nil or what?
06:54clgvyes.
06:54opqdonutI've sometimes implemented a map+ that is like map but goes on until all sequences are exhausted
06:54clgvok. I might implement it myself via loop then ;)
06:55opqdonutmhmm
07:07clgvdone: (defn pair-seq [c1 c2] (when (or (seq c1) (seq c2)) (lazy-seq (cons [(first c1) (first c2)] (pair-seq (rest c1) (rest c2))))))
07:07clgvno generalization on multiple arguments right now...
08:05raekaw! 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)
08:34raekwhen was defprotocol docstring support added to Marginalia?
08:34raekdoesn't seem to be recognized with [lein-marginalia "0.6.0"]
09:03buddywilliamsAnyone know of a great article on clojure recursion? One which address the different types of recursion.
09:04buddywilliams,(println "good morning world!")
09:04clojurebotgood morning world!
09:07manutter1Missed the live stream last night, is the video ready yet?
09:07clgvbuddywilliams: what exactly are your questions? maybe we can answer them here
09:13gfrlogin 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.
09:17raekgfrlog: and this is not a java liv that you can find on jarvana.com?
09:17raek(just checking that first)
09:18joegallohttp://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
09:18joegalloJust use maven to install the jar locally.
09:19raekgfrlog: 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
09:19raekthere is a thread about this in the clojure and leiningen mail list
09:25kumarshantanugfrlog: raek: is it something you can use lein-localrepo plugin for?
09:31gfrlogI'll look at all those options, thanks guys
09:38ischyrusIs there a clojure function to generate a unique id?
09:39kumarshantanuischyrus: gensym
09:39kumarshantanu,(gensym)
09:39clojurebotG__199
09:41ischyrusthanks
09:48clgvischyrus: kumarshantanu's suggestion generates a unique symbol for use in macros. do you want unique ids for your business objects?
09:49ischyrusyeah, I ended up with '(.toString (java.util.UUID/randomUUID)))'
09:50clgvif that works for you it's fine. but that might not work as intended with persistence in several programm runs.
09:51ischyruswhat would you suggest?
09:52clgvischyrus: 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
09:55ischyrusI'm essentially creating a key that can be given to someone that can be used for a basic authentication. Basically an api key
09:56fliebelIs the presentation about clojurescript up on the web somewhere?
09:56stuartsierraVideo will go up at some point, but not yet.
09:56fliebelokay
09:57abedrastuartsierra, what do we need to do in order to get it downloadable?
09:57stuartsierrano idea
09:57abedrastuartsierra, is it just too big right now?
09:57clgvischyrus: well then I would use java.util.UUID/randomUUID and store the results in a file/database for lookups regarding "true persistent uniqueness".
09:57stuartsierraabedra: ask Alan
09:57fliebelI though that streaming thing automatically recorded the stream.
09:57abedrastuartsierra, if so, I can grab it and run ffmpeg on it today
09:57clojurebotstuartsierra is volunteering
09:57abedrastuartsierra, ok will do
09:57stuartsierradammit, Clojurebot
10:13jodarohiya
10:20maravillasis a pull request or a google groups post preferred for a clojurescript patch?
10:22stuartsierraneither yet. We will have JIRA set up soon.
10:24ejacksonah, so the idea of ClojureScript is to allow Clojure to be deployed where the JVM cannot. I get it, I think.
10:25Scriptoralso solves the slow startup time problem, so it should be great for small scripts
10:27ejacksonwith which engine ? (I'm not being sarcy, I genuinely don't know)
10:28Scriptorejackson: v8 via node I guess?
10:28ejacksonOK, interesting, thanks.
10:28Scriptorwell, that's one of the intended uses, I think it might come with rhino as well
10:29ejacksonand the mobile angle is that all phones have JS enabled browsers, or they can run JS natively ?
10:30Scriptorpretty much
10:30ejacksonoh, I meant it as a question of which clause was true ?
10:31Scriptorwell, 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:32Scriptorand I think the major phone os's support js
10:32clgvhmm will all clojure code be compilable to javascript via clojurescript? or will it be like .Net vs silverlight?
10:33Scriptornot familiar with how it was with silverlight, but not all clojure code
10:33Scriptorin 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:37kumarshantanuScriptor: Has anybody given a thought to debugging w.r.t. ClojureScript? Is it possible to generate debugger steps in the emitted code?
10:38Scriptorkumarshantanu: I don't really know, I've of firebug integration with clojurescript though
10:41jodarohi, 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:42raekjodaro: yes, that is a limitation of proxy. you can't access protected fields.
10:43raekjodaro: a simple work around is to write a small class in Java that exposes an accessor and then subclass that one instead
10:43jodaroyeah
10:43jodarothat was my next plan
10:43jodarothanks
10:44raekin 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:45jodaronice
10:45jodaroi'm a scala refugee to some extent. lein reminds me a lot of sbt
10:45jodarowhich is a good thing
10:48chouseror do something similar with gen-class
10:53jodaroyeah i was looking at gen-class as well
11:00jodaroits not clear why the implementer didn't add an accessor for the data member
11:00jodarosince there is a setter, and all of the other fields have them
11:23clgvis it true that I can speed up execution if I use the method of the interface generated by defprotocol directly?
11:32dnolenkumarshantanu: 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:39kumarshantanudnolen: any URL/googleable_keyword for the ongoing effort on Webkit and Firefox?
11:42kumarshantanufound http://code.google.com/closure/compiler/docs/inspector.html
11:43dnolenhttps://bugs.webkit.org/show_bug.cgi?id=63940
11:43dnolenhttps://docs.google.com/document/d/14AWiLDDxEuLaWuyG0X6deLRufrvxRu8HBP0LNJwvRZw/edit?hl=en_US&amp;pli=1
11:46kumarshantanudnolen: Thanks!
11:55the-kennyhttp://tarn-vedra.de/test.html <-- clojurescript is awesome :)
11:56clgvthe-kenny: you should show the clojurescript source as well^^
11:57ambrosebs:D
11:58the-kennyclgv: You can find the source in test.js :)
11:58the-kenny:p
11:58the-kennyclgv: https://gist.github.com/1097505
11:58clgvyeah, well - considering this it is pretty ugly then :P
11:59clgvthx
12:00the-kennyIt's pretty simple, but there are a few gotchas (like the syntax for (.method object args...)
12:00the-kennySorry for bothering you guys, I just got around playing with Clojurescript
12:00clgvdnolen: did you tell me that 2d double arrays were much slower than 1d double arrays?
12:02dnolenclgv: yes
12:02clgvdnolen: this seems to be not true at all, considering random read and write access on them.
12:03clgvdnolen: I just measured both implementations.
12:03dnolenclgv: interesting got a gist? could be wrong o course.
12:04clgvdnolen: I can make a gist in a few mins. Maybe I have overhead when calculating the index due to possibly not using primitives?
12:05dnolenclgv: that's probably it.
12:06clgvdnolen: does it matter if I use boxed Integer or int?
12:16clgvdnolen: with assuring all being Integer it still is slower.
12:17clgvI also have typehints in place
12:20abhinavmehtahi clojure tribe, suggestion for first-book to read about clojure.
12:20abhinavmehtaany.?
12:20pdkprogramming clojure then joy of clojure probably
12:20pdkpractical clojure is kind of just a ready reference for core functions and needs editing work
12:21abhinavmehtapdk: ahaa..looking at it(joy of clojure), seems good.
12:21abhinavmehtapdk: thank-you. :)
12:22pdkjoy of clojure does assume some java/lisp understanding a bit of familiarity with clojure
12:22pdkthough the stuff it does cover is missed by the others
12:24frouwatching some of Rich's nice video talks might be the best step zero?
12:24abhinavmehtapdk: not a problem with Java/Lisp and second statement sounds more interesting...thats a good one
12:25ohpauleezfwiw, I swear by Joy of Clojure and have read it a good number of times
12:25ohpauleezI think four or five total now
12:27abhinavmehtaohpauleez: clojure peeps seems badly loving it..huhh. :)
12:28abhinavmehtafrou: Is there some Rich's video tutorial targeting beginners ? Any url's ?
12:36frouabhinavmehta: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
12:36abhinavmehtafrou: thank-you. :-)
12:37frouabhinavmehta: welcome, and http://blip.tv/clojure/clojure-for-java-programmers-1-of-2-989128
12:38abhinavmehtafrou: thanks once-again.
12:49ohpauleezyeah
12:49clgvdevn: why?
12:49ohpauleezI still tell people to go and watch it
12:49technomancydevn: is that still only available on flash?
12:50ohpauleezclgv: 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:51ohpauleezand it fully motivates the Clojure story
12:51clgvI wanted to know why 6 times ;)
12:51ohpauleezohh
12:51ohpauleez:)
12:55ieurehttp://i.imgur.com/58mjC.jpg
12:56clgvhow do I create an unboxed integer?
12:58froutechnomancy: at least in Safari, you can download the video file by looking in the "Activity" window while you're streaming it
12:59technomancyfrou: that still requires flash
13:02dnolenclgv: boxed number will always be slower. what version of Clojure are you using?
13:02clgvdnolen: 1.2.1
13:02dnolenclgv: you can cast to a primitive in 1.2.1 (int n)
13:02clgvdnolen: I guess I have to convert my map to a defrecord then.
13:03dnolenclgv: but you also need to type your arrays as arrays of primitives, ^ints
13:04clgvdnolen: in the current version the 1d approach is about 40% slower
13:06clgvdnolen: I'll do the defrecord conversion tomorrow and see if I can get a speedup
13:07mattmitchellhmm, 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:07mattmitchellsorry, i meant TWO namespaces
13:08clgvmattmitchell: refactor to avoid the cyclic dependency relation
13:08mattmitchellclgv: i was afraid to hear something like that :) any suggestions?
13:09clgvmattmitchell: 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:09mattmitchellclgv: yeah makes sense. ok i'll give it a shot. thanks!
13:14Vinzentenlive question: how can I select the node that is in 3 elems after some element?
13:14Vinzente.g. <div ...> <img ...> <p ...> <a ...>, I need to extract a
13:16Vinzentshould I use {} syntax to select fragment between div and a?
13:27Vinzentanother one: how to select node from the fragment returned by {}?
14:11ambrosebshow can I find the index number of the first value in a vector to pass a predicate?
14:12ambrosebs[true true false], looking for false, returns 2
14:12kumarshantanuambrosebs: (map f foo-vector (iterate inc 0))
14:14ambrosebsnot quite what i'm after, I'll be clearer
14:14ambrosebs(mystery false? [true true false]) => 2
14:14ambrosebswhat is mystery? :)
14:15technomancy,(filter (comp not second) (map-indexed vector [true true false]))
14:15clojurebot([2 false])
14:16ambrosebstechnomancy: perfect thanks!
14:16technomancynot quite perfect, but sure
14:16ambrosebs:)
14:17amalloyusually if i care about indexes in a vector it's because i'm in the middle of doing something the wrong way :P
14:18ambrosebsI'm implementing an algorithm from a paper :)
14:18ambrosebsso it must be right ;)
14:29amalloytechnomancy: 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:30technomancyamalloy: really?
14:30technomancythe only reason the .core convention was introduced was to avoid single-segment namespaces
14:31amalloymaybe it's a sick fetish i've developed as a result of that convention
14:32technomancylein 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:32technomancybecause that's the first thing I fix when I start a new project
14:32kumarshantanu+1
14:33amalloyi guess i'm probably also lying about my preference
14:33amalloysince amalloy-utils has amalloy.utils and amalloy.utils.foo
14:35kumarshantanutechnomancy: any tentative schedule for lein 2.0? Is 1.6 the last in 1.x series?
14:36technomancykumarshantanu: right, 1.6 will probably see a couple bugfix releases
14:36technomancyI don't know how long 2.0 will take. the big juicy bits are the aether switch and rewriting eval-in-project.
14:36amalloythe aether switch? that sounds fantastic, whatever it is
14:36kumarshantanuI guess Cljs support will coincide with 2.0
14:37kumarshantanugiven that it is still alpha
14:37technomancyamalloy: I could explain, but I think whatever your imagination is coming up with is probably better.
14:37technomancykumarshantanu: I haven't looked at it enough to say for sure, but that would probably work fine as a plugin for 1.x
14:37kumarshantanuamalloy: aether is the Maven deps resolution functionality factored out of Maven (roughly speaking)
14:40rhebus(constantly 2)
14:43Vinzenthttp://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:46bendlasHi, I've written an improved version of clojure.repl/dir https://github.com/bendlas/clojure.repl
14:46bendlasI'd appreciate feedback
14:55bpris there a "correct" way to write tests for private functions?
14:56danbellAnyone know the difference between replicate and repeat?
14:56amalloybpr: my preference is to stop writing private functions
14:56amalloydanbell: one of them's older. i always use repeat
14:56amalloy&(doc replicate)
14:56lazybot⇒ "([n x]); Returns a lazy seq of n xs."
14:56amalloy&(doc repeat)
14:56lazybot⇒ "([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."
14:57danbellseems like replicate is redundant and not as powerful
14:57amalloy~source replicate
14:57amalloy~source repeat
14:57amalloyyeah, replicate is 100% redundant
14:58danbellwell i'll be
15:00amalloybpr: 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:01kumarshantanubpr: private functions have been termed "bossiness" in the past - you should consider creating a namespace called "internal" and put private stuff there
15:02kumarshantanuas in foo.bar and foo.bar.internal
15:05bprI 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:06Vinzentwhat's wrong with plain private fns?
15:06amalloypeople often argue you should only write tests for public APIs. i'm not really convinced, but it's something to think about
15:07Vinzentmore consize way for testing is #' trick
15:10bprthanks for the suggestions!
15:14ibdknox_Vinzent: what's the #' trick?
15:14Vinzentibdknox_, you can access even private vars with var-quote
15:14ibdknox_ah
15:15ibdknox_interesting
15:46Scriptoranybody know how to get the jdk on cygwin?
15:58Scriptorhmm, so I figured that out
15:59Scriptorbut now, it says "no 'server' JVM at (path-to-JRE)\bin\server\jvm.dll
15:59Scriptordid I get the wrong java version or something?
15:59Scriptor*edition, not version
16:00DethStrykeI had to point my path to the jdk version in order to get it to work.
16:00Scriptorargh
16:01DethStrykeIt might work if you remove the -server argument. I didn't try.
16:02DethStrykeI'm assuming you are playing with ClojureScript..
16:03Scriptoryep
16:05DethStrykeAlso, the current arguments don't work with 32bit java either. I had to use 64bit. Or remove the -Xmx2G -Xms2G
16:15tarcieriohai
16:15tarcierisuppose I should start chilling here
16:16Scriptornow if only I can find where in the path the java executable's location is stored...
16:17raekhas anyone of you written something like this? https://gist.github.com/1098101
16:17raeki.e. make a proxy like this so that you have have vars for its methods
16:17raekso that when you redef the vars, the existing proxy object will change behaviour
16:18jonasenAbout dev.clojure.org, Does the login for confluence work for jira? Or do I (also) have to sign up for jira?
16:21raekshould be the same, I think
16:21amalloyi've heard some people had problems though
16:22jonasenok. I can login to confluence but not jira
16:22mjg123ls
16:25jonasenwhen 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:29mjg123"Runtime eval is not supported in ClojureScript"
16:30mjg123not supported yet? or ever?
16:30Scriptorever, I think
16:31RaynesScriptor: Evers.
16:31raekjonasen: try sending an email to the clojure-dev list. shoudln't take very long to get it fixed.
16:40jonasenraek: I'll do that. Thanks.
16:43Scriptorok, so how is java's path stored in windows's PATH (on xp)?
16:43ScriptorI tried looking for it, but it doesn't seem to be there
16:44kumarshantanuScriptor: "c:\\temp\\foo.clj;c:\\temp\\bar.clj"
16:44Scriptorkumarshantanu: sorry, wasn't clear, I meant the path to JRE itself
16:45kumarshantanuC:\Program Files\Java\jdk_1.6.0_26\bin
16:46kumarshantanuor something similar
16:46Scriptorkumarshantanu: yes, but where does it store that path?
16:46Scriptorit's not in the PATH environment variable
16:47kumarshantanuin the PATH variable, or some scripts resolve it from JAVA_HOME
16:47kumarshantanuecho %PATH%
16:47kumarshantanuecho %JAVA_HOME%
16:47kumarshantanuand if nothing works, then there would be a java.exe in C:\Windows or C:\Windows\System32
16:48kumarshantanubecause Java JRE installs a copy of java.exe in the Windows dir
16:50Scriptorah, looks like it's under system32, thanks kumarshantanu
16:54Scriptorwoohoo, graduated to the next error
16:59mjg123ClojureScript question: Is there example code for making an ajax call?
17:00kumarshantanumjg123: you can probably use jQuery for that from within Cljs script
17:00mjg123ye - is that how the twitterbuzz demo was done?
17:00mjg123would avoid jquery if I can.
17:01Scriptorthey probably used google closure
17:01Scriptorso I'd recommend looking into their ajax lib
17:01emacsenso what was the big announcement yesterday?
17:01dnolenmjg123: you'll probably want to avoid jQuery as that code can't be optimized by Google Closure
17:02kumarshantanuFWIW this is a jQuery example - https://gist.github.com/1096382
17:02Scriptoremacsen: clojurescript, clj -> js
17:02babilenemacsen: clojurescript
17:02emacsenok, even though rhicky doesn't seem to have many commits to the github
17:05emacsenso why, other than coolness, is clojurescript a big deal?
17:06dnolenwrite Clojure for web, mobile, and shell scripts that don't take 7 seconds to even start up.
17:06RaynesOne thing I'm excited about is that it gives Clojure a good CLI story.
17:06tarcieriemacsen: you can share code between client and server
17:06jcromartiehow would I wrap up random numbers (for a game) in a functional way?
17:06jcromartieor really, wrap up the PRNG
17:06Raynesemacsen: https://github.com/clojure/clojurescript/wiki/Rationale
17:06technomancyI hope it doesn't mean JVM Clojure's CLI is considered a lost cause though
17:07emacsentarcieri, sure. I guess I'm asking "What is the benefit of this in comparison to, say, straight node.js"
17:07pjstadigclojurescript is not a full clojure impl
17:07dnolentechnomancy: certainly not.
17:07dnolenemacsen: JS semantics are awful.
17:07Raynestechnomancy: It doesn't. It's still a big focus of cake.
17:07pjstadigso i don't see how it's CLI could replace the JVM
17:07tarcieriemacsen: node.js kinda sucks? heh
17:07Scriptoremacsen: js is somewhat functional, but not wholely
17:07Raynestechnomancy: We haven't given up on persistent JVMs.
17:07technomancydnolen: well, more of a lost cause than the present
17:07tarcierithe JVM rules
17:08technomancyheadius 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:08emacsentarcieri, does it? I'm writing something in it. It doesn't suck to me.
17:08tarcieriorly
17:08tarcieriemacsen: node.js gives you callback soup
17:08pjstadigtechnomancy: right like a tierd compiler or something
17:09dnolenemacsen: it's little different than people writing Node.js in CoffeeScript. You like the underlying platform but you'd use a nicer language.
17:09dnolenthat's Clojure's whole story even on the JVM.
17:11emacsendnolen, 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:11Raynespjstadig: Even a subset of Clojure for CLI scripting is nice.
17:11technomancyemacsen: I think the only reason node is relevant is that V8 has awful CLI tools
17:12technomancyI 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:12emacsentechnomancy, I don't agree. If I weren't writing this current code in node, I'd be using python or ruby or clojure.
17:12technomancyemacsen: eh? I'm agreeing with you.
17:12emacsentechnomancy, then I'm confused :)
17:13emacsenbut thanks for agreeing with me ;)
17:13kylpoor elnode! elisp nodejs :P
17:14dnolenemacsen: Clojure is not just about threads or concurrency.
17:14emacsendnolen, no it's also about CLOS done right :)
17:14Scriptordnolen: it's not, but for non-lispers who don't know about macros that's one of the selling points
17:14technomancyemacsen: 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:14emacsentechnomancy, hrm. ok
17:15dnolenI agree w/ technomancy
17:15mjg123I'd add 2) running on mobile platform
17:16dnolenit'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:16kumarshantanumjg123: you mean browser? mobie browser? that is 0
17:16pjstadigRaynes: sure, i was just saying it doesn't make sense to talk about replacement, when it's not a full impl
17:16mjg123well, yes
17:16RaynesRight
17:17Scriptorso...what's a likely reason for clojurescript hitting a NoClassDefFound error when looking for clojure/main?
17:17dnolenScriptor: classpath not set
17:17dnolenyou need to set CLOJURESCRIPT_HOME and export it
17:17Scriptorsame on windows?
17:18dnolenScriptor: I would imagine so.
17:18bpris 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:20chouserthey're working on making the video avaliable
17:21bprchouser: cool
17:21chouserI woudl guess it'll be up sometime tomorrow
17:24mjg123re: https://gist.github.com/1096382 - only works if cljs compiled with :optimizations :simple
17:25mjg123I get a random js error if I use :advanced
17:25mjg123Why would that be?
17:26Scriptordnolen: set the environment variable, still doesn't work
17:26ScriptorI'm trying to run the repl from the clojurescript root directory, by the way
17:27scottjdoes clojurescript compiler call closure from the commandline or via java?
17:27chouservia java api
17:28bendlasHey 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:29bendlasI'd love to see something like that as the official clojure.repl/dir
17:30bendlasbecause if i've learned something from python, it is that a good namespace-exploring tool is invaluable
17:30dnolenScriptor: oh huh, repl should just work
17:31scottjis there a function that takes clojurescript code and returns js run through closure on maximum as a string?
17:33scottjs/maximum/advanced
17:33lazybot<scottj> is there a function that takes clojurescript code and returns js run through closure on advanced as a string?
17:33Scriptordnolen: could it be a problem with cygwin?
17:37chouserScriptor: you'd have to send the entire program through
17:37Scriptorchouser: what do you mean?
17:37Scriptoras in, which program?
17:37scottjI think maybe he meant to respond to me
17:37ScriptorI tried running it through the regular cmd and am still getting the same error
17:38chouseroh, yes, sorry. scottj
17:38dnolenScriptor: perhaps, I'm not a Windows person. Might want to take it up on the ML.
17:39scottjchouser: if you're willing to give up advanced closure then can you do just part of the program?
17:40chouserscottj: simple should work
17:40chouserI don't know if there's a function that does all cljs and simple gclosure at once, but you could make one.
17:42mjg123How can I make a javascript map (ie {"a":"b"}) with ClojureScript?
17:43chouser(doto (js-obj) (aset "a" "b")) works -- not sure if it's the best or only way
17:44mjg123chouser: thanks :)
17:55dnolenhmm, in the ClojureScript REPL can you access the goog stuff?
18:03Scriptorin case it matters, I'm on a 32 bit machine, so someone suggested removing two of the flags from inside the repl command
18:18mjg123Would someone mind looking at this https://gist.github.com/1098372 please?
18:19mjg123regarding making js maps in ClojureScript
18:45mjg123ClojureScript, jQuery, ajax sitting in a tree... https://gist.github.com/1098417
18:48ibdknox_mjg123: seems like there's a big opportunity for someone to come in and clean up the experience of using JQuery
18:48ibdknox_lol
18:48mjg123yeah!
18:50ibdknox_actually we need something that wraps all of the JS standard lib I guess
18:51mjg123once you've got all ClojureScripty on top of it, it doesn't seem that useful to actually have jQuery underneath
18:51ibdknox_hm?
18:51ibdknox_how would you expect dom manipulation to work
18:51mjg123there are google-closure libraries which would do that
18:51ibdknox_this is something I've been trying to think through
18:52mjg123unless you're really attached to something jQuey can do
18:52ibdknox_so it would compile into dom functions directly?
18:52ibdknox_not particularly
18:52mjg123I suppose it would - I don't know much about the closure-libraries
18:52ibdknox_I'll have to look into that
18:52mjg123me too...
18:53mjg123but I don't suppose (eg) gmail uses jQuery, does it?
18:55jakedouglasits 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:58chouserjakedouglas: familiarity is not the same as quality
18:59jakedouglaschouser: so you're asserting that closure library is of a higher quality than jquery?
19:00chouserI'm saying the fact that more people use jquery doesn't mean it's higher quality than gclosure
19:00jakedouglaschouser: sure
19:01Raynesjakedouglas: 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:01chouserIt 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:02chouser s/the/this/
19:04chouserbut if jquery can be made compatible with the gclosure compiler, you're free to use that instead
19:04jakedouglasright
19:05pmbauerread-string, pr-str and friends in the browser is so sweet ... might be getting cavities just thinking about it
19:07mjg123pmbauer: as in (read-string somthing-got-by-ajax) ?
19:07pmbauerexactly
19:18aaelonyi think gmail probably uses GWT
19:18scottjI think gmail is pre GWT. adsense stuff uses GWT though
19:19Scriptorso, note for any windows users trying clojurescript on cygwin, the string that's used for the classpath needs to use ; as the separator
19:19Scriptordoes google still run the output of GWT through Closure?
19:20pmbauerScriptor: right ... and set CLOSURESCRIPT_HOME using windows-style path (C:\...), but edit the path to use /cygdrive/c/.../bin
19:21Scriptorjeez
19:21Scriptormaybe I'll write a blag post about it :p
19:22pmbauerMaybe we can get MSFT to sponsor the ClosureScript port to windows a la node.js ;)
19:26Scriptorhmm, all that'd have to be done to port it is to fix the scripts, right?
19:27pmbauerThat and there's some path mangling going on in the generated .js files if you don't use an optimization parameter (windows)
19:28pmbauere.g. cljsc src {:optimizations :advanced} > twitterbuzz.js
19:29pmbauer...otherwise all the generated paths passed to goog.addDependency are not resolvable (windows only)
19:30Scriptorwhy does adding an optimization parameter fix that?
19:30pmbauerthe :advanced option puts everything in one .js file, so no need for the goog.addDependency calls
19:31Scriptoroh, makes sense
19:31mjg123when I compile the code at https://gist.github.com/1098417 with {:optimization :advanced} it doesn't work
19:31mjg123with {:optimization :simple} it does
19:31mjg123(doesn't work == JavaScript errors in the browser)
19:31pmbauerI believe that is because jquery is not compatible with Closure (google) advanced mode
19:32scottjhas anyone used the closure firefox plugin for debugging? is it helpful with clojurescript?
19:32mjg123pmbauer: OK thanks
19:33ScriptorI feel like this is one of the big things you'll have to clarify about clojurescript
19:33Scriptorthat it already comes with a js library, Closure's lib
19:48mjg123Same jsonp-ajax as before with gclosure instead of jquery - https://gist.github.com/1098521 - much nicer!
19:52seancorfieldis there anyone involved with ClojureScript based on the West Coast?
19:52seancorfieldin the preso, it looked like everyone involved was East Coast...?
19:52pmbauerdevn is Wisconsin ... not west but not east
19:54seancorfieldwas hoping someone was close enough to come talk to the Bay Area Clojure User Group :)
19:54pmbauerseancorfield: So are you saying there's an "east coast bias" ;) ?
19:54seancorfieldsomeone from core asked if i'd like to "drop by the office" one friday and do some group hacking on clojure.java.jdbc...
19:55seancorfieldi was flattered but felt the 3,000 flight (each way!) was a bit too much for a day in the office :D
19:55seancorfield3,000 mile
19:55pmbauermjg123: win
19:55seancorfieldstill, looking forward to that trip in november for the Conj...
19:56pmbauerWere at (first clojure-conj)?
19:56seancorfieldno :*(
19:57seancorfieldi had conflicts and couldn't make it (i was already committed to be in ABQ and then LA that week)
19:57seancorfieldi did get the T shirt tho' :) (thanx to my friend Roger Austin)
19:57pmbauerseancorfield: so many crazy smart people in one room ... ridiculous
19:57seancorfieldyeah, i was dead jealous!
19:58seancorfieldi 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:59seancorfieldpersistence, logging, log file analysis... it's just kinda general purpose stuff
20:06dnolen_fun graphic, https://github.com/clojure/clojurescript/graphs/traffic
20:07tarcieritechnomancy: you around?
20:11jodarorad
20:11jodaro:gen-class rescued me today
20:11jodarouh
20:11jodaroi think
20:13jodaroand i was just minutes away from giving up and writing java
20:14mjg123So do the google closure folks have their own IRC channel?
20:16Scriptormjg123: there's a (very) small one at ##closure-tools
20:17mjg123Scriptor: ta
20:18mjg123lol - kicked immediately - invite-only channel
20:20mjg123Scriptor: just trying to find the event to listen for that indicates dom-has-loaded...
20:20Scriptormjg123: are you sure? I'm still in it, maybe you have to be identified with nickserv?
20:22Scriptormjg123: try this: http://groups.google.com/group/closure-library-discuss/browse_thread/thread/545fd2e335ba26d1
20:30jodarosounds like some of you are here, so ...
20:30jodarowhere does the bay area clojure group meet?
20:47technomancytarcieri: about to head out, but go ahead
20:53tarcieritechnomancy: have you had any reports of emacs-starter-kit not working on Lion?
20:54pmbauerclojurescript really doesn't use any JS, github tells me so :) http://twitpic.com/5tqmdj
21:24seancorfieldi'm working on code that seems to have a mix of ^String and #^String type hints - what's the difference?
21:27tomojone is newer
21:28dsantiago^String is the preferred way to do it.
21:28seancorfielddoes that work for 1.2 as well as 1.3?
21:29seancorfieldi'm trying to keep this code 1.2 compatible :(
21:29dsantiagoYes
21:29seancorfieldtx!
21:30methodshow 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:31dsantiagoWell, an anonymous function can give itself a name to call itself, if you look at the args to fn.
21:39sritchie,({"one" 1 "two" 2} "three" 3)
21:39clojurebot3
21:39sritchiecool, just checking
21:59ahriman53072just checking what?
22:19ckirkendallQuick 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:21ambrosebsanyone got vimclojure working for clojure 1.3?
22:22sjlIf 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:22sjlIt's at https://github.com/sjl/clojurecraft
22:44technomancytarcieri: I haven't heard anything yet
22:45technomancymethods: the y combinator is the classic way to get recursion with anonymous functions, but clojure can have anonymous functions that have internal names:
22:45technomancy,(let [f (fn anonymous [] anonymous)] (= f (f)))
22:45clojurebottrue
22:46tarcieritechnomancy: 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:47tarcieri"Emacs" is an application downloaded from the Internet FEAR!#$!!
22:47tufflaxmethods: here's a goot explaination of the y combinator http://mvanier.livejournal.com/2897.html
22:48tarcieriuhh, wtf
22:48tarcieriyeah I have no idea what's going on at this point
22:53tarcieriso I got everything running earlier today on another computer by copying my coworker's config
22:53tarcierihe showed me over Skype what it's supposed to look like
22:54tarcieriwhen you start up for the first time
22:54tarcieriexcept when I tried to start from scratch it gibbed hardcore and continued gibbing
22:54rimmjob_i'm trying to set up lein and when i use lein swank i get "that's not a task"
22:54rimmjob_did i do something wrong?
22:54tarcierinow it's like I don't even have a .emacs.d
22:56technomancytarcieri: you could try the v2 branch
22:56technomancyif you have emacs 24
22:56tarcieriit's 23.3
22:56tarcierithe latest on the "Emacs for OS X" site
22:57tarcieriwhich the readme says should work
22:57tarcieriI just can't fucking believe this
22:57tarcieriI'm seeing 3 different results in 1 day
22:57tarcierifor a clean install
22:57technomancythere's always nightlies for 24: http://emacsformacosx.com/builds
22:57technomancyI've been running it since 23 was released
22:57tarcierisure, WHY NOT
22:57technomancyyeah, well os x is not really known for supporting repeatable program installation
22:58tarcieriso far today my opinion of Emacs has gone from a mild distaste to "oh my god what the fuck is this shit"
22:58tarcieriuhh
22:58tarcieridude
22:58tarcierino?
22:58technomancywell, what you're describing sounds a lot like the last time I used a mac
22:58tarcierimy general experience with OS X is if you stay on the happy path all is well
22:58technomancylasted three days
22:58tarcieriI'm trying to stay on the happy path here
22:58tarcieriand... uhh
22:59technomancyfour full wipes of macports in three days and I gave up
22:59tarcierimacports sucks
22:59seancorfieldi hear bad things about macports
22:59tarcierithat doesn't even factor into the equation here though
22:59tarcieriI just downloaded a .dmg
22:59tarciericloned a git repository
22:59tarcierisaw my coworker do the EXACT SAME THING
22:59technomancywhat I'm saying is without a proper package manager, it's all guesswork
23:00tarcieriso far, works for him!
23:00tarcieriwhat's lacking about a "proper package manager"?
23:00tarcieriI insalled a NeXT bundle
23:00seancorfieldmust admit, i did not think much of any of the emacs distros on OS X
23:00seancorfieldso i went back to Eclipse + CCW
23:01tarcieriat this point I'm kind of like fuck it, I'll try my coworker's config again
23:01tarcieribut right now it feels like Emacs isn't even loading my .emacs.d
23:01seancorfieldemacs was my core editor back in the 17/18/19 days... but it seems really primitive to me these days...
23:02ckirkendall@rimmjob_ you need to make sure you include the following in your project file. :dev-dependencies[[swank-clojure "1.2.1"]]
23:03technomancyrimmjob_: have you read through the swank-clojure readme?
23:03technomancytarcieri: usually that's caused by the presence of a ~/.emacs file outside ~/.emacs.d
23:04ckirkendallonce you have set the :dev-dependencies then you need to make sure you lein deps before you do lein swank
23:04tarcieritechnomancy: oh ho!
23:04tarcierithat may be the problem
23:05tarcieriholy fucking shit
23:05tarcieriI think it's working
23:05ambrosebsI remember that feeling :)
23:06tarcieriit's like, downloading and installing stuff
23:06mattmitchellanyone here familiar with midje? i can't figure out why this doesn't work: https://gist.github.com/1098809
23:08mattmitchelljust added the result as a comment to that gist...
23:11qbgI want to try ClojureScript, but I get java.lang.ClassNotFoundException: sun.org.mozilla.javascript.internal.Context *sigh*
23:11tarcierihooooly crap
23:11tarcieriso after closing and reopening Emacs like 5 times
23:11tarcieriwhen various downloads failed
23:11tarcieriit now loads without errors
23:11tarcieri:D
23:12tarcierithat's how I was told it was supposed to work
23:14technomancyhas anyone tried medusa?
23:15technomancyaw geez. never mind. https://github.com/amitrathore/medusa/blob/master/src/org/rathore/amit/medusa/core.clj
23:17kephaleoh neat… i've been looking for a way to control the size of the threadpool
23:18technomancywell, you can probably do that better without bringing in a library like this
23:21technomancyI mean, it may work OK, but there are warning flags all over this; it looks sloppy.
23:21kephalemmm, it looks like most functions in medusa are just exposing Executors
23:22technomancyyeah, I wish Clojure exposed more flexibility with the agent pools
23:22mattmitchellok, i was using wrong version of midje. only took an hour to figure that out. ugh.
23:22kephalewouldn't one actually want a concurrency library like this to replace existing clojure functions?
23:23kephaleerrr override
23:23technomancykephale: yeah, like a flexible-agents/flexible-futures
23:25kephalesounds good
23:25ckirkendalltechnomancy: high on my list would be agents that had a fixed pool that we could set as demons.
23:25ckirkendalldaemons
23:25ahriman53072÷¸
23:34chouserThe video of Rich's ClojureScript announcement is up: http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498
23:35Scriptorby the way, what's the [ANN] tag, project release announcements?
23:43rimmjob_ckirkendall: thank you, that worked
23:50ckirkendallrimmjob_: your welcome