2009-05-02
| 03:30 | yason | Hmmm, did Clojure have a function/idiom to join a list of strings together with a glue string? Java doesn't seem to have one! |
| 04:02 | unlink1 | str-join? |
| 04:03 | yason | unlink1: sounds like it but it isn't in the API index |
| 04:04 | unlink1 | http://code.google.com/p/clojure-contrib/wiki/StrUtilsApiDoc#str-join |
| 04:05 | yason | oh, the contrib repository |
| 04:06 | yason | thank you, i should remember that more often :) |
| 04:12 | cgrand | yason: or (apply str (interpose \- ["hello" "world"])) |
| 04:12 | cgrand | ,(apply str (interpose \- ["hello" "world"])) |
| 04:12 | clojurebot | "hello-world" |
| 11:49 | Chousuke | :) |
| 11:59 | unlink1 | Might I also recommend switching to mercurial? ;-) |
| 12:21 | jboner | hg over git, no |
| 12:24 | Raynes | jboner: Woar. |
| 12:31 | AWizzArd | Ah, again hg vs git? ;) |
| 12:31 | AWizzArd | This whole discussion could be ended by a sweet version control system written in Clojure :) |
| 12:31 | Raynes | I haven't even installed a VCS yet. |
| 12:31 | Chousuke | hg is fine, but I like having control over what branches I publish from a repo. :/ |
| 12:32 | AWizzArd | I like to have different branches in different repos, and decide which of those repos I publish |
| 12:32 | Chousuke | with hg it seems I'd have to clone the repository every time I want a private branch... acceptable I guess, but not the way I want to work. |
| 12:32 | Chousuke | well, git obviously supports that as well :) |
| 12:34 | Chousuke | there's just rarely any need to clone a local repository because you can just branch. |
| 12:45 | AWizzArd | Chousuke: it is very simple with hg and the typical workflow |
| 12:45 | AWizzArd | hg supports hard links, so those repositories won't eat much HD space |
| 12:45 | Chousuke | git does too |
| 12:45 | AWizzArd | in googles analysis they only noticed that git repos are bigger than hgs |
| 12:46 | AWizzArd | So, that speaks more for hg in my opinion. |
| 12:46 | AWizzArd | It is trivial to start a new repo, and the hosting services provide tools for that. |
| 12:46 | Chousuke | bigger? |
| 12:46 | AWizzArd | as in "more hd space is used" |
| 12:46 | Chousuke | I thought they were about the same size. |
| 12:47 | AWizzArd | probably not huge differences |
| 12:47 | AWizzArd | what surprised me was that cloning via http is much faster with hg |
| 12:47 | AWizzArd | Google measured about 8 seconds for their test repo with hg |
| 12:47 | AWizzArd | and 178 seconds with git |
| 12:47 | Chousuke | yeah, that's one thing hg has for it. |
| 12:48 | Chousuke | git has no good protocol for http cloning. |
| 12:48 | AWizzArd | Anyway, from the technical point of view both are too similar to see an obvious better candidate |
| 12:48 | Chousuke | they'll probably fix it in some future version though. |
| 12:48 | Chousuke | actually the first benchmark I find with google regarding repo size shows that git repos are smaller :/ |
| 12:49 | Chousuke | but it's almost a year old. maybe hg has improved. |
| 12:50 | Chousuke | http://vcscompare.blogspot.com/2008/06/git-mercurial-bazaar-repository-size.html anyway |
| 12:50 | AWizzArd | I think yes |
| 12:51 | Raynes | I can't believe I managed to spark a conversation about VCS's simply by saying I had switched to Linux. :o |
| 12:51 | AWizzArd | Raynes: yeah, good job |
| 12:51 | Chousuke | :P |
| 12:51 | Chousuke | Raynes: you mentioned git. |
| 12:51 | Chousuke | that's enough. |
| 12:51 | AWizzArd | if it is silent here mention git |
| 12:52 | Raynes | "What are the benefits of using Git?" I bet that phrase would make people talk in here who have never talked before. |
| 12:53 | AWizzArd | I think git has won the popularity thing |
| 12:53 | AWizzArd | For example in #git there sit around 500+ people, while in #mercurial we have 120 or so |
| 12:53 | AWizzArd | But this does not seem to reflect the technical capability |
| 12:54 | Chousuke | git and hg are both good. I just think git is a bit better |
| 12:54 | AWizzArd | For example git hosts as its maybe biggest project the Linux kernel with over 2,5 mio LOC |
| 12:54 | AWizzArd | hg has Mozilla with around 2,3 mio LOC |
| 12:54 | Raynes | :o |
| 12:55 | Chousuke | X.org uses git too |
| 12:55 | clojurebot | git is http://www.github.com |
| 12:55 | AWizzArd | and not to forget OpenSolaris. Alone the OpenJDK has 6,5 mio LOC. So from that it seems that hg is capabale of holding big code bases. |
| 12:55 | Chousuke | though X is modularised into several repos nowadays |
| 12:56 | AWizzArd | Would be cool if Rich would switch to hg which is now available on Google. |
| 12:56 | Chousuke | I wouldn't mind that at all :) |
| 12:56 | AWizzArd | I also already said: if the choice is hg or git instead of svn, then both options are a win |
| 12:56 | Chousuke | yeah :P |
| 12:57 | AWizzArd | But Rich will also have tool support in mind |
| 12:57 | AWizzArd | technicaly speaking hg and git seem to be very similar |
| 12:58 | AWizzArd | In 2010 someone will start Clojanarian - the next VCS |
| 12:58 | Chousuke | :P |
| 13:00 | Raynes | Yes, I will, and it will be called Verjure. |
| 13:03 | Raynes | Or, Jursion. JCS Jursion Control System. |
| 13:06 | Raynes | CVCS Clojure Version Control System. |
| 13:07 | Drakeson | just build a java/clojure version that reads and writes to the .git directory and uses git protocols, and everyone will be happy. |
| 13:08 | Chousuke | you mean http://www.jgit.org/ ? :P |
| 13:08 | Raynes | But, I'd rather just trump Git in general. |
| 13:10 | Drakeson | does it work well, then? |
| 13:10 | Drakeson | is it actively maintained? |
| 13:13 | alvivi | http://hgbook.red-bean.com/read/preface.html#id412633 more git vs hg flame :P |
| 13:14 | Chousuke | and out of date :P |
| 13:30 | AWizzArd | That Google decided to go with hg tells a lot :) |
| 13:32 | Drakeson | such as it is easier to deploy hg in a python environment |
| 13:32 | Drakeson | not to forget that they have a great set of tools around git (gerrit, etc.) |
| 13:38 | AWizzArd | So git as a set of C programs and shell scripts can make sense for the Linux kernel |
| 13:39 | unlink1 | Why do I get a reflection warning from (defn f [o] (.toString o))? |
| 13:39 | AWizzArd | but things like Mozilla and the OpenJDK or Python decided to go the hg route. |
| 13:40 | AWizzArd | I think at compile time it is not obvious which .toString method needs to be called |
| 13:40 | Chousuke | I suppose for those projects, windows support is essential. |
| 13:40 | Chousuke | also in google's case, HTTP cloning. |
| 13:40 | Chousuke | not to mention they are very familiar with python :P |
| 13:41 | AWizzArd | unlink1: Clojure cannot insert a direct call to the right .toString. Only at runtime we know which of the many thousands .toString is the right one. |
| 13:41 | AWizzArd | The OpenJDK guys? ;-) |
| 13:42 | hiredman | unlink1: you need to type hint o |
| 13:42 | unlink1 | Doesn't everything have toString? |
| 13:43 | Chousuke | AWizzArd: google |
| 13:47 | AWizzArd | funnily googles Android project.. |
| 13:47 | Chousuke | what about it? |
| 13:47 | AWizzArd | it's under git |
| 13:47 | Chousuke | heh. |
| 13:47 | Chousuke | maybe they decided git was better for it :P |
| 13:48 | AWizzArd | Oh well, possible. In the end I don't care too much. I used git for some months, now switched for hg (because I like that working style more and find it easier to use). I can use both systems and have both installed. |
| 13:48 | AWizzArd | I hope they can divide the market fairly so that there is always some pressure on both teams to evolve their system. |
| 13:49 | Chousuke | I don't think that'll be a problem :) |
| 13:51 | AWizzArd | even if more people and projects decided to use git, I can still be happy that Mercurial has the cooler name |
| 13:51 | replaca | ~seen hiredman |
| 13:51 | clojurebot | hiredman was last seen in #clojure, 9 minutes ago saying: unlink1: you need to type hint o |
| 13:52 | replaca | hiredman: I got some json for ya |
| 13:53 | replaca | hiredman: http://clojure-contrib.googlecode.com/svn/wiki/ApiDocIndex.json |
| 13:53 | dreish | unlink1: It looks like Clojure just spits out reflection warnings on non-type-hinted objects without exception. If you type hint it as #^Object (which provides no actual information; everything is an Object), the warning goes away. |
| 13:56 | replaca | 1/4 MB on a single-line, since c.c.json.write doesn't seem to know any other way |
| 13:56 | danlarkin | replaca: clojure-json does :) It can do indenting! |
| 13:56 | replaca | danlarkin: cool, maybe we should pull that behavior into contrib |
| 13:57 | replaca | I was thing I'd just write a pp dispatch table rather then replicating the indenting logic everywhere |
| 13:57 | danlarkin | ,(org.danlarkin.json/encode-to-str "[1 2 3 {\"a\" \"b\"} 4 5]" :indent 4) |
| 13:57 | clojurebot | "\"[1 2 3 {\\\"a\\\" \\\"b\\\"} 4 5]\"" |
| 13:57 | danlarkin | well.. ok it doesn't indent on irc but you get the idea |
| 13:57 | hiredman | gnarly |
| 13:58 | danlarkin | ,(org.danlarkin.json/encode-to-str [1 2 3 {"a" "b"} 4 5] :indent 4) |
| 13:58 | clojurebot | "[\n 1,\n 2,\n 3,\n {\n \"a\":\"b\"\n },\n 4,\n 5\n]" |
| 13:58 | danlarkin | there we go |
| 13:58 | hiredman | replaca: I'll get on that tomorrow or next week sometime |
| 13:58 | replaca | but since it's for clojurebot anyway, I'm not sure it matters right this sec - I'll fix it up later |
| 13:59 | replaca | yup, no worries, I just wanted you to know it was ready when you are |
| 13:59 | replaca | I'm thinking I'll probably write some repl and slime tools to go with it too |
| 14:00 | replaca | so you can find doc without loading all the namespaces |
| 14:00 | Lau_of_DK | Good evening all |
| 14:00 | replaca | Hi Lau |
| 14:01 | replaca | I'm off to spend a rainy day at the museum looking at Andy Warhol paintings... |
| 14:01 | replaca | by all |
| 14:01 | replaca | bye all |
| 14:01 | replaca | having fun arguing git vs. hg! |
| 14:05 | Lau_of_DK | Guys - I remember technomancy talking about using thread-local vars when handling sessions for webusers on a jetty servlet - Anybody know how thats done ? |
| 14:06 | Chousuke | with-local-vars? |
| 14:09 | Lau_of_DK | Thanks big guy, I'll look into it |
| 14:14 | Quiark | Anyone has vimclojure working? I'm getting all sorts of seemingly random errors... |
| 14:17 | hiredman | vimclojure is sensitive about having a correct namespace declaration |
| 14:17 | hiredman | and the namespace has to be on the classpath of the nailgun server |
| 14:18 | Quiark | yep, I think I have that correct |
| 14:18 | hiredman | are you sure? |
| 14:18 | Quiark | I restarted vim once more and now it works without changing anything... |
| 14:19 | hiredman | *shrug* |
| 14:19 | Quiark | I'm using the svn head version of clojure, so if its unstable, it could be the cause |
| 14:22 | hiredman | nope |
| 14:22 | hiredman | unless you wait months between checkouts |
| 14:23 | Quiark | I just started using clojure, so I have yesterday's checkout :) |
| 14:24 | hiredman | ~latest |
| 14:24 | clojurebot | latest is 1360 |
| 14:24 | hiredman | r1360 |
| 14:26 | Quiark | yes, 1360 is what I have |
| 14:34 | unlink1 | I'm not sure exactly what *warn-on-reflection* accomplishes. It seems like it just complains if you use field/method accesses on an object which doesn't have a type annotation, and then is silenced when that object is given a type annotation, regardless of the type; but then fails at runtime if the field/method doesn't resolve. |
| 14:36 | dnolen | unlink1: it's telling you that the code will have to use reflection. This is a _massive_ performance hit. |
| 14:36 | hiredman | type hinting is just a sort of unsafe cast :P |
| 14:37 | unlink1 | OK, so it says "cast to this type"? |
| 14:37 | hiredman | more or less |
| 14:37 | hiredman | so if the type doesn't have the corrent field or method at runtime *boom* |
| 14:37 | hiredman | correct |
| 14:40 | unlink1 | so (fun x [#^String s] (.trim s)) corresponds to something like public static Object x(Object s) { String s = (String)s; return s.trim(); } ? |
| 14:41 | unlink1 | Well I mean you can't shadow a parameter in java. |
| 14:42 | hiredman | I forget if casts have higher or lower presidence then method calls |
| 14:42 | hiredman | ((String)s).trim |
| 14:42 | hiredman | (); |
| 14:42 | unlink1 | uh, . has the highest precedence I think. |
| 14:44 | unlink1 | I actually never used reflection in Java. |
| 14:45 | unlink1 | Interesting, you can access private fields with it? |
| 14:46 | unlink1 | I guess that would be an important feature. |
| 15:00 | technomancy | is there a function like remove that takes an element to remove instead of a predicate? |
| 15:03 | cgrand | technomancy: (remove #{foo} coll)? |
| 15:04 | cgrand | (doesn't work with false and nil as usual) |
| 15:05 | technomancy | right; that's fine; thanks |
| 15:23 | lisppaste8 | technomancy pasted "dir-seq" at http://paste.lisp.org/display/79555 |
| 15:23 | technomancy | how would you write that without using "flatten"? |
| 15:30 | Drakeson | who mentioned jGit? it is a funny joke at the moment. It only has branch, clone, daemon, fetch, init, log, push, rm, tag, version. |
| 15:32 | Drakeson | I cannot imagine what can be done using those, other than just reading a git repo, and/or serving it. |
| 15:33 | technomancy | Drakeson: well it would be pretty silly to use a JVM-hosted tool for actually committing given the JVM's boot time |
| 15:33 | technomancy | but letting JVM-hosted apps read repositories could be pretty useful |
| 15:34 | Drakeson | technomancy: no it is not. you don't need to launch a new JVM for every operation. People are already looking for libgit to use git as a storge backend for whatever makes sense. |
| 15:35 | technomancy | Drakeson: still, there's very little advantage to JVM-hosting for day-to-day usage. |
| 15:35 | Drakeson | also, it is a matter of things not written yet. the have added the "push" command recently. |
| 15:36 | Drakeson | technomancy: unless you use a git repos as a persistence backend. |
| 15:36 | Drakeson | (again, for limited but important use cases) |
| 15:37 | technomancy | well it sounds like if you want to do that you'll have to write the commit functionality yourself. =) |
| 15:37 | eee | does anyone here use clojure-dev |
| 15:39 | Drakeson | The usage I have in mind is sharing libraries with source code. A central repository of git repositories for clojure libraries. |
| 15:40 | Drakeson | (with read-only operations a good portion of that can be done, though) |
| 15:41 | eee | i'm interested in mercurial before git |
| 15:41 | eee | personally |
| 15:42 | kadaver_ | I'm gonna post my mp3player to the mailinglist |
| 15:42 | kadaver_ | what is thge best format to post it? |
| 15:43 | kadaver_ | Ie should I paste the code somewhere or upload .clj files? |
| 15:43 | Drakeson | eee: It is not a matter of which is functionally superior, anymore. Right now it only matters which one is being used by more projects. |
| 15:44 | eee | i use the same reasoning, and the eclipse plugin sucks |
| 15:44 | eee | and eclipse is awesome |
| 15:45 | eee | therefore ... |
| 15:45 | eee | but I haven't used mercurial yet |
| 15:45 | eee | just curious about it |
| 15:45 | eee | is all I was saying :) |
| 15:47 | kadaver_ | git git git git |
| 15:48 | eee | lol |
| 15:48 | kadaver_ | noone is curious about my mp3player |
| 15:48 | kadaver_ | it has a weirdo bug |
| 15:48 | kadaver_ | probably with threading :P |
| 15:48 | eee | kadaver_ i don't know how to answer other than to say to check into the github |
| 15:48 | eee | and then post to the group that you have a third-party |
| 15:49 | eee | and then rich can add it to the third party page |
| 15:49 | eee | or that would be my guess |
| 15:56 | technomancy | interesting comparison: http://bitbucket.org/repo/all/?name=clojure vs http://github.com/languages/Clojure |
| 15:57 | technomancy | 2 pages vs 12 pages |
| 15:58 | eee | i never heard of bitbucket |
| 15:58 | eee | to support your argument |
| 15:58 | eee | which one is older? |
| 15:58 | hiredman | can't say I am surprised that most clojure projects are following clojurebot's lead... |
| 16:01 | Drakeson | does github has a way to initiate a project right from the commandline, without going through the web interface? |
| 16:06 | Drakeson | What is the vision for lancet? Is it going to be a versatile dependency resolution and be able to obtain and track/update dependencies from external and local repositories? |
| 16:11 | technomancy | hiredman: heh |
| 16:11 | technomancy | Drakeson: yeah, you can initiate projects through the command line through github. the Jeweler project does that, and the "gh" gem might as well. |
| 16:11 | technomancy | Drakeson: Stu doesn't seem to be that interested in adding dependency resolution to lancet. |
| 16:12 | technomancy | I've been playing around with a prototype here: http://github.com/technomnacy/corkscrew ... doesn't support transitive deps yet, but it can pull jars from HTTP and projects from git/svn repos |
| 16:18 | Drakeson | Where do you put the jar files? |
| 16:19 | Drakeson | is it in ~/.m2 ? |
| 16:45 | technomancy | Drakeson: right now it uses ~/.corkscrew, but eventually it should integrate with mvn and use ~/.m2 |
| 17:55 | Raynes | Business is picking up with severe weather here. :\ Tornado warnings. |
| 17:55 | Raynes | I don't like tornado warnings. |
| 18:01 | rsynnott | presumably better than un-warned-of tornados |
| 18:10 | kadaver_ | there is no function like reduce-and-add-to-end? |
| 18:12 | unlink1 | What's the idiomatic way of taking a list and an object and returning the list with the object appended (i.e. to the end of the list)? |
| 18:12 | unlink1 | Like conj but at the end of the list. |
| 18:14 | Chousuke | ,(concat '(1 2 3) (list 4)) ; this is probably as idiomatic as you can get. |
| 18:14 | clojurebot | (1 2 3 4) |
| 18:14 | AWizzArd | You should just be aware that this is O(n) |
| 18:14 | Chousuke | it's lazy, actually :) |
| 18:14 | AWizzArd | If you need that then maybe lists are not the right datatype for the task at hand. |
| 18:14 | Chousuke | so it's only O(n) if you traverse the list. |
| 18:15 | Chousuke | in which case it would be O(n) anyway :) |
| 18:15 | unlink1 | I'm not too worried, I don't expect n > 4 or 5. |
| 18:15 | Chousuke | anyway, vectors would be more idiomatic |
| 18:16 | Chousuke | or well, I guess it depends on what you do with it. |
| 18:16 | unlink1 | I'm trying to write a macro that does the same thing as -> except threads the return value as the last argument to the next function. |
| 18:17 | Chousuke | hmm, tricky. |
| 18:17 | kadaver_ | the idiomatic way in clojrue is suing evctors... |
| 18:18 | Chousuke | but yeah, if it's a macro, performance doesn't matter much. |
| 18:19 | kadaver_ | @paste |
| 18:19 | kadaver_ | clojurebot: paste? |
| 18:19 | clojurebot | lisppaste8, url |
| 18:19 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 18:20 | lisppaste8 | kadaver pasted "mp3-main" at http://paste.lisp.org/display/79566 |
| 18:20 | AWizzArd | Chousuke: when does the concat gets fired off? |
| 18:20 | Chousuke | AWizzArd: immediately. it just returns a lazy seq |
| 18:20 | AWizzArd | Only when one touches the (to be concated) last element of the list? |
| 18:21 | Raynes | This is rare. |
| 18:21 | Raynes | 116 people in here. 128 in #Scala. |
| 18:21 | Raynes | We normally trump that channel. |
| 18:21 | lisppaste8 | kadaver pasted "guilogic" at http://paste.lisp.org/display/79567 |
| 18:22 | lisppaste8 | kadaver pasted "utils" at http://paste.lisp.org/display/79568 |
| 18:22 | Chousuke | kadaver_: load-latest looks like it does IO. does it? |
| 18:23 | Chousuke | guessing from hte name :P |
| 18:23 | lisppaste8 | kadaver pasted "database" at http://paste.lisp.org/display/79569 |
| 18:24 | Chousuke | right, it does. |
| 18:24 | Chousuke | you can't do that in a transaction |
| 18:24 | arohner | spit and slurp both do I/O |
| 18:24 | Chousuke | it'll break. |
| 18:25 | Chousuke | I wonder if slurp and spit contain an (io!) block? :/ |
| 18:26 | Chousuke | ~source slurp |
| 18:27 | Chousuke | apparently not. |
| 18:27 | Chousuke | wonder if they should :P |
| 18:28 | cp2 | i'll slurp you |
| 18:31 | aperotte | hi everyone |
| 18:32 | aperotte | I've been working on a new datatype for clojure and I posted my work so far up on github |
| 18:33 | aperotte | http://github.com/aperotte/persistentmatrix |
| 18:33 | aperotte | It's a matrix/n-dimensional array datatype, and would welcome any and all feedback |
| 18:35 | kadaver_ | http://groups.google.com/group/clojure/browse_thread/thread/c0819f314391a311 |
| 18:35 | kadaver_ | ^^ mp3player written in Clojure, thread in the google group, some info and comments on programming in clojrue + ofc the code. |
| 18:36 | kadaver_ | it is ~400 LOC |
| 18:38 | kadaver_ | I'd love comments on the code |
| 18:39 | Chousuke | aren't you using a version control system? :/ |
| 18:40 | kadaver_ | nah |
| 18:40 | Chousuke | you should |
| 18:40 | Chousuke | there's no reason not to use one :/ |
| 18:40 | kadaver_ | REAL programmers dont use version control systems |
| 18:40 | Chousuke | you're not a REAL programmer :) |
| 18:40 | kadaver_ | they write one perfect program in ASM. |
| 18:41 | Chousuke | kadaver_: anyway, as I said, doing IO inside a dosync is generally not good |
| 18:41 | Chousuke | it might get retried. |
| 18:43 | Chousuke | have you even tested if that code works at all. because it looks like it won't :P |
| 18:44 | Chousuke | or hm. |
| 18:45 | Chousuke | never mind, I just forgot Ref does pass-through when in operator position |
| 18:47 | Chousuke | but you should do something like (let [latest (utils/load-latest (str (player-state :dir) "latest"))] (dosync (commute player-state assoc :playlist latest))) |
| 18:49 | Chousuke | alter works too, but looks like commute should do in that case. |
| 18:49 | kadaver_ | it does |
| 18:49 | Chousuke | anyway, it's time for me to sleep. so good night. :) |
| 18:50 | kadaver_ | alter vs commute? |
| 18:54 | Drakeson | How would you talk to a webserver (It needs POST, https). |
| 18:55 | Drakeson | I couldn't find anything for that in contrib |
| 19:10 | cgrand | technomancy: you can use tree-seq to avoid flatten (flatten being usually implemented with tree-seq), but file-seq looks very much like your dir-seq |
| 19:12 | Raynes | "What is linux?" :o |
| 19:14 | bradford | ,(for [x (range 5)] x) |
| 19:14 | clojurebot | (0 1 2 3 4) |
| 19:15 | gnuvince_ | bradford: alternatively, (range 5) ;) |
| 19:15 | bradford | gnuvince - just showing my friend the repl :-) |
| 19:18 | gnuvince_ | ok |
| 19:19 | kadaver_ | rhickey: are you opposed to static typing? |
| 19:43 | rlb | Does clojure already have something like a map for n-ary trees? i.e. map (fn [x] (* x 2)) over (1 (2 3)) to produce (2 (4 6)) |
| 19:53 | Raynes | I hate the sound of tornado sirens. |
| 20:33 | AWizzArd | Drakeson: it depends on the complexity of your requirements |
| 20:33 | AWizzArd | You may want to consider htmlunit, if that fits your needs. |
| 20:33 | AWizzArd | http://htmlunit.sourceforge.net/ |
| 20:34 | rlb | Can you index a map by a string, i.e. ("x" {"x" 42}) -> 42? |
| 20:34 | AWizzArd | ,({"x" 1, "y" 2} "x") |
| 20:34 | clojurebot | 1 |
| 20:34 | rlb | I know maps are functions of their values for symbols at least. |
| 20:34 | rlb | oh, right |
| 20:35 | rlb | (thinking backward) |
| 20:35 | AWizzArd | rlb: only when you use keywords, such as :x or :my-keyword you can put them into the position of the function. |
| 20:35 | rlb | AWizzArd: I think that's what confused me. |
| 20:35 | rlb | Thanks |
| 20:35 | AWizzArd | ,(:a {:a 1}) |
| 20:35 | clojurebot | 1 |
| 20:35 | AWizzArd | there it works |
| 20:40 | rlb | I imagine there's probably a clever way to take f and '(x y z) and call (((f x) y) z). |
| 20:54 | ee | this should be easy, but how do you print "done" if a java object is null? |
| 20:55 | ee | I have (when (= nil heap) (println "done")) |
| 20:55 | ee | so what's the predicate for "isNull" |
| 20:55 | AWizzArd | ,(doc nil?) |
| 20:55 | clojurebot | "([x]); Returns true if x is nil, false otherwise." |
| 20:56 | ee | i tried that |
| 20:56 | ee | i guess it's not null |
| 20:56 | ee | duh |
| 20:57 | ee | it ws null |
| 20:59 | ee | hmmm |
| 20:59 | AWizzArd | ,(when (nil? nil) (print "done")) |
| 20:59 | clojurebot | done |
| 21:00 | AWizzArd | probably your heap was not nil at that time |
| 21:00 | ee | yeah |
| 21:01 | ee | it wasn't, but i was getting null pointer exception. but it was from inside the heap I guess |
| 21:01 | ee | thanks |
| 21:01 | ee | i think I figured it out |
| 21:56 | eee | i finally solved the problem with my heap. I'm glad I'm forcing myself to get through some gotchas |
| 21:57 | eee | my mistake was probably something pretty simple for a veteran java person. |
| 21:57 | eee | :) |
| 22:00 | eee | i was trying to break ties between user data associated with keys |
| 22:00 | eee | i mean associated with priorities |
| 22:00 | eee | so I call hashCode |
| 22:00 | eee | seems obvious now |
| 22:13 | technomancy | Drakeson: danlarkin and I are working on an HTTP client that may make it into contrib |
| 22:13 | technomancy | Drakeson: http://github.com/technomancy/clojure-http-client |
| 22:14 | technomancy | Drakeson: it does POST, but I don't know about https |
| 22:15 | eee | what's a longer description |
| 22:15 | technomancy | Drakeson: also check out the "resourcefully" branch for a higher-level wrapper. |
| 22:16 | eee | i see |
| 22:17 | eee | it's for programmatically accessing web pages? |
| 22:17 | technomancy | Drakeson: let me know if you end up using it; would like to hear what you think. obviously there's still a lot missing right now |
| 22:17 | technomancy | eee: more for REST-based APIs. if you just need to read a web page you can use slurp |
| 22:17 | eee | cool |
| 22:18 | technomancy | rather, use duck-streams; slurp might not do it |
| 22:18 | eee | oh i see in the test |
| 22:18 | technomancy | bbiab & |
| 22:40 | eee | glad to have learned about miglayout |
| 22:40 | eee | from that mp3 app |
| 22:41 | eee | posted to the user group |