2010-04-10
| 00:05 | technomancy | sweet; jumped to #18 on the github high-score list: http://github.com/languages/Clojure |
| 00:13 | defn | yay! |
| 00:13 | defn | explaining why using clojure is a good idea to non-technical types is very challenging |
| 00:14 | defn | the second i mention MVCC and STM they get on the defensive |
| 00:15 | lancepantz | i wouldn't even mention those to non-technicals |
| 00:16 | defn | lancepantz: it's tough not to, but yeah you're probably right |
| 00:16 | defn | lancepantz: how would you pitch it in a way that doesn't make it sound like "just another toy language" |
| 00:17 | hiredman | a. functional b. lisp c. libraries |
| 00:17 | hiredman | done |
| 00:17 | lancepantz | the thing that helped me sell it the most was the ability to use that java libs |
| 00:18 | lancepantz | s/that/all the/ |
| 00:18 | lancepantz | that in addition to the performance |
| 00:18 | lancepantz | it was either clojure or c++ for us |
| 00:19 | defn | instead of saying lisp right away i like to say it means more modular code, talk a little bit about the benefits of a functional language when it comes to testing and changes |
| 00:19 | hiredman | each of those three things can be expanded further |
| 00:19 | defn | and then i say "oh and it's a lisp...but it's not scheme" |
| 00:19 | hiredman | and I think rhickey calls c. "embracing a platform" |
| 00:20 | defn | i heard a funny interview with rich not too long ago where he gave the advice when pitching clojure to say it's just java, "it's a jar file!" |
| 00:20 | technomancy | it's lisp, but it's not scheme, and it's not from the 80's. |
| 00:20 | lancepantz | that's basically what we did |
| 00:21 | defn | "this ain't yo daddy's lisp-- and yet it is (but only the good parts)" |
| 00:21 | lancepantz | my boss is far more concerned about switching to tokyo cabinet from postgres than ruby to clojure |
| 00:21 | slyphon | defn: that's actually a good pitch |
| 00:21 | lancepantz | he's technical though, so different point |
| 00:21 | slyphon | lancepantz: owah, postgres -> tokyo cabinet |
| 00:22 | slyphon | uh, wut? |
| 00:22 | lancepantz | hahah |
| 00:22 | lancepantz | it's a graph db |
| 00:22 | defn | i usually find that im talking to a range of people, some moderately technical, some technical in other areas, some non-technical |
| 00:22 | defn | the trouble is they talk and someone who has a moderate understanding of lisp starts spouting off the myths to non-tech folks |
| 00:22 | defn | things go down hill from there |
| 00:23 | defn | and when i say moderate understanding i mean they have seen lisp code before, and they didnt like it |
| 00:24 | technomancy | college scheme classes, I bet. =) |
| 00:31 | defn | :) indeed |
| 00:35 | Licenser | greetings |
| 00:40 | Licenser | so defn your walton page is really cool :) |
| 00:41 | lancepantz | link? |
| 00:41 | clojurebot | your link is dead |
| 00:41 | lancepantz | heh |
| 00:41 | hiredman | ~botsnack |
| 00:41 | clojurebot | thanks; that was delicious. (nom nom nom) |
| 00:58 | defn | Licenser: thanks -- id really like to do some automatic indentation stuff, but that looks to be /hard/ |
| 00:59 | defn | to turn these long one-liners into readable blocks |
| 00:59 | defn | lancepantz: getclojure.org:8080/examples/concat , replace concat with a fn name -- very much a WIP |
| 01:01 | lancepantz | oh wow |
| 01:01 | lancepantz | that's awesome defn |
| 01:01 | lancepantz | a very needed resource |
| 01:02 | defn | lancepantz: if you'd like to help out im trying to get it into more of a "finished" mode by adding some filters, javascript noshow for the results, and ultimately a way to "vote" for examples, or at least "favorite" them or something |
| 01:03 | lancepantz | do you have it on github? |
| 01:03 | defn | i do |
| 01:03 | defn | http://github.com/defn/walton |
| 01:04 | lancepantz | cool man, i'll look through it and see if there's anything i can do |
| 01:04 | lancepantz | so does this only pull examples parsed by clojurebot? |
| 01:09 | defn | nope, it run's licenser's awesome sanbdox |
| 01:09 | defn | it goes through and finds all of the valid sexps in all of the #clojure logs and then runs them in the sandbox |
| 01:09 | Licenser | heh thanks defn |
| 01:10 | lancepantz | it would be cool to source the mailing lists as well |
| 01:10 | defn | Licenser: query: why doesn't juxt work? Is that not an approved fn? |
| 01:10 | defn | lancepantz: oh that will come! |
| 01:10 | defn | i have big plans, but i need to focus on getting the basics working |
| 01:10 | Licenser | let me see |
| 01:10 | Licenser | (doc juxt) |
| 01:10 | clojurebot | "([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]" |
| 01:11 | Licenser | I think we forgot it :P |
| 01:11 | defn | Licenser: they all must fail in the sandbox i think |
| 01:11 | defn | oh, or that! :)P |
| 01:12 | Licenser | I think because it is alpha ut I'll add it |
| 01:14 | Licenser | 0.2.13 should be up spj |
| 01:14 | defn | spj? |
| 01:15 | Licenser | now I think |
| 01:15 | defn | ah yes, thanks Licenser |
| 01:16 | Licenser | defn: you can whitelist functions on your own you know that? |
| 01:17 | defn | Licenser: yes but i like working with your official version because a.) you know what you're doing whereas i do not, and b.) if this is distributed it will be with your official version anyways :) |
| 01:18 | Licenser | heh |
| 01:18 | Licenser | yea but you can get things faster :P |
| 01:21 | defn | Licenser: do you have any suggestions for re-indenting one-liners? |
| 01:22 | Licenser | hmm yes some |
| 01:27 | Licenser | A) identation deepth 2 sapaces behind the opening ( |
| 01:28 | defn | would you use something like fnparse? |
| 01:28 | Licenser | B) Don't split functions with only native values (only after 80 chars) |
| 01:28 | Licenser | I have no clue didn't got fnparse to work :P |
| 01:28 | defn | yeah me either yet! :) |
| 01:28 | defn | Licenser: what do you mean native values? |
| 01:28 | Licenser | non functions |
| 01:28 | defn | ah okay |
| 01:28 | Licenser | as 2 or 'bla or :bla or "bla" |
| 01:31 | defn | Licenser: hmm, those aren't bad ideas |
| 01:31 | defn | kind of like how emacs does it |
| 01:31 | defn | (i think) |
| 01:32 | Licenser | *nods* |
| 02:08 | tomoj | am I repeatedly disconnecting or something? |
| 02:12 | Licenser | yes |
| 02:17 | Licenser | defn: perhaps the enclojure project can give you sime ideas about code formating since they have something like that and I think it is written in clojure :P |
| 02:22 | Licenser | then again browsing the code it looks very NB specific |
| 02:24 | mikem | is there a more idiomatic way to set an atom to a certain value other than (swap! atom (fn [_] value)) ? |
| 02:30 | Licenser | mikem: there is constantly |
| 02:30 | Licenser | (swap! atom (constatly value)) |
| 02:31 | mikem | Licenser: ah, cool :) that'll do it. thanks |
| 02:33 | Licenser | I found that some time back I wrote me a static function like (defn static [v] (fn [& _] v)) ;) |
| 02:47 | _ato | ,(doc reset!) |
| 02:47 | clojurebot | "([atom newval]); Sets the value of atom to newval without regard for the current value. Returns newval." |
| 02:47 | _ato | mikem, Licenser: ^ |
| 02:47 | Licenser | ah sneaky |
| 02:48 | Licenser | I used it in update in so not in swap :) but always good to know |
| 02:48 | mikem | _ato: haha cool |
| 02:48 | Licenser | hmm so _ato what do you think want to bang our heads together and make a really good search lein dependency thingy stuff for clojars? |
| 02:49 | _ato | ah yeah |
| 02:49 | _ato | you were talking about description |
| 02:49 | Licenser | cool :) |
| 02:49 | Licenser | yap |
| 02:49 | Licenser | since they all have a short description text it'd be awsome if it would be possible to search those |
| 02:49 | _ato | as maven central is quite useful to search as well |
| 02:50 | Licenser | *nods* But from where I stand clojars is more important since it are 'true' clojure libraries there |
| 02:50 | _ato | yeah |
| 02:50 | Licenser | I mean in an ideal world we'd just install clojure libs that have dependencies to java libs :P |
| 02:52 | Licenser | but the index you serve now is really cool I'll go and use that in the next push of lein-search since it saves so much time, bandwith and effort |
| 03:01 | Licenser | so it'd be nice to have like a third entry in the map that gives the description but I'm not sure if that would break lein if copied in |
| 03:07 | _ato | I'll make a seperate "full" feed that has the description. It'll probably be a gzipped text-file with one map per line that looks like: {:group-id "org.clojure" :artifact-id "clojure" :versions ["1.0.0" "1.1.0" "1.2.0-master-SNAPSHOT"] :description "Clojure is a functional Lisp on the JVM."} |
| 03:09 | _ato | might extend it with github url at some point as well |
| 03:09 | Licenser | _ato: sounds good |
| 03:09 | _ato | imagine: lein clone clj-sandbox |
| 03:09 | Licenser | I can give you some code to sort version number :) |
| 03:09 | Licenser | yea that'd be awsome |
| 03:10 | _ato | it's alright, I've already got a function for sorting maven version numbers |
| 03:10 | Licenser | okay |
| 03:12 | Intertricity | How far do you think ClojureCLR is from a binary release? |
| 03:15 | Licenser | _ato: I currently use something like this as data:http://gist.github.com/361886 |
| 03:15 | Licenser | grrr |
| 03:15 | Licenser | http://gist.github.com/361886 |
| 03:15 | Licenser | there w/o data: |
| 03:30 | dcnstrct | I'm getting this error when I do an insert using contrib/sql but only from inside emacs: No matching method found: println for class clojure.proxy.java.io.StringWriter |
| 03:30 | dcnstrct | has anyone seen it before ? |
| 03:34 | Licenser | there we go _ato lein-search now reads your index file :) |
| 03:35 | Licenser | and only 8 KB isn't that much traffic |
| 03:37 | _ato | cool |
| 03:41 | Licenser | yap |
| 03:41 | Licenser | and way easyer :P |
| 03:41 | Licenser | I don't have to do all the silly web crawling |
| 03:46 | Licenser | also this is very cool since lein search now has no non java/clojure deps |
| 03:48 | dcnstrct | now just remove any dependencies on Maven and you're done. |
| 03:48 | dcnstrct | ;) |
| 03:49 | Licenser | lein search isn't dependant on maven :D |
| 03:49 | Licenser | wow my read-line is silly |
| 03:49 | Licenser | it just returns nil (without waiting for input) and dies with a NPE |
| 03:50 | Licenser | that is a very unnice and ugly behaviour! |
| 04:00 | Licenser | everyone ever experienced that behavior or read-line? |
| 04:03 | vIkSiT | hi all |
| 04:03 | vIkSiT | anyone still awake? :) |
| 04:03 | vIkSiT | I'm trying to wrap my head around monads - some inputs would be useful! |
| 04:03 | Licenser | yap |
| 04:03 | Licenser | I don't know monands so |
| 04:06 | vIkSiT | Licenser, ah well |
| 04:06 | hiredman | http://channel9.msdn.com/shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads/ |
| 04:11 | glogic | hi |
| 04:11 | glogic | jesus |
| 04:12 | vIkSiT | hiredman, ah was planning to see that |
| 04:12 | Licenser | heh |
| 04:12 | vIkSiT | I guess my main problem is - I'm trying to find a usecase for monads, or rather.. |
| 04:13 | vIkSiT | an understandable reason for why I should learn/use them |
| 04:13 | glogic | hiredman: that's a good one |
| 04:13 | glogic | hiredman: now that i can send to the channel again |
| 04:14 | glogic | freakin nickserv |
| 04:15 | Licenser | heh |
| 04:22 | _ato | Licenser: http://clojars.org/repo/feed.clj.gz |
| 04:26 | bsteuber | which hook do I need to set in order to enable paredit for slime repls on default? |
| 04:26 | Licenser | _ato: tanks! |
| 04:27 | _ato | bsteuber: (add-hook 'slime-repl-mode-hook 'turn-on-paredit) |
| 04:27 | Licenser | sweet! |
| 04:28 | _ato | bsteuber: where turn-on-paredit is: (defun turn-on-paredit () (paredit-mode t)) |
| 04:28 | bsteuber | _ato: thank you :) |
| 04:29 | bsteuber | I use +1 instead of t |
| 04:29 | bsteuber | copied from another tutorial I guess :) |
| 04:29 | Licenser | _ato: that is damn sweet! |
| 04:30 | Raynes | I don't know why, but my REPL is the one place where I don't use paredit or syntax highlighting. |
| 04:31 | Raynes | I wouldn't mind the highlighting, but I think I'd rather stick with no paredit in the REPL for quicker debugging. |
| 04:31 | _ato | Licenser: let me know if there's anything else from the POMs you want in it, it's trivial to add. Here's the code that generates it: http://github.com/ato/clojars-web/blob/no-db/src/clojars/feed.clj |
| 04:38 | Licenser | _ato: *nods* thanks a lot |
| 04:38 | Licenser | so I am still stuck with a very odd behavior of readline |
| 04:40 | _ato | ah |
| 04:40 | _ato | yeah |
| 04:40 | _ato | input doesn't work properly inside lein |
| 04:40 | Licenser | hmm can someone try it if it is a local and or global problem? http://github.com/Licenser/lein-search/downloads there is the jar just drop it in some lein lib folder and try lein add sandbox |
| 04:41 | Licenser | hrm it worked yesterday oddly enough |
| 04:41 | Raynes | http://github.com/SFEley/candy/blob/2f964916961a2dcccbb374cd389520ac2ac62226/LICENSE.markdown |
| 04:43 | _ato | NPE |
| 04:43 | Licenser | yea I've the same problem :( that is very sad |
| 04:43 | Licenser | hmm might be because I updated lein today |
| 04:43 | Licenser | this is a show stopper for lein search somewhat :( |
| 04:45 | Licenser | I of cause could make it non interactive but that would be only half as helpful |
| 04:46 | _ato | try using System/in directly |
| 04:46 | _ato | just give (.read System/in) a try, you can wrap it in a bufferedreader to get readline later if needs be |
| 04:47 | Licenser | *tries that |
| 04:48 | Licenser | ah that works sneaky, binding Systen in to *in* doesn't wokr |
| 04:49 | _ato | *in* has to be a PushbackReader IIRC |
| 04:49 | _ato | ,(doc *in*) |
| 04:49 | clojurebot | "; A java.io.Reader object representing standard input for read operations. Defaults to System/in, wrapped in a LineNumberingPushbackReader" |
| 04:50 | Licenser | sneaky sneaky |
| 04:50 | _ato | so maybe... (binding [*in* (-> System/in (java.io.InputStreamReader.) (clojure.lang.LineNumberingPushbackReader))] ...) |
| 04:51 | Licenser | _ato: how does it come that you know so much and I know so little :P |
| 04:51 | Licenser | and that does the trick :D |
| 04:53 | _ato | I've read a fair bit of Clojure's source code and I used to work as a Java developer so I guess I've picked up a few bits and pieces. :-P |
| 04:53 | Licenser | oh then I pittie you for suffering as a java developer ;) |
| 04:55 | sthuebner | Licenser: well the language is not so horrible. You can e.g. create something like Clojure with it |
| 04:56 | Licenser | I'm sure you could create clojure in brainfuck |
| 04:56 | sthuebner | or whitespace for that matter... sure |
| 04:57 | Licenser | which does not make them useful languages, we are just very very very lucky that rhicky jumped the bullet for us and did the task :P |
| 04:58 | Licenser | Since I know of clojure I even less see a reason for java. |
| 04:59 | Licenser | There are way worst things then java so |
| 04:59 | bsteuber | Licenser: for me it's the other way round - since I know clojure, I finally know see reason in Java again :) |
| 04:59 | Licenser | bsteuber: for the JVM yes :P for java, no |
| 05:00 | Licenser | they now could close the entire java world down, continue to make this very nice JVM and just let us write clojure and be happy for ever after! |
| 05:01 | quotemstr | Java isn't all that bad, honestly. It gets a bad rap, but it's far better than PHP. |
| 05:01 | Licenser | quotemstr: that is true |
| 05:01 | Licenser | and java has improved |
| 05:01 | bsteuber | not to mention c++ |
| 05:01 | Licenser | but there was a point where you couldn't add a Integer and a int :P |
| 05:01 | glogic | quotemstr: i usually consider Java as an implementers language like C |
| 05:01 | quotemstr | A lot of people will be stuck with their late-90s prejudices until the day they die. |
| 05:01 | Licenser | without typcastig, creating objects or anything that odd |
| 05:02 | sthuebner | quotemstr: I second that. |
| 05:02 | Licenser | especially in the latest releases sun has fixed somet things that were really bad |
| 05:03 | sthuebner | Consider this: Lisp was there for several decades and only few people knew about it. |
| 05:03 | quotemstr | was? Hey! I still write Common Lisp. :-D |
| 05:03 | dcnstrct | they should stop trying to add dynamics to java and just let it die already instead of trying to pretend that it can do the same types of things that dynamic languages can do. |
| 05:03 | sthuebner | Java if nothing else, was prepared the way for a new wave of Lispians |
| 05:03 | sthuebner | quotemstr: Good on you! |
| 05:04 | glogic | http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html |
| 05:04 | sthuebner | dcnstrct: totally agree |
| 05:04 | dcnstrct | stevey rules |
| 05:04 | glogic | dcnstrct: love that article |
| 05:04 | Licenser | but adding dynamic to java means adding dynamic to jvm which means clojure gets evenb etter :P |
| 05:06 | dcnstrct | does that mean clojure may get tail call optimization one of these days ? or is that impossible |
| 05:06 | quotemstr | So you don't have to use reflection as much? |
| 05:07 | quotemstr | dcnstrct: I'd rather have LOOP and ITERATE (http://common-lisp.net/project/iterate/) than TCO. |
| 05:07 | glogic | quotemstr: well, it's not like there are any specific expectations other than what people want i suppose, clojure being it's own dialect |
| 05:08 | bsteuber | for me, recur is not that bad of a TCO-replacement - at least you're code is explicit about when recursion will be fst and when not |
| 05:08 | dcnstrct | yeah loop would not suck |
| 05:08 | bsteuber | *fast |
| 05:09 | quotemstr | glogic: The gratuitous incompatibilities with CL drive me up a wall. |
| 05:09 | _ato | from what I've read TCO isn't going to make it into Java 7 |
| 05:09 | glogic | quotemstr: isnt' part of the point of clojure being it's own dialect, that there are really no rules on compatability? |
| 05:11 | quotemstr | Sure, there's no _requirement_ to be like CL. |
| 05:11 | quotemstr | But why be different for the sake of being different? Why use []-notation for LET? |
| 05:11 | _ato | because it's more readable to those who don't have a lisp background |
| 05:12 | glogic | quotemstr: overspecialize and you breed in weakness, it's slow death |
| 05:12 | glogic | someone has to have gottent hat reference |
| 05:13 | dcnstrct | quotemstr, have you seen this ? http://github.com/hoeck/clojurebox2d/blob/master/hoeck/iterate.clj |
| 05:13 | bsteuber | [] instead of () for lists whose first element is not "special" seems very clean to me |
| 05:13 | Licenser | quotemstr: so that the [] looks nicely different from the () :P |
| 05:13 | Licenser | also you don't have ot escape () |
| 05:13 | glogic | quotemstr: also, i think most people require a bit more syntax than just () so it's a good slice imho |
| 05:13 | quotemstr | dcnstrct: Nifty. |
| 05:13 | glogic | quotemstr: almost like a requirement for human minds |
| 05:14 | quotemstr | glogic: Natural languages span the whole spectrum from analytic to synthetic. |
| 05:14 | quotemstr | glogic: On one hand, you have Chinese; on the other, Latin. |
| 05:14 | sthuebner | well, I for one, don't like the [] notation too much |
| 05:15 | sthuebner | it's a hassle to type |
| 05:15 | sthuebner | ... on the keyboard, I mean |
| 05:15 | sthuebner | but it makes sense from a language point of view, I guess |
| 05:15 | glogic | quotemstr: dont' forget ancient languages lke akkadian and aramaic |
| 05:17 | dcnstrct | I like how [] notation lets Rich say things like "this clojure function is much shorter and has fewer parens than the java version". |
| 05:17 | Licenser | _ato: with the new gz this is realy neat |
| 05:18 | glogic | personally i like parens |
| 05:18 | glogic | and less sytax |
| 05:18 | glogic | syntax* even |
| 05:18 | Licenser | this now almost looks like a real tool :P |
| 05:21 | Licenser | thanks to _ato new index: http://gist.github.com/361932 |
| 05:22 | Borkdude | haha, the []'s really make for fewer parens, but I liked the Full Disclojure project Foil version better: {} instead of () |
| 05:23 | sthuebner | Licenser: what's the new gz? |
| 05:23 | _ato | Licenser: nice. when you construct the name, if the artifact-id equals the group-id you can just print one of them. So "sandbar" instead of "sandbar/sandbar". |
| 05:23 | Licenser | _ato: ah cool thanks |
| 05:24 | Licenser | sthuebner: the new gz is the new index file ato publishes for clojars |
| 05:24 | sthuebner | I see |
| 05:25 | sthuebner | I haven't looked into Clojars yet, since in my environment we heavily rely on internal maven infrastructure |
| 05:26 | Licenser | http://gist.github.com/361932 |
| 05:28 | Licenser | hmm when you call lein add clj-sandbox would you expect it to be interactive or automatically choose the latest stable versions? |
| 05:28 | Licenser | I'd kind of go for the second and add -i or something for interactive |
| 05:28 | _ato | yes |
| 05:28 | _ato | "lein add clj-sandbox" adds latest sandbox |
| 05:28 | clojurebot | sandbox is http://calumleslie.blogspot.com/2008/06/simple-jvm-sandboxing.html |
| 05:29 | _ato | "lein add clj-sandbox 0.2.10-SNAPSHOT" adds that particular version |
| 05:29 | Licenser | at least as long as there is only one group with a clj-sandbox thingy |
| 05:30 | _ato | "lein add org.clojars.ato/clj-sandbox" adds my fork |
| 05:30 | _ato | etc |
| 05:30 | quotemstr | 2008? That's ancient news! :-) |
| 05:33 | Licenser | *g* |
| 05:57 | Raynes | Licenser: I forgot juxt? |
| 05:57 | Raynes | I could have swore that I added juxt. |
| 05:57 | Licenser | Raynes: I couldn't find it. |
| 05:57 | Raynes | Hrm. |
| 05:57 | Raynes | I must have been too busy playing with it to remember to add it. :p |
| 05:59 | Licenser | *g* |
| 06:01 | Licenser | okay line-search 0.2.0 is out :D |
| 06:01 | Licenser | now with nifty new features and a more comprehensive search |
| 06:02 | Licenser | now people can use maven as much as they want since there is a very thick protective layer :P |
| 06:45 | Raynes | Isn't there a command in Emacs to switch to the REPL to the ns of the file you're currently editing? |
| 06:48 | Licenser | (in-ns 'namespace)? |
| 06:48 | Raynes | I mean, a keybinding. I'm pretty sure there is. |
| 06:49 | Raynes | It's not important. |
| 06:49 | Raynes | Just curious. |
| 06:50 | mrSpec | Hello, I have problem with clj-web-crawler. "org.apache.commons.httpclient.HttpClient Thrown class java.lang.ClassNotFoundException." What should I install to use it? I cant find this apache lib. |
| 06:53 | Borkdude | mrSpec, using google: http://hc.apache.org/downloads.cgi |
| 06:57 | mrSpec | Borkdude: ah, thanks |
| 06:58 | sthuebner | Raynes: Maybe most-recent-list-mode-buffer, which is bound to 'l' in 'slime-selector |
| 07:03 | kzar | So I'm reading through the Programming Clojure book and a lot of the Java terms in the Java interop chapter are foreign to me, is there a good guide to read just to learn enough about Java to understand how Clojure interacts with it? |
| 07:03 | hoeck | Raynes: slime-repl-set-package ? |
| 07:05 | sthuebner | kzar: if your not into Java at all, why did pick Clojure as your Lisp? Just curious |
| 07:06 | bsteuber | sthuebner: because it's the best existing programming language maybe :) |
| 07:07 | hoeck | kzar: I would suggest the "official" java tutorial: http://java.sun.com/docs/books/tutorial/java/TOC.html |
| 07:07 | Raynes | hoeck: Might be it. |
| 07:08 | Raynes | hoeck: Yeah, this is it. Thank you. |
| 07:08 | kzar | hoeck: Thanks I'll have a read through that |
| 07:09 | Raynes | kzar: At least they're good Java tutorials as opposed to bad ones. |
| 07:09 | hoeck | there are far more worse programming languages than java :) |
| 07:09 | kzar | I haven't seen them though heh |
| 07:14 | Borkdude | I haven't worked with Java for years either |
| 07:14 | zakwilson | I would like to use a profiler with lein-swank. Could someone point me in the right direction for getting started? I'd also like a recommendation on a profiler. I played with a Yourkit trial about a year ago and liked it, though I'd prefer something open source. |
| 07:14 | Borkdude | but Clojure + a massive library made a lot of sense to me to start using it |
| 07:15 | Borkdude | same I reason I started F# when I did .NET programming, but I like Clojure a lot better, because it's Lisp |
| 07:15 | zakwilson | I came to Clojure not being in to Java or any other JVM language. I did know CL and Scheme first though. |
| 07:15 | kzar | zakwilson: Yea that sounds more like me, I've done some Lisp but never Java |
| 07:16 | Borkdude | zakwilsen: same for me, it's practical lisp, without the common ;) |
| 07:16 | kzar | I guess I liked Common Lisp but it was such a nightmare to deploy on my webserver I never really stuck with it and I had to use Python instead. But Python isn't as nice so I was always looking for something else |
| 07:16 | zakwilson | That's essentially been the appeal of Clojure for me as well. Very often, it feels like Rich thought about what I want to do before I did. |
| 07:17 | zakwilson | kzar: I did not find Common Lisp at all difficult to deploy on a VPS. What tools were you using? |
| 07:17 | zakwilson | Incidently, I haven't tried deploying a webapp on Clojure. It actually looks like it might be harder than CL. |
| 07:18 | kzar | zakwilson: Well it was the first time I had ever done it so maybe I was just being stupid but it took me AGES to get it all working. I used hunchentoot running on SBCL using cl-who to make html and cl-couch to store data if I remember correctly |
| 07:20 | Borkdude | Clojure took me also ages to setup... all these different IDEs and error msgs... takes a lot of searching and asking around to get it working |
| 07:20 | Borkdude | but I guess that is how everything works nowadays |
| 07:20 | zakwilson | kzar: Pretty much my setup. As for deployment, I saved an executable, then wrote a shell script that started it with detachtty and put the app behind Apache using mod_proxy. |
| 07:21 | kzar | zakwilson: Oh nice, I didn't know how to save an executable (still don't) so I had to get it all running on there. Then I wrote a script that started it up at boot and used Nginx to put requests through to it |
| 07:22 | Borkdude | The problem is that Emacs is most supported Clojure IDE probably... and learning Emacs and Clojure at once are two learning curves instead of one |
| 07:22 | zakwilson | Ahh. See sb-ext:save-lisp-and-die |
| 07:23 | kzar | Borkdude: I'm already a big emacs fan, I'm in the emacs irc client right now :) |
| 07:23 | Borkdude | but I'm starting to appreciate it more and more |
| 07:23 | kzar | Borkdude: Stick with it, it's worth learning trust me |
| 07:23 | Borkdude | kzar, I experimented with a twitter client in emacs |
| 07:23 | Borkdude | I even contributed to the emacs wiki a little for it ;) |
| 07:23 | kzar | heh nice |
| 07:24 | kzar | zakwilson: Ok thanks, I'll look it up later |
| 07:26 | zakwilson | kzar: You can save a standalone executable that way, and you can define a function that serves as an entry point. |
| 07:27 | Borkdude | gtg |
| 07:31 | Borkdude | Hmm, ok, so this is how it looks from Emacs |
| 07:31 | Borkdude | cool... I try to use this some more in the future... gtg now |
| 07:32 | kzar | bobo_: http://paste.lisp.org/display/97342 |
| 07:32 | kzar | oops |
| 07:32 | kzar | Oh right I missed him, sorry that was for Borkdude |
| 07:45 | Raynes | http://nighthacks.com/roller/jag/entry/time_to_move_on Gosling left Oracle. :o |
| 08:02 | candeller | is there a function that returns the index of an element in a vector/list? |
| 08:04 | defn | some fun progress: http://getclojure.org:8080/examples/concat |
| 08:04 | defn | you can now click on expressions to show the result |
| 08:06 | defn | also, dupes are now removed |
| 08:14 | _ato | ,((zipmap [:a :b :c :d :e] (iterate inc 0)) :c) |
| 08:14 | clojurebot | 2 |
| 08:14 | _ato | hehe |
| 08:15 | _ato | ,(ffirst (filter (fn [[i v]] (= v :c)) (indexed [:a :b :c :d :e]))) |
| 08:15 | clojurebot | 2 |
| 08:15 | _ato | I like the zipmap way, but it realises the whole list and may not do what you want if there's duplicates |
| 08:16 | _mst | ,(first (positions #{:c} [:a :b :c :d :e])) |
| 08:16 | clojurebot | 2 |
| 08:16 | _ato | nice |
| 08:17 | defn | candeller: is there a reason why there is no "index-at" function in core clojure? |
| 08:17 | defn | err @ _ato, _mst |
| 08:17 | _ato | if you're working with indices, most of the time you're doing something wrong. (not always, but most of the time) |
| 08:18 | defn | yeah that was going through my head |
| 08:18 | defn | seems like a million other ways to do it |
| 08:19 | candeller | hmh, well i am writing a function that takes a collection and randomly shuffles elements within it |
| 08:19 | candeller | so i have 2 collections, one empty at the beginning, the other one to pick elements from |
| 08:20 | candeller | and i am generating a random index, then removing that element and adding it to the empty collection |
| 08:20 | candeller | and so on |
| 08:21 | Chousuke | contrib has a shuffle function |
| 08:21 | _ato | where does finding the index of an element come into it your algorithm? |
| 08:21 | defn | it's in seq-utils isnt it? |
| 08:22 | Chousuke | it copies your data into an array, uses the java shuffle function, and then creates a vector out of that |
| 08:22 | chouser | a seq |
| 08:22 | Chousuke | ah. I thought it made a vector |
| 08:23 | _ato | ,(class (shuffle [1 2 3])) |
| 08:23 | clojurebot | clojure.lang.IteratorSeq |
| 08:23 | _ato | boo :( |
| 08:23 | defn | ,(shuffle [1 2 3 4 5 6 7 8 9 10]) |
| 08:23 | clojurebot | (3 4 1 5 8 2 7 10 9 6) |
| 08:24 | _ato | ArraySeq would be much better |
| 08:24 | _ato | ~def shuffle |
| 08:24 | clojurebot | Pardon? |
| 08:25 | chouser | Well, Collections/shuffle actually shuffles an ArrayList in place, so the seq on that is an IteratorSeq |
| 08:26 | _ato | ah, and you can't get at the underying array without a copy |
| 08:26 | _ato | annoying |
| 08:26 | defn | ,(let [a (ArrayList. (range 10))] (Collections/shuffle a) (vec a)) |
| 08:26 | clojurebot | java.lang.IllegalArgumentException: Unable to resolve classname: ArrayList |
| 08:29 | defn | ,(import java.util.ArrayList) |
| 08:29 | clojurebot | java.util.ArrayList |
| 08:30 | defn | ,(let [a (ArrayList. (range 10))] (shuffle a)) |
| 08:30 | clojurebot | (6 4 7 2 8 9 0 3 1 5) |
| 08:30 | defn | ,(let [a (ArrayList. (range 10))] (shuffle a)) |
| 08:30 | clojurebot | (7 8 1 0 9 3 5 2 4 6) |
| 08:35 | _ato | candeller: you might be interested in this implementation of Knuth shuffle by Per Vognsen: http://gist.github.com/356035 |
| 08:35 | defn | _ato: wow -- how did you find that? |
| 08:35 | defn | _ato: as in literally, how did you come across that link? |
| 08:38 | _ato | http://groups.google.com/group/clojure/browse_thread/thread/2a479bc9d9dd5bac |
| 08:39 | defn | _ato: awesome. |
| 08:39 | defn | _ato: if you dont mind me asking, how do you read the groups? |
| 08:39 | defn | (with a browser, email?) |
| 08:39 | _ato | email (gnus in emacs) |
| 08:40 | defn | ah, i still feel pain with gnus |
| 08:40 | sthuebner | _ato: same here |
| 08:40 | defn | im setting up wanderlust |
| 08:40 | sthuebner | Gmane -> gnus |
| 08:40 | defn | im used to mutt and it's a dirty habit |
| 08:41 | sthuebner | Gnus is good. I like the scoring features a lot |
| 08:45 | zakwilson | I'm trying to make a jar with leiningen. I have ":main foo.bar" in project.clj and "src/foo/bar.clj" contains (defn -main [] (clojure.main/main)). The jar buids, but when I run java -jar Foo.jar, I get Exception in thread "main" java.lang.NoClassDefFoundError: foo/bar |
| 08:46 | zakwilson | This structure seems to match leiningen itself, so I'm not sure what I could be doing wrong here. |
| 08:48 | _ato | zakwilson: do you have (ns foo.bar (:gen-class)) in foo.bar? |
| 08:59 | zakwilson | _ato: Missing the (:gen-class) bit, and I suspect that's my problem. |
| 09:01 | zakwilson | Fixed that and now get Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/IFn |
| 09:01 | _ato | ah good |
| 09:01 | _ato | now try: lein uberjar |
| 09:01 | _ato | and then run java -jar foo-standalone.jar |
| 09:02 | _ato | the plain "lein jar" doesn't produce a jar that includes dependencies (ie clojure) |
| 09:03 | zakwilson | I knew that, but I somehow expected it to magically work in the project directory. I'm not sure *why* I expected that, not seeing any way that it would set the classpath to include the lib dir, but... I did. |
| 09:05 | _ato | yeah, I've accidentally expected the plain jar to work many times before as well. You can of course do it like: java -cp 'lib/*:foo.jar' foo.bar |
| 09:05 | zakwilson | And now I get Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.NoSuchFieldException: main |
| 09:06 | _ato | oh |
| 09:06 | _ato | huh |
| 09:06 | _ato | that's interesting |
| 09:06 | _ato | I guess it's because clojure.main is both a class and a clojure namespace |
| 09:07 | _ato | actually if you're just wanting to run clojure.main, why not set :main to that in project.clj? |
| 09:08 | zakwilson | Because I actually want to run it from inside my namespace. |
| 09:09 | _ato | anyway, the problem is likely that you're missing a (:require clojure.main) in foo.bar |
| 09:11 | zakwilson | That... could be it. |
| 09:11 | zakwilson | I haven't used Clojure much in the past year. I'm more rusty than I thought. |
| 09:12 | zakwilson | Leiningen looks to make deplayment much easier, once I get used to it. |
| 09:16 | zakwilson | Got it working. Thanks _ato |
| 09:16 | _ato | cool :) |
| 09:18 | zakwilson | Now... let's see why this code is so slow. |
| 09:28 | moshisushi | can i get clojure to use gnu-readline for REPL? |
| 09:30 | moshisushi | extremely disturbing without it.. i can't even use backspace right now |
| 09:30 | _ato | moshisushi: sure, install rlwrap |
| 09:31 | _ato | (apt-get it, or whatever the equivalent is for your distro) |
| 09:31 | arbscht | or jline |
| 09:32 | moshisushi | which one is preferred? |
| 09:32 | Raynes | Hardcore Clojure users don't use any of that. For example, Rich sends expressions to a remote REPL in Antarctica via his mind and it's sent back encrypted with ROT-13, which he decrypts in his mind to get the returned value and output. |
| 09:33 | arbscht | moshisushi: up to you |
| 09:33 | carkh | moshisushi: usually you'll use you editor/ide to work with the repl |
| 09:34 | _ato | I've heard reports that jline is buggy under Linux (inserts null characters occasionally) and I don't think it's as featureful as readline, so I'd suggest rlwrap |
| 09:34 | zakwilson | I think most people use Slime for their repl. |
| 09:34 | moshisushi | sure i will use slime later.. |
| 09:34 | raek | btw, which one does lein repl use+ |
| 09:34 | raek | ? |
| 09:34 | _ato | rlwrap |
| 09:35 | _ato | oh wait |
| 09:35 | _ato | maybe it uses both |
| 09:35 | _ato | hmm |
| 09:35 | _ato | $RLWRAP java -client $JAVA_OPTS -cp "src/:classes/:$CLASSPATH" jline.ConsoleRunner clojure.main ${@:2} |
| 09:35 | _ato | confusing :p |
| 09:38 | _ato | ah... jline doesn't support reverse-isearch, that's a deal-breaker |
| 09:48 | zakwilson | Would a type hint saying that the keys of a map are all keywords speed up something that does a lot of lookups? |
| 09:51 | moshisushi | where do i find clj_completions? |
| 09:55 | moshisushi | nevermind... |
| 10:19 | mikem | how can I coax a number from a floating point representation into an Integer or BigInteger, whichever is appropriate? (int num) will fails on anything larger than Integer/MAX_VALUE |
| 10:20 | Raynes | $(bigint 5.3) |
| 10:20 | sexpbot | 5 |
| 10:20 | Raynes | mikem: That what you're looking for? |
| 10:21 | mikem | $(type (bigint 10.0)) |
| 10:21 | sexpbot | class java.math.BigInteger |
| 10:21 | mikem | in that case, I'd expect a Integer |
| 10:22 | mikem | I can always use an if, but perhaps there's already a function that does the right thing :) |
| 10:22 | Raynes | You could check to see if the resulting integer is > MAX_VALUE. |
| 10:22 | Raynes | If there is, I don't know of it. :\ |
| 10:22 | Raynes | But I don't know a lot of things. ;) |
| 10:24 | hamza | if we have a pluging that creates other files such as a .exe is it possible to somehow hook into the leain clean to also delete this when lein clean is run? |
| 10:24 | Raynes | technomancy: ping ^ |
| 10:40 | Raynes | Woot, MEAP update (Joy),. |
| 10:46 | The-Kenny | \o/ MEAP updates for Joy of Clojure |
| 10:47 | khingebjerg | Did you guys receive emails about the update? |
| 10:48 | The-Kenny | khingebjerg: Yes, I got mine just a few minutes ago |
| 10:48 | khingebjerg | The-Kenny: Ahh ok, I'll just try to be patient then... |
| 10:48 | Raynes | khingebjerg: Indeed. Moments ago. |
| 10:52 | defn | whoa wait! |
| 10:52 | defn | new JoC? |
| 10:52 | The-Kenny | defn: Yes! |
| 10:53 | defn | The-Kenny: awesome |
| 10:53 | defn | The-Kenny: where ya been? havent seen you around in weeks |
| 10:54 | defn | :) |
| 10:54 | The-Kenny | defn: huh? I was here every day since saturday. |
| 10:54 | defn | thanks chouser for the JoC |
| 10:54 | The-Kenny | +last |
| 10:54 | defn | The-Kenny: oh, my bad, must've just missed you |
| 10:55 | The-Kenny | defn: looks so :) |
| 10:55 | The-Kenny | Btw. I'm watching "Introductions to Monads" just now: http://www.youtube.com/user/LinkedInTechTalks?feature=mhw5#p/u/0/ObR3qi4Guys |
| 10:56 | defn | thoughts on http://getclojure.org:8080/examples/partial? |
| 10:56 | defn | err http://getclojure.org:8080/examples/partial |
| 10:56 | defn | (in case your url grabber snagged that ?) |
| 10:58 | The-Kenny | hmm looks good, but there are a lot examples |
| 11:00 | defn | The-Kenny: heh, yeah, not very well organized yet |
| 11:00 | defn | i wonder if it makes more sense to show the result first and the code second |
| 11:01 | The-Kenny | I don't think so. But a short description of what the code does would help, in my opinion. |
| 11:03 | defn | like human readable The-Kenny ? |
| 11:03 | The-Kenny | defn: yeah |
| 11:03 | defn | The-Kenny: ah, yeah that would be a lot of work |
| 11:03 | defn | these are just pulled from #clojure |
| 11:03 | The-Kenny | defn: heh, yeah |
| 11:03 | The-Kenny | defn: Oh, I didn't know that |
| 11:03 | shadowspar | The-Kenny: fwiw, I really liked Marty Pauley's "A Swift Kick in the Monads": http://yapc.tv/2005/ye/marty-monads/ |
| 11:04 | shadowspar | more for the humour value, but also useful when ppl are first wrapping their minds around monads |
| 11:04 | The-Kenny | shadowspar: I'll take a look, thanks |
| 11:04 | defn | oi vey, monads |
| 11:05 | dullard | defn: On my firefox, the links need to be sorted out with some kind of text-decoration: none css because all the examples are underlined with a varying thickness of blue hideousness |
| 11:08 | defn | dullard: care to screenshot it? |
| 11:09 | defn | i havent seen that in FF, IE, Chrome, or Safari |
| 11:09 | dullard | defn: and while I'm at it, have you considered making all the keywords into links to their respective examples pages? That'd be great |
| 11:09 | dullard | defn: sure will do... |
| 11:09 | Raynes | $walton juxt |
| 11:09 | sexpbot | Raynes: http://getclojure.org:8080/examples/juxt |
| 11:09 | defn | dullard: yeah i have -- just working other pieces right now |
| 11:09 | defn | dullard: long way to go but that will be implemented eventually guaranteed |
| 11:10 | defn | ,((juxt ++)) |
| 11:10 | clojurebot | java.lang.Exception: Unable to resolve symbol: ++ in this context |
| 11:10 | defn | ,((juxt + +)) |
| 11:10 | clojurebot | [0 0] |
| 11:10 | defn | heh, interesting |
| 11:10 | defn | ,((juxt + -)) |
| 11:10 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args passed to: core$- |
| 11:10 | Raynes | Yay! Examples. |
| 11:11 | Raynes | ((juxt identity identity) 0) |
| 11:11 | Raynes | ,((juxt identity identity) 0) |
| 11:11 | clojurebot | [0 0] |
| 11:13 | defn | Raynes: :) |
| 11:14 | dullard | defn: here's the screenie: http://ScrnSht.com/qjnpec |
| 11:14 | cp2 | ew |
| 11:15 | cp2 | renders fine without that in chrome |
| 11:15 | defn | it's because they're links, technically |
| 11:15 | defn | your browser is treating those way too literally :) |
| 11:18 | Raynes | $((juxt identity identity) 0) |
| 11:18 | sexpbot | [0 0] |
| 11:18 | Raynes | Yay! |
| 11:19 | Raynes | defn: Also, my Firefox is rendering it the same way his is. |
| 11:19 | chouser | all carefully sandboxed, right? |
| 11:19 | chouser | $(System/exit 42) |
| 11:19 | sexpbot | DENIED! |
| 11:20 | Raynes | chouser: It should be sandboxed really well. For now, you can't even use the . special form. |
| 11:20 | Chousuke | chouser: hm, looking at the new MEAP... You have examples about binding references to lazy sequences, and state that eg. (defn mr3 [s rf mf] (let [x (reduce rf (map mf s))] x)) is not safe, but isn't that outdated? Didn't the locals clearing optimisation solve that problem? :/ |
| 11:20 | Raynes | Feel free to try to break it in ways that wont damage my system. It can only help clj-sandbox. :> |
| 11:21 | chouser | $(clojure.lang.RT/cons 1 nil) |
| 11:21 | sexpbot | DENIED! |
| 11:21 | chouser | $(println ".") |
| 11:21 | sexpbot | . |
| 11:22 | kzar | $(println "$(println \o)") |
| 11:22 | sexpbot | Unsupported escape character: \o |
| 11:23 | kzar | $(println "$(println \b)") |
| 11:23 | sexpbot | $(println ) |
| 11:23 | kzar | heh damn |
| 11:25 | companion_cube | $(let [w (fn [x] (x x))] (w w)) |
| 11:25 | sexpbot | null |
| 11:25 | companion_cube | hello there |
| 11:26 | Raynes | It said null because it threw a stackoverflow with no message. :p |
| 11:28 | companion_cube | it was what i expected it to do :) |
| 11:29 | Drakeson | it seems that c.c.lazy-xml is broken (uses reify, has not been updated) |
| 11:30 | esj | oooh ! Fresh Joy of Clojure :) |
| 11:30 | esj | huzzah |
| 11:30 | chouser | Drakeson: hm, seems likely. :-/ |
| 11:31 | chouser | Chousuke: I'll double check those examples. |
| 11:32 | zakwilson | I'm having an issue in that calling set is slow. Is there a well-known faster means of getting the unique elements in a sequence? |
| 11:33 | Chousuke | chouser: I suppose you might need to mention the optimisation in 1.2 a bit earlier, at least. |
| 11:33 | Drakeson | zakwilson: can your sequence be sorted? |
| 11:34 | zakwilson | Drakeson: yes. |
| 11:34 | Chousuke | chouser: oh wait, it seems you do. duh. :P |
| 11:35 | Drakeson | zakwilson: then you can get the unique elements with O(n) |
| 11:35 | Chousuke | chouser: I was kind of under the impression that this was fixed in 1.1 already but I suppose I'm wrong :/ |
| 11:36 | Drakeson | zakwilson: you know how to do that, right? |
| 11:36 | zakwilson | Drakeson: How to sort it, or how to find the unique elements? |
| 11:37 | Drakeson | how to find the unique elements in a sorted seq |
| 11:38 | zakwilson | Off the top of my head, no, but there seems to be a lot of example code on Google. |
| 11:39 | noidi | Drakeson, maybe just stick them in all in a set? |
| 11:39 | zakwilson | I think I see how to get started on this now. Thanks, Drakeson. |
| 11:39 | triyo | I have an API spread over several clj files. I wish to simplify the client API. How should I simplify the client API so that client can require less "imports/uses"? |
| 11:39 | noidi | or maybe you could just use a set in the first place |
| 11:40 | zakwilson | noidi: are you responding to his answer to my question? |
| 11:40 | Drakeson | zakwilson: it is trivial, go through the seq, if not= current-element (first unique-element) then conj unique-elements current-element |
| 11:40 | triyo | I've seen strategy before where guys creat a main clj file that calls all other lower-lever APIs |
| 11:41 | Chousuke | triyo: you might want to rethink the organisation of your APIs |
| 11:41 | zakwilson | I assumed somethnig along those lines. I think that should be worth a substantial speedup. |
| 11:41 | Drakeson | triyo: is it your api? if you cannot change the API, aggressively use immigrate |
| 11:42 | Chousuke | triyo: I think one namespace should ideally be enough to solve one particular problem. Stuffing everything into one super-namespace is not very nice either :/ |
| 11:42 | noidi | zakwilson, oops, apparently yes :) |
| 11:42 | triyo | Drakeson: I can change as its still in the early dev stage. |
| 11:43 | triyo | Chousuke: thinking about it now, my API does have good logical separation and was checking to see what might the response on the "super-namespace" be. :) |
| 11:45 | Drakeson | triyo: (as a library user :p) I would suggest go for fewer namespaces, unless some part is large and not always needed. |
| 11:46 | Chousuke | if some two namespaces end up being really small you might consider "denormalisation" :P |
| 11:46 | Drakeson | admittedly though, having more separation might help with development |
| 11:47 | triyo | hehe, sure "denormalisation" sounds like an appropriate term here. ;) |
| 11:52 | kzar | ,(println "$(println /b") |
| 11:52 | clojurebot | $(println /b |
| 11:52 | sexpbot | Invalid token: /b |
| 11:59 | kzar | ok last try |
| 11:59 | kzar | $(println ",(println (str \$ \( \p \r \i \n \t \l \n \space \( \s \t \r \space \, \( \p \r \i \n \t \l \n \space \( \s \t \r \space \y \o \! \) \) \)))") |
| 11:59 | sexpbot | Unsupported escape character: \$ |
| 12:22 | technomancy | Drakeson: good idea |
| 13:03 | technomancy | _ato: what's no-db all about? |
| 13:10 | erikcw1 | I'm trying to find the Clojure equivalent to the Python "in" keyword. Basically I want to do the equivalent of "ABC" in "xxxABCxxx" (ie True if string ABC is in string xxxABCxxx) |
| 13:10 | erikcw1 | I looked at contains?, but it doesn't seem to be the fit |
| 13:11 | The-Kenny | erikcw1: just use .contains from java.lang.String |
| 13:11 | The-Kenny | ,(.contains "foobar" "foo") |
| 13:11 | clojurebot | true |
| 13:11 | The-Kenny | ,(.contains "foobar" "fooa") |
| 13:11 | clojurebot | false |
| 13:12 | dcnstrct | there are regular expressions built into clojure also.. whatever floats your boat. |
| 13:12 | erikcw1 | The-Kenny: I was just looking at the wrong contains... :-) |
| 13:13 | kzar | Inside a proxy how do I set the constructor? |
| 13:18 | chouser | kzar: you don't. instead, put your 'proxy' form inside a function that will act as a ctor or factory. |
| 13:20 | kzar | chouser: I don't completely understand, say for example I'm trying to call addMouseListener from within the constructor of MyPanel how could I do that? I'm trying to worth through this Java tutorial to get the hang of Clojure - Java workings http://java.sun.com/docs/books/tutorial/uiswing/painting/step3.html |
| 13:20 | kzar | work* |
| 13:20 | chouser | It does require thinking about things in a somewhat different way. |
| 13:20 | chouser | why does MyPanel have to be a class? |
| 13:21 | chouser | or, why do you need to call addMouseListener from its ctor? |
| 13:21 | chouser | why not from some function that accomplished both things (creating a MyPanel or equiv, and also calling addMouseListener)? |
| 13:22 | kzar | chouser: Well MyPanel is passed to the JFrame I make later so I think it has to be made that way. I'm trying to call the addMouseListener from the constructor of MyPanel yea |
| 13:23 | kzar | chouser: I thought maybe the call to addMouseListener had to be inside the creator for it to add the hook to the JPanel object. |
| 13:25 | chouser | I think the add*Listeners can be called anywhere as long as the target and object are right. |
| 13:27 | kzar | chouser: OK thanks I'll give it a go |
| 13:50 | Drakeson | is there an idiomatic way of saying: (loop [coll coll result result] (if (empty? coll) result (recur (rest coll) (f (first coll) result)))) |
| 13:51 | Chousuke | reduce? |
| 13:51 | Chousuke | it has a different arg order though |
| 13:51 | Chousuke | so you need to adapt a bit |
| 13:52 | Chousuke | ,(reduce (fn [a b] (/ b a)) [1 2 3 4 5])) |
| 13:52 | clojurebot | 15/8 |
| 13:53 | Chousuke | ,(reduce / [1 2 3 4 5])) |
| 13:53 | clojurebot | 1/120 |
| 13:54 | kzar | I can't figure out how to call addMouseListener properly, what's wrong with this? (. java.awt.Component.addMouseListener mouse) |
| 13:54 | kzar | (I set mouse earlier) |
| 13:54 | Chousuke | mouse is probably not a method of j.a.c.addMouseListener :) |
| 13:54 | carkh | (.addMouseListenter myFrame the-listener-instance) |
| 13:55 | Chousuke | don't use plain dot notation |
| 13:55 | kzar | oh so it's a method of the frame? |
| 13:55 | carkh | kzar yes, of any component i think |
| 13:55 | kzar | carkh: Oh gotya |
| 13:55 | kzar | so a frame is a type of component |
| 13:55 | carkh | right |
| 13:56 | sexpbot | programble: You have 2 new messages. Type $getmessages to see them. |
| 14:08 | kzar | What's the hotkey to kill a Clojure thread in Emacs again? |
| 14:10 | Drakeson | C-c C-b ? |
| 14:10 | Drakeson | that interrupts, though. |
| 14:10 | kzar | Drakeson: Did the trick thanks |
| 14:12 | Drakeson | Chousuke: thanks. how embarrassing! |
| 14:12 | kzar | sweet thanks guys I've got my red square moving to where I click |
| 14:23 | erikcw1 | Does clojure have a function to produce a random number that falls in a range -- something like (rand-range 5 30) to get a random number between 5 and 30? |
| 14:24 | The-Kenny | rand-int |
| 14:24 | The-Kenny | ,(doc rand) |
| 14:24 | clojurebot | "([] [n]); Returns a random floating point number between 0 (inclusive) and n (default 1) (exclusive)." |
| 14:24 | The-Kenny | ,(doc rand-int) |
| 14:24 | clojurebot | "([n]); Returns a random integer between 0 (inclusive) and n (exclusive)." |
| 14:25 | erikcw1 | The-Kenny -- but I want the starting point to be 5, not 0 |
| 14:26 | StartsWithK | (+ 5 (rand-int n)) |
| 14:26 | The-Kenny | ,(+ 5 (rand-int 30)) |
| 14:26 | clojurebot | 24 |
| 14:27 | The-Kenny | :) |
| 14:27 | erikcw1 | That would return between 5 and 35 |
| 14:27 | carkh | (defn rand-range [start end] (+ start (rand-int (- end start)))) |
| 14:27 | carkh | or something close to that |
| 14:27 | StartsWithK | (+ 5 (rand-int (- n 5)) |
| 14:28 | erikcw1 | ok -- that's what I was thinking -- just was wondering if it was somewhere in the standard lib or in contrib |
| 14:28 | erikcw1 | thanks! |
| 14:40 | Hali_303 | hi! many times I'd like to test for a non-empty string in a cond function. what's the easiest way to do that? I mean I've found no not-empty? or not-nil? functions.. |
| 14:43 | hiredman | ,(empty? "foo") |
| 14:43 | clojurebot | false |
| 14:43 | hiredman | ,((comp not empty?) "foo") |
| 14:43 | clojurebot | true |
| 14:45 | tomoj | no need for a not-nil function |
| 14:45 | tomoj | well, unless false is a possible value |
| 14:50 | chouser | ,(seq "") |
| 14:50 | clojurebot | nil |
| 14:53 | Hali_303 | sorry guys I don't really get this. I know about function composition and that I can do (not (empty? astring)). I'm just asking why there is no shorthand for such a seemingly common use case |
| 14:53 | carkh | (.isEmpty "") |
| 14:54 | carkh | ,(.isEmpty "") |
| 14:54 | clojurebot | true |
| 14:54 | TakeV | Could also make a function or macro. |
| 14:54 | Hali_303 | carkh: the problem is, that this string comes from the web and it may be "" or nil, and the test should return false in both cases |
| 14:54 | carkh | oh sorry you want a "not-empty" |
| 14:55 | carkh | i have written a null-string? predicat just for that |
| 14:55 | carkh | that's like 2 lines =P |
| 14:55 | Hali_303 | yeah I'm thinking about creating a (not-empty? I just thought that there is some way I don't know of |
| 14:56 | carkh | then you need his friends, safe-parse-int and safe-parse-decimal |
| 14:56 | Hali_303 | I like to use built in stuff, if possible |
| 14:56 | carkh | well clojure is a general purpose language, at some point you'll have to write your own functions =P |
| 14:57 | Hali_303 | what a shame :D |
| 14:57 | carkh | hehe |
| 14:57 | Jevgeni | hi, I have a vector [1 4 5 5 10 12]. What should I use if I want to use "map" and create another vector, but to get access to the left and the right of the vector. For example, if I am processing the 3 element in the row, then I want to perform some operation on the left parts [1 4] and on the right part [5 10 12]. In Java I would use simple for and access the array before i and after i.... |
| 14:57 | Jevgeni | ...What is the idiomatic way of doing the same in Clojure? |
| 14:59 | Borkdude | Class clojure.lang.Reflector can not access a member of class Barbara with modifiers "public static" |
| 14:59 | Borkdude | |
| 14:59 | Borkdude | why not? |
| 14:59 | carkh | Jevgeni: you need the full left and right parts ? or just the value of the first item on each side? |
| 14:59 | carkh | maybe have a look at zippers |
| 15:00 | Jevgeni | carkh, full parts |
| 15:00 | Jevgeni | okay, I've have a look on zipper.. thanks |
| 15:03 | hoeck | Jevgeni: or use map + range |
| 15:03 | technomancy | (map (fn [p x n] (println p x n)) v (rest v) (rest (rest v))) |
| 15:04 | technomancy | alternatively use indexed from seq-utils |
| 15:04 | hoeck | (map (fn [i] ... (nth v (- i 2)) ... ) (range (count v))) |
| 15:05 | technomancy | (map (fn [[i x]] (println (v (dec i)) x (v (inc i)))) (indexed v)) |
| 15:07 | Chousuke | Jevgeni: split the thing into two subvecs and map over them separately |
| 15:07 | Jevgeni | technomancy, hoeck okay, I'm checking this too.. |
| 15:08 | Chousuke | (doc subvec) |
| 15:08 | clojurebot | "([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done." |
| 15:08 | Jevgeni | Chousuke: I have to do it for every element in the vector |
| 15:08 | technomancy | if you need access to any part of the vector from the mapper fn then indexed is probably better |
| 15:09 | Chousuke | hm |
| 15:09 | Chousuke | I suppose I misunderstood your question |
| 15:11 | carkh | clojurebot: paste? |
| 15:11 | clojurebot | lisppaste8, url |
| 15:11 | carkh | ! |
| 15:11 | hiredman | lisppaste8 has been broken for sometime |
| 15:12 | hiredman | someone needs to +v it |
| 15:12 | carkh | Jevgeni: check this http://gist.github.com/362235 |
| 15:13 | Jevgeni | carkh: yes, this is exactly what I am looking for! Thanks. Is is the idiomatic way of writing such things? |
| 15:15 | carkh | i don't know if that's idiomatic =/ |
| 15:15 | carkh | i guess it is |
| 15:16 | Borkdude | If I have a .class file on my classpath and I (import) it, but make changes to the class file, will Clojure see it? |
| 15:16 | Borkdude | It seems like it doesn't to me |
| 15:17 | Chousuke | Borkdude: no. |
| 15:17 | Chousuke | Borkdude: you need to restart the JVM |
| 15:17 | Borkdude | Chousuke, this means restart swank-clojure-project probably |
| 15:17 | Borkdude | in my case |
| 15:18 | anars | on windows I'm invoking my lein.bat to perform the 'uberjar' task for some project I've made. but it keeps telling me "Wrong number of arguments to task uberjar". what am I doing wrong? I've got vimclojure and nailgun running properly if that's any help. |
| 15:18 | Chousuke | Borkdude: maybe |
| 15:18 | Chousuke | Borkdude: never used that, so... |
| 15:18 | Borkdude | Chousuke, what do you use for project mngmt |
| 15:18 | Chousuke | Borkdude: just plain emacs :P |
| 15:18 | technomancy | Borkdude: M-x restart-inferior-lisp |
| 15:18 | Chousuke | and git |
| 15:18 | Chousuke | and emacs to manage git ;P |
| 15:19 | Borkdude | technomancy: mine doesn't have that... |
| 15:19 | Chousuke | Magit is great, and any emacs-using git person should give it a try |
| 15:20 | Chousuke | though I would prefer egg if it were actively developed :/ |
| 15:22 | Borkdude | technomancy: ah, slime-restart-... |
| 15:22 | Borkdude | tnx |
| 15:22 | Borkdude | and now I have one issue left: |
| 15:22 | Borkdude | Class clojure.lang.Reflector can not access a member of class Barbara with modifiers "public static" |
| 15:22 | Borkdude | |
| 15:22 | Borkdude | why is this? |
| 15:23 | hiredman | maybe you are trying to access a static member as an instance member |
| 15:23 | hiredman | I have not seen that exception before so it is hard to tell without more detail |
| 15:23 | Borkdude | hiredman: I'm doing Barbara/foo |
| 15:24 | hiredman | and foo is a static member? |
| 15:24 | Borkdude | hiredman: public static String foo = "Foo!"; |
| 15:25 | Chousuke | does class Barbara have a package? |
| 15:25 | Borkdude | no |
| 15:25 | Chousuke | make it have one |
| 15:25 | Chousuke | that can cause all kinds of weird errors |
| 15:25 | Borkdude | will try |
| 15:25 | Chousuke | reflector failure on default-package classes would not surprise me in the least :P |
| 15:25 | hiredman | is Barbara public? |
| 15:29 | Borkdude | hiredman, I now put "package foo;" at the top |
| 15:29 | hiredman | Borkdude: and is barbara public? |
| 15:30 | Borkdude | yes I made it now, just to be sure |
| 15:30 | Borkdude | I didn't explicitly say that before, but then it had no problem 'importing' it |
| 15:31 | Borkdude | but how do I import it now: (import '(foo Barbara))? |
| 15:31 | hiredman | sure |
| 15:32 | Borkdude | foo.Barbara |
| 15:32 | Borkdude | [Thrown class java.lang.ClassNotFoundException] |
| 15:32 | Borkdude | |
| 15:32 | Borkdude | :-s |
| 15:33 | hiredman | so directory structures and classpaths all need to be in alignment with packages |
| 15:33 | hiredman | foo/Barbara.class |
| 15:33 | Borkdude | ah heck, that's true |
| 15:33 | hiredman | with whatever directory foo is in on the classpath |
| 15:34 | Borkdude | it works now, tnx |
| 15:34 | moshisushi | anyone using enclojure? |
| 15:39 | Raynes | Getting there. |
| 15:45 | anars | sorry I'm repeating my question - just giving it one last shot: on windows I'm invoking my lein.bat to perform the 'uberjar' task for some project I've made. but it keeps telling me "Wrong number of arguments to task uberjar". what am I doing wrong? I've got vimclojure and nailgun running properly if that's any help. |
| 15:46 | Chousuke | did you try running lein help uberjar? |
| 15:46 | Borkdude | I didn't even get lein running on windows |
| 15:46 | Borkdude | that's why I switched to linux ;-) |
| 15:47 | Borkdude | I got a "not implemented here" syndrome msg |
| 15:47 | anars | Chousuke: it doesn't give me any syntax or argument specifications. a friend of mine tried it on mac os x.. same cmd and all, and it worked fine. |
| 15:47 | anars | Borkdude: yeah, I get that too if I do a lein self-install |
| 15:48 | anars | but I manually installed the needed jars |
| 15:48 | anars | lein deps works fine, e.g. |
| 15:48 | Chousuke | hm, looks like it doesn't. |
| 15:48 | dgreensp | anars: what's your bat file look like? |
| 15:49 | anars | dgreensp: here http://pastebin.com/KP4jcVQT |
| 15:49 | anars | basically, I specify the leiningen and clojure jars explicitly. |
| 15:50 | anars | the paths, that is :-) |
| 15:51 | dgreensp | well, this is beyond my bat-file fu, but it looks like you know to use semicolons on windows and stuff; "wrong number of arguments" sounds like it could be something like that, or your quoting or something |
| 15:52 | dgreensp | i.e. arguments to the java command |
| 15:56 | anars | dgreensp: that could be. even when running 'lein repl' inside a dir with a project.clj and another clj file with a few functions won't work. it fires up the repl fine, but it does not include my clj file. |
| 15:58 | anars | hmm, it seems like my leiningen standalone jar is of the wrong version |
| 16:06 | seths | I'm trying to debug a labrepl problem, apparently deftype is changing faster than its documentation on Assembla? |
| 16:06 | seths | ,(deftype Foo [bar] :as this Object (toString [] "woah")) |
| 16:06 | clojurebot | DENIED |
| 16:06 | seths | er |
| 16:07 | seths | well, it pukes saying ":as unsupported" |
| 16:07 | seths | ,(deftype Foo [bar] Object (toString [this] "woah")) |
| 16:07 | clojurebot | DENIED |
| 16:07 | mattrepl | I recall seeing examples in channel, but have forgotten the latest syntax for key destructuring bind in a let, is it documented anywhere? |
| 16:07 | seths | but that works (outside of irc :-) |
| 16:09 | seths | mattrepl: I seem to remember seeing "strs" involved in destructuring lately on Twitter |
| 16:10 | seths | haven't found it yet tho. And searching for "destruct" is somewhat scary |
| 16:10 | triyo | Hmm, how do I make a reference to macro available in one namespace from another namespace. So I want a macro to be aliest from namespase1 in namespace2. |
| 16:10 | anars | I got it working! I managed to compile the 1.1.0 leiningen from a git clone, and put my leiningen jar path to the classes-folder containing the 1.1.0 bytecompiled leiningen. |
| 16:10 | seths | ,(let [{:strs [a b]} {"a" 5 "b" 6}] (+ a b)) |
| 16:10 | clojurebot | 11 |
| 16:11 | mattrepl | well that looks nice |
| 16:11 | seths | mattrepl: courtesy of @cleotd |
| 16:11 | mattrepl | ,(let [{:keys [a b]} {:a 5 :b 6}] (+ a b)) |
| 16:11 | clojurebot | 11 |
| 16:12 | StartsWithK | ,(let [{:syms [a b]} {'a 1 'b 2}] [a b]) |
| 16:12 | clojurebot | [1 2] |
| 16:12 | mattrepl | ok, I was doing it right |
| 16:14 | Raynes | That's the last time I have to restart that damned bot. |
| 16:14 | triyo | i got it. |
| 16:14 | triyo | ,(def #^{:macro true} case #'cond) |
| 16:14 | clojurebot | DENIED |
| 16:15 | triyo | hehe well thats how :) |
| 16:15 | Raynes | If I have to look at another line of code in the next 5 hours, I'll murder a small child. |
| 16:15 | Raynes | :| |
| 16:17 | StartsWithK | ma |
| 16:17 | seths | Raynes: sounds like a good time for lots of yardwork! |
| 16:17 | Raynes | seths: Indeed, sir. Indeed. |
| 16:22 | Borkdude | seths: who are you on Twitter? I run @cleotd |
| 16:27 | seths | Borkdude: @foogoof |
| 16:28 | seths | Borkdude: thanks for providing a neat service |
| 16:28 | seths | I just followed the account |
| 16:28 | seths | speaking of yardwork... |
| 16:29 | Borkdude | seths: tnx... too late |
| 16:48 | naeu | does anyone know if there's currently a meap discount on the joy of clojure? |
| 16:48 | Borkdude | naeu, try the discount code clojure35 |
| 16:49 | Borkdude | it gives you 35% off on both The Joy and In Action |
| 16:49 | naeu | Borkdude: nice, that worked - thanks |
| 16:49 | Borkdude | np |
| 16:50 | bitti | online 35% joy? doesn't sound good :/ |
| 16:51 | Borkdude | you mean 35% off the joy? |
| 16:53 | triyo | ~joy |
| 16:53 | clojurebot | I don't understand. |
| 16:53 | triyo | ~joyofclojure |
| 16:53 | clojurebot | No entiendo |
| 16:54 | triyo | oh well :) |
| 16:58 | bitti | would be cool when clojurebot could learn from conversation |
| 16:58 | The-Kenny | clojurebot: joyofclojure is http://joyofclojure.com/ |
| 16:58 | clojurebot | In Ordnung |
| 16:58 | The-Kenny | ~joyofclojure |
| 16:58 | clojurebot | joyofclojure is http://joyofclojure.com/ |
| 16:59 | triyo | guess bot would not make much sense if that was the case |
| 16:59 | bitti | clojurebot spricht deutsch? |
| 16:59 | bitti | cool |
| 16:59 | The-Kenny | bitti: And italien. But only one or two sentences. |
| 16:59 | The-Kenny | *italian |
| 16:59 | naeu | does anyone know why clojure doesn't have a condition system? |
| 16:59 | triyo | ~haskell |
| 16:59 | clojurebot | haskell is Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you don't compute. |
| 17:00 | The-Kenny | bitti: If you're interested: There's a small-but-growing german clojure-channel at #clojure.de </advertising> |
| 17:01 | bitti | aha |
| 17:02 | qbg | I'm trying to reify an ActionListener, but I get "Can't define method not in interfaces: actionPerformed", which makes no sense considering that the method is in the interface... |
| 17:02 | Borkdude | hmm no #clojure.nl unfortunately |
| 17:03 | Borkdude | qbg, maybe you should use proxy? |
| 17:03 | qbg | Borkdude: proxy works, but this should also work |
| 17:04 | carkh | qbg do you have the same number of parameters as the actionPerformed from the interface ? |
| 17:04 | qbg | Yes, one argument. |
| 17:04 | carkh | there was a very recent change to reify |
| 17:04 | technomancy | naeu: there are a couple in contrib |
| 17:04 | carkh | o think that now you have to put the self parameter as well |
| 17:04 | qbg | I'm pretty sure it was working last week... |
| 17:05 | The-Kenny | Can a experiences java-developer in here tell me if it would be possible to run clojure on a j2me-vm? |
| 17:05 | carkh | you got latest from github maybe ? |
| 17:05 | qbg | carkh: Yep, adding a this parameter works |
| 17:05 | carkh | =) |
| 17:06 | naeu | technomancy: oh, interesting. Do you happen to know if either of them are gaining any traction? |
| 17:07 | technomancy | naeu: not really. they're not that well-known, and java Exceptions are 90% good-enough. |
| 17:07 | carkh | qbg : that's the cost of living on the bleeding edge =P |
| 17:07 | qbg | I don't remember seeing a commit message that mentioned that... |
| 17:07 | naeu | that's a shame. From my understanding the benefits of having are a condition system are when all the libraries are built upon their abstraction |
| 17:08 | technomancy | naeu: well that would involve getting Java folks on board too; not too likely =\ |
| 17:09 | naeu | haha - true for java interop stuff which is probably the majority of clojure code |
| 17:10 | rowth | qbg: http://github.com/richhickey/clojure/commit/ba6cc3bde1a1ea9801b2133748a45f1277166368 |
| 17:11 | rowth | I went through much the same a few days back :) |
| 17:11 | qbg | Ah, the commit was farther back than I typically look... |
| 17:13 | carkh | so how is it now ? proxy = implied this ... all the rest explicit this ? |
| 17:13 | carkh | the rest being gen-calls, deftype, reify |
| 17:13 | carkh | gen-class =/ |
| 17:14 | technomancy | straw poll: I'm actually pretty curious about how many folks in here are still interested in keeping a CL environment running with Clojure. |
| 17:15 | carkh | technomancy: what do you mean ? inside emacs ? |
| 17:15 | Borkdude | CL with Clojure? |
| 17:15 | technomancy | carkh: either way; in slime or just in general |
| 17:16 | carkh | i have a cl application that i need to maintain, but i'm using the lispworks editor for this one |
| 17:16 | Borkdude | technomancy, I don't |
| 17:16 | technomancy | not in the same running instance, just having them both configured at the same time |
| 17:16 | carkh | i do, just not in emacs |
| 17:17 | technomancy | there's a few people on the mailing list that are still using CL, but I get the feeling it's pretty much an edge case |
| 17:17 | carkh | but why are you asking? |
| 17:17 | Chousuke | technomancy: are you going to do something that would break it? :/ |
| 17:18 | Chousuke | I think that would be rude :) |
| 17:18 | technomancy | Chousuke: they already broke it |
| 17:18 | dullard | why not fork slime and make sljme |
| 17:18 | Chousuke | Okay, so "they" are rude :P |
| 17:18 | Chousuke | what's broken with slime anyway? |
| 17:18 | technomancy | Chousuke: I'd be more inclined to fix it if they actually did stable releases instead of just saying "everyone should always use trunk." |
| 17:19 | technomancy | that just strikes me as amateurish |
| 17:19 | technomancy | I'm fuzzy on the details... I have zero interest in CL myself. |
| 17:19 | Chousuke | well, that's fine by me but then they should also commit to keeping trunk stable :P |
| 17:19 | technomancy | dullard: that would make it more difficult to sync up in the future if we got a swank-clojure maintainer who did care about CL |
| 17:19 | technomancy | but it's an option |
| 17:20 | Chousuke | I still don't quite understand the swank protocol very well though :/ |
| 17:20 | Chousuke | it appears not to be documented in any way |
| 17:20 | technomancy | I don't either, and I'm the maintainer. =P |
| 17:20 | technomancy | the current implementation is almost a line-for-line port of the CL version |
| 17:21 | Chousuke | besides some comments in slime.el or someplace which says "here the protocol magic happens" |
| 17:21 | technomancy | very un-idiomatic and difficult to maintain |
| 17:21 | Chousuke | If I were to design a protocol to do something the first thing I would do is document it |
| 17:22 | Chousuke | because I would inevitably forget how it works |
| 17:22 | technomancy | Chousuke: http://twitter.com/jbarnette/status/6469242097 |
| 17:23 | Chousuke | undocumented code is not so bad but to understand a protocol you need to understand the code handling the protocol and then piece it all together :P |
| 17:24 | Chousuke | the thing is, once your code gets complicated enough it basically becomes a protocol :/ |
| 17:24 | Chousuke | if it's not documented by then, you're screwed :P |
| 17:25 | technomancy | hugod has been doing some good work on it recently |
| 17:25 | technomancy | and from the commits it looks like he does understand the protocol =) |
| 17:25 | technomancy | so that's good |
| 17:26 | Chousuke | I think this might be the primary cause of undocumented code |
| 17:26 | Chousuke | "I can still keep this in my head" *fast forward 6 months of development* "..." |
| 17:30 | bitti | I think the primary cause for lacking documentation is, because just hacking is more fun... |
| 17:30 | technomancy | yeah, and nobody's actually using this stuff for real work |
| 17:31 | technomancy | which may explain why they don't care about things like stability and releases |
| 17:31 | bitti | what, slime? |
| 17:32 | technomancy | yeah. half-joking, but unless all the committers work for ITA software, then there's a much lower percentage of slime maintainers that actually use it for work vs swank-clojure |
| 17:42 | Chousuke | hm, I wonder what's wrong with maven now |
| 17:42 | Chousuke | it's failing to build contrib |
| 17:42 | Chousuke | apparently it's not finding clojure :P |
| 17:42 | Chousuke | even though I have no fewer than six versions installed in my local meven repository |
| 17:42 | Chousuke | maven* |
| 17:53 | anars | running 'lein nailgun' for a new project gives me this: IllegalArgumentException: No matching field found: getCommandLine ... for ant |
| 17:54 | anars | class org.apache.tools.ant.taskdefs.Java to be precise. |
| 17:55 | anars | and also, when I'm doing a 'lein compile' it just tells me 'all :namespaces already compiled' and my classes/ folder is empty. |
| 17:55 | anars | this is on windows, mind you. |
| 17:59 | technomancy | anars: you need to list the namespaces you want to compile in project.clj |
| 17:59 | technomancy | are you compiling for purposes of java interop? |
| 18:01 | technomancy | anars: the getCommandLine problem might be an issue with an old version of ant; could you try upgrading to the latest git version of leiningen and doing a clean+deps? |
| 18:01 | chouser | lazy-xml should be fixed now |
| 18:02 | Borkdude | anars, I had this problem too |
| 18:02 | chouser | also, the grass in my yard is now neatly trimmed, though I assume there are even fewer people here who care about that than lazy-xml |
| 18:02 | Borkdude | but my error was that the ns and the filename didn't correspond |
| 18:03 | Borkdude | :-s ... |
| 18:03 | Borkdude | or maybe just the name of the ns in the project.clj and in the src clj |
| 18:16 | anars | back! thanks for the responses, technomancy and Borkdude.. I'll try it and get back to you |
| 18:23 | anars | technomancy: btw, according to http://github.com/technomancy/leiningen/raw/stable/bin/lein.bat it's indicated that there's supposed to be a leiningen-1.1.0.jar at your website, but I can't seem to find it. is it the leiningen.jar? |
| 18:24 | seths | chouser: did the 1.2 branch change such that the ":as this" option for deftype has become a mandatory initial argument to functions defined by that type? recently? |
| 18:25 | seths | given this protocol: (defprotocol Plane (fly [p to])) |
| 18:25 | seths | this doesn't work: (deftype Glider [] :as this Plane (fly [to] (str "slowly glided to " to))) |
| 18:26 | seths | but this does: (deftype Glider [] Plane (fly [_ to] (str "slowly glided to " to))) |
| 18:26 | technomancy | anars: check the .sh version; since 1.1.0 it's been hosted at github |
| 18:28 | anars | ahh right - thanks |
| 18:28 | hoeck | seths: yes, just check the commit messages :) |
| 18:29 | seths | hoeck: that's a little lower level than I wanted to go to debug a labrepl problem |
| 18:29 | seths | I did check assembla though |
| 18:30 | seths | oh, *shame*, the docstring has been updated. sorry. |
| 18:30 | hoeck | yeah, thats the downside of using the master |
| 18:31 | seths | well, the mandatory this parameter is very pythonish |
| 18:31 | seths | which is a strong not-complement in my worldview |
| 18:42 | technomancy | I'll place a copy of 1.1.0 in repo.hagelb.org anyway if it's causing confusion |
| 18:43 | anars | technomancy: I dep'ed HEAD of the leiningen repos and it's working now. thanks again :-) |
| 18:53 | technomancy | cools |
| 19:45 | chouser | extending a protocol to a concrete class is a lot like implementation inheritence, isn't it? |
| 19:49 | tomoj | what's the point of :dependencies vs :dev-dependencies? |
| 19:58 | hamza | AFAIK :dependencies are placed in the uberjar whereas :dev-dependencies are not. |
| 19:59 | tomoj | that would make sense |
| 20:00 | tomoj | but doesn't seem to be the case |
| 20:02 | hamza | hmm, then thats should be a bug, quote from technomancy " :dev-dependencies key for things that shouldn't be pulled in at production or included in the standalone jar; the syntax is the same." |
| 21:13 | _ato | technomancy: no-db is just something I've been slowly hacking away at now and then when I have some time, it's nowhere near complete. I realised Clojars doesn't actually need a database and it'd much better if you could just point it at any old maven repo on the filesystem and start it up. Replication would just be rsync. It will also do away with the dependencies on maven and nailgun, which were causing their own set of problems |
| 21:49 | defn | technomancy: correct me if im wrong, but i added your repo to my emacs for package.el stuff, but i dont notice any updated versions |
| 21:58 | _ato | Apr 11 10:04:05 haproxy[21019]: 192.102.239.53:38538 [11/Apr/2010:10:02:29.162] trove trove/stick-8080 0/0/0/165/96485 200 2355214 - - CD-- 114/114/114/111/ |
| 21:58 | _ato | gah |
| 21:58 | _ato | wrong channel |
| 21:58 | _ato | ;) |
| 22:04 | technomancy | defn: I haven't released anything since I did my work on package.el =) |
| 22:04 | technomancy | tomoj: yeah, you need to run clean before uberjar or they sneak in |
| 22:05 | technomancy | it's an open issue; there's a discussion on the mailing list of the best way to fix it |
| 22:05 | technomancy | hasn't proven to be a big problem so far |
| 22:09 | tomoj | technomancy: ah, I see |
| 22:09 | tomoj | I'm fine with cleaning first, didn't know that would work |
| 22:09 | technomancy | tomoj: it's more about transitive deps vs deps only used for that project |
| 22:10 | technomancy | so if you want to hack your project, you want swank as a dep. but projects that depend on your project don't need to pull it in. |
| 22:17 | tomoj | I see |
| 22:18 | tomoj | that makes more sense |
| 22:19 | technomancy | I think the uberjar thing is listed under "known issues" |
| 22:19 | technomancy | but yeah, we should fix that |