2009-07-08
| 00:27 | technomancy | who wants to try out my dependency management project? http://github.com/technomancy/corkscrew/tree/master |
| 02:30 | doubleagent | Is this the correct channel for 'support' questions? |
| 02:33 | slashus2 | What question do you have? |
| 02:35 | doubleagent | Fairly simple. How do I force a Ratio or Double to be represented as an Integer/Long/BigNum? |
| 02:36 | slashus2 | ,(double 5/4) |
| 02:36 | slashus2 | (bigint 5/4) |
| 02:37 | slashus2 | doubleagent: That what you mean? |
| 02:39 | doubleagent | slashus2, thanks - I see those forms in the api now too. :) |
| 02:39 | slashus2 | doubleagent: This is dex by the way. |
| 02:39 | slashus2 | :-P |
| 02:40 | doubleagent | :) |
| 02:55 | slashus2 | doubleagent: Rich Hickey hangs out in here often too. |
| 02:56 | doubleagent | cool. |
| 05:49 | tsdh | Hi. What do I have to do to get a repl when invoking "java -jar my-stuff.jar"? |
| 05:50 | tsdh | This jar contains all clojure class files and my code. In my ant jar target there's <exclude name="**/Test*.java"/>. |
| 05:50 | tsdh | Ups, sorry. I've meant: <attribute name="Main-Class" value="clojure.lang.Repl"/> |
| 05:52 | tsdh | But executing the jar errors: http://paste.lisp.org/display/83222 |
| 05:59 | tsdh | Hm. I replaced the value of Main-Class with "clojure.main", but I get the same exceptions. |
| 05:59 | hoeck | tsdh: and you have set a classpath? |
| 06:00 | hoeck | tsdh: as in the clojure build.xml? |
| 06:00 | tsdh | It is ".". Yes, exactly the same. |
| 06:00 | asbjxrn | Is the line reader part of the jar? |
| 06:00 | asbjxrn | Uh... |
| 06:02 | tsdh | asbjxrn: It's in java, so it should be there anyway, right? |
| 06:03 | tsdh | I annotated my previous paste with the complete build.xml. |
| 06:04 | asbjxrn | Yes I got confused there, thought it was that jline.ConsoleRunner lib... Don't know how I managed to misread that badly. |
| 06:06 | tsdh | Oh, in the paste of the exception backtrace I omitted the last line. "Could not find the main class: clojure.main. Program will exit." |
| 06:08 | tsdh | But looking at the jar's contents, there is clojure/main.class... |
| 06:09 | hoeck | tsdh: so you are compiling clojure into this jar, and additionally your own (compiled) namespace? |
| 06:10 | tsdh | Yes. |
| 06:11 | hoeck | what about only compiling your namespace and adding a precompiled clojure.jar to your own jarfile? |
| 06:12 | tsdh | I tried that first, but it didn't work, too... |
| 06:12 | hoeck | too bad, mhh, do you have a build-xml for that latter case? |
| 06:13 | tsdh | sure, I'll annotate my paste. |
| 06:15 | tsdh | done |
| 06:16 | tsdh | Ups, there's a small error in it. The jar target depends on unjar, and it should depend on compile. |
| 06:17 | tsdh | I fixed that and annotatet the past with the error I get with this jar. |
| 06:27 | tsdh | Hm, when I omit the (unpacked) jar in my jar and call it with "java -cp ".:clojure.jar:myjar.jar" clojure.main, it works... |
| 06:35 | hoeck | packaging a jar inside a jar and then setting the manifests classpath attribute is not allowed - thats new to me |
| 06:35 | hoeck | tsdh: so I'm going tol try the other approach : ) |
| 06:55 | hoeck | tsdh: its the version.properties file in the clojure subfolder that is missing from the jar |
| 06:57 | hoeck | tsdh: clojure loads it at class-initialization-time |
| 06:58 | ChrisPS | Using emacs slime, can I select a function-name and jump to its definition in clojure-mode? |
| 06:59 | hoeck | tsdh: adding <include name="**/*.properties"/> to the unjar pattern and <fileset dir="${build}" includes="**/*.properties"/> to the create-jar pattern works |
| 07:02 | hoeck | ChrisPS: the slime-edit-definition command will do that |
| 07:03 | hoeck | ChrisPS: but it isn't very reliable here (using xemacs, and a not up-to-date clojure-mode/swank/slime) |
| 07:08 | ChrisPS | hoeck: oh, this works perfectly here (!) |
| 07:11 | hoeck | ChrisPS: well, then maybe I'm going to update my setup, but no its lunchtime : ) |
| 07:11 | hoeck | r/no/now |
| 07:48 | hoeck | tsdh: I have annotated your paste with a build.xml that works (at least with my setup) |
| 07:58 | bartj | can someone please help me setup REPL using vimclojure |
| 07:58 | durka42 | bartj: what OS are you on? |
| 07:58 | bartj | durka42: Ubuntu |
| 07:59 | durka42 | ok, do you have vim and clojure and vimclojure installed already |
| 07:59 | tsdh | hoeck: Thanks. |
| 07:59 | bartj | I have got most of it right, except I am unable to understand how to set up LocalLeader, etc. |
| 08:00 | bartj | durka42: yes |
| 08:01 | durka42 | so you should be able to do \sr from within a clojure file to start a repl |
| 08:02 | durka42 | provided you have vimclojure's ng-server running |
| 08:05 | bartj | durka42, yes I have the ng-server running |
| 08:07 | durka42 | but nothing happens when you do \sr? |
| 08:07 | bartj | durka42, no |
| 08:07 | bartj | I don't think I have specified the map properly in my vimrc |
| 08:07 | bartj | can you tell me how it should look like? |
| 08:08 | bartj | I have the foll. lines in my vimrc: |
| 08:08 | bartj | let vimclojure#NailgunClient = "/home/<username>/clojure/vimclojure-2.1.1/ngclient" |
| 08:08 | bartj | let clj_want_gorilla = 1 |
| 08:10 | bartj | can someone help me setting up the REPL in vim (using vimclojure) |
| 08:11 | bartj | I have the ng-server running but, when I type "\sr" in vim the REPL does not start :( |
| 08:11 | bartj | I haven't used maps in vim yet |
| 08:11 | durka42 | i have let g:clj_want_gorilla = 1, not sure if that makes any difference |
| 08:12 | durka42 | do you have a .clj file open in vim? |
| 08:12 | bartj | durka42, yes |
| 08:12 | bartj | durka42, I'll try that |
| 08:13 | bartj | durka42, no luck |
| 08:14 | bartj | also, does vimclojure not have automatic paranthesis closing? |
| 08:15 | durka42 | no it doesn't |
| 08:15 | durka42 | you might find surround.vim and autoclose.vim helpful |
| 08:15 | bartj | both? |
| 08:16 | bartj | durka42, I think my main problem is that I am not able to set "<LocalLeader>" in my .vimrc file |
| 08:20 | durka42 | does it work if you do :call vimclojure#Repl.New() directly? |
| 08:23 | bartj | durka42, it throws me two warnings but yes! it does work!!! |
| 08:24 | bartj | durka42, I am not able to "type" anything though |
| 08:24 | durka42 | in the repl? |
| 08:24 | bartj | durka42, the warnings are - Couldn't execute Nail! /bin/bash: /home/kiran/clojure/vimclojure-2.1.1/ngclient: is a directory |
| 08:25 | durka42 | eh... |
| 08:25 | bartj | durka42, I think this is because, I have this in my .vimrc |
| 08:25 | durka42 | is that a directory? |
| 08:25 | bartj | yes |
| 08:25 | durka42 | you should set that to the executable |
| 08:26 | durka42 | not the directory it is in |
| 08:26 | bartj | durka42, I am on Unbuntu |
| 08:26 | durka42 | if you go into the vimclojure-2.1.1 directory and run ant, you will get an executable called ng in vimclojure-2.1.1 |
| 08:26 | bartj | and I have a ng.exe so, it wouldn't make sense right? |
| 08:27 | durka42 | no, not that one |
| 08:27 | durka42 | there should be a file named ng |
| 08:28 | bartj | there is something called ng-server |
| 08:28 | bartj | in vimclojure-2.1.1/bin directory |
| 08:29 | bartj | my local.properties in the vimclojure directory looks like this: |
| 08:29 | bartj | clojure.jar = /home/username/clojure/clojure/clojure.jar |
| 08:29 | bartj | clojure-contrib.jar = /home/username/clojure/clojure-contrib/clojure-contrib.jar |
| 08:29 | clojurebot | clojure is a language to use if you want to up your game |
| 08:29 | bartj | nailgun-client = ng |
| 08:29 | bartj | vimdir = /home/username/.vim |
| 08:31 | bartj | durak42, are you there? please help |
| 08:32 | bartj | there is a ng.exe |
| 08:38 | bartj | I am on Ubuntu, unable to setup REPL on vimclojure |
| 08:38 | durka42 | sorry, i wasn't paying attention |
| 08:38 | durka42 | first, change the directories in local.properties so they point to your actual clojure and contrib jars |
| 08:38 | bartj | durka42, you are like my only hope now to clojure (seriously) |
| 08:38 | durka42 | then run ant in the vimclojure-2.1.1 directory |
| 08:39 | bartj | yes, did that |
| 08:39 | bartj | running ant throws and error - "java.lang.NoSuchMethodError: clojure.lang.Var.deref()Ljava/lang/Object; " |
| 08:39 | tsdh | When I start a repl with 'java -cp ".:clojure.jar:other.jar" clojure.main' and then try to `use' a namespace from other.jar, I get a "java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)". |
| 08:39 | tsdh | What should that tell me? |
| 08:40 | durka42 | the ant error is interesting... |
| 08:40 | durka42 | is your clojure up to date? |
| 08:41 | tsdh | Well, somehow. When I use my slime repl using the same clojure version, it works |
| 08:41 | bartj | durka42, how do I see the version number? |
| 08:42 | tsdh | Ups, wrong conversation. :-) |
| 08:43 | durka42 | where did you download it from? |
| 08:43 | durka42 | there is a file in clojure/src/clj/clojure/version.properties |
| 08:43 | durka42 | tsdh: try to get a backtrace? |
| 08:45 | tsdh | durka42: How? |
| 08:49 | bartj | where can I get clojure-contrib from? |
| 08:49 | bartj | I have got the latest clojure from here - http://code.google.com/p/clojure/downloads/list |
| 08:49 | Chouser | bartj: clojure and contrib latest are now at github |
| 08:50 | Chouser | bartj: http://github.com/richhickey/ |
| 08:50 | durka42 | tsdh: (.printStackTrace *e) |
| 08:50 | bartj | Chouser: you mean the stable versions? |
| 08:51 | bartj | Chouser: How can I know the version of my clojure? |
| 08:51 | Chouser | bartj: all versions are at github. google code is no longer being updated. |
| 08:51 | Chousuke | bartj: the stable is still 1.0.0 though. |
| 08:52 | Chouser | bartj: if you have at least version 1.0 of clojure, you can type *clojure-version* at the repl |
| 08:54 | bartj | It gives me a "Unable to resolve symbol" |
| 08:54 | Chousuke | then you have some old version :/ |
| 09:00 | bartj | Can someone mention on clojure hosted on googlecode project that it is not the latest! |
| 09:01 | Chouser | there's a small note on http://code.google.com/p/clojure/ |
| 09:01 | rhickey | bartj: http://code.google.com/p/clojure/ says "Note - the latest development is on GitHub and Assembla" |
| 09:02 | Chouser | the featured download there is 1.0.0 which is the latest stable anyway |
| 09:02 | Chouser | latest release |
| 09:02 | Chousuke | is there going to be a bugfix release of 1.0 anytime soon though? |
| 09:03 | Chousuke | Chouser: also, have you noticed that you can use assembla to "connect" two tickets together. maybe that would be useful for the 1.0-bugfix tracking tickets. |
| 09:04 | Chouser | Chousuke: ooh, no I hadn't. |
| 09:04 | bartj | rhickey: thanks! (I missed that, maybe it can be in red or something :) |
| 09:04 | Chousuke | there's an "associations" thingy on the ticket page |
| 09:04 | Chouser | Chousuke: ok thanks. |
| 09:06 | Chousuke | it doesn't seem to like associating things with closed tickets though :/ |
| 09:08 | Chousuke | but it seems you could just create a ticket, then click "associate with new ticket" to create the bugfix tracking ticket as a child of the main entry. |
| 09:10 | AWizzArd | Any windows user here who has installed JDK 6 Update 14? |
| 09:10 | Chouser | yeah, that looks good -- one operation makes a two-way link. |
| 09:22 | bartj | can anyone please tell me how to start REPL in vim using vimclojure? |
| 09:22 | bartj | I donot have the mapping set up properly for "\sr" |
| 09:23 | bartj | durka42: if I type :call vimclojure#Repl.New() in vim I get the following errors |
| 09:23 | clojurebot | vimclojure is state-of-the-art |
| 09:23 | bartj | Couldn't execute Nail! java.lang.NoClassDefFoundError: Could not initialize class de.kotka.vimclojure.nails.Repl at java.lang.Class.forName0(Native Method) a t java.lang.Class.forName(Class.java:169) at com.martiansoftware.nailgun.NGSession.run(Unknown Source |
| 09:24 | bartj | someone please help! |
| 09:29 | bartj | can someone help me setup REPL on vimclojure? |
| 09:29 | clojurebot | http://www.khanacademy.org/ |
| 09:29 | bartj | is anyone here? |
| 09:29 | bartj | or is everyone ignoring me? |
| 09:29 | bartj | test |
| 09:30 | rhickey | bartj: I'm sure if someone knew the answer they'd chime in - I don't |
| 09:30 | Chousuke | bartj: Maybe there are no vimclojure users around :/ |
| 09:30 | Chousuke | but that looks like your classpath isn't properly configured |
| 09:36 | AWizzArd | rhickey: any news about Datalog? And btw, is DL comparable to Jess (rule engine)? |
| 09:38 | rhickey | AWizzArd: there is datalog in contrib, I haven't had as much time for it as I'd like, differs from Jess in being "backward chaining" (although can be bottom-up) vs forward-chaining Rete in Jess |
| 09:38 | rhickey | try it out! |
| 09:40 | AWizzArd | Ah good, it arrived in contrib by now. While Jess is nice it is *by far* too expensive. |
| 09:41 | rhickey | How much is Jess? |
| 09:46 | AWizzArd | rhickey: if you want to fully use it 75k |
| 09:46 | AWizzArd | but an evaluation license for 90 days or so only costs 5k |
| 09:47 | AWizzArd | this is for companies but also for personal use. Only the US government may use it for free, and universities may apply for a free license. |
| 09:47 | asbjxrn | 5k for evaluation!? |
| 09:47 | AWizzArd | yup |
| 09:48 | rhickey | well, there's Drools then |
| 09:48 | AWizzArd | ah no, 2000 for 90 days evaluation (just checked again) |
| 09:50 | AWizzArd | Lisa is unfortunately very clos'ish which would make a translation harder. Not much reusable code. |
| 09:51 | rhickey | http://www.jboss.org/drools/ |
| 09:54 | rhickey | the only problem with Drools, IIRC, was that they weren't great at dynamic facts, i.e. you (I) want to be able to use java.util.Maps (and thus Clojure maps) as facts, and they wanted POJOs with bean properties :( |
| 09:55 | bartj | durka42 are you there? |
| 09:56 | bartj | I get the foll. error - Couldn't execute Nail! java.lang.NoClassDefFoundError: Could not initialize class de.kotka.vimclojure.nails.Repl at java.lang.Class.forName0(Native Method) a t java.lang.Class.forName(Class.java:169) at com.martiansoftware.nailgun.NGSession.run(Unknown Source) |
| 09:56 | bartj | when I do a ":call vimclojure#Repl.New()" in vim |
| 09:56 | bartj | ie. trying to start a REPL on vim |
| 10:05 | AWizzArd | For just general pattern matching that also has pretty declarative rules fnparse is nice. |
| 10:36 | sayyestolife | this question might be bizare (and probably wrong) but, how can clojure be "truely" multithreaded when running on jvm? (is the jvm also multithreaded?) |
| 10:36 | Chouser | yes |
| 10:37 | Chouser | jvm provides access to real OS threads, and Clojure uses them. |
| 10:40 | Chouser | but a perfectly reasonable question. :-) |
| 10:43 | sayyestolife | oh okay, cool :) |
| 10:52 | AWizzArd | Is there a way in JSwat (4.4) to watch some specific variables? The default view shows me everything, but my clojure vars are deeply hidden into class members of arreys of hashtables of arrays of values, and so on. |
| 10:55 | AWizzArd | I can step through my program, which is nice, but don't see why it goes a specific route and how values change. The real values are not practically visible. |
| 12:00 | AWizzArd | Is there in contrib already a text/repl based stepper? |
| 14:06 | dysinger | sup |
| 14:09 | Raynes | Hi. |
| 14:13 | danlarkin | howdy |
| 14:18 | sayyestolife | it seems like the 'cond' in clojure doesn't work quite the same way as the one in c-lisp? |
| 14:20 | hiredman | among many things |
| 14:20 | sayyestolife | well, is there a way of having a similar cond in clojure? |
| 14:21 | sayyestolife | the api doc didn't give me much of a clue of how to use clojures cond |
| 14:21 | hiredman | ,(doc cond) |
| 14:21 | clojurebot | "([& clauses]); Takes a set of test/expr pairs. It evaluates each test one at a time. If a test returns logical true, cond evaluates and returns the value of the corresponding expr and doesn't evaluate any of the other tests or exprs. (cond) returns nil." |
| 14:21 | hiredman | ,(cond (= 1 1) :foo :else :bar) |
| 14:21 | clojurebot | :foo |
| 14:22 | sayyestolife | thanks |
| 14:22 | hiredman | I have not really used cl, but I believe the main difference is you don't wrap tests and expressions in their own set of parens |
| 14:22 | sayyestolife | oh |
| 14:23 | sayyestolife | that was it, thanks! |
| 14:23 | hiredman | so if (= 1 1) is true then the result of the above cond is :foo |
| 14:23 | hiredman | :else is just a convention, you can use anyhing non-nil as the final clause |
| 14:23 | sayyestolife | ok |
| 14:24 | hiredman | ,(cond (= 1 3) :foo \F :bar) |
| 14:24 | clojurebot | :bar |
| 14:24 | hiredman | well, non-nil and non-false |
| 14:24 | lenst | ,(or nil false) |
| 14:24 | clojurebot | false |
| 14:25 | hiredman | ,(or false nil) |
| 14:25 | clojurebot | nil |
| 15:06 | ChrisPS | hello all |
| 15:09 | drewr | hi |
| 15:16 | sayyestolife | I just made my first clojure app, may I be so rude that I'd request some comments on it? http://pastebin.com/d5c8bf086 |
| 15:17 | arohner_ | sayyestolife: it looks fine |
| 15:18 | Chouser | uses mutual recursion |
| 15:19 | Chouser | it won't load in a fresh repl without (declare guess-the-number) first, but I wonder if mutual recursion is the best way to go. |
| 15:19 | sayyestolife | Chouser hmm how would you structure it then? |
| 15:20 | drewr | a single loop would suffice |
| 15:20 | Chouser | not sure. maybe a single loop/recur? |
| 15:21 | Chouser | or reduce on (repeatedly read-line) |
| 15:21 | Chouser | ok, I don't really recommend the latter in the case. :-) |
| 15:21 | drewr | reduce with side-effects? |
| 15:21 | drewr | :-) |
| 15:22 | Chouser | I've actually used (repeatedly #(.read f)) a few times -- it can work quite nicely. |
| 15:22 | hiredman | yes it can |
| 15:23 | Chouser | sayyestolife: but it works! congrats. :-) |
| 15:23 | sayyestolife | thanks! :) |
| 15:25 | Chouser | yeah, I think since the heart of your program is the guess loop, I'd try to do that with a single local loop. If you want to factor out some code, use a different tack. |
| 15:25 | Chouser | maybe store the messages in a separate hash so they don't clutter up the logic in the loop. or something. |
| 15:27 | sayyestolife | mkay |
| 16:40 | technomancy | when you see something like Text.class() in Java, what does it mean? |
| 16:40 | technomancy | isn't Text already a class? |
| 16:40 | technomancy | err; assuming Text is a class. =) |
| 16:40 | Chouser | technomancy: it's now they get the instance of Class |
| 16:41 | technomancy | Chouser: so (say) when you reference String, that's not an instance of Class? |
| 16:41 | technomancy | or not in Java at least? |
| 16:41 | Chouser | I'm not sure, but I guess you can't just say Class foo = Text; |
| 16:42 | ozzilee | technomancy: I'm pretty sure it's mostly just a syntactic kludge. |
| 16:42 | Chouser | you'd have to say Class foo = Text.class(); |
| 16:42 | technomancy | ozzilee: so it's probably unnecessary in Clojure then? |
| 16:42 | ozzilee | technomancy: Yeah, I think it is (unnecessary). |
| 16:42 | Chouser | in clojure you'd just use the word Text as an expression |
| 16:42 | Chousuke | ,(.class "foo") |
| 16:42 | clojurebot | java.lang.IllegalArgumentException: No matching field found: class for class java.lang.String |
| 16:42 | technomancy | what a mess of a language. =) |
| 16:42 | Chousuke | hmm. |
| 16:42 | hiredman | I know Class has a getClass method |
| 16:42 | Chouser | ,Integer |
| 16:42 | clojurebot | java.lang.Integer |
| 16:42 | hiredman | never heard of the class method |
| 16:42 | Chousuke | (class Integer) |
| 16:42 | Chousuke | ,(class Integer) |
| 16:42 | clojurebot | java.lang.Class |
| 16:43 | ataggart | ,(.getClass "foo") |
| 16:43 | clojurebot | java.lang.String |
| 16:43 | hiredman | ,(class (resolve (symbol "Integer"))) |
| 16:43 | clojurebot | java.lang.Class |
| 16:43 | Chousuke | but String.class is special syntax in Java to get the class object I think |
| 16:43 | ataggart | (class String) |
| 16:43 | hiredman | yeah |
| 16:43 | ataggart | ,(class String) |
| 16:43 | clojurebot | java.lang.Class |
| 16:43 | hiredman | but you don't call it like a method |
| 16:43 | hiredman | String.class() |
| 16:43 | Chouser | it's pretty amazing how little #clojure knows about Java |
| 16:44 | Chousuke | :) |
| 16:44 | ataggart | String.class() isn't valid java anyway |
| 16:44 | technomancy | sorry, no parens on that. |
| 16:44 | hiredman | hey, I am in #java too |
| 16:45 | ataggart | why? |
| 16:45 | Chouser | I guess #clojure probably knows more about java than #java does about clojure. |
| 16:45 | technomancy | Chouser: every time I try to read something that explains basic Java concepts it just numbs my brain. I literally can't proceed. |
| 16:45 | Chouser | technomancy: heh |
| 16:45 | technomancy | it's like my brain is trying to protect itself |
| 16:45 | Chousuke | basic java concepts? like whaT? |
| 16:46 | technomancy | dependency injection is the classic example. |
| 16:46 | Chousuke | hm |
| 16:46 | ataggart | DI isn't really java per se |
| 16:46 | Chousuke | I don't think that's a basic java concept. |
| 16:46 | Chousuke | :P |
| 16:46 | technomancy | I can't even comprehend the basic problem it's trying to solve, much less how it works. |
| 16:46 | technomancy | but I'm OK with that. |
| 16:46 | ataggart | avoiding tight coupling between implementations |
| 16:47 | drewr | technomancy: +1 |
| 16:48 | Chousuke | sounds like they just need higher-order functions :/ |
| 16:48 | ataggart | bear in mind this is within the context of java, not a functional language |
| 16:49 | ataggart | also makes it easy to swap out implementations without the caller caring |
| 16:52 | hiredman | I am by no means a fan of Java, but I fidn the level of disgust regarding it far out of porportion to how horrible it is |
| 16:52 | mblinn | yeah the need for such things seems to pretty much disappear in more expressive languages |
| 16:53 | Chousuke | hiredman: I found java rather pleasant, coming from C++ :P |
| 16:55 | ataggart | hiredman: I can't tell whether you think the level of disgust is too small or too great ;) |
| 16:56 | hiredman | too great |
| 16:56 | hiredman | it's not like java eats babies (very often) |
| 16:57 | Chousuke | I guess a lot of the disgust comes from the perception that all java apps are of substandard quality (because many of them are) |
| 16:57 | mblinn | yeah, it's the 90% of everything is crap rule |
| 16:57 | Chousuke | I think java's UI toolkits make it worse though. |
| 16:58 | Chousuke | it's easy to make a java GUI program that doesn't fit well in any system. |
| 16:58 | drewr | and because it's so ubiquitous, 90% is a very large sample |
| 16:58 | ataggart | I'm not sure what a "java app" is, but I use several dozen open source java tools and libraries. They serve my purposes very well |
| 16:58 | Chousuke | so even if the code is good, it'll still look like crap. |
| 16:59 | ataggart | 90% of java apps with a UI makes up about 5% of the java stuff out there |
| 16:59 | Chousuke | there are pleasant exceptions too though, like Cyberduck on OS X. |
| 16:59 | Chousuke | I didn't even know it was java until I took a look at the source :P |
| 16:59 | drewr | Chousuke: I suspect the good apps like that hide their Java so well that people don't realize it's Java |
| 16:59 | Chousuke | heh, yeah |
| 17:00 | Chousuke | Cyberduck isn't portable java though. |
| 17:00 | Chousuke | it uses Cocoa bindings for its UI. |
| 17:00 | drewr | DBVisualizer is another one (although it requires JDBC knowledge to use) |
| 17:00 | ataggart | judging java by the ui apps that are written in it is... less than representative. |
| 17:01 | drewr | ataggart: those were examples of *good* apps |
| 17:01 | ataggart | my point is that a huge proponderance of java is running without any ui whatsoever, namelyon the server |
| 17:01 | ataggart | and much of it is very well done |
| 17:02 | drewr | my problem with Java started when I had to maintain some Struts/JSP coming from a Perl background |
| 17:02 | drewr | just seemed way too heavy |
| 17:02 | ataggart | well, that's a separate issue from the language |
| 17:02 | Chousuke | ataggart: I think Java's reputation got another hit here in Finland when one of our banks, as a result of a merger, replaced their fully working and cross-platform compatible web banking solution with a java-based piece of crap that worked well for no-one. |
| 17:03 | drewr | ataggart: true, but a language is inseparable from its ecosystem, and the ecosystem at a lot of Java shops sucks |
| 17:03 | ataggart | bad shops are bad. can't do much about that |
| 17:03 | Chousuke | ataggart: the amount of fail was epic. |
| 17:03 | ataggart | if anything I would imaine that the distribution of code quality to volume is a result of java being somewhat more approachable than some functional languages |
| 17:04 | slashus2 | Chousuke: So the software didn't replace the old software completely? Usability wise.. |
| 17:04 | ataggart | namely java has a huge amount of code spread around the quality axis (because one can write working, yet crappy code in java) |
| 17:04 | Chousuke | slashus2: I don't know, but my impression is that it was a complete overhaul |
| 17:04 | ataggart | whereas only the top few academic and hardcore CSers are doing stuff in "better" but more esoteric languages |
| 17:05 | ataggart | so, higher quality, but very little of it to see |
| 17:05 | Chousuke | http://kks.cabal.fi/SampoApplet this page collected some of the fail found in the java client applet. |
| 17:05 | ataggart | I dont care what other people do |
| 17:05 | ataggart | so long as my java code is done correctly |
| 17:06 | Chousuke | I like the public static final int RandomErrorNotEnoughRandom = 1; |
| 17:06 | drewr | ataggart: none of us is arguing that Java is bad; we were just reminiscing about our bad tastes :-) |
| 17:07 | ataggart | java related stuff I use on a regular basis: eclipse, ant, ivy, tomcat, apache-commons-*, hibernate, log4j, spring, aspectj, various MQs, several X*L related libraries, and so on |
| 17:08 | Chousuke | eclipse is pretty good |
| 17:08 | Chousuke | it's not even that slow anymore. |
| 17:08 | ataggart | yup, and they had the god sense to not deal with Sun's ui library |
| 17:08 | ataggart | *good |
| 17:08 | Chousuke | the look'n'feel could still be better though. |
| 17:09 | ataggart | intellij felt snappier when I played with it, but I dislike how things are laid out |
| 17:09 | ataggart | plus the ecosystem aroudn eclipse is better |
| 17:10 | ataggart | alas, I don't have anu opportunity to do real work in clojure |
| 18:06 | eevar | ,(doc for) |
| 18:06 | clojurebot | "([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], :while test, :when test. |
| 18:08 | kotarak | oh. Welcome back, clojurebot. How was your vacation? |
| 18:08 | AWizzArd | ~max people |
| 18:08 | clojurebot | max people is 164 |
| 18:17 | hiredman | http://ejohn.org/blog/html-5-parsing/ slightly off-topic, but the page contains the word Java... |
| 18:27 | grrrt | Hi! Are there guidelines for documenting clojure code? And is it possible to generate html from code docs? |
| 18:28 | grrrt | doh... I just noticed "gen-html-docs" in clojure contrib. I'll look at that before asking questions :) |
| 18:38 | Knekk_ | ,(+ 1 2) |
| 18:38 | clojurebot | 3 |
| 18:38 | Knekk_ | neat-o |
| 18:55 | arohner_ | I have a collection of elements that I want to logical and. Is there a better way than (every? identity coll)? |
| 19:00 | arohner_ | it would be nice if (doc ns) produced the doc strings for all public functions in the namespace |
| 19:00 | arohner_ | lol |
| 19:00 | arohner_ | ,(doc docs) |
| 19:00 | clojurebot | "clojure.contrib.ns-utils/docs;[[nsname]]; Prints documentation for the public vars in a namespace" |
| 19:01 | arohner_ | of course... |
| 19:08 | technomancy | it must be hard to be a scala newbie. you have to choose between reading "Programming Scala", reading "Programming Scala", and reading "Programming in Scala" |
| 21:22 | hiredman | ~exceptions |
| 21:22 | clojurebot | http://paste.lisp.org/display/74305 |
| 21:53 | notostraca_ | Hi, room |
| 21:54 | danlarkin | Hi, notostraca_ |
| 21:54 | notostraca_ | I am trying to learn clojure |
| 21:54 | notostraca_ | in particular, I am trying to learn clojure to use on an IRC bot |
| 21:54 | danlarkin | how's it going? |
| 21:54 | notostraca_ | well it is going pretty well |
| 21:55 | notostraca_ | on a side-note i did a little experimenting with fibonacci sequences |
| 21:55 | notostraca_ | and i got the 1,000,000th after a while |
| 21:55 | notostraca_ | but my question is esoteric |
| 21:56 | notostraca_ | i want to use the PircBot IRC bot |
| 21:56 | notostraca_ | written in java |
| 21:56 | notostraca_ | but it uses java threads |
| 21:56 | notostraca_ | and I don't know if there are bad interactions with the STM? |
| 21:57 | danlarkin | there's a mature user of PircBot already, clojurebot |
| 21:57 | danlarkin | his code is open source |
| 21:57 | danlarkin | clojurebot: where are you? |
| 21:57 | clojurebot | http://github.com/hiredman/clojurebot/tree/master |
| 21:57 | notostraca_ | nice! |
| 21:57 | danlarkin | I don't know if that uses the STM at all |
| 21:58 | notostraca_ | well my irc bot is meant to moderate a "tabletop" game |
| 21:58 | notostraca_ | but to do more than just roll dice |
| 21:59 | notostraca_ | so it has to separate game commands from normal chat |
| 22:00 | danlarkin | mmmhmm |
| 22:00 | notostraca_ | because the whole routine of "Bot: it is your turn, Bill. What is your action? a, b, or c", "Bill: b", "Bot: Targeting what character? a, b, or c", "Bill: a"... |
| 22:00 | danlarkin | yeah I think that's a good use case for clojure |
| 22:00 | notostraca_ | gets to take up a lot of chatroom space |
| 22:01 | notostraca_ | so i am not sure about a lot of things about concurrency |
| 22:01 | hiredman | 3d6 |
| 22:01 | clojurebot | 6 |
| 22:01 | JAS415 | if i'm using :inline and :inline-arities, is there a way to make the function inline for any arity? |
| 22:01 | notostraca_ | 10d99 |
| 22:01 | clojurebot | 465 |
| 22:01 | hiredman | 3d6 |
| 22:01 | clojurebot | 16 |
| 22:02 | JAS415 | i cast magicmissile |
| 22:02 | notostraca_ | at the darkness? |
| 22:02 | JAS415 | yes, at the darkness |
| 22:03 | notostraca_ | you hit the darkness for NaN damage |
| 22:03 | JAS415 | nice |
| 22:03 | JAS415 | 1e7d6 |
| 22:03 | JAS415 | hm |
| 22:03 | notostraca_ | 1.5d7 |
| 22:03 | JAS415 | any ideas about inline and inline arities |
| 22:03 | JAS415 | ? |
| 22:04 | notostraca_ | & args... |
| 22:04 | hiredman | the bot uses a regex to look for dice rolls |
| 22:04 | hiredman | JAS415: I don't think you can inline arbitrary arities |
| 22:04 | JAS415 | that's too bad it would be useful for fixing + |
| 22:04 | hiredman | 1d6+20 |
| 22:04 | clojurebot | 22 |
| 22:05 | JAS415 | hmm |
| 22:05 | JAS415 | well it takes a set |
| 22:05 | JAS415 | maybe i can make it take a really big set? |
| 22:06 | hiredman | well |
| 22:07 | hiredman | ,^+ |
| 22:07 | clojurebot | nil |
| 22:07 | hiredman | bah |
| 22:07 | hiredman | ,^#'+ |
| 22:07 | clojurebot | {:ns #<Namespace clojure.core>, :name +, :file "clojure/core.clj", :line 549, :arglists ([] [x] [x y] [x y & more]), :inline-arities #{2}, :inline #<core$fn__3946 clojure.core$fn__3946@90ebfe>, :doc "Returns the sum of nums. (+) returns 0."} |
| 22:08 | JAS415 | nope it didn't like that |
| 22:08 | JAS415 | ah becauserange didn't exist |
| 22:09 | hiredman | I am not sure how :inline is suposed to work |
| 22:09 | JAS415 | it is a function that returns a list of lists that expands out into the body |
| 22:10 | JAS415 | example you can do this: |
| 22:11 | JAS415 | (defn + |
| 22:11 | JAS415 | "Returns the sum of nums. (+) returns 0." |
| 22:11 | JAS415 | {:inline (fn ([x y] `(. clojure.lang.Numbers (add ~x ~y))) |
| 22:11 | JAS415 | ([x y & more] (reduce (fn [a b] `(. clojure.lang.Numbers (add ~a ~b))) `(. clojure.lang.Numbers (add ~x ~y)) more))) |
| 22:11 | JAS415 | :inline-arities #{1 2 3 4 5 6 7 8 9 10 11 12 13}} |
| 22:11 | JAS415 | ([] 0) |
| 22:11 | JAS415 | ([x] (cast Number x)) |
| 22:11 | JAS415 | ([x y] (. clojure.lang.Numbers (add x y))) |
| 22:11 | JAS415 | ([x y & more] |
| 22:11 | JAS415 | (reduce + (+ x y) more))) |
| 22:12 | JAS415 | and then your math for (+ 1 (+ 2 (+ 3))) isn't any faster than (+ 1 2 3) because they are the same |
| 22:12 | JAS415 | just i'd like it to inline for all arities |
| 22:13 | hiredman | you need a set of all natural numbers |
| 22:13 | hiredman | :P |
| 22:13 | JAS415 | yup! |
| 22:13 | JAS415 | :-) |
| 22:13 | hiredman | clojurebot: set? |
| 22:13 | clojurebot | It's greek to me. |
| 22:13 | JAS415 | except i guess i need to build it from java primitives? |
| 22:16 | notostraca_ | can you use lazy sets of all natural numbers? |
| 22:16 | notostraca_ | are there any lazy sets??? |
| 22:17 | hiredman | no |
| 22:17 | hiredman | I was sort of working on rule based sets |
| 22:17 | JAS415 | you can coerce a lazy list to a set i think though |
| 22:18 | hiredman | I kind of doubt that |
| 22:18 | JAS415 | hmm |
| 22:18 | JAS415 | well i guess 1-20 should be enough for now? |
| 22:18 | JAS415 | 2-20 |
| 22:19 | hiredman | http://paste.lisp.org/display/80355 |
| 22:20 | hiredman | a big annoyance is many clojure.set operations work on the result of calling seq on the set |
| 22:20 | JAS415 | ooo |
| 22:20 | JAS415 | hmm |
| 22:21 | JAS415 | well i guess i could do a proxy class on that which returns true as long as it is a number? |
| 22:21 | JAS415 | i guess it would have to be a number within a range |
| 22:31 | notostraca_ | hm |
| 22:31 | notostraca_ | this looks bad for my usage of clojurebot |
| 22:31 | notostraca_ | it still won't respond to my DCC request |
| 22:31 | notostraca_ | so i don't know if it... can. |
| 22:32 | notostraca_ | i bet it isn't able |
| 22:32 | hiredman | it won't |
| 22:32 | hiredman | clojurebot is uses pircbot |
| 22:32 | hiredman | and I never connected up the dcc bits |
| 22:32 | notostraca_ | pircbot uses threads for dcc |
| 22:32 | hiredman | and? |
| 22:32 | notostraca_ | are they compatible with clojure concurrency stuff? |
| 22:33 | hiredman | of course |
| 22:33 | notostraca_ | oh good |
| 22:33 | notostraca_ | i am just working my way through Programming Clojure, so I don't know most of this |
| 22:34 | hiredman | unless you need annotations, you can use anything java from clojure |
| 22:34 | notostraca_ | nice |
| 22:35 | notostraca_ | are there any good parsing libraries for clojure? |
| 22:35 | hiredman | fnparse is pretty nice |
| 22:35 | hiredman | clojurebot: parse? |
| 22:35 | clojurebot | parser is http://github.com/joshua-choi/fnparse/tree/master |
| 22:35 | hiredman | there is clj-peg too |
| 22:35 | hiredman | I have not used clj-peg |