#clojure logs

2010-06-21

00:01mae8. Also compilation (javac implementation in clojure) is the only thing we need to consider for above mentioned points 2, 2a, and 3.
00:04arbschtI'll bite. why is this a good idea?
00:04maeSigh, I guess succinctly all I'm really trying to say is, how can we streamline the JVM so we can use pure streamlined clojure, and we can choose which webservers such as jetty we want to embed. but what do we really need in the jvm platform? Can we not port existing webservers written in common lisp such as CL-HTTP and abandon all the Java multiple-applications-on-one-webserver-instance-failure; instead of jetty we can port CL-HTTP for example.
00:05maeWow that was terribly jumbled
00:05maearbscht: thanks for playing; ok so here is the deal. Why don't we take the one good thing about the Sun JVM (The HotSpot VM) and abandon all the Java Community Process baggage?
00:05maeIf that makes sense
00:06arbschtis that really the only good thing about it?
00:06clojurebot@ has nothing to do with whether sth is evaluated or not
00:08arbschtand how much of a real problem is it implementing on top of an existing platform? especially with cinc...
00:11arbschthrm, it's beer o'clock, bbl. happy clojuring! :)
00:17technomancymae: rich is already working on Clojure-in-Clojure
00:18technomancymae: but supporting Common Lisp is never going to happen
01:35tomoj,(keyword "'")
01:35clojurebot:'
01:35tomoj,(keyword ",")
01:35clojurebot:,
01:35tomoj:/
01:36tomoj,(keyword "foo bar")
01:36clojurebot:foo bar
01:36tomojI suppose this means you need to be pretty careful about what you pass to keyword if you plan to read it back later
01:57tomojthe fact that zipper locs are vectors seems to make it so that c.c.zip-filter.xml/xml-> can't be chainable :(
01:57tomojas in, you can't do xml-> on a seq of locs
01:58tomojguess you can just map xml-> over it
02:22serp_,(map + {:x 1 :y 2} {:x 3 y: 4})
02:22clojurebotInvalid token: y:
02:22serp_,(map + {:x 1 :y 2} {:x 3 :y 4})
02:22clojurebotjava.lang.ClassCastException: clojure.lang.MapEntry cannot be cast to java.lang.Number
02:23serp_is there a way to do that? the result I want is {:x 4 :y 6}
02:25hoeck,(merge-with + {:x 1 :y 2} {:x 3 :y 4})
02:25clojurebot{:x 4, :y 6}
02:26serp_nice!
02:30Blackfootis there a ref? function? returns true for any of agent, atom, ref?
02:34zmilajust yesterday i read about (merge-with ) in the "Practical Clojure" book :)
03:54LauJensenMorning guys
03:54DarthShrineHi LauJensen
03:58TheBusbymorning
04:18miltondsilvahi, I'm having a bit of trouble sending a clojure map over a network.. is there someplace where I can see some examples?
04:31TheBusbymiltondsilva: Not exactly what you're looking for, but this shows one serialization mechanism: http://www.bestinclass.dk/index.clj/2010/01/hadoop-feeding-reddit-to-hadoop.html
04:48miltondsilvaTheBusby thanks
05:07Licenseraloa
05:09Licensermiltondsilva: how are you trying to do it?
05:10Licenserwoha this is lagg sorry I dc'ed in the middle I hope your question was answered yet?
05:10miltondsilvaLicenser: Yes, thank you
05:11Licenserokay that is good
05:24Licensercoookies
06:40LauJensenserializing Clojure data = prn :)
07:49bartjtrying to understand regex functions in clojure
07:49bartjwhy does this return "foo bar" twice?
07:50bartj, (re-find #"(f(oo bar))" "foo bar")
07:50clojurebot["foo bar" "foo bar" "oo bar"]
07:50bartjmy understanding is that since there are only two groupings,
07:50bartjthe returned vector must contain only two elements - "foo bar" and "oo bar"
07:51raekgroup zero is the whole expression
07:51raek,(re-find #"f(oo) bar" "foo bar"=
07:51clojurebotEOF while reading
07:52raek,(re-find #"f(oo) bar" "foo bar")
07:52clojurebot["foo bar" "oo"]
07:52raekif you have n groups, there will be n+1 elements in the resulting vector of re-find
07:58bartjraek; but, the first one is always useless
07:58bartjI can't think of why it is always included?
07:59raekthis is due to some old convention, I think
07:59raekI haven't used it either
07:59cemerickbartj: all regex libraries provide the entire match as group 0
08:00cemerickit's not useless if you need the whole match
08:00bartjhmm, ok
08:00raekI often do a (if-let [[_ a b] (re-find #"...(...)...(...)..." s)] (do-something a b))
08:00raekuseful for parsing
08:02bartjis there a better way to remove the first match than:
08:02bartj, (pop (into [] (reverse (re-find #"(f(oo bar))" "foo bar"))))
08:02clojurebot["oo bar" "foo bar"]
08:03serp_,(re-find #".+" "a")
08:03clojurebot"a"
08:03serp_,(re-find #".+" "")
08:03clojurebotnil
08:04bartjraek: yeah, that is definitely better!
08:11raekbartj: then you might like this: http://gist.github.com/446760
08:14bartjraek: if-let would not work, if I did not know the number of matches that are returned by re-find
08:15raekre-find returns the number of groups plus one things
08:15raekit only looks at the first match
08:15raekre-seq gives the sequence of all matches
08:17raekfor example, #"the (\w*)" might find more than one match
08:19raekbut if tou don't know the number of groups, I guess you could just use (rest (re-find ...))
08:19raekto get a seq of the groups
08:21bartjok, thanks a lot!
08:29Licenserbartj: next?
08:29Licenser$(next (re-find #"(f(oo bar))" "foo bar"))
08:29sexpbot=> ("foo bar" "oo bar")
08:32bartjLicenser: yes, thanks
08:32Licensersorry it was late and redundant :P
08:32Licenserbut next and rest gracefully handle no matches too
08:32Licenser$(next (re-find #"(f(oo bar))" "gooble gobble"))
08:32sexpbot=> nil
08:32Licenser$(rest (re-find #"(f(oo bar))" "gooble gobble"))
08:32sexpbot=> ()
08:32Licenserdepending on what is more fitting for you
08:34Licenserif you use if-let next might be better, if you always want a list rest is your friend
08:40bartjLicenser: free advise must not be prefixed with a sorry :)
08:40Licenserbartj: wait, who saied it is free? I have already send out the invoice!
08:40LicenserThe advice costs you one happy<tm>
08:41bartjok, does format take a sequence?
08:41bartj, (format "%s::%s" "abc" "xyz")
08:41clojurebot"abc::xyz"
08:41bartjI have abc and xyz as elements of a sequence
08:42raekno, but you can always use (apply format my-seq)
08:42raek,(apply format "%s::%s" ["abc" "xyz"])
08:42clojurebot"abc::xyz"
08:42raekeverything between the function and the argument list gets appended to the front of the arg list
08:43raek(apply f a b c [x y z]) => (apply [a b c x y z])
08:43raekcan be very convenient
08:44bartjcool! have been using apply only to sum, concat,etc. till now
08:49Licenserapply is a very powerful tool
08:50rhickeycan anyone figure out what this has to do with Clojure? : http://service-architecture.blogspot.com/2010/06/rest-has-put-enterprise-it-back-five.html?utm_source=feedburner
08:54mmarczykrhickey: I was wondering if the CA I mailed off a week ago or so might have reached you by now? if yes, I'd apply for clojure-dev membership and maybe you could bump up my Assembla status
08:55bartjrhickey: It says all the cool kids are playing with Clojure and hence, there is now a vacuum in enterprise IT
08:55rhickeyI just did a bunch, if your names not here, you'll be in the next batch: http://clojure.org/contributing
08:56bartjQuote from the article - " With all of the cool, and smart, kids off playing with REST and Clojure and the like we've got an intellectual vacuum in enterprise IT that is being "filled" by the vendors in the only way that vendors know how."
08:56mmarczykrhickey: ok, thanks
08:57mmarczykas for the article, I read it as a statement of "Clojure hasn't managed to save enterprise IT before seeing reasonable adoption in the enterprise IT"
08:58mmarczyka terrible shortcoming I should say, makes one wonder if your work makes sense at all... :-P
08:59mmarczykit's also saying the same with s/Clojure/REST/g, I've no opinion on that though ;-)
09:06Licensergreetins rhickey :)how are you today?
09:09rhickeyLicenser: fine
09:10Licenserglad to hear :) and to your article I don't see anything to do with clojure yet really, nor do I agree with it.
09:12LauJensenHehe, fun article, good find rhickey :)
09:14LauJensenSeems to be an emotional rant, so I imagine that the author just doesnt like Clojure and included it therefore
09:14rhickeybest ignored
09:15mmarczykright
09:15Licenserrhickey: clojure is a easy target in that earea, it is so young that - of cause - the big enterprise impact is close to zero
09:15LicenserIf he had written Ruby a lot of people would have cried 'not true we use ruby in enterprisy stuff'
09:15Licensersame for python or other high roller dynamic languages
09:16LicenserI'm not even sure if clojure was around 5 years ago
09:18_extermhello everybody.
09:18mmarczykhowever well-respected JVM people -- Cliff Click and Alex Buckley, say -- already mention Clojure in their far-from-Clojure-specific talks / blog posts and give careful consideration to its design, so in this way it's making quite a splash
09:18Licenserhi _exterm
09:18_extermWhere or how can I change the clojure version leiningen uses for compilation with lein jar ?
09:19mmarczykthe enterprise is hardly going to jump the Java ship, as well it shouldn't, they probably should be a bit slow... but hopefully they pay attention
09:19_extermany leiningen experts here? :-)
09:19Licensermmarczyk: of cause it is but clojure is in a early stage, we see it right now with the primitive discussion. While I greatly enjoy this it is not what huge highly reliable systems are build on
09:20mmarczykthat would be what I meant by saying that enterprise should be a bit slow :-)
09:20mmarczyk_exterm: project.clj
09:20mmarczyk_exterm: whatever Clojure version you put there is going to be used, I guess
09:20LauJensenLicenser: There are already hugely reliable systems, mission critical systems, which are backed by Clojure
09:21LauJensenBut change doesnt come overnight as most companies are entrenched - A financial crisis helps a little though
09:21mmarczyk_exterm: (if you believe something else happens, please double check, than complain about it as a bug)
09:21_extermmmarczyk: in dev_dependencies?
09:21mmarczyk_exterm: no, in :dependencies
09:22mmarczyk_exterm: lein new foo gives you a skeleton with Clojure 1.1 included in project.clj, have a look
09:22LicenserLauJensen: I expect them in startups - of cause, so I'd be really surprised to see them in the big companies
09:22LauJensenDont be, they're already there
09:22_extermTo elaborate, I got the latest version of swank-clojure and I want to compile it with a clojure compiler that I have modified
09:22LicenserThen I'm surprised, but just to be annoying who are they? Where do I need to apply :P
09:22_extermmmarczyk: OK, I'll investigate the result of lein new.
09:22mmarczyk_exterm: swank-clojure doesn't require compilation
09:23mmarczyk_exterm: no aot'ed namespace, iirc
09:23_extermmmarczyk: hmm
09:24mmarczykjust use it with your project, it'll be loaded (and compiled in the process of being loaded) by whichever version of Clojure your project uses
09:24mmarczykswank-clojure.jar contains .clj files, not compiled classes
09:24Licenserlein-search might be a nice dev dependency too ^^
09:26mmarczykLicenser: what's that? I think I read about something by that name, but can't recall what it was about...
09:26Licensermmarczyk: that is something that makes the managing dependencies a little easyer on you :) at least as long as they are on clojars
09:26Licenseryou can search for versions, update when there are new versions add and remove .jars from clojars
09:29kib2Hi guys; is there any need for a syntax-highlighter in Clojure ? If so, I could try to port mine.
09:30lpetitkib2: can you be more precise ?
09:30mmarczykLicenser: ah, interesting -- I'll have to look into it
09:30Licenserand if you've a problem with it feel free to bug me :P
09:30Licenserthis is all in the sake of self-advertisement ;)
09:31kib2lpetit: For example http://prism-pastebin.heroku.com/57
09:31kib2lpetit: Frenchie ?
09:31LauJensenlpetit: While you're working, could you please ask etate for some help on picking colors for CCW?
09:32lpetitLauJensen: etate ?
09:33LauJensenlpetit: Yea, he does great color-themes for coding, and frankly the excess of pink in CCW is quite hard on the eyes :)
09:33lpetitLauJensen: why not. But I you feel like you can do it yourself, you can already go to the preference pages of ccw and try alternative colors.
09:34lpetitLaujensen: I'm open for suggestions in this area
09:35Licenserkib I've written clj-highlight which does syntax highlighting for clojure in clojure and is pretty extendable I think
09:35lpetitkib2: is this syntax highlighting, or lexical highlighting ? :-p
09:36kib2lpetit: syntax one, but adding some lexical stuff shouldn't be too hard (in fact it is for ie Ruby herodoc strings).
09:37kib2Licenser: I wasn't aware of your project. Where can I give it a try ?
09:37Licensergithub, one second I look for the link
09:37lpetitkib2: sorry, but I see syntax coloring as subsuming lexical coloring, and that some times lexical coloring is called syntax coloring
09:37Licenserhttp://github.com/Licenser/clj-highlight
09:37Licenserkib2: started it while talking to the coderay maintainer
09:37kib2Licenser: thanks
09:38Licensertry-clojure.org uses it for code highlighting
09:38lpetitLicenser: used a hand-made lexer or parser ?
09:38chouserIt sure would be handy to have a way to mix method implementations into reify.
09:38lpetitLicenser: or uses the reader ?
09:38Licenseryes it's all hand written
09:39djpowellI thought reductions was lazy?
09:39Licenserit isn't made specifically for clojure, thus using the reader would be 'cheating'
09:39djpowell,(first (reductions max (map (fn [x] (println ".") x) [2 4 7 8 3 5 1])))
09:39clojurebot2
09:39clojurebot. . . . . . .
09:40chouserdjpowell: probably chunked
09:40djpowellah
09:40djpowellof course
09:41djpowellhmm - I could do with seq1 really, as I'm only using reductions to avoid having to process more of the list than necessary in my get-best-item-but-stop-trying-if-we-reach-the-optimal-metric function
09:42Licenserdjpowell: you should think about renaming it .P
09:42djpowellha
09:42Licenserif the function name is longer then the body you've done something wrong
09:42chouserLicenser: I'm pretty sure there are people who would disagree with that.
09:43Licenserchouser: there are usually people who disagree with me, but they are wrong most of the time :P
09:44djpowellthat wasn't really the function name guys!
09:44Licenseryea sure I'd say that to
09:44Licenserets rename + to take-two-or-more-numbers-then-add-them-togehter-if-there-is-only-one-nuber-return-it-if-there-is-no-number-return-zero
09:44chouserwe don't have a seq-iterator fn, do we?
09:45Licenserwe have a function that takes a iterator and makes a seq from it yes
09:45chouserjust iterator-seq ?
09:45Licensersomewhere idden I found it once
09:45chouserI want the other way 'round
09:45Licensermeh meh meh
09:45Licenserbut it would be a nice function I guess
09:45chouseronly for interop
09:46cemerickchouser: I think many people have written it at least once.
09:46sparievhi all, I need some help with macros - http://gist.github.com/446863
09:46chousercemerick: I suppose so. but it's not in contrib or something?
09:46cemerickchouser: doesn't look like it
09:47cemerickseems like a good item for core, really
09:47chouseractually, I'd rather it be a protocol. heh. it being java.util.Iterator, I suppose.
09:47chouseroh well.
09:47LauJensenspariev: (execute-query `items..) => `(execute-query ~items).. depending a little on what items should be
09:47chouseroh, it's mutable. gah.
09:48Chousukeprobably ~'items in this case
09:48Chousukebut that's not very good style /:
09:48Chousukeconstructing the query from a string isn't very good style either ;P
09:48LauJensenChousuke: I agree, he should use ClojureQL instead
09:50sparievLauJensen: I'm still waiting for newest & latest ClojureQL )
09:50rhickeychouser: the thing you have isn't Iterable?
09:50chouserthe thing I have is a reify I'm writing. :-(
09:50LauJensenspariev: Well, the master branch is still very good, but the next evolution will be much better :)
09:50chouseroh. actually it's what 'for' returns
09:51chouserwhich ought to work fine. hm...
09:51sparievwell, I'll better rewrite second macros into somethng simples, multulevel quotes are too complex
09:51sparievsimpler*
09:51rhickey,(.iterator (for [x (range 3)] x))
09:51clojurebot#<SeqIterator clojure.lang.SeqIterator@1fabfb3>
09:52chouserrhickey: yes, prefect question! Thanks!
09:52LauJensenspariev: Even still, it seems like you're reinventing something thats been around for a while. Both contrib.sql and clojureql allow for somekind of wrapper around a query. We use run
09:52Licenserit surprises me every time how briliantly simple things in clojure can be :)
09:55_extermmmarczyk: thanks, I've got it working now.
09:59sparievlaujensen: I've got a few handwritten queries that are too complex for the current version of ClojureQL, so I have to resort to building queries with str
09:59sparievand my macros are basically wrappers around c.c.sql/with-query-results
10:00LauJensenspariev: so use the 'raw' query type, and you can still get all the other benefits
10:00LauJensen(raw "SELECT * table1") == (query table1 *)
10:00LauJensenI have to duck out now, but I hope you work it out :)
10:01sparievLaujensen: thanks for the help
10:25hoeckconcat isn't lazy anymore, can anybody confirm this?
10:25hoeck,(let [x (apply concat (repeatedly #(do (print "X") [1 2 3])))])
10:25clojurebotXXXX
10:25hoeckthis should only start printing the "X" when I start to request the first value of seq x
10:26hoeckor am I wrong?
10:26LauJensenhoeck: Im wondering if its because its chunked, and therefore loads the first 32 or so items
10:26sclvIs there some handy function for turning a clojure map into a typical java map for marshalling purposes, etc., or do I need to roll my own?
10:27raekthere is a lazy-cay, so my guess is that concat isn't lazy
10:27raekbut I don't know any reasons for this
10:27hoeckLauJensen: thats ok, but shouldn't it wait to evaluate the sequence until I am requesting the first element?
10:28LauJensen$(let [x (apply concat (repeatedly #(do (print "X") (repeat 60 1))))])
10:28sexpbot=> XXXX nil
10:28hoeckafter requesting the first element, I' fully aware that there will be some chunked precalculations
10:29chouserconcat is definitely still lazy
10:29Raynes$(type (concat [3] [4]))
10:29sexpbot=> clojure.lang.LazySeq
10:29RaynesLazy.
10:29LauJensenchouser: So what about those 4 xs ?
10:30cgrandhoeck: side effect of apply, applys has no guaratees towards laziness
10:30cgrand,(let [x (apply concat (repeatedly #(lazy-seq (do (print "X") [1 2 3]))))])
10:30clojurebotnil
10:30hoeckI mean technically its a lazy seq, but its behaviour is not fully lazy, its like the old lazyness, where the first element was always computed eagerly
10:30chouser,(take 1 (apply concat (repeatedly #(do (print 'X) '(1)))))
10:30clojurebot(1)
10:30clojurebotXXXX
10:30RaynesHuh.
10:31chouserif concat were eager, that would never return, right?
10:31RaynesSince when does clojurebot distribute results over more than one message?
10:31cgrand,(take 1 (apply concat (repeatedly #(lazy-seq (print 'X) '(1)))))
10:31clojurebot(1)
10:31cgrandno X?
10:32cgrand,(flush)
10:32clojurebotnil
10:33hoeckmy problem was actually a long seq computation with a blocking queue as the source and a mapcat: (->> (repreatedly #(.take q)) (filter ..) (mapcat ..) (filter))
10:34hoeckand I expected the mapcat to just work like a normal lazy map, though mapcat docs do not state any lazyness
10:35hoeckmy workaround is to have my own totally lazy concat definition
10:35hoeckand I was just wondering if that is the right mapcat/concat behaviour or a bug
10:40r0manHi there, when I (compile 'burningswell.servlet) I end up with classes of all namespaces that I'm depending on. All of clojure, clojure-contrib, the ring dependencies etc. are compiled into my "classes" folder. Is this the supposed behaviour? Did this change in clojure 1.2? How can I compile only this namespace?
10:42cgrandhoeck: does the function passed to mapcat return a lazy seq?
10:43hoeckcgrand: its a #(repeatedly (.take q))
10:43hoeckwhere each take on the BlockingQueue q returns a vector
10:45cgrandhoeck: in (->> (repreatedly #(.take q)) (filter ..) (mapcat XX) (filter)), you mean that XX is #(repeatedly (.take q))?
10:46hoeckcgrand: sorry, didn't understand that
10:47cgrandyou said that your code was something like that (->> (repreatedly #(.take q)) (filter ..) (mapcat XX) (filter ..)), right?
10:47hoeckright
10:49cgrandhoeck: I'm interested in what the XX function returns
10:51hoeck(.take q) returns a vector hashmaps
10:51hoeckand XX returns a specific key of such a hashmap
10:51hoeckwhere the value is again a vector of vectors
10:53cgrandif XX could return a lazy seq, I think it would solve your laziness problem
10:54AWizzArdCan Java programs make use of Clojure-Protocolls?
10:54hoeckthe problem is, that the whole sequence expression was blocking, although I did not request the first element, I just tried to return it
10:55hoeckthe problem boiled down to (apply concat a-lazy-seq-of-seqs) always evaluates at least the first seq
10:56raekr0man: I think this is a known issue... I can't find the ticket
10:56chouserAWizzArd: yes, defprotocol generates an interface with the name you'd expect, no munging.
10:57r0manraek: so it's clojure 1.2 specific?
10:58raekhttp://www.assembla.com/spaces/clojure/tickets/322-enhance-aot-compilation-process-to-emit-classfiles-only-for-explicitly-specified-namespaces
10:58raekno, it's not, I think
10:58rhickeyuser=> (defn foo [] (loop [x 1 y 2.0 z 42N] (recur 42 42 42)))
10:58rhickeyNO_SOURCE_FILE:26 recur arg for primitive local: y is not matching primitive, had: long, needed: double
10:58rhickeyAuto-boxing loop arg: y
10:59Licenserrhickey: that is awsome, the changes of loop!
10:59cgrandhoeck: I agree with the pb being with (apply concat a-lazy-seq-of-seqs), my argument is that changing that to (apply concat a-lazy-seq-of-lazy-seqs) make it go away
11:00cgrand,(let [x (apply concat (repeatedly #(lazy-seq (print "X") [1 2 3])))]) : hoeck
11:00clojurebotnil
11:01hoeckcgrand: that might just be it, thanks, I'm trying it
11:05cgrandrhickey: great commit!
11:06r0manraek: If I remember correctly, I didn't had this problem some months ago with an earlier version. I'm developing a web application on Google App Engine, and just noticed this problem because App Engine was complaining that I reached the max. number of files I can have in my project. Since then I switched clojure versions, build system and other libraries. Maybe I have to look into my dependencies or the build system
11:06r0manto get rid of those class files. Thx anyway ...
11:08raekI have had this problem in 1.1.0, IIRC
11:08raekI have only recently started to use 1.2.0
11:10Chousukethe prim thread must be one of the longest on the Clojure group so far. :P
11:12cemerickraek: I've got half of a fix over here. It's a fairly simple thing in the end.
11:13cemerickIf I can clean it up this week, I'm hoping to convince rhickey to let it into 1.2.
11:15r0mancemerick: that would be wonderful ...
11:17raekcemerick: ah, great!
11:18djpowellre seq-iterator - don't seq's implement Iterable - ie, implement a .iterator() method?
11:19djpowellwell, ASeqs do
11:23chouserdjpowell: yeah, I was being dumb.
11:29AWizzArdDo (keys map) or (vals map) cons much? Or do they use an already existing structure and thus run in O(1) and MemoryO(1)? :)
11:32LicenserAWizzArd: since they return them unsorted I guess they will run in O(1) but that it is a guess
11:32arohneris anyone successfully using lein with nexus?
11:32LicenserI think they'll just 'Walk' the leaves or nodes of the tree
11:33HerrBlumehow do i create a java byte array?
11:33AWizzArd,(byte-array [(byte 10) (byte 20)])
11:33clojurebot#<byte[] [B@45d9be>
11:33HerrBlumeah, thank you
11:33AWizzArd,(vec (byte-array [(byte 10) (byte 20)]))
11:33clojurebot[10 20]
11:33AWizzArdas literal numbers are not bytes you need to make them bytes first
11:34AWizzArd,(byte-array (map byte [1 2 3]))
11:34clojurebot#<byte[] [B@106a66b>
11:34AWizzArd,(doc vals)
11:34clojurebot"([map]); Returns a sequence of the map's values."
11:34AWizzArdLicenser: it mentions a seq, not a lazy one.
11:34HerrBlume,(byte-array 1024)
11:34clojurebot#<byte[] [B@1926cb6>
11:34HerrBlume,(byte-array 102400000000000000000000000000000000000)
11:34clojurebotjava.lang.ExceptionInInitializerError
11:34HerrBlumekk
11:35AWizzArdAber aber, HerrBlume, was versuchst du da nur ;)
11:35Licenserhmmm
11:35HerrBlumesry
11:36AWizzArdLicenser: a walker over the existing structure would be nice, as this could be done with basically no extra memory usage
11:36AWizzArdwhich is nicely when doing this with a 47 GB hashmap
11:36AWizzArd-ly
11:37Licenserhttp://github.com/richhickey/clojure/blob/equal/src/jvm/clojure/lang/APersistentMap.java#L104
11:46HerrBlumehm, is there an easy way to parse an xmlstring?
11:46chouserHerrBlume: I think there is an example of that at the bottom of clojure.contrib.lazy-xml
11:49HerrBlumeah, ok
11:50HerrBlume,(clojure.xml/parse (java.io.StringBufferInputStream. "<foo/>"))
11:50clojurebot{:tag :foo, :attrs nil, :content nil}
11:52HerrBlumethis is cool
11:58LicenserHerrBlume: watch out that you don't have w3c DTD's in the xml otherwise the parser goes nuts :P
12:03HerrBlumeLicenser: what are w3c DTD's?
12:04HerrBlumeah docuemnt type declarations, ok
12:04HerrBlume<!doctype blah>
12:05riddochcSo, am I remembering correctly that stuart halloway and rich hickey are working together these days? Or was it someone else? I can't seem to find the announcement in my mail archives.
12:08riddochcnm, it's halloway.
12:20dnolenany tried to use ring with httpcore?
12:21dnolens/any/anyone
12:21riddochcdnolen: I haven't yet, but it's on my list.
12:22dnolenI'm running into address already bound exception which doesn't make much sense.
12:25riddochcdnolen: As in, the server can't listen on the port? That happens to me when something else is already listening on the port.
12:26riddochcI once had some weird issue where linux was taking a surprisingly long time to allow another program to listen on the same port after the first stopped.
12:28riddochcSpecifically, it was with socat. I had a command like "socat tcp-l:20001 SSL:someserver:portnum,verify=0"
12:28nDuffthere are some flags which can be set on the LISTEN socket to make it be released more readily
12:29riddochcIf I killed socat and restarted it, it didn't want to listen on the port. I had to do "socat tcp-l:20001,reuseaddr ..." to make it work.
12:31dnolenriddochc: it doesn't matter what I set the port to
12:31riddochcYeah, this is relevant: http://stackoverflow.com/questions/775638/using-so-reuseaddr-what-happens-to-previously-open-socket
12:31dnolensame exception
12:32rhickeyriddochc: you are all set on the CA list: http://clojure.org/contributing
12:32riddochcrhickey: Great, thanks!
12:34riddochcrhickey: Google says my clojure-dev membership is pending. Want me to cancel & retry, or can you add me there?
13:04jkkramerrhickey: getting an exception on the equal branch with clojure.contrib.string/partition: (require 'clojure.contrib.string) (clojure.contrib.string/partition #"[a-z]+" "abc123def")
13:04jkkramer=> clojure.lang.Numbers.add(II)I [Thrown class java.lang.NoSuchMethodError]
13:08ajazzhello, could somebody explain it (http://pastebin.com/xBHUZ6Fr) for me?
13:10riddochcajazz: http://clojure.org/data_structures describes how IPersistentList and IPersistentVector are different.
13:12ajazzyeh, thanks, but when I pass vector to function and call conj I get element added at the begin of the vector
13:15jkkramerajazz: the destructuring makes the tail a seq, not a vector
13:15jkkramer,(let [[h & t] [1 2 3 4 5]] t)
13:15clojurebot(2 3 4 5)
13:17ajazz,(type (let [[h & t] '(1 2 3 4 5)] t))
13:17clojurebotclojure.lang.PersistentList
13:18ajazz"conj puts the item at the front of the list."
13:21jkkramerajazz: for lists and seqs, yes
13:21jkkramer,(conj [1 2 3] 4)
13:21clojurebot[1 2 3 4]
13:21jkkramer,(conj (seq [1 2 3]) 4)
13:21clojurebot(4 1 2 3)
13:21ajazzjkkramer: ok, when I call type on t it returns PersistentList
13:21ajazzI expect t will behave like list
13:22rhickeyjkkramer: works, here, did you rebuild contrib?
13:23jkkramerrhickey: using the latest contrib build from build.clojure.org
13:23jkkramerrhickey: will try building locally...
13:26ajazz, ((fn [s] (let [[h & t] s] (do (print (type t)) (conj t h)))) '(1 2 3))
13:26clojurebot(1 2 3)
13:26clojurebotclojure.lang.PersistentList
13:33jkkramerrhickey: rebuilt contrib, still getting the exception. here's the exact steps I'm following: http://gist.github.com/447181
13:33ajazzjkkramer: ok, I got it, thanks for help
13:34jkkramerajazz: np
13:38rhickeyjkkramer: you need to mvn clean, then build against the version of clojure you built from the equals branch:
13:38rhickeymvn package -Dclojure.jar=/Users/rich/dev/clojure/clojure.jar
13:38rhickeyseems like you are building contrib against a Clojure snapshot jar
13:40jkkramerrhickey: you're right, sorry for false report
13:48mmarczykrhickey: would it be possible for the ^:static functions to generate Object-taking overloads so that the same arities+bodies may be used with boxed numbers?
13:49dnolenmmarczyk: I thought that was already the case. some-static-fn -> #'some-static-fn is boxed
13:50mmarczykdnolen: ah, of course, thanks
13:54rhickeymmarczyk: still thinking about type overloading - the set would be long/double/Object, but you don't always want the same bodies
13:54mmarczykrhickey: that's true
13:55mmarczykrhickey: I've been trying to squeeze a non-promoting (obviously!) primitive version and a promoting boxed version together... I suppose that's semantic abuse, but I don't even know what the would be supposed to look like
13:55mmarczyk...what that would...
13:57rhickeymmarczyk: yes, semantic abuse
13:57mmarczykrhickey: by the way, might the ^:static machinery make it possible to use Clojure namespaces directly as classes in Java code? my.ns.foo();
13:58rhickeymmarczyk: not the intent, no
13:59mmarczykah, ok. no real reason to ask though... just curious
14:01AWizzArdHow interchangable are primitves vs their Wrappers?
14:02AWizzArdFor example, when I declare a fn to take an ^int but call it with an Integer
14:02AWizzArdOr vice versa
14:09mmarczykrhickey: I think I broke latest equal, http://gist.github.com/447233
14:10mmarczykAWizzArd: in general, the primitive will be boxed for you when needed... I think I've just hit something funky with locals' behaviour on equal in this area, though
14:10mmarczykrhickey: that's with *warn-on-reflection* set to true
14:11mmarczykrhickey: ah, wait, scratch that... with *warn-on-reflection* false it's still broken (hangs), with true it's more spectacular
14:16chouserI'd rather have a way for libs to turn that on/off for themselves without effecting other libs they use or are used by.
14:16mmarczykAWizzArd: most of it is not aot'd, though, so if you (set! *warn-on-reflection* true), I think you'll get warnings when you require (if indeed there are any)
14:16mmarczyk(someone please correct me if I'm wrong)
14:16mmarczykoh, and (inc chouser)
14:19AWizzArdYes, this would be a nice default during the development of a contrib. There are still several areas that would like to get type hints :)
14:21chouserwhy? performance?
14:24cemerickThere's not a lot of interop in contrib as it is.
14:36LauJensenIn the styleguide its stated that we should consider a macro, if all of the information is available at compile time to improve performance, but Im guessing that advice will change with the merging of prim ?
14:51AWizzArdIs it possible to make a Protocoll for specific classes? Such as (foo Integer 1 2) (foo MyRecord 3 4) (Foo String 5 "abc") etc?
14:52AWizzArdfirst arg is the class, not an instance of it
14:54AWizzArdOr is this something that can be done with :static fns?
14:55chouserHow is that not just a regular function?
14:55chouseroh, you want to dispatch based on the instance of the first arg (not its type)?
14:56AWizzArdThe first arg would be of type Class
14:56AWizzArdAnd I want to dispatch on that.
14:56AWizzArdMultimethods come to mind, but what about Protocols?
14:58the-kennyAWizzArd: I don't think so.. Maybe you can extend java.lang.Class, but that wouldn't enable you to dispatch on specific instances
14:58utgois there a more convenient way to write nested operations like this? (s/replace (s/replace str "\n" "") #"\s+" " "))
14:59chouserutgo: the -> macro
14:59utgochouser: ah thanks
15:26OForerohi
15:26OForeroI was wondering if somebody knows if incanter.chrono is still alive?
15:27OForerowould this be the best choice for a date library in Clojure?
15:29OForeroor is clj-time a better option?
15:29hugodOForero: my choice http://github.com/clj-sys/clj-time
15:32OForerook ... I'll go with that
15:32OForerochrono is difficult to get ... I guess is not really maintained
15:40fogus_Anyone interested in separate Errors for pre- and post-conditions? (besides me that is) http://github.com/fogus/clojure/commit/87eb4124947297c86e30e0747931a16e21634575
16:01chouser,[(identical? 127 127) (identical? 128 128)]
16:01clojurebot[true false]
16:06chouser,(letfn [(id? [x] (identical? x (+ 0 x)))] (for [s (partition-by id? (range -200 201))] [(id? (first s)) (first s) '.. (last s)]))
16:06clojurebot([false -200 .. -129] [true -128 .. 127] [false 128 .. 200])
16:10rustemsunievchouser : 127 and 128 it's java Integer class implementation, caching values below 128 in the stack.
16:11chouserhuh! I assumed Clojure was doing that.
16:12rustemsunievjava already does, maybe Clojure adds smth I don't know :)
16:14chouser,(identical? (Integer/valueOf 10) 10)
16:14clojurebottrue
16:14chouserlooks like it's just Java.
16:15serp_,[(= 128 128) (== 128 128)]
16:15clojurebot[true true]
16:15ihodessurprising result, there, serp_ ;)
16:15serp_I don't know the different between = and ==
16:16serp_perhaps it's not surprising
16:16ihodes== is for identity
16:16chouserno
16:16ihodes= is for value
16:16chouser== is for numbers
16:16chouser,(== {} {})
16:16clojurebotjava.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.Number
16:16ihodesaha-so don't listen to me ;)
16:17ihodes,(equal? 128 128)
16:17clojurebotjava.lang.Exception: Unable to resolve symbol: equal? in this context
16:17serp_how can (identical? 1 1) work? 1 is not an object, is it?
16:17chouserthough the exact meaning of = and == may be different in some of the working branches.
16:18chouserserp_: it is. literals numbers are boxed (instances of a subclass of Object)
16:20serp_ok
16:20serp_isn't it slow to box all integers?
16:20chouseryes
16:20chouser:-)
16:20AWizzArdType-hinting the first arg of a Protocol method is not needed, right? Because when I say (extend String PMyProto {:foo [s a b c] ...}) then s will automatically be a String.
16:20chouserserp_: locals can be primitive, and there's work in some other branches to make the wider use of primitives possible.
16:21serp_ok neat
16:21chouserAWizzArd: if you use extend-type or extend-protocol, that's true. With just extend, the hinting is not done for you.
16:22AWizzArdah ok, thx
16:23AWizzArdThough the documentation on clojure.org says that extend-type expands into extend...
16:32LauJensenserp_: For now, macros can help you to let distributed code work on primitives
16:33serp_how is that?
16:34LauJensenserp_: When you distribute some code into several fns, the primitives gets boxed when they're passed around. Macros still let you have your code divided into separate entities, but they dont box since they expand before the compiler starts
16:34LauJensenThere's a huge abusive example on my blog :)
16:37serp_mhm I see
16:37serp_could you link me to your blog, please?
16:37chouser...because locals can be primitive
16:38chouserso you can have a macro expand into code inside a function and have it use the existing primitive locals you have there.
16:38LauJensenserp_: http://bestinclass.dk/index.clj/2010/03/functional-fluid-dynamics-in-clojure.html
16:38LauJensenyea it works how chouser just explained it - Though Im hoping the prim branch will simplify this
16:39serp_got it
16:55cemerickI like the blue and yellow clojure logo variant http://twitter.com/sclojug/
16:57raeka stockholm clojure group... nice
16:57raekanyone from Linköping here?
16:58serp_o/
16:59raekserp_: :)
17:01cemerickQ for those UI folk in earshot: http://twitter.com/cemerick/status/16720988108
17:09AWizzArdWhen I open a FileOutputStream and wrap that in a BufferedOutputStream and wrap that one in a DataOutputStream, do I then only need to .close that last one to free the resource?
17:09qbgLauJensen: You should revisit functional fluid dynamics once this prim business stabilizes.
17:11raekAWizzArd: yes, I think so
17:12raekclosing the DataOutputStream should close the wrapped stuff too
17:13raekdunno what happens if you only close the FileOutputStream, though
17:13raekmaybe there will be data left in the buffer of the BufferedOutputStream that will not get flushed
17:14raekbut closing the outermost wrapper is enough
17:14AWizzArdk
17:17raekfrom FilterInputStream (DataInputStream super class) javadoc: Closes this input stream and releases any system resources associated with the stream. This method simply performs in.close().
17:18qbgFleeting question: Is there something like Factor's with-destructors in contribs?
17:20LauJensenqbg: Naah, its trivial. An interesting thing would be to port it to OpenCL, put it on the GPU and extend it to 3D - But ehm, Im waiting for a slow day :)
17:21AWizzArdraek: this "any system resources" is the important hint, thx
17:22qbgThe fluid example in Penumbra would be more cool if it ran at more than 2 fps on my machine
17:22raek(-> sock (.getOutputStream) (OutputStreamWriter. out-encoding) (BufferedWriter.) (PrintWriter. true))
17:22raekyou gotta love that
17:23LauJensenqbg: thats actually a direct port from blogpost. It goes 2 fps on linux systems, because linux queues the un-rendered frames (ie diffusion and advection), its a bug, and its the reason Zach is porting to OpenCL instead of OpenGL
17:23qbgIt looked familiar...
17:23raek...but it makes sense to keep separate conserns separate, so maybe it's not that bad anyway
17:23LauJensenIt should go about 800x600 @ 50fps
17:29herdrickweird. does is google not picking up all the logs for this channel?
17:30LauJensenGoogle sees them
17:30herdrickbecause i had a convo with liebke: here a little while back about a function in incanter
17:30herdrickthat was giving me an NPE
17:30LauJensenclojure-log.n01se.net
17:30herdrickLauJensen: yeah, that's where i was searchign with google
17:30herdrickno sign of that conversation
17:31LauJensenaha
17:34herdrickLauJensen: it's here: http://clojure-log.n01se.net/date/2010-06-15.html
17:34chousergoogle tends to index today's conversation every hour or two, but then has a gap of a week or two before it picks up the older logs.
17:34herdrickchouser: ok, thanks
17:36herdrickshoot, looks like no progress on that problem (getting a NPE from .viewSorted in Incanter/Colt)
17:36herdrickbummer for me
17:39chouserbrb. don't say anything important.
17:37dnolen,(conj [1, 2] 3)
17:37clojurebot[1 2 3]
17:37ldpthanks :)
17:46herdrickso, is there another way to sort a matrix? other than .viewSorted , that is
17:46herdrick(in incanter)
17:46herdricknatch
18:05djpowellthe loop autoboxing seems pretty cool. has anyone raised any objections to it for any reason?
18:13qbgdjpowell: Not as far as I know
18:14qbgThere seems to be at least one bug with it though
18:34herdrick,(* 92193901239012390312 9219123903129039)
18:34clojurebotjava.lang.ExceptionInInitializerError
18:34herdrick(* 9219 921)
18:34clojurebot*suffusion of yellow*
18:34herdrick,(* 9219 921)
18:34clojurebot8490699
18:34herdrickuh,
18:34herdrickdoes this:
18:35herdrickhttp://github.com/richhickey/clojure/commit/6ab3e4cd672092823a04c944210a23c29142785d#diff-0
18:35herdrickmean what i think?
18:35herdrickoh no
18:35herdrick,999999999999999999999999999999999999999
18:35clojurebot999999999999999999999999999999999999999
18:35herdrickoh, maybe not
18:37herdrickhey - does the above commit mean that Clojure isn't allowing automatic arbitrary-precision arithmetic?
18:38herdrick,(+ 1 java.lang.Long/MAX_VALUE)
18:38clojurebot9223372036854775808
18:38dnolenherdrick: testing on clojurebot won't get you very far, it's not up to date
18:38herdrick,(* 2 java.lang.Long/MAX_VALUE)
18:38clojurebot18446744073709551614
18:39herdrickoh, i thought it was
18:39herdrickin any case i probably shouldn'
18:39herdrickshouldn't scatter that stuff all over the logs
18:39dnolenherdrick: with the latest changes automatic arbitrary-precision continue to be possible. it just a matter of what it will look like.
18:39herdricklook like?
18:39dnolen+', or + for autopromotion
18:40herdrickso you've got to prepend N on larger integers?
18:40dnolenherdrick: not if you use the autopromoting fns
18:41herdrickdnolen: ok, so what is + going to be bound to?
18:41herdricknchecked-add ?
18:42herdricksorry, unchecked-add
18:42herdrick?
18:42dnolenherdrick: unchecked-add is not safe
18:42herdrickok, i suppose i'm asking, "what will + be bound to"
18:42herdrick?
18:43herdrickwill it work with arbitrary precision?
18:44dnolenherdrick: it might, or +' might, no word yet.
18:44dnolenprobably + tho, there's more community support for that it seems.
18:44herdrickoh man, let me cast a strong vote in favor of THAT
18:44dnolenthe primitive version will throw on overflow
18:45herdricksure, that's a great optimization, as long as it's something like +'
18:45herdrickand not +
18:46tomojso the fac speedup example would use +' ?
18:47tomojin THAT case
18:49herdrick..."primitive" version indeed...
19:13arohneranyone here using the nexus maven server with lein?
19:44herdrickquestion: (.getCanonicalPath (new java.io.File "."))
19:44herdrickis showing my lein project home dir
19:45herdrickusing (System/setProperty "user.dir" "/foo/bar") isn't changing that, for me
19:45herdrickanyone know how to get the default path to something else?
19:49dnolenherdrick: you can't change it
19:49herdrickdnolen: thanks. that's odd.
19:49dnolenthat's Java for you.
19:50herdrickhuh - the docs seem to say you can, by changing that property
19:50herdrick"By default the classes in the java.io package always resolve relative pathnames against the current user directory. This directory is named by the system property user.dir, and is typically the directory in which the Java virtual machine was invoked."
19:50herdrickkind of ambiguous though
19:50technomancythe JDK is missing all kinds of obvious functionality like that
19:51herdrickhuh - ok
19:55dnolenyou can get the most advanced runtime optimization but you can't change the working directory.
20:22islonhow do you update lein to the newest version?
20:25dnolenislon: I would replace your lein script with 1.2-RC, wipe out ~/.m2, lein self-update
20:32islondnolen, self-update is not a task. Use "help" to list all tasks.
20:33mmarczykthat's self-install
20:33mmarczykself-install is also not a task, but it's handled by the shell script
20:35mmarczykactually I think it should work without wiping ~/.m2, though, with the script replaced and self-install performed... if it doesn't, something is amiss
20:35islonwhere's the script for rc2?
20:35mmarczykhttp://github.com/technomancy/leiningen
20:35technomancyyeah, don't clear out ~/.m2; that's unnecessary.
20:36mmarczykhere's the repo... you can pull it out of it
20:36mmarczykum, select the tag for the version you want first, I guess
20:38isloni downloaded lein dev version and executed self-install and it downloaded leiningen-1.2.0-RC1-standalone.jar
20:40mmarczyktechnomancy: how about having defproject munge ::foo style keywords (and perhaps :foo/bar style too) into unquoted symbols? -- that's in the way of brainstorming a fix for #49...
20:42mmarczykislon: the lein script you used to self-install should now be able to launch lein tasks for you
20:43islonmmarczyk, yes, it does, after i installed 1.20 rc1 i executed lein upgrade and it downgraded itself to 1.1.0... strange
20:44mmarczykislon: um, what did you do that for?
20:44technomancyislon: "lein upgrade" gets you the latest stable release
20:44technomancyright now that is 1.1.0.
20:44mmarczykanyway, upgrade is only meant for stable releases; when 1.2 is released, that's what it'll get you
20:45islonok, thanks for the info i'll "unupgrade" it =)
20:45technomancymmarczyk: not sure how that works with #49. Just calling eval where version strings are expected would solve it for that particular case.
20:47mmarczyktechnomancy: sure, but I was thinking what to do so that e.g. a Var to hold the group id for some dependencies becomes a possibility, for ease of switching between various people's artifacts on Clojars, say
20:49technomancyoh, I see. yeah, if you want to expand it to more than just version numbers it becomes trickier.
20:51mmarczykor actually
20:52mmarczyktechnomancy: the idea suddenly strikes me to use unquote
20:56Raynestechnomancy: Is leiningen supposed to upgrade even when there isn't anything to upgrade to?
20:57technomancyRaynes: to do that you'd have to reimplement version comparison logic in bash... would rather not.
20:58technomancyI mean it'd be easy to just not upgrade if they were equal, but there's no way it could prevent downgrading.
20:58Raynestechnomancy: To do what? Last time I did 'lein upgrade' just to see what would happen, it installed the same version I already had, which is the current version.
20:58Raynes>_>
20:58RaynesOh.
20:58RaynesI thought you were saying the opposite.
21:00alexykRaynes: so hows your Haskell lately?
21:00Raynesalexyk: I've mostly forgotten everything./
21:00alexykRaynes: dynamism does that to you
21:00RaynesMeh, just don't have time for it.
21:01alexykso I rewrote the clojure project in Haskell, and instead of a 32 GB JVM, it exploded to 50 GB+ and hit a bug in Haskell's runtime.
21:01alexykalso had to strictify everything like crazy.
21:02alexykOTOH, OCaml beats both hands down so far.
21:02lancepantzalexyk: your graph project?
21:02alexykI'm going to have a functional shootout for large scale Twitter data mining. Haskell, OCaml, Clojure, and Scala. lancepantz: yep.
21:03alexyklancepantz: btw, clojure-protobuf is on par with the best binary serialization in Haskell.
21:03alexyklancepantz: you can claim it's the fastest for clojure overall
21:03lancepantzwow, i'll tell justin
21:03alexykyeah, this was the thing which made repeated banging on clojure possible
21:04ninjuddalexyk: that's awesome
21:04ninjuddglad to hear it
21:05technomancymmarczyk: I'm not sure how unquote would work, but if you have a solution that'd be awesome. without such a solution I'm inclined to apply the version-string-only strategy of eval.
21:05alexyklancepantz: ninjudd: but Haskell is not very fast on large data anyhow; lazyness makes it gigabytes of thunks inside maps of maps. Clojure's "map is lazy" is kindergarden against that kind of GC-overwhelming lazynes -- La-zy-ness.
21:05alexykninjudd: did you see Apache Avro or Thrift with Cassandra?
21:05alexykthose things look yummy
21:06alexykScala has an Avro client
21:06mmarczyktechnomancy: I thought about having all forms of the shape ~foo to be copied verbatim into defproject's output
21:06mmarczyktechnomancy: then you could say ~my-version-string
21:06ninjuddalexy: i debated whether to do thrift or protobuf when i started
21:07alexykninjudd: I guess thrift can be useful separately
21:07mmarczyktechnomancy: and my-version-string appear in the macro expansion & be evaluated... if this sounds vaguely reasonable, I'll just write a patch to do it
21:08ninjuddsettled on protobuf because it was slightly faster in the benchmark and seemed simpler to implement
21:08technomancymmarczyk: I don't think macros really work that way, but maybe I'm misunderstanding you.
21:08technomancyif you can get something to work that'd be awesome.
21:08technomancygotta take off for now though.
21:09mmarczyktechnomancy: ok, I'll just write the patch then, we'll see how good this looks in practice
21:09mmarczyksee you.
21:09alexykninjudd: yeah, it's great. I contacted the Haskell guy who did protobufs but he says it's easier to implement the map as a repeated message on the wire; same was uttered by the scala folk. But I prefer it in extensions.
21:10ninjuddthe nice thing about the extensions is that others can use them as plain old repeated messages
21:10ninjuddit is just a hint
21:11ninjuddperhaps i shouldn't make the extensions go in the clojure namespace though, so others can implement them if they want
21:11alexykninjudd: yeah, but they resist saying it requires to map to a Haskell map which is not standard -- you can have several types of maps, so easier to make teh recipient decode from the wire in program's logic.
21:12alexykAgain I didn't see actual usage. I adore the map extension and would like to see it everywhere.
21:21scottjHow come (let [a (lazy-cat [1] a)]) doesn't work but (def a (lazy-cat [1] a)) does?
21:24qbgBecause let doesn't make recursive bindings
21:25qbgThat is, a is not in scope in the binding
21:25scottjqbg: is there a let form that does?
21:25qbgIf clojure had letrec, that would work
21:25qbgBut it only has letfn, which isn't what you want
21:26qbgThere is a macro in contribs that will do what you want, though
21:27qbg,(doc clojure.contrib.seq-utils/rec-cat)
21:27clojurebot"([binding-name & exprs]); Similar to lazy-cat but binds the resulting sequence to the supplied binding-name, allowing for recursive expressions."
21:27scottjqbg: nice thanks
21:38yacin,((partial #(fn [x y] (+ x y)) 3) 5)
21:38clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--10366$fn
21:38yacini'm not understanding why this doesn't work
21:38yacinbut
21:38yacin,((partial + 1) 4)
21:38clojurebot5
21:38yacinworks fine
21:39woobyyacin: # and (fn.. are for 2 things
21:39qbg,((partial #(+ %1 %2) 3) 5)
21:39clojurebot8
21:39wooby,((partial (fn [x y] (+ x y)) 3) 5)
21:40clojurebot8
21:40Raynes$((partial (fn [x y] (+ x y)) 3) 5)
21:40sexpbot=> 8
21:40yacinoh wow
21:40yacinhahaha
21:40yacinwhat a stupid typo
21:40yacinjeez
21:40yacinsorry for wasting your time wooby :P
21:40yacinand others
21:40qbgNo problem
21:41woobyyacin: no worries, happy to help :)
21:44maeclojure pwns
21:44maebut i don't know java very well
21:44maetrying javafaces as an exploratory learning process... wish me luck
22:01mmarczyktechnomancy: wrote the patch for lein #49 and commented on the issue