#clojure logs

2009-06-18

00:15jtalok, one more related question- if I cant load str-utils, math, etc- is there an env var or something where I need to add a path?
05:02frodefis there some built-in mutex-like thingy, or is there a mutex in the java libs?
05:06eevar2frodef: http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html
05:07eevar2frodef: and check java.util.concurrent in the api docs
05:07frodefyep, thanks.
05:10eevar2frodef: you should come a long way with the clojure synchronization mechanics, though
05:10eevar2didn't notice the first part of your question
05:12frodefI just need to do (let [x (new lock-or-whatever)] ... (await x)) and some other thread (that has lexical access to x) will notify x.
05:12eevar2read about refs and agents
05:13frodefI did, but I couldn't "make them fit" this pattern.
05:16eevar2me neither -- then again, my clojure skills blow :)
05:16frodefA simple java lock should do the trick, though. .. mine too :)
05:18jdzfrodef: i used a blocking queue (don't remember the namespace by heart, but somewhere in java.concurrent)
05:19jdzso you have threads which put stuff into the queue, and others who just take stuff from it
05:19jdzand the nice thing is that the producer thread can put more than a single thing on it (the queue capacity)
06:18AWizzArdclojurebot: max people
06:18clojurebotmax people is 164
07:11frodefwhen using proxy to implement an interface, is there some way to automatically "fill out" the methods you don't care about?
07:13frodefHm.. Perhaps this is what the "fooAdapter" class is for, for each "fooListener"..
07:14eevar2__frodef: yup
07:21frodefeevar2__: thanks.. it's a strange world, this :)
07:23eevar2__wonderful world of Java :)
09:46frodefisn't it somewhat strange to not have a version of distinct that takes a test function?
09:52rhickeyfrodef: you want to pass a comparator?
09:52rhickeyor a keying fn?
09:55frodefrhickey: either, or both..? :)
09:56rhickeycemerick: so, I thought of a canonic case where I would want pulls vs patches - say pprint goes into core (I hope soon), it's likely to get ongoing enhancement and I'm sure Tom would prefer to keep working in his repo and just tell me when to pull than to create involved patches. true really for any non-trivial subsystem moved from contrib to core (not core ns)
09:57rhickeyfrodef: distinct-by?
09:58frodefrhickey: right.. I'm (again) used to CL where distinct would have a number of keyword arguments like test, key, etc.
09:58frodefrhickey: but you prefer a separate function?
09:59rhickeyfrodef: I was just looking for conventions already present in Clojure, found sort-by
10:01rhickeywell, you're still shorter than remove-duplicates :)
10:02frodefin terms of characters, yes, but not in terms of operators :)
10:03rhickeysince Clojure doesn't have lots of equality preds, test isn't that important, we have rseq, subvec, the only key would be :key, so I'm not sure the CL idioms work
10:04rhickeyi.e. we havent' been doing :key
10:18cemerickrhickey: yeah, that's true.I'll bet that patchfiles will disappear eventually, though. I looked at the network diagram associated with your repo, and there's already at least 8 patches that are presumably worth pulling in, and that's just in the first week being on github. I don't think you're going to want to deal with the busywork that patches entail as that snowball builds.
10:19cemerickrhickey: BTW, regarding this:
10:19cemerick~ticket 79
10:20clojurebotTitim gan éirí ort.
10:20cemerickhrm, I thought that was the incantation.
10:20rhickeycemerick: seems to me to be just git am vs git pull, and in the former case I can peruse the diff first to see if I want to bother
10:20rhickey~ticket #79
10:20clojurebot{:url http://tinyurl.com/mwfnkq, :summary "GC Issue 76: adding sorted-set-by", :status :new, :priority :low, :created-on "2009-06-17T20:21:15+00:00"}
10:20cemerickah-ha
10:22cemerickrhickey: so, Tim filed a patch, but it doesn't apply against current revs. I fixed it and based it against your master, but since I used his patch (and I don't know the status of his CA), what is the legal status of that fix?
10:22ChouserHis CA is in.
10:22cemerickah, OK
10:22cemericknevermind then :-)
10:23Chousercemerick: will you attach it to the ticket?
10:23cemerickI've never had to deal with the notion of provenance before, and I only thought about it after I applied the fix.
10:23cemerickChouser: sure.
10:23cemerickthe procedure is to set the status to 'test' if a patch is ready?
10:25rhickeycemerick: I'm thinking about that, one caveat right now is that the existing patches weren't produced with git format-patch, which is the way we want to patch moving forward
10:25ChouserThe doc says "Now you can attach that patch file to the Assembla ticket and please add the 'patch' tag. Please mark the ticket 'ready to test' by checking that option under Choose an action..."
10:26ChouserCan't we just grandfather in the raw patches that are already there? I can't think of why that would be a problem.
10:26cemerickChouser: damn, sorry, what doc? Information overload over here lately. :-(
10:26Chousercemerick: yeah, np: http://clojure.org/patches
10:27cemerickChouser: thanks much
10:28cemerickrhickey: I'd agree with Chouser, except that I'll bet that a lot of patchfiles that have lingered aren't going to apply at this point.
10:29ChouserI think we can add a custom field to assembla tickets. Might be nice to have a "latest proposed patch" field.
10:30Chouserthat might facilitate, for example, automated scrubbing of tickets to flag those whose patches don't apply cleanly.
10:35rhickeyI think we need to look through what we've got, it might be a good exercise for people to produce up-to-date patches for non-trivial things. toggling off ready-to-test for non-clean patches might be enough?
10:38cemerickrhickey: missed your 'git am vs. git pull' msg from before -- I think it's mostly a tooling/UI issue that github will likely resolve (e.g. tie pull requests to particular sha's, show the diffs easily, maintain status on whether or not the changeset merges cleanly, etc).
10:41rhickeycemerick: I think you were gone yesterday when I summed up my feelings about pull requests from unsupervised repos - they feel to me as if someone submitted a patch by giving me a URL to the patch. Those URLs in the ticket system make understanding it dependent upon their continuing validity
10:48cemerickrhickey: I'm marking an issue as ready to test with a patch attached -- you don't want such things assigned to you?
10:59frodefis there a reason why you can't simply add methods with proxy? I.e. (. (proxy [Object] [] (foo [] 'hello)) foo) could have worked?
11:02cemerickfrodef: You might be able to invoke foo in that case using the reflector, but . invokes a static java method.
11:02clojurebot
11:04Xcaliborgreetings
11:04cemerickfrodef: nope, nevermind, proxy only reports the methods defined by the interfaces/abstract class it inherits from.
11:05Chouserfrodef: there are a few reasons that can't work. For one, you'd need a full method signature declaration (return type, arg types, private/public, etc.)
11:06frodefa more trivial question.. (gen-class :name foo ..) how do I create an instance of this foo?
11:06frodefChouser, cemerick: ok, thanks.
11:06Chouserfrodef: if there's no existing class or interface that you can extend via proxy, you'll have to use gen-interface, gen-class, or write some java code.
11:07rhickeycemerick: no one should be assigning things other than to themselves, so leave blank
11:07cemerickfrodef: gen-class produces a java class in bytecode, so it'd just be (com.Foo.)
11:07Chouserbut only with AOT compilation.
11:08frodefChouser: right, I'm doing gen-class, but I can't seem to be able to instantiate it.. :)
11:08cemerickright, I was assuming that :-)
11:08frodefso I have to import the class or something like that?
11:09Chouserfrodef: you'd have to (gen-interface :name com.yoursite.Foo), AOT compile that, then (proxy [com.yoursite.Foo] [] ...)
11:09Chouserno need to use import.
11:10frodefChouser: ok, thanks.
11:11Chouserhmph. patches attached to assembla tickets are application/octet-stream
11:11cemerickI'm pretty convinced the 'daily summary' selection in assembla's notifications is just broken.
11:11ChouserI'm having trouble convincing firefox to send them to my editor the way I want it to.
11:27rhickeycemerick: your sorted-by set likely has the same problem as sorted-by maps in that empty doesn't preserve the comparator?
11:28cemerickrhickey: right -- it uses PTM/EMPTY, so it inherits the problem. I figured that was a separate issue to be dealt with separately.
11:28rhickeypatch welcome, or at least an issue
11:29rhickeyif there isn't one
11:29rzoomi would like to replace particular elements in a list of lists with the value 1. Here is what I have: (map #(replace {%1 1} %2) '(2 3) '('(0 0 0 0 0) '(0 0 0 0 0)))
11:29cemerickrhickey: OK. I've never actually hit that problem, so I figured I'd leave well enough alone
11:30rzoombut that doesn't seem to work. would like element 2 in the first list and element 3 in second list to be set to 1.
11:30rzoomyet alas: ((quote (0 0 0 0 0)) (quote (0 0 0 0 0)))
11:30rzoomperhaps I am missing something
11:31Chouserrzoom: vectors are better at this sort of thing than lists. You're sure you need a list?
11:32jdzthe double quoting is not related to that, though
11:32rzoomvectors are fine, still not working as i would expect.
11:32rzoom(map #(replace {%1 1} %2) [2 3] [[0 0 0 0 0] [0 0 0 0 0]])
11:32rzoomreturns ([0 0 0 0 0] [0 0 0 0 0])
11:34Chouser,(map #(assoc %2 %1 1) [2 3] [[0 0 0 0 0] [0 0 0 0 0]])
11:34clojurebot([0 0 1 0 0] [0 0 0 1 0])
11:34rzoom!!!
11:34rzoomthanks!
11:34rzoomis there some reason that the replace shouldnt work?
11:35Chouserreplace isn't about indexes, but about replacing values that are equal to a search value.
11:36Chouser,(replace {0 1} [0 0 0 0 0])
11:36clojurebot[1 1 1 1 1]
11:36rzoomwell played.
11:36rzoomthanks for the insight, must have missed that one.
11:37Chouserhuh, replace doesn't return a seq. I'm surprised.
11:37rhickeyChouser: as documented, no?
11:37Chouserindeed
11:38rhickeythe idea was to make a sparse replace on a vector efficient
11:38Chouserah, ok. Just not something I knew about.
11:42cemerickone thing that surprised me a bit about using sorted-set-by (and therefore PTM with a non-default comparator) is that object that sort equally are treated as duplicates. In my usage, that means that the comparator I provide ends up falling back to = to ensure that 0 is only ever returned for objects that are actually equal (as opposed to sorting identically given the primary comparison I'm using).
11:45rhickeycemerick: ?
11:45cemerickrhickey: just scribbling into the ether, apropos of nothing, really.
11:47cemerickthere's just consequences to using an RB tree for a sorted set, as the set semantics can change compared to regular sorted sets.
11:47Chousercemerick: I think I've heard others express surprise about that before, but it's certainly a more general behavior -- allows you to control what is equal for that set, not just the order.
11:48cemerickok
11:48cemericke.g. (sorted-set [1 2] [-5 10] [1 5]) contains three values
11:48cemerickhowever, one would initially use sorted set like so:
11:48cemericksorted-set-by, I mean
11:49cemerick(sorted-set-by (comparator #(< (first %) (first %2)) [1 2] [-5 10 [1 5]) ==> a set with only two values
11:50cemerickwhen actually, the naive (common sense?) expectation is to end up with a set with the same values as the default-comparator sorted-set, just ordered differently
11:51cemerickbah, dropped a bracket and a paren on that last one: (sorted-set-by (comparator #(< (first %) (first %2))) [1 2] [-5 10] [1 2])
11:55Chouser,(sorted-map-by (comparator #(< (first %) (first %2))) [1 2] :a, [-5 10] :b, [1 5] :c)
11:55clojurebot{[-5 10] :b, [1 2] :c}
11:55Chouserfor those of us without your patch. :-)
11:56cemerickheh
11:56cemerickOf course, none of this is really a problem, but I think sorted-set-by is a bad name, as the membership semantics are different than sorted-set
12:04Drakesonare there plans to include swank-clojure right into upstream slime?
12:07Drakesonis it actually possible?
13:08s450r1 /join #clojure
13:09Chouseryou're already here!
13:11s450r1excellent, this is where I want to be :-) Too bad I don't know how to use IRC
13:11Chouser:-)
14:12hiredman~contrib ticket #1
14:12clojurebot{:url http://tinyurl.com/ntftnj, :summary "Add chunk support to map filter et al", :status :accepted, :priority :normal, :created-on "2009-06-13T14:38:41+00:00"}
14:13hiredmanhmmm
14:15hiredman~contrib ticket #1
14:15clojurebot{:url http://tinyurl.com/lytzu7, :summary "Move Clojure Contrib issues from GC to Assembla", :status :new, :priority :highest, :created-on "2009-06-10T18:34:55+00:00"}
14:33mrsolois assembla better than github?
14:33hiredmanassembla is different
14:34mrsolohmm aseemba is subversion?
14:34mrsoloisn't clojure moving to git?
14:35dnolen_mrsolo: assembla is for issue tracking. clojure is on github already.
14:35hiredmanmrsolo: read http://groups.google.com/group/clojure/browse_thread/thread/d2bf650ab97b204f#
14:36mrsoloclojure_dev group is limited i assume
14:36mrsolomembership that is
14:39Chousermrsolo: anyone who has submitted a CA can be a member: http://groups.google.com/group/clojure-dev/browse_thread/thread/99e2728f665c52fa
14:41mrsologood grief google ad is blocking on view on that link
14:41mrsoloah refresh fixes it
14:42cemerickheh, no one's volunteered for the clojure-contrib issue migration yet, eh?
14:42hiredmanit is off the highest priority...
14:42hiredmanof
14:43Chousercemerick: I spent about 15 minutes looking at what it would take to automate.
14:44hiredmanyou can get an rss feed of gc issues I think, right?
14:45cemerickit *might* be sorta easy, if it weren't for attachments, which are always finicky.
14:45hiredmanhmmm, rss feed is not helpful
14:46Chousercemerick: well, I was aiming for a 70% solution.
14:46cemerickI managed to do about 1.5 issues/minute. Wouldn't take long.
14:46Chouserbut such annoying work. Thanks for doing it, but my goodness.
14:47cemerickmanual is the way to go, if you're objective about cost/benefit
14:47technomancycemerick: what we need is a newbie to come in here wondering, "What's a good project I could use to learn Clojure"
14:48cemerickI'll probably break down and do it this weekend if no one else steps up. :-/
14:48technomancyand then we conscript him
14:48Chousercemerick: unless you place a high cost multiplier on the "annoying work" factor.
14:48cemericktechnomancy: heh, that's my position AFAIC. A little copy-paste action is the least I could do to help out.
14:49cemerickChouser: random scripting jobs are *way* more painful for me than a little bit of data entry.
14:49ChouserNext time somebody complains that contrib doesn't have a release out, they're the one doing it.
14:49technomancynice
14:52bhurt_\?
14:52bhurt_Ignore that
14:52bhurt_Anyone else here?
14:52technomancydefinitely not
14:52Chousernot me
14:53bhurt_So, quick stupid question: is there a way to call an overloaded Java constructor with a variable number of arguments?
14:54Chousersure. did you try it?
14:56bhurt_Yes. I mean, I'm passed a seq of the arguments I want to pass on to the constructor. apply doesn't seen to work.
14:57bhurt_I'm willing to assume there are a valid number and they're of valid types.
14:57bhurt_Nor does playing games with partial seem to work.
15:01achim-_bhurt_: constructors and method calls aren't functions, although they look like some in most cases. but you can't use them as "higher order" functions, i.e. as arguments to other functions
15:01bhurt_Sigh. I was afraid of that.
15:02achim-_you'll have to take apart you argument seq or pull off some macro tricks ...
15:02bhurt_Or just wrap the constructor in a variable arg function, and then apply it.
15:03achim-_right, that's easier
15:04achim-_... but how would it work? you get the optional args as a seq ...
15:05hoeckbhurt_: or use clojure.lang.Reflector
15:05hoecklisppaste8: URL
15:05lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
15:06ChouserIf you don't know the number of args at the point where you call the constructor, you'll have to use reflection.
15:06lisppaste8hoeck pasted "jctor" at http://paste.lisp.org/display/82075
15:07bhurt_achim-_: yes, but then I can call apply on the normal function and pass in the seq.
15:08bhurt_I think I like the idea of using a multiarg function and apply better than using reflection. Maybe that's just me.
15:09Chouserlike (defn foo ([x] (Ctor. x)) ([x y] (Ctor. x y)) ([x y z] (Ctor. x y z))) ?
15:09bhurt_Chouser: exactly.
15:09hoeckbhurt_: the only downside I know of is, that it is slow
15:09bhurt_Oh well.
15:09Chouser"it" being reflection
15:10Chouserthe multibody foo there should be very fast as long as there's only one Ctor per arg count.
15:10bhurt_Chouser: also, reflection is generally complicated, and easy to get wrong.
15:10hoeckmhh, one could write a macro which uses reflection at compile time to generate those functions
15:10achim-_(defmacro applym [this to-that] `(~this ~@to-that))
15:10bhurt_There is.
15:10achim-_(applym .toUpperCase ["quick brown fox"])
15:10achim-_-> "QUICK BROWN FOX"
15:11Chouserbhurt_: clojure.lang.Reflector handles a lot of the complexity, but it's reasonable to avoid it when you can.
15:12bhurt_In this case, it allows me to drop a let expression and just fold it into the pattern matching on the arguments of the function.
15:12bhurt_Which actually simplified the code.
15:13cemerick~ticket #129
15:13clojurebot{:url http://tinyurl.com/nxbzf7, :summary "Add documentation to sorted-set-by detailing how the provided comparator may change set membership semantics", :status :new, :priority :low, :created-on "2009-06-18T19:14:02+00:00"}
15:14cemerickrhickey, Chouser: ^^^, FYI
15:14Chouserachim-_: yeah, but you usually use apply when you don't know the size of your arg seq until runtime.
15:14cemerickthat's my best writeup of it
15:14Chousercemerick: thanks
15:16bhurt_Chouser: in this case I don't, I'm being passed in the seq. Bad programming style, I know.
15:21achim-_Chouser: argh, of course. i think i need to get some sleep
15:33hoeckmay someone briefly explain how a given comparator may change the set semantics of sortet-set-by?
15:33mrsoloRe: Ticket #128: Ensure that PersistentTreeMap.empty() is getting fixed...woot!
15:34cemerickmrsolo: heh, yeah, it's in the queue :-)
15:36cemerickhrm, it occurs to me that I should probably be adding unit tests to contrib as I start pushing patches related to core stuff.
15:36technomancycemerick: yeah, jumping between repos is no fun
15:36cemerickwell, they're always going to be in different repos, no?
15:37cemerick(though, actually, merging clojure and contrib doesn't sound so bad....)
15:37technomancyoh heavens no
15:37technomancyI mean just the test suite
15:38mrsolomerging clojure and contrib? no......
15:38mrsoloi assume contrib will get very big
15:39george_is clojure fast than java or common lisp ?
15:39technomancyI just mean it's unfortunate that when you're working on Clojure itself you have to switch to another repo to work on/run your tests
15:39cemerickwell, I wasn't saying that only one jar file should be produced.
15:39technomancygeorge_: It Depends™
15:39mrsologeorge: clojure can't be faster than java i assume
15:40technomancyit can certainly be faster than poorly-written Java
15:40cemerickmrsolo: the magic wand of pmap makes it functionally faster than java in many circumstances
15:40mrsolowell but that is 'person behind the keyboard' argument
15:41george_what is great about clojure so ?
15:41technomancymrsolo: right, my point is that you can't measure two languages without taking into account other factors
15:41cemerickdoing anything similar is Java is not really workable, IMO, so it's more than the programmer knowing what he's doing
15:41technomancys/measure/compare/
15:41hiredman~git 6e9d29d51acef05e033cd0bed1ac23dc962943c6
15:41clojurebotAdd .gitignore file. Covers classes, jars, and pom.xml.
15:41technomancythat's my patch!
15:42dnolengeorge_: haha, that's a big question. have you gone over the rationale at clojure.org?
15:42george_dnolen: nope
15:42george_dnolen: i will take a look
15:43mrsolotechnomany: but you can give some generalized indication in term of language performance
15:43hiredmanclojurebot: rationale?
15:43clojurebotrationale is http://clojure.org/rationale
15:43mrsoloassuming that human factor is more or less..*cough* equal..
15:44technomancymrsolo: I still maintain that it depends entirely on the problem domain.
15:44hiredman,(/ 300 5)
15:44clojurebot60
15:44hiredman,(/ 300 5 4)
15:44clojurebot15
15:44hiredmanblarg
15:48george_isn't there any other lisp designed for concurrency ?
15:50hiredmanmost don't even have standard threading apis
15:51dnolengeorge_: there aren't many languages designed for concurrency much less lisps ;)
15:53dnolengeorge_: clojure really shines when it comes to single machine concurrency. it doesn't really have distributed concurrency story (some work has been done in this area)
15:54george_that's why lisp is not popular as it deserves ... it is too busy looking backward, instead of looking to the future
15:54george_how about clojure sinthax ? is it similar to common-lisp ?
15:55dnolengeorge_: well that's only partly true. many parts of common lisp seems to be pretty futuristic to me. it simply suffers from being largely invented some 20-30 years ago, and it shows.
15:55dnolengeorge_: syntax in clojure has learned a lot from python/ruby, syntax support for data structures.
15:55dnolen,[1 2 3]
15:55clojurebot[1 2 3]
15:56dnolenfor example is a vector
16:07Lau_of_DKSpeaking of Compojure - I've got a question, when I launch my route-handlers, how do I go about providing them with a sessionID in an elegant way - I want something like this to happend (with-my-binding [foo 5] (defn bar [] (println foo)), which prints 5, regardless of it being defined out of the local scope
16:19Lau_of_DKany takers?
16:26hiredmanhttp://mailinator.blogspot.com/2008/02/kill-myth-please-nio-is-not-faster-than.html interesting
16:30dnolenLau_of_DK: i wonder if this can be handled with the middleware feature? It's called decorate
16:31Lau_of_DKIm not sure - Im more thinking a macro perhaps, like (with-results) from ClojureQL - its not quite what I want, but close
16:31Lau_of_DKHow would you decorate?
16:34dnolenLau_of_DK, never done it myself, but compojure has something called decorate-bind, it takes all your routes and wraps them.
16:34dnolenit looks the decorate macro is the thing to use.
16:34Lau_of_DKI'll have a look
16:35cemerickhiredman: yeah, that particular myth is going to be around forever
16:35cemerickthe lesson is profile, profile, profile
16:40bhurt_"It's more complicated, so it has to be faster!"
16:43mrsoloNIO is not faster? what? hmm
16:44cemerickit *can* be (and is on certain platforms)
16:44cemerickbut in the most common deployment scenarios and platforms, it's on par, or slower
16:44hiredmanmost common being linux?
16:45cemerick(of course, everything is app-dependent)
16:46cemerickhiredman: yeah...most unixes end up being slower. I seem to remember someone telling me that nio screams on solaris, but I've never profiled it myself. I think it was a toss-up on windows when we looked at it.
16:46cemerickthat was two years ago, though, so who knows at this point.
16:47cemerickjeez, that was *two years* ago. :-/
16:48mrsolohmm why are we switching to mina then... *boggle*
16:49hiredmanbecause twitter used mina that one time
16:49cemerickwell, mina is event-driven, right? Having a pleasant programming model could be worth the penalty.
16:49cemerickthat, and hell, maybe NIO will be faster *for you*
16:50hiredmanoh hey, I'm at 100 urls
16:50mrsolowe switched mainly because threads spawning was out of control
16:50mrsoloand of course..expected performance boost
16:52hiredmanhttp://www.usenix.org/events/hotos03/tech/full_papers/vonbehren/vonbehren_html/index.html <-- Why Events Are A Bad Idea (for high-concurrency servers)
16:53mrsoloduh
16:53cemerickouch.
16:54cemerickstill, that was 6 years ago. Things change (they used JDK 1.4).
16:56hiredmanyeah
16:56hiredmanbut things always change
16:56hiredmanlisppaste8: url?
16:56lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
16:56lisppaste8hiredman pasted "ignore this" at http://paste.lisp.org/display/82090
16:57hiredmanwell that did not work
17:00wavisteris there a way to exit a repl without going (. java.lang.System exit 0)
17:01hiredman(System/exit 0)
17:01wavisterthanks
17:01hiredmancontrol c or control d
17:02hiredmanwavister: classes in java.lang.* are essentially "auto" imported, just like they are in java
17:02hiredmanand the modern way to call static methods is (Class/method args)
17:07wavisterok spiff
17:08wavisterso if i did (def x (new StringBuilder))
17:08wavisteri wouldn't do (x/append "stuff")
17:08wavisterstill learning so pardon mistakes if they are there
17:10hiredmanoh no
17:10hiredmanappend is not a static method
17:10wavisterso the / is like a namespace thing? and static methods are essentially defined in the namespace of the class?
17:10wavisterright
17:10hiredmanno
17:10hiredmanthe Class/method is just syntactic sugar
17:11hiredmanit makes it look that way, but (Class/method args) expands to (. Class method args)
17:12hiredmanfor calling methods you use (.method Object args)
17:12hiredman,(macroexpand '(.method Object args))
17:12clojurebot(. (clojure.core/identity Object) method args)
17:12hiredmanhuh
17:12hiredmanthat identity is new, I think
17:21mrsolowhy is it there?
17:25Lau_of_DKFrom suns website: javax.mail.internet.MimeMessage ... Why does this fail: (import '(javax.mail.internet MimeMessage))
17:28hiredmandoes it throw an exception?
17:28Lau_of_DKSure does
17:28Lau_of_DKClass not found
17:28hiredmanis it in your classpath?
17:29hiredmanjavax.mail is not shipped with the jre I believe
17:29Lau_of_DKoh.. then that would be the cause
17:29slashus2It would be nice if they would ship it with the jre.
17:29Lau_of_DKincredible that java doesnt come with some kind of sendmail functionality
17:30hiredmandon't worry, we'll all switch to Wave and email will be obsolete
17:30Lau_of_DKI gotta jet, thanks for chiming in hiredman
17:30hiredmannice to see you around
17:46bhurt_OK, Stupid Question of the day #2: Java Arrays are seq'able, right? I.e. if I have a Java function that returns a Foo[] I can just treat that as a seq of Foo's, right?
17:47Chouseryou can call seq on it, yes.
17:47Chouser,(into-array [1 2 3 4])
17:47clojurebot#<Integer[] [Ljava.lang.Integer;@a96fd2>
17:48Chouser,(filter even? (into-array [1 2 3 4]))
17:48clojurebot(2 4)
17:48bhurt_Thanks.
18:39hiredmanI hate slideshare
18:40hiredmanis it too much to ask people just let me download a pdf?
18:40hiredmanhttp://www.slideshare.net/hlship/clojure-functional-concurrency-for-the-jvm-presented-at-open-source-bridge?type=presentation
18:41rhickeydidn't assembla tickets have tags yesterday?
18:43durka42~ticket #123
18:43clojurebot{:url http://tinyurl.com/lese6n, :summary "GC Issue 119: require doc out of date", :status :test, :priority :low, :created-on "2009-06-17T21:23:16+00:00"}
18:43sudishWould it be possible to have clojure-dev gatewayed to Gmane? http://gmane.org
18:44sudishI added the main clojure group long ago, but clojure-dev subscriptions have to be authorized, so I didn't take the liberty. The sub URL is http://gmane.org/subscribe.php
18:45sudishThe primary advantage over other mailing list archives being NNTP gatewaying. Newsreaders make for a nice mailing list read interface.
18:47eevarpossible to kill off the sourceforge/google code svn repos now?
18:48eevarwell, delete all contents and leave a file redirecting people to github
18:54durka42that seems like not a bad idea
19:11wavisterhow would one evaluate a ratio into a float
19:13hiredman,(float 5/3)
19:13clojurebot1.6666666
19:14wavisterah thanks. how would i have figured that out without asking? i don't much want to read through the whole api every time i don't know how to do something...
19:15wavisterthere's no way to narrow down what i'm trying to look up, it seems
19:16hiredmanwavister: search the api for "float"
19:16hiredman(find-doc "float")
19:17wavistermy point is that to me the name "float" is not obvious. i looked for "toFloat" and "Ratio" thinking I could get methods meant for ratios
19:17wavisternow that i know it it's pretty obvious
19:17hiredmanwavister: how could "float" not be obvious?
19:19wavisterit doesn't seem like an operation you would do on a ratio to me. maybe i'm obtuse, but that's what I think. the real problem is that i'm intimidated by the api being just a huge list of functions with no segmentation.
19:19hiredmanwavister: there is segmantation
19:20hiredmanlook, if you had just typed "float" into your browsers search thinger, the second or third hit is "float"
19:20wavisterok, no argument
19:20hiredmangood
19:20wavisteri appreciate the pointer, also
19:21mrsolohttp://mailinator.blogspot.com/2008/11/so-our-core-duo-server-now-gets-3.html so he really doesn't like nio
20:01technomancyso it looks like nailgun doesn't set up stdin and stdout for you?
20:05technomancyhmm; docs seem to say it's supported, but it doesn't get set up for you automatically
20:08bpattisonI'm trying to call this java function in clojure
20:08bpattisonStringTemplate hello = new StringTemplate("Hello, $name$", DefaultTemplateLexer.class);
20:08bpattison-- where --
20:08bpattison(import '(org.antlr.stringtemplate StringTemplate))
20:08bpattison(import '(org.antlr.stringtemplate.language DefaultTemplateLexer))
20:08bpattison(def x (new StringTemplate "Hello $name$") (. DefaultTemplateLexer class)))
20:08bpattison-- but I get --
20:08bpattisonjava.lang.NoSuchFieldException: class (NO_SOURCE_FILE:37)
20:08bpattisonI'm not only a clojure noob, am a java noob as well -- so any help would be appreciated
20:16technomancylooks like it does the right thing with System.in, but *in* doesn't pick that up. easy workaround
20:19bpattisonI probably need to understand what DefaultTemplateLexer looks like in Java before I can use it in Clojure
20:21bpattisonanyway to get the methods/attributes of java class in clojure?
20:22technomancybpattison: use the show function from clojure.contrib.repl-utils
20:22technomancyclojurebot: show?
20:22clojurebotshow is clojure.contrib.repl-utils/show
20:22bpattisonexcellent -- thanks!
20:22technomancythough if you use slime it's just C-c I
20:24bpattisontechnomancy: that worked perfectly!
20:25jtalwhen I try to "use" stuff and its not found- where should they be by default?
20:25mrsoloslime is great
20:48jtalclojure.contrib.* not included maybe?
21:47blbrown_win2what is the syntax for varialble args. (defn abc [a b [& c]] (when c (println c))) ...?
21:54liebkeblbrown_win2: try (defn abc [a b & [c]] (when c (println c)))
22:00texodusmake sure clojure-contrib is on your classpath
22:04blbrown_win2texodus, that is part of clojure-contrib?
22:15jtalis everyone eating dinner? :>
22:26blbrown_win2programmers don't eat
22:27jtalthey look like they do
22:29jtalmy current issue is resolved; the book uses contrib.str-utils and forgets to mention that its a separate thing to get
22:30jtalthen when I try to find it the first thing I have is the assembla page which doesnt seem to have the code, then I find the google code page which has nothing under "downloads"; then I notice they are in the middle of moving and assume things are in limbo; finally, I find it under source on google page