#clojure logs

2009-02-23

00:00rlbChouser: got it -- it was a misunderstanding of ByteBuffers. You don't want .clear, you want .flip (presumably means "flip" it from writing to reading). Now it works. Thanks again.
00:16arohnerman, laziness makes your stack traces confusing
00:24cp2oi -- whats this ClojureCLR in clojure-contrib?
00:24hiredman~google microsoft CLR
00:24clojurebotFirst, out of 246000 results is:
00:24clojurebotCommon Language Runtime - Wikipedia, the free encyclopedia
00:24clojurebothttp://en.wikipedia.org/wiki/Common_Language_Runtime
00:25cp2yeah i know hiredman
00:25cp2im just curious what they are doing with it
00:25hiredmanport to the clr
00:25cp2This project is a native implementation of Clojure over the Microsoft .Net Framework
00:25cp2programmed in C# and using the Dynamic Language Runtime.
00:25cp2yeah, readme.txt always useful
00:25hiredmanit is on the google group
00:33pilkarn http://paste.lisp.org/display/76007#2 <- there is what i have bow, i dont know what im doing wrong. noclassdeffounderror
00:33pilkarnyeah its java code but those bastards arent very helpful
00:46pilkarnanyone have an url to a vdieo?
01:16cooldude127i really hate the way java just loves immutability
01:16cooldude127s/immutability/mutability
02:00fffejhas anyone ever seen an issue where :use with a namespace causes a Java heap space exception?
02:00fffej,(ns foo (:use java.security MessageDigest))
02:01clojurebotjava.io.FileNotFoundException: Could not locate java/security__init.class or java/security.clj on classpath:
02:11durka42fffej: no, but :use is for clojure code. :import is for java
02:12fffejthanks - yeah, I realized that after I sent that, but I still get the out of memory (even with 1GiB heap)
02:13fffejbut updating to the head revision of everything seems to have solved my problem
03:44cgranddigash: thanks for the (add-remote-javadoc "" "http://www.google.com/search?btnI=I%27m%20Feeling%20Lucky&amp;q=allinurl:&quot;) trick, I added it to clojure.contrib.javadoc
04:56hoeck'foo
06:19Lau_of_DKHey hey :)
06:30alinp~def time
06:41rfgpfeiffer~def pl
07:05AWizzArdkotarak: achso, is ja jetzt frei! Und hier ist auch Karnevall ;)
09:45stuarthallowayis it to be expected that the new lazy sequences are functions returning themselves?
09:45stuarthallowayscratch that: returning themselves *realized*?
09:47Chouserstuarthalloway: that's what they are, though Rich described that as an "implementation detail"
09:47stuarthallowayChouser: thanks. Didn't see that in the web docs -- do I need to go back and read all the irc logs? :-)
09:48ChouserIt's ok, I read them for you.
09:49Chouser:-)
09:49Chouserhttp://groups.google.com/group/clojure/msg/bfa1b376cd144735
09:49stuarthallowaywhich reminds me, what do the A and I an AFn and IFn mean?
09:50ChouserAbstract and Interface
09:50Chouserthe classes provided by clojure use that frequently -- have you seen my chart?
09:50stuarthallowayys
09:51Chouserthe idea is that Interface defines a formal interface with no method bodies at all
09:51stuarthallowayright, this is Java stuff. For some reason I thought there was a more Clojurish meaning
09:51ChouserAbstract then often provides a bunch of helpful method definitions to fill out parts of the Interface that would be repetitive.
09:51Chouserah. no.
09:52shooveris it humanly possible to read #clojure logs AND comp.lisp.lang?
09:52stuarthallowaymy confusion was around ifn? and fn?
09:52ChouserThe important part is to pronounce "ifn" with a country twang.
09:53Chouserare you straight on 'ifn?' and 'fn?' now?
09:54stuarthallowayyes, I just think the names are confusing
09:54ChouserThe key to lazy-seq is that it must return an object that holds onto a closure, and when it's seq() method is called that it run the closure and cache the result.
09:55Chouserright now it just so happens that you can also call the object directly and it does the same thing as if you called seq on it, but I don't think that's a promise.
09:55stuarthallowayin my world ifn? would do what fn? does, and there would be another world for fn's behavior
09:56Raynesstuarthalloway: Hi. :)
09:56ChouserI put up a bit of a fuss at the time: http://clojure-log.n01se.net/date/2008-11-25.html#09:19
09:57ChouserI just failed to come up with an acceptible alternative.
09:57stuarthallowayChouser: Yeah, I got nothing.
10:07ChouserI wonder if rhickey could be talked into importing clojure.lang automatically, just like java.lang.
10:11RaynesA possible new Clojurer on Stackoverflow.com "When I went to the site I was immediately turned off by what it talked about -- differences from other lisps, how to get it running under the jvm. Where's my hello world! "
10:11RaynesNow /that/ is what I call idiocy.
10:12danlarkinjust coming from a different place
10:12mattreplturnkey programming
10:13gnuvince*sigh*
10:13gnuvinceDoes everything have to be spoon-fed to these people?
10:13RaynesI even talked with him for a moment, what he said next was "my problem with it, is that as a new learner, those are the things I am absolutely least interested in. I view having to work in the jvm, and deal with any java stuff as a minus not plus. When I look at a new language's site, I want to see *how to code in it.*"
10:14Rayneshttp://stackoverflow.com/questions/563356/which-lisp-should-i-learn/569399#569399 <---
10:14RaynesOur comments are in Greg Hewgill's post.
10:16cemerickgnuvince: you need the spoon-fed "track" in order to gain critical mass, whatever level of activity that is
10:17cemerickI don't think clojure should have that track just yet, as lots of important things are still in flux (although I'll bet stuarthalloway would disagree for business reasons)
10:18Raynescemerick: There is a wiki with everything he's looking for but he wont click the fuckin link.
10:18stuarthallowaycemerick, Raynes: Actually, I would say "not quite yet" for the spoon-fed track
10:18stuarthallowayone way that shows up in the book is my refusal to write a tutorial on "How to do Clojure in IDE X"
10:19Raynesstuarthalloway: I hate books that do that. <3 you and your book.
10:19cemerickRaynes: not good enough. Go to http://www.ruby-lang.org/en/ -- boom, the spoon-feeding is *right up top*.
10:20mattreplit's not like there's a "hello world" on sbcl.org - seems that he's not going to find a spoon-fed track for any lisp
10:20Raynescemerick: Ruby was the first thing that came to mind when he said "Wheres my Hello World!"
10:21cemerickI don't know ruby from a rock on the ground, but they've been very successful in attracting the people who simply want to get things done, not be impressed by whatever gizmo or technical advantage some language has
10:21gnuvinceThe Java or C# sites don't have hello world plastered on their front pages either. C and C++ don't even have web pages.
10:21stuarthallowayI hope that chs 1 and 2 of the book at least help the spork-fed crowd :-)
10:21RaynesRuby gives me that "In ur language, ruinin' ur fun" kind of feeling.
10:21leafw"Try ruby (in your browser)" link is quite compelling.
10:21cemerickmattrepl: goodness, let's not follow anything in the CL world w.r.t. marketing/community/whatever.
10:22marklarstuarthalloway: I read an excerpt chapter 2 and I really liked it. I'm from an imperative background too
10:22cemerickat some point, clojure could *easily* provide that spoon-fed track, and have an immediate leg up within the masses
10:22gnuvinceThe "Road to Clojure" thread on c.l.l was really enlightening about their community.
10:22mattreplcemerick: of course not! just pointing out that the fellow is in for a rude awakening if he refuses to investigate languages that don't have "hello world" plastered on the front page
10:22BrackiIs there a way to print to a given output stream?
10:23ChouserRuby is well positioned for spoon-feeding. It's imperative and oop so it's not going to challenge the way you solve problems up front
10:23gnuvinceMaybe a Python.org-like tutorial wouldn't be out of order
10:23ChouserIt's dynamic, so you'll get up to speed faster than with Java or C#
10:23cemerickgnuvince: Java, C, and C++ all have established userbases -- being able to say that 1M people (or whatever) use a particular platform is enough of a signal to someone that those are "safe" choices
10:23leafwBracki: use binding of *out*
10:23Brackileafw: *out* is bound already.
10:23gnuvincecemerick: I'm sure closure has at least 1000000 users... in binary :)
10:23cemerickC# is a special case being from Microsoft, so it gets a pass from *thousands* of MS shops
10:24cemerickgnuvince: :-)
10:24gnuvince,2r1000000
10:24clojurebot64
10:24RaynesClojure has atleast 135 users.
10:24gnuvinceor at least 135 lurkers
10:24cemerickgnuvince: whoa, I've never seen that numeric notation
10:25gnuvincecemerick: works from 2 upto 36 :)
10:25gnuvince,36rz
10:25clojurebot35
10:25leafwBracki: (binding [*out* (get-a-stream)] (println "hello")) ---> prints to stream.
10:25cemerickgnuvince: that's fantastic. What's the 'z'?
10:26Chouser35 in base 36
10:26gnuvincecemerick: the base-36 digit
10:26gnuvince,16rBEEF
10:26clojurebot48879
10:26cemerickoh, I see
10:26gnuvince,36rCEMERICK
10:26clojurebot972199975844
10:26Chousergnuvince: seriously, where'd you dig that up? I didn't know it either.
10:26gnuvinceChouser: it's in the doc
10:26Chouserunbelievable.
10:26cemerickjeez, that's sick
10:26Chouser;-)
10:26cemerickgnuvince: link?
10:26gnuvinceHang on
10:26gnuvince(slow link here)
10:27cemerickChouser: how did we not know about this? ;-)
10:27Brackileafw: Yeah but can I rebind insinde a binding?
10:27Chouserhm, not in the reader->forms->Numbers section as I would expect.
10:27ChouserBracki: yes!
10:27gnuvinceHmmm
10:27cemerickyeah, I was just scanning /reader frantically
10:28gnuvinceI was sure it was in the reader doc...
10:28ChouserBracki: your new binding pushes on like a stack
10:28cemerickthat's one crazy easter egg!
10:30gnuvinceI can't find the doc anymore
10:30gnuvinceBut I'm quite sure I saw it somewhere.
10:30RaynesThat guy I was talking about a moment ago "Things I like: good library support (me=spoiled by python), good environments, unicode support."
10:31Raynes"spoiled by python".
10:31RaynesThat explains it.
10:31gnuvinceWell CLojure has good library support, good environments and unicode support.
10:32Raynesgnuvince: Doesn't have a website that spoon feeds.
10:32gnuvinceRaynes: neither does Python. You need to go in the documentation to find the tutorial
10:32cemerick...all in good time
10:32Chouserah, found it. It's documented right here: http://tinyurl.com/b9t3og
10:32Raynesgnuvince: But Clojure doesn't have /any/ of that type of documentation unless you click "wiki" AND HE WONT DO IT!
10:33gnuvince:)
10:33gnuvincewell then
10:33mattreplChouser: thanks
10:33gnuvinceIs it really a loss?
10:33Raynesgnuvince: It just makes my chains rattle a bit :|
10:34ChouserRaynes: leave him alone. He'll try it later.
10:34gnuvinceI agree.
10:34RaynesChouser: I'm not even bothering him.
10:34Chouseroh, I didn't mean it like that
10:34cemerickheh, I just got why the literal uses 'r', and not 'b' (for base) :-P
10:35gnuvince,0b10
10:35clojurebotInvalid number: 0b10
10:35ChouserI just meant he may go try Common Lisp first, or Scala, or who knows what. Eventually he'll be frustrated by the ways they aren't Clojure (whether he understands that's why they're frustrating or not) and will try again.
10:36Chouseror he'll become enamored with inferred static typing and we'll lose him forever. :-)
10:37gnuvinceYou may still lose me to that :)
10:42ChouserI need to get past Qi's goofy type syntax so I can grok it and understand how it could work with Clojure.
10:44gnuvinceRich has talked a couple times about Qi's type system and how he wouldn't dislike bringing that to Clojure to provide � la carte static typing.
10:44mattreplI'm still hoping we'll get gradual typing down the road. both to help spot bugs and get a speed boost.
10:44stuarthallowaywhat's the best way to write fibo with the new laziness?
10:44mattreplsuch as: http://portal.acm.org/citation.cfm?id=1408681.1408688
10:45stuarthallowayclojure.contrib.lazy-seqs version is broken (and was broken before)
10:45stuarthallowayI came up with http://paste.lisp.org/display/76021
10:48BrackiSo how do I rebind insinde a binding?
10:49jbondesonis anyone else having problems building the latest clojure?
10:51BrackiMy *out* is already bound but I need to rebind.
10:51stuarthallowayBracki: just do another [binding ...]
10:51BrackiCan I use loop as well?
10:52stuarthallowayjbondeson: 1299 builds fine for me
10:53gnuvinceHow come this doesn't work? (def lazy-fibs (lazy-seq (cons 0 (cons 1 (map + lazy-fibs (rest lazy-fibs))))))
10:53jbondesonodd, i have seq objects complaining about not overriding next
10:54jbondesonbah
10:54jbondesoni know what happened.
10:54jbondesonit didn't delete files that were renamed
10:55jbondesonvery odd.
10:55lisppaste8leafw pasted "untitled" at http://paste.lisp.org/display/76022
10:56cgrandstuarthalloway: (seq-utils/rec-cat fib [0 1] (map + fib (rest fib))) :-)
10:56leafwBracki: see the double binding example.
10:56stuarthallowaycgrand: cheating!
10:56leafwBracki: ... that I just pasted.
10:56BrackiWhere?
10:56gnuvincecgrand: how come using cons+map inside lazy-seq gives a stackoverflow?
10:57cgrandgnuvince: where?
10:58gnuvinceHow come this doesn't work? (def lazy-fibs (lazy-seq (cons 0 (cons 1 (map + lazy-fibs (rest lazy-fibs))))))
10:58cgrandgnuvince: it's the the call to rest I think
10:59gnuvinceRaynes: ?
10:59Raynes:)
10:59Raynes<3
10:59gnuvincecgrand: either next or rest causes a stack overflow.
10:59cgrandwhen you realize this seq, (cons 0 (cons 1 (map + lazy-fibs (rest lazy-fibs)))) is evaluated
11:00Raynesclojurebot: svn?
11:00clojurebotsvn is http://clojure.googlecode.com/svn/trunk/
11:00slashus21(def lazy-fibs (lazy-seq (cons 0 (lazy-seq (cons 1 (map + lazy-fibs (rest lazy-fibs)))))))
11:01cgrandand to evaluate that you need lazy-fibs (ok) and (rest lazy-fibs) which needs to realize lazy-fibs
11:01lisppaste8bracki pasted "what's wrong with the loop?" at http://paste.lisp.org/display/76023
11:01gnuvinceShouldn't it only need to realize as much as is needed?
11:01BrackiMy loop won't stop.
11:02gnuvinceBracki: which one?
11:02gnuvinceThe one which is clearly infinite?
11:02BrackiIf you say so. I meant the inner one.
11:03stuarthallowayslashus21: try this on yours: (rem (nth (lazy-fibs) 100000) 1000)
11:03gnuvinceBracki: you have no termination condition.
11:03gnuvinceIt'll always print input and recur with outs
11:03gnuvinceYou never tell it when to stop recurring
11:03cgrandgnuvince: rest "advances" the seq
11:03cgrandif you use drop 1 instead of rest it works:
11:03slashus21stuarthalloway: ouch
11:03BrackiSo how do I check if outs is empty?
11:03cgrand(def lazy-fibs (lazy-seq (cons 0 (cons 1 (map + lazy-fibs (drop 1 lazy-fibs))))))
11:04gnuvinceadvances the seq?
11:04slashus21stuarthalloway:
11:04slashus21Is that not correct behavior?
11:05stuarthallowayslashus21: runs out of memory on my box
11:05BrackiOr should I just check *out*?
11:05stuarthallowaybut http://paste.lisp.org/display/76021 correctly returns 875
11:06stuarthallowayslashus21: trying yours as a function now....
11:07Brackignuvince: What should the termination condition be?
11:07cgrandgnuvince: (drop 1 s) holds a reference on s (including the head) while (rest s) really returns the rest of s, that's why it needs to realize s: simply to be able to discard the head
11:07gnuvinceBracki: I don't know, it's your app, but there should be a when or if in there to return a value once you're done looping.
11:08BrackiWell what do I check against that I know I'm done looping?
11:09stuarthallowayslashus21: I can't convert your lazy-fibs to a function, same problem as the impl in clojure.contrib
11:10leafwBracki: you are looping *connections*. What do you know about this list? When no more elements, stop.
11:17BrackiSorry I'm at a loss here. @*connections* will give me back the whole list.
11:17BrackiSo checking against it doesnt make sense.
11:18gnuvinceWell you need to figure it out.
11:18gnuvinceBecause otherwise, you're always gonna be stuck in that infinite loop.
11:24Chouseris there any appetite for combining :use and :require syntax?
11:24stuarthallowayis fn* an undocumented special form?
11:25Chouserstuarthalloway: it's the real special form that the 'fn' macro uses.
11:25jbondesonChouser: that would be nice to have a consistent syntax
11:25jbondesonstuarthalloway: there's also if*, and i believe a few others
11:26Chouserif* is new -- 'if' is now a macro that does the lazy-seq assert and uses 'if*'
11:26Chouserlet is a macro that does destructuring and then uses let*
11:26stuarthallowayare the semantics of fn* and list* documented anywhere?
11:27Chouserbut the clojure docs seem to specifically obscure this distinction
11:27BrackiHm, while loop works now it doesn't do what I had expected.
11:27Chouser(doc if)
11:27Chouser,(doc if)
11:27clojurebot"([tst & etc]); "
11:27stuarthallowayI am considering introducing rec-cat into the FP chapter of the book, which requires explaining how list* and fn* work
11:28Chouserlist* is different -- it's just a normal function
11:28stuarthallowayso you would use it instead of cons if you knew you had a list?
11:29stuarthallowayand list* could be replaced with cons?
11:29danlarkinChouser: how would the new use/require work? like use or like require?
11:30ChouserIf I understand your question, yes. (list* 1 2 [3 4 5 6]) is the same as (cons 1 (cons 2 [3 4 5 6]))
11:30Chouserdanlarkin: both! (demand '[my.lib :all]) would be like (use 'my.lib)
11:31stuarthallowayChouser: thanks
11:31Chouser(demand '[my.lib :only (foo)]) would be like use
11:31Chouser(demand '[my.lib :as bar]) would be like require
11:31jbondesonhaha love the name
11:32Chouserstuarthalloway: I wouldn't recommend discussing the implementation of rec-seq
11:32stuarthallowayChouser: believe me I don't want to~
11:33ChouserThat's pretty tightly married to the current implementation of lazy-seq
11:33lisppaste8bracki annotated #76023 "*out* isn't rebound properly." at http://paste.lisp.org/display/76023#1
11:33cemerickis demand a proposal? I haven't seen it discussed anywhere...?
11:34danlarkinChouser: how about cutting some unnecessary nesting: (:demand my.lib.*) would be use, (:demand my.lib :only (foo bar)), (:demand my.lib), (:demand my.lib :as mylib)
11:34BrackiWhat I just pasted, shouldnt that work?
11:34Brackiprint last readline to every known out?
11:34hiredman(doc if)
11:35Chouserdanlarkin: hm ... if no features are lost, I think I'd like that.
11:36Chouserlots more quoting in the fn case though. (demand 'my.lib :as 'mylib)
11:36cgrandstuarthalloway: if you want to show an implementation of rec-seq/rec-cat, I think it would be better to show one that uses an atom, not the one in contrib (which relies on current implementation details)
11:36stuarthallowaycgrand: cool. I am going to post a question over on the mailing list and see what people think.
11:36danlarkinChouser: true, but how often is it used outside of an ns expression
11:36Chousercgrand: couldn't rec-seq be defined in terms of lazy-seq, perhaps with an inner fn?
11:37cgrandChouser: hmmm....
11:40lisppaste8Chouser pasted ":demand" at http://paste.lisp.org/display/76025
11:41hiredmanhmmm
11:41hiredmanfar too few parens
11:41Chouserheh. are you serious?
11:41hiredmanif you take out parens like that how will people know it's a lisp?
11:41hiredmanNo.
11:41Chouserok, just checking.
11:42cemericklooks good to me -- easy enough to port existing code
11:42jbondesonChouser: how would you do an straight require vs. straight use?
11:42jbondesonbasically how would you tell the difference
11:42danlarkinahh that looks so much more aesthetically pleasing
11:42Chouserjbondeson: I would default to 'require' since I don't like straight use
11:42cemerickI'm still hoping that imported classes have their corresponding libs automatically required someday
11:42Chouserjbondeson: and maybe add :all to get use behavior
11:42jbondesonChouser: makes sense, would you add an :all ?
11:42slashus21looks good
11:42jbondesonhaha
11:43Chouserjbondeson: :-)
11:43hiredmandanlarkin: you demand demand?
11:43Chouserwhich would to the same as my.lib :exclude ()
11:44Chousershould each lib be grouped to be more like :import?
11:44Chouseror should :import not be group -- check for dots in the symbol to know if its a package or class.
11:46jbondesondamn, forgot to ask rich if he still wanted the empty-seq in if checking.
11:46jbondesoni know it works cause i just caught one in swank-clojure.
11:46lisppaste8Chouser annotated #76025 "each lib grouped in :demand" at http://paste.lisp.org/display/76025#1
11:47danlarkinahh the parens are back
11:47BrackiHm somehow I had assumed doseq in combination with binding is the same as loop but it isn't.
11:47jbondesonChouser: i like the explicit parens to be honest. i could see the paren-less version getting messy
11:47BrackiSo doseq does it.
11:49cemerick+1 on the parens
11:50danlarkinhurumph
11:52lisppaste8cgrand pasted "rec-seq without ugly details" at http://paste.lisp.org/display/76027
11:52HolcxjoAnd now combine demand and import into some common construct?
11:53ChouserHolcxjo: I think they're different enough to keep separate. import is for Java classes.
11:53cgrandChouser: yup rec-seq can be defind that way
11:53Chouseruse and require are both working on libs
11:55WizardofWestmarcso do it in clojure instead? :)
11:55gnuvinceweb development should be renamed to "most frustrating programming job EVER"
11:55gnuvinceWizardofWestmarc: it's not the language, it's the nature of the work
11:56WizardofWestmarcgnuvince: I think that depends at this point. Stuff like jQuery has been working on removing the multi-browser retardation to help webdevs keep sanity
11:57WizardofWestmarc...which is why I'm working on a web side project w/django front end and clojure for back end processing that requires actual beef.
11:57cemerickI'm hoping javafx matures into something that eliminates all pain, forever (for our purposes, anyway)
11:57cemerick;-)
11:57hiredmancemerick: that will never happen
11:58cemerickthus the wink
11:58hiredmanbecause all is suffering
11:58cemerickah, well, I wasn't thinking existentially
11:58hiredman(when doing front end developement)
11:58gnuvinceWizardofWestmarc: here's an example; we have a client who wanted to list the numerous advantages members of her organizations benefited from. She said they changed so rarely that she didn't mind if we did the updates. With that in mind and the way she wanted the page to work, we used PHP and jQuery to make the content dynamic, save us a lot of typing and have a copy under revision control.
11:59gnuvinceWizardofWestmarc: this morning she called to say that finally she wanted to be able to modify that page herself, and she wanted the thing to be super simple.
11:59gnuvinceAnd to top it all off, she needs us to do it in about 1 hour and 30 minutes, because that's all the time that's left in her time bank.
11:59shooverChouser: all else being equal, whatever gets the point across with the least boilerplate (i.e. quoting) because this stuff is the first thing you see in every lib. In terms of names, use is intuitive, but require and demand sound more about declarative security than loading code. I prefer variations of use and load.
12:00WizardofWestmarcgnuvince: that's client issue not webdev issue, though I appreciate the pain there.
12:00gnuvinceFucking site is a Drupal site (thank God we switched to Django for all other sites)
12:00slashus21yey django
12:00WizardofWestmarcI've really come to like Django from my limited experience with it. Been watching Django from the Ground up to get up to speed quickly
12:00gnuvinceWizardofWestmarc: the hard webdev part is figuring out how I'm gonna do this so that she doesn't have to learn ANYTHING
12:00jbondesonout of morbid curiosity, what's the point of the 'nil?' function?
12:01gnuvincejbondeson: testing if something is nil?
12:01jbondesonoh you mean (if x) ?
12:01WizardofWestmarcgnuvince: that can be hard in a LOT of arenas, the problem is mostly expectations seem different for people in relation to web pages for some reason.
12:01gnuvincejbondeson: that could be false too.
12:01jbondesonnil is just always false in an if
12:01gnuvincejbondeson: you may want/need to differentiate between
12:01Chousershoover: The name 'demand' is just a placeholder.
12:02jbondesoni guess
12:02gnuvinceWizardofWestmarc: the big one I see coming from a mile and a half away is that she's gonna want to put colors and bold text and crap like that.
12:02slashus21"its pretty"
12:02jbondesonif you think you may have booleans AND objects in your function...
12:02slashus21it's*
12:03gnuvinceDo you think expecting the user to edit a JSON file is too hard?
12:04slashus21probably
12:04gnuvincedamn
12:05danlarkinoh man y'all are going to love my django port then, bahaha!
12:06slashus21danlarkin: Porting django to?
12:06danlarkinclojure of course
12:06slashus21yey
12:07fogusSo would it be called Djjango? I'm so confused.
12:07cratukiHow do I go about embedding clojure into an existing java application? Can I spawn an interpreted in a thread?
12:08WizardofWestmarcneeds a different musician name
12:08WizardofWestmarcbut still has to have a j :)
12:08gnuvincejimi
12:08Chouserdo people use the prefix feature of use and require? (require '(clojure [set :as cset] [xml :as xml]))
12:08fogusdjimi
12:09Chousercratuki: clojure is not interpreted
12:09slashus21cljango
12:09slashus21?
12:09gnuvincehell no, this isn't Common Lisp
12:09slashus21the cl sort of look like a d
12:09danlarkinno it won't be called django, no it will not have a J in the name, end in -jure or start with clj
12:09Chousercratuki: but you can compile clojure and clojure-generated code and java compiled code all into one app and have it all call each other.
12:09hiredmanYawfie!
12:09slashus21okay okay
12:10Chouserclabango!
12:10danlarkinnooooo
12:10danlarkindon't give lau the idea that's a good name
12:10cratukiChouser: not interpreted - OK. But there's a REPL, yes? What's the difference between a language with a REPL and an interpreted language?
12:10hiredmanclojurebot: Yawfie is danlarkin's port of django to clojure
12:10clojurebotAck. Ack.
12:11danlarkinbah!
12:11clojurebotsvn rev 1300; lazy-seq perf tweaks
12:11rsynnottisn't Ruby (pre 1.9) about the only major pure-interpreted langauge with a repl?
12:11rhickeysvn 1300 support lazy-seq metadata and better perf, if-lets no longer needed
12:13jbondesonrhickey: Chouser said that you were willing to take a patch to the lazy-seq assert logic to also add empty-list asserts as well. is that still the case?
12:15Chouserrhickey: very cool.
12:17Drakesonwalters: ping ..... what version of JNA do I need for JGIR? I've got 3.0.9-1 from debian. is that enough?
12:18Chousercratuki: clojure.lang.Repl used to be a Java app that provided a clojure repl.
12:18Chousernow it's written in clojure.
12:19hiredmanooooh
12:19cratukiIf I could get old code, are there any good reasons not to embed clojure as a scripting language-come-app development language? The software I'm thinking of embedding in is integration softwar.e
12:19hiredmanneat
12:19waltersDrakeson: for JGIR from svn you'll need https://jna.dev.java.net/issues/show_bug.cgi?id=98 too
12:19rhickeyjbondeson: still thinking about that - could be lots of false positives
12:19hiredmancratuki: the fiji guys embedded it somehow in their image processing software
12:20waltersDrakeson: if you can convince the debian maintainer to add that patch until the next JNA release that'd be great
12:20jbondesonrhickey: i haven't had too bad a time with it yet, but i haven't put it through a ton of paces.
12:20Drakesonwalters: great, thanks
12:21rhickeyjbondeson: what did you test for?
12:22jbondesonrhickey: i went very broad and started with any empty list, and not an identical object to the EmptyList
12:22cgrandrhickey: thanks!
12:22Chousercratuki: Should work well.
12:22rhickeycgrand: you're welcome!
12:23jbondesoni think that may be a little broad. though technically you could have different levels of checking from paranoid to light if you wanted to.
12:25jbondesonare other swank-clojure users getting NullPointerExceptions when you try to tab complete?
12:27jbondesonbah, figured out what happened. something i did for debugging was forcing a delayed object.
12:27cratukiChouser - thanks for help
12:33jbondesoncan anyone think of a reason why (first coll) would return an empty list (not null) for any reason other than an explicit empty list is in the sequence?
12:33technomancyhave people suggested removing parens from clojure already, or is this the first time?
12:33technomancy(on the mailing list)
12:34technomancyI'm wondering if there's some kind of universal constant that states it must happen when the size of the community exceeds a certain point.
12:34replacaQ: When I use derive & multimethods, am I guaranteed to get the "most specific" method or do I have to call prefer-method? That is, if I have (derive ::b ::a) and (derive ::c ::b) and then (defmethod foo ::a...) (defmethod foo ::b ...) and (defmethod foo ::c...) am I guaranteed to get the last one when I call with ::c even though isa? matches all of them?
12:34jbondesondebugging swank is going to be the end of me...
12:35replacaThis matches my O-O sensibility, but isn't specified in the doc
12:37Chouserreplaca: I think that's right.
12:38jbondesondorun is tripping my empty-list in if with the (or (first coll) true) construct...
12:39replacaChouser: thanks. This probably should be added to the doc. Either it's not there or my head was cloudy when I read it. :-)
12:41lisppaste8Chouser annotated #76025 ":use already does most of :demand" at http://paste.lisp.org/display/76025#2
12:42jbondesonChouser: can you think of any reason do run couldn't be changed to use a do construct?
12:43jbondesondorun that is
12:44Chouserdorun takes a seq -- you want it to force the seq returned by a block?
12:44Chouser(dorun foo bar (map inc coll)) ? foo and bar are each run once, then map is forced?
12:45jbondesonthe current dorun forces the evaluation in an if statement by calling first on the collection, which is what is tripping the empty-list logic, changing it to (do (first coll) (recur coll)) would pull it out of an if
12:46jbondesonbut i don't know if there is some reason it didn't already do that.
12:46jbondesonwonder if (or (first coll) true) is faster than relying on a do construct
12:47danlarkindon't micro-optimize like that
12:47danlarkinyou'll just end up reading your code later saying... wtf was I trying to do here
12:47jbondesonwell we're talking about the dorun in clojure.core
12:48jbondesoni think forcing the evaluation in an if like that is a little ugly personally, but rich is much smarter than me, so i'm trying to think of why he did that.
12:48danlarkinwell that's what I get for not reading the context I guess
13:05ozzileeCan anyone tell me if Compojure works with the Clojure trunk? (use 'compojure) gives me the dreaded "Don't know how to create ISeq from: Symbol".
13:05jbondesonwelp, changing it to a (do (first coll)...) fixed the tripping of empty-list in seq
13:05jbondesonand actually, i think i could trip the lazy seq in the exact same way
13:05stuarthallowayozzilee: building from the vcs head of all projects seems to work
13:06jbondesoni'll have to talk to rich about that the next time he's in irc
13:08ozzileestuarthalloway: Let me try rebuilding them both again.
13:12ozzileestuarthalloway: Still no dice. It works if I use the clojure.jar that comes with compojure, but not with the clojure.jar from trunk.
13:12stuarthallowayozzilee: dunno then. worked for me when I rebuilt the dependencies for the book samples this morning
13:14ozzileestuarthalloway: That's frustrating. Ok, thanks.
13:16jbondesonhah, yep, (doall (list (lazy-seq nil))) will trip the lazy-seq assert logic
13:18Kerris7woot http://skillsmatter.com/event/java-jee/clojure-for-java-programmers
13:19hiredmanlondon
13:19technomancywhoa; rich got a haircut
13:19technomancy=)
13:20jbondesonhe needed that last bit of performance and the hair was slowing him down
13:21technomancyjbondeson: there was no way to lazy-load it, I guess.
13:21Kerris7hiredman: since I'm a skint student this may be a once in a lifetime opportunity for me to set my eyes on a creator of a programming language :V
13:22technomancyif that's your goal you should try oopsla
13:22technomancyyou'll run into twenty language creators before lunchtime
13:22Lau_of_DKGood evening gents
13:28danlarkinhiya lau
13:28cgrandHi Lau!
13:35jbondeson,(if (lazy-seq nil) "true" "false)
13:35clojurebotEOF while reading string
13:35jbondeson,(if (lazy-seq nil) "true" "false")
13:35clojurebot"true"
13:36jbondesonguess clojurebot doesn't have the assert logic on
13:36Chouserhe used to, but I guess you're right.
13:36hiredmanoh, I must not have turned it the last time I built clojure
13:47jochujbondeson: I noticed that with swank-clojure as well - it makes it noisy and angry sometimes. (dorun ..) uses it in an: (or (first coll) true) so it's not broken per se.
13:47jochujbondeson: And since I figured the asserts were just a tool to help convert to lazy-seqs, which is only done once, I just turned it off let it go.
13:54jbondesonjochu: yeah, i guess, but i still think the dorun form shouldn't do that.
13:54jbondesonjochu: oh, yeah and thank you for fixing swank-clojure debugging those infinite loops was driving me batty last week.
13:54Chouserjbondeson: I think you're right.
14:05jochujbondeson: Heh, it was driving me nuts too. Well - if you're using swank-clojure with asserts on, sorry about the dorun stuff. If I remember right, they're pretty debilitating.
14:07Chouserjbondeson: I think you should bring up dorun and your example on the google group.
14:08jochuChouser: I think I saw one on there before, let me see if I can find it
14:09jochuChouser: http://groups.google.com/group/clojure/browse_thread/thread/f0248e837b9d27a/5a84e5e6a1eaf9f4
14:09Chouserah, indeed.
14:10Chouserrhickey: did you see that one? I think I missed it somehow.
14:10Chouserjbondeson's example failure is useful too: (doall (list (lazy-seq nil)))
14:12Lau_of_DKChouser: What happend with Textjure ?
14:12ChouserLau_of_DK: I got distracted?
14:13jbondesonPPADD: Programming Project Attention Deficit Disorder
14:15danlarkinI have that
14:21clojurebotsvn rev 1301; removed dorun calls to first
14:21ChouserThe spirit of rhickey is with us.
14:21AWizzArdcan I change the metadata of a function?
14:22ChouserAWizzArd: no
14:22ChouserAWizzArd: you can change the metadata of a Var, though, which is what's normally done.
14:22Chouserbut I suspect you know that
14:23AWizzArdcan you give a short example?
14:23Chousersure
14:23jochuYay, that was quick
14:25hiredmansomeone should fix ring for lazy
14:26danlarkinhiredman: ring has been working for me
14:26danlarkinalthough I'm really only using the jetty interface
14:27hiredmanhmmm
14:27hiredmanmaybe it is just an old contrib
14:27hiredmanI hate that it comes with it's own contrib and clojure
14:29tomswwhy can't I use javax.swing.filechooser.FileNameExtensionFilter? "(import '(javax.swing.filechooser.FileNameExtensionFilter))" followed by "FileNameExtensionFilter" gives me a "no source file" exception. I don't have problems using other swing classes...
14:29hiredmanyou are not using import correctly
14:29Hunthe last . shouldn't be there
14:29hiredman(import '(javax.swing.filechooser FileNameExtensionFilter))
14:30tomswdoh!
14:30danlarkinhiredman: yeah that's the wrong way to do things in my opinion (packaging dependencies). I don't like that it seems like a trend
14:31hiredman:(
14:31hiredmanI keep getting:
14:31hiredmanjava.lang.Exception: Unable to resolve symbol: lazy-cons in this context (core_utils.clj:33)
14:32hiredmanwhich makes sense because lazy-cons is gone
14:32hiredmanjust cannot figure out where core_utils.clj is
14:35technomancydanlarkin: well until an automated way to specify and fetch dependencies becomes widespread, it's going to continue.
14:35technomancydanlarkin: I agree that it's bad for libraries. for applications I think it's better than the alternative.
14:39drewrHave any of you experienced a JVM issue where it hangs on FUTEX_WAIT after -main runs?
14:40Chouserdrewr: did you use 'future' or agents?
14:40drewrI have a logging agent.
14:41drewrAm I supposed to do something to him when I'm done?
14:41Chousershutdown-agents
14:41hiredmanugh
14:43drewrAh, excellent.
14:43drewrSo a System/exit will block if there are threads somewhere?
14:44AWizzArdChouser: btw, maybe I misunderstood it, but I thought you have a little example ready, where one changes the metadata of a Var :)
14:45ChouserNo, I think System/exit will quit. But just returning from 'main' waits for thread pools to shut down.
14:46ChouserAWizzArd: oh, I misread your question.
14:46drewrChouser: I'm calling System/exit as the last expression in -main.
14:46drewrI'll see if shutdown-agents helps though.
14:47hiredmanah
14:47hiredmanlazy-cons in clj-html
14:48Chouser,(alter-meta! #'take assoc :add-some :meta)
14:48clojurebot{:add-some :meta, :ns #<Namespace clojure.core>, :name take, :file "core.clj", :line 1531, :arglists ([n coll]), :doc "Returns a lazy sequence of the first n items in coll, or all items if\n there are fewer than n."}
14:48ChouserAWizzArd: ^^^
14:49Chouserthat's probably not recommended for other namespace's vars, though.
14:49Chouser,(:add-some ^#'clojure.core/take)
14:49clojurebot:meta
14:50drewr...and it didn't.
14:50Chouserdrewr: hm... do you have a thread blocking on something?
14:50AWizzArdChouser: thanks
14:51hiredmanok, what other html generating libs are there besides clj-html?
14:51drewrChouser: I don't think so, but I'm probably not looking at every possibility.
14:52drewrEverything I'm doing is wrapped in macros that release resources and close database connections.
14:53drewrI'm using pmap, so maybe I've retained a head somewhere that would keep its threads?
14:53drewrJust guessing.
14:53Chouserdrewr: well, you're beyond my experience. Let us know when you figure it out.
14:53Chouser:-)
14:53drewrYay!
15:12tomswhow do I deal with Java constructors that take a variable number of arguments? For example, (javax.swing.filechooser.FileNameExtensionFilter. (String. "Test") (String. "exe")) returns "java.lang.String cannot be cast to [Ljava.lang.String"
15:13Chousertomsw: they expect an array instead of the variable part of the args
15:14Chouser(,(javax.swing.filechooser.FileNameExtensionFilter. "Test" (into-array ["exe"]))
15:14Chouser,(javax.swing.filechooser.FileNameExtensionFilter. "Test" (into-array ["exe"]))
15:14clojurebot#<FileNameExtensionFilter javax.swing.filechooser.FileNameExtensionFilter@13b792[description=Test extensions=[exe]]>
15:15tomswChouser: thanks. I had a feeling (apply FileNameExtensionFilter. ["a" "b" "c"]) wouldn't work...
15:15Chouser:-) nope.
15:16drewrOK, I had (flush) (shutdown-agents). Reversing those makes exit work.
15:16hiredmanhmmm
15:17cp2hi guys
15:18cp2tomsw: also, its not all important, but you do not need to create a new String object if you are using literals
15:18Chouserdrewr: wow
15:18cp2eg, (String. "abc") is stll "abc"
15:18cp2except "abc" is automatically interned (i think)
15:18Chousercp2: right
15:18cp2so if anything, (String. "literal") is more expensive
15:19hiredman,(identical? (String. "abc") "abc")
15:19clojurebotfalse
15:19AWizzArdis there something similar to resolve which does not return a Var but instead the function object of a symbol? (get-function '+) ==> #<core$_PLUS___3251 clojure.core$_PLUS___3251@c9537b>
15:19Chouser,(identical? "abc" "abc")
15:19clojurebottrue
15:19Chouser,@(resolve '+)
15:19clojurebot#<core$_PLUS___3251 clojure.core$_PLUS___3251@63b660>
15:19AWizzArdgood
15:38gnuvinceAnybody knows what Mark Volkman's deal is?
15:38WizardofWestmarcsyntax thread?
15:39gnuvinceAny thread really.
15:39hiredmanI have wondered that myself
15:40WizardofWestmarc...
15:41danlarkinhe's an interesting fellow
15:41gnuvinceI don't know how long he's been around, I would estimate 3-4 months, kind of like me, but he always seems to have questions that are answered in the documentation or these weird propositions that would take Clojure to a place I'd rather not see it go.
15:42hiredmanhe has an article or two in a few java trade magazines
15:42hiredmangnuvince: that is my feeling as well
15:42hiredmanabout, uh, ANTLR I think they were
15:42danlarkinif you have nothing nice to say then you shouldn't say anything at all!
15:43gnuvincedanlarkin: I'm not bashing him or anything, I just find him peculiar
15:43hiredman(obviously, I googled the guy and the company mentioned at the bottom of his posts)
15:46stuhooddoes clojure have the equivalent of a switch statement?
15:46stuhoodi know about cond, but it requires a bit of repetition to do (= value cond1) (= value cond2)
15:46danlarkinstuhood: condp
15:47danlarkin(doc condp)
15:47clojurebotTakes a binary predicate, an expression, and a set of clauses. Each clause can take the form of either: test-expr result-expr test-expr :>> result-fn Note :>> is an ordinary keyword. For each clause, (pred test-expr expr) is evaluated. If it returns logical true, the clause is a match. If a binary clause matches, the result-expr is returned, if a ternary clause matches, its result-fn, which must be a unary function, is ca
15:47gnuvince,(resolve 'condp)
15:47clojurebot#'clojure.core/condp
15:47hiredman,(condp = :x :x :a :y :b)
15:47clojurebot:a
15:47gnuvincebuilt-in?
15:47hiredmanyep
15:47gnuvinceIs that new?
15:47stuhoodawesome, thanks guys
15:48hiredmannot too new
15:48stuhoodnew enough to not be in the online docs, heh
15:48hiredman21st of Dec new
15:49hiredmansvn rev 1180
15:49hiredmanclojurebot: come on, are you kidding?
15:49clojurebotTitim gan �ir� ort.
15:49hiredmansvn rev 1300
15:49clojurebotsvn rev 1300; lazy-seq perf tweaks
15:50hiredman"I don't think we should pander to the
15:50hiredmanmasses"
15:50hiredman*sigh*
15:51WizardofWestmarchiredman: ?
15:51hiredmanhttp://twitter.com/technomancy/statuses/1241615252
15:51hiredmanWizardofWestmarc: from a post to the google group
15:52WizardofWestmarchaha
15:52WizardofWestmarcit's so true
15:52WizardofWestmarcI remember those discussions on C.L.L. when I still followed it regularly
15:54stuhoodi remember hickey praising python for its syntactic simplicity, but i guess a lisp is a lisp
15:54WizardofWestmarcnod
15:55WizardofWestmarcI found it interesting when GvR mentioned he was looking at clojure
15:56gnuvinceWizardofWestmarc: he did?
15:56danlarkinon twitter
15:57gnuvinceok
15:57WizardofWestmarcyeah, one sec I'll find the tweet
15:57gnuvinceI found it ;)
15:57gnuvincehttp://twitter.com/gvanrossum/status/1228991275
15:57danlarkinheh, there's not really much to see...
15:57hiredmanyou know in red china, the chairman of the party (mao) used to create all these grandiose plans and ideas that where "ideologically pure" rice crops failed and people lied about shortages etc etc, then he died and there was a power struggle, and some dude whose name I cannot recall became chairman and said "hey, true from facts" and now china is a power house in the global economy
15:58WizardofWestmarcdanlarkin: true, but it's still interesting
15:58WizardofWestmarcespecially since he's at google
15:58danlarkinyeah for sure
15:58WizardofWestmarcand I know Norvig already knows about it since Rich sent him a spelling program for that one language shootout of his.
15:59danlarkinI work in python all day long at work, it's a great language and I have loads of respect for guido, maybe he'll have some constructive input :)
15:59WizardofWestmarcyeah Python was probably my first "love" language
15:59WizardofWestmarcand I'm jealous you get to use it for work.
15:59gnuvincePython is nice, but it's Guido who could learn from Rich IMO :)
16:00leafwWizardofWestmarc: do you have a link for Norvig's page?
16:01leafwWizardofWestmarc: norvig.com is just too many links
16:01zakwilsonI think Python makes it hard to write confusing code, which I believe was a goal for Java.
16:01WizardofWestmarcleafw: one sec
16:01gnuvinceleafw: http://www.norvig.com/spell-correct.html
16:01gnuvincetable at the bottom
16:01gnuvince(Link is dead though)
16:01gnuvincetechnomancy: so say we all
16:02leafwthank you.
16:02hiredmandoesn't look like it will
16:02WizardofWestmarcit never will
16:02Hunit didn't for 50 years
16:02WizardofWestmarcC.L.L. has so much proof of that fact...
16:02gnuvinceWell, as long as people keep killing them :)
16:02technomancynothing against people experimenting with things they find interesting, it's the "we should use this to promote clojure" angle that bothers me
16:02hiredmaneveryone needs their 2� in
16:02jbondesonquick someone alter the parser to inverse the use of []/()
16:03gnuvinceTo me, it would create two classes of Clojure programmers: sexp guys and mexp guys.
16:03fogusWhy is it that no one ever suggests a Java syntax with less parens?
16:03gnuvinceKind of like C# and VB.NET in the .NET world
16:03gnuvincefogus: because curly braces are good
16:03gnuvinceending a class with 12 closing brackets is a sign of a serious program
16:03hiredmanfogus: because their are so many stake-holders in java it is almost impossible to get everyone on board
16:04WizardofWestmarcif I can't have my ((())))))(()()()))() I'd rather have meaningful whitespace, personally
16:04gnuvinceending a Lisp function with 12 parens is a "toy"
16:04zakwilsonAlternate syntax comes up all the time in Lisp communities. It always creates a long thread, sometimes somebody implements it. Hardly anybody actually cares.
16:04leafwhum, the clojure spelling corrector would be so much more readable spread over at least twice as many lines
16:04fogusgnuvince: Well, curly brace certainly rolls off the toungue
16:04jbondesonor better yet, i'm make Clojure sharp and just replace all the parens with {} that way C and Java programmers will feel at home
16:04HunWizardofWestmarc: saw a cool emacs-mode for that recently
16:04hiredman,(pl inc $ inc $ 0)
16:04clojurebot2
16:04jbondeson{let [a b] {do {some stuff} }}
16:04gnuvincejbondeson: heheh :)
16:04ChouserSomething has interfered with lisp being more popular than it is.
16:05WizardofWestmarcOne part of it, IMO, is the mystical "it's an AI language" thing
16:05ChouserI think Clojure has found a couple of these and fixed them
16:05WizardofWestmarcsome reason that idea gets in peoples heads and they think "oh I don't need that"
16:05gnuvinceChouser: I doubt it's the parentheses. People *think* it is, but it's the "I'm my own world" philosophy that also killed Smalltalk.
16:05hiredman,(pl (map inc � first [[1 2] [3 4]]))
16:05clojurebot(2 4)
16:05fogusTurning a parser from recognizing (foo 1 2 3) to f(1 2 3) is a piece of cake. Would that really solve the problem?
16:06HunWizardofWestmarc: http://www.foldr.org/~michaelw/emacs/
16:06Hunlook at mwe-color-box
16:06Chouser"programs writing programs" always threw me -- sound like not just AI but *hard* AI.
16:06hiredman,(pl (?map range $ 3 inc))
16:06clojurebot(1 2 3)
16:06gnuvinceI say that if people can use C++'s and Perl's syntax, there's no reason why they should fear Clojure's and Lisp's in general.
16:06Chousergnuvince: excellent point
16:07WizardofWestmarcHun: oh, color box, I think I've heard of this
16:07WizardofWestmarcgnuvince: thing is a lot of people first learned on C like language syntax
16:07Hunprogram writing programs are pretty usual stuff. people do it all the time, maybe without realizing it
16:07Chousercalling perl's syntax "c-like" is a bit of a stretch.
16:08gnuvinceWizardofWestmarc: your brain doesn't shut down after you learn C
16:08WizardofWestmarcChouser: ok true
16:08HunChouser: but but but... it has {} and ;!
16:08gnuvince(well, hopefully not)
16:08WizardofWestmarcgnuvince: Mine doesn't, no
16:08WizardofWestmarcbut a lot of people don't seem to want to learn new types of syntax
16:08gnuvinceExcept if it's XML
16:08gnuvinceor JSON
16:08Hunor YAML
16:08WizardofWestmarcXML isn't a language to them, it's data payload
16:08WizardofWestmarcsily I know
16:09gnuvinceI'm preaching to the choir here
16:09WizardofWestmarcbut *shrug*
16:09gnuvinceLet me join ##c and explain to them why they should use sexp!
16:09Hungnuvince: wrong channel for this flamewar :)
16:09WizardofWestmarca lot of programmers don't actually give a damn about expanding their programming skills.
16:09fogusWizardofWestmarc: sad but true
16:09hiredmanI think that is fine
16:09hiredmanIt's a Living
16:10WizardofWestmarcIf they're good enough they don't make my job harder maybe ;-)
16:10Chousersure, but there's another set -- those who say "I want to learn one of these 'new' languages -- I hear about ruby, python, haskell, clojure. They're all so new and confusing. Which should I learn?"
16:10hiredmanyeah, but that is true in every field
16:11Chousera mess of parens and talk of AI may be all it takes for them to go after python instead
16:11WizardofWestmarcTrue hiredman.
16:11WizardofWestmarcdoesn't mean I want to deal with them ;-)
16:11gnuvinceI think it's sad that people don't want to improve the craft they spend their days executing
16:11gnuvinceIt might just be that we're insane
16:11hiredmanI know, I just get this attitude from programers that programming is so great art that everyone should learn
16:12WizardofWestmarcoh I don't think THAT
16:12WizardofWestmarcI just think if you're going to do it you should be serious about it
16:12WizardofWestmarcwell if you're going to do it as more then a hobby
16:12gnuvinceI don't either, but I couldn't understand why a car salesman would not want to flip through a car magazine to learn about new models, technologies, trends, etc.
16:13hiredmangnuvince: I am sure many do not
16:14WizardofWestmarcand many car salesmen suck and I wouldn't want them to be the ones pitching cars to me either.
16:14hiredmanI work at a painting company, I don't know shit about painting, or care to, really
16:15hiredmansometimes a job is just a job
16:18zakwilsonIt's sad when a job is just a job. I feel sorry for anyone in that situation.
16:20shooverChouser: don't forget the money quote from indyaltnet: "With or without competition, Lisps isn't going to take off."
16:21hiredman#%@#$%
16:21hiredmanbastards
16:21gnuvinceMy current job is so boring and annoying that I've decided that it's time to go to university. At least there was a nice by-product of having a bad job.
16:22WizardofWestmarcgnuvince: hah, for anything in particular or dunno yet?
16:22hiredmanI need to do that
16:24gnuvinceWizardofWestmarc: I live in Quebec where there two types of establishment who give "superior educations": colleges (which we call cegeps) and universities. I graduated from a college about 5 years ago in the computer program (can't call it computer science). I'm gonna go into computer science and hopefully open doors to more interesting jobs. When I hear Rich talk about what he does, my jaw drops cause I think it must be really
16:24shooverhiredman: sorry, didn't mean to ruin your day with the negativism. It was said as a joke, I think, from historical observation, except that historically there is competition
16:25WizardofWestmarcgnuvince: yar I know how that is
16:25WizardofWestmarcI've been considering looking at getting a math bachelors to go with my CS as what math skills I _DID_ have have attrophied with doing all CRUD apps for the entirety of my professional career
16:26hiredmanshoover: nah, don't worry about it :P
16:26gnuvinceI'm doing my pre-req math classes, calculus 1. It's pretty hard by correspondance with no teacher however :-/
16:26hiredmanI was joking as well
16:26shooverhiredman: whew
16:26fogusI'm considering attending one of those wizard schools. ;)
16:26WizardofWestmarcI hated calculus
16:27WizardofWestmarcactually found a textbook for linear algebra + workbook w/answers online that I grabbed to work my way through
16:27danlarkinoh please let's not talk about calculus :(
16:27hiredmanI have to rember to use my sarcasm marker ?
16:28jbondesoni loooved my math courses.
16:28jbondesoncourse i've never used a line integral outside of pysics =/
16:28jbondeson+h
16:28WizardofWestmarcheh yeah
16:29hiredmanmy last math course, the instructor had no record of me taking the final, so he failed me, and I didn't notice until six months later when I tried to take another math course
16:29jbondesonhiredman: yowch
16:29hiredmanbecause I figured I must have passed, because I just sort of sailed through the class
16:30hiredmanit was a bit of a set back, I haven't been back in a classroom for about a year now
16:33BrackiHow should public static final Strings be defined in clojure? As *STATIC_STRING* ?
16:33technomancywhat does that even mean?
16:33hiredman(def a "string")
16:33jbondeson^^^
16:33hiredman*name* is for stuff that maybe rebound with binding
16:33BrackiNah, what I meant is, is there any convention on the names?
16:34technomancylower case, dash separated words
16:34WizardofWestmarcif you really want it to stand out, just use the earmuffs
16:34WizardofWestmarcother then that, eh
16:34Brackiearmuffs?
16:34technomancyWizardofWestmarc: that doesn't mean "this should stand out", it means "this will change".
16:34WizardofWestmarc*avar*
16:34WizardofWestmarceh?
16:34WizardofWestmarcI thought ** were non-changing
16:35WizardofWestmarchm
16:35jbondesonusually they're refs
16:35technomancyWizardofWestmarc: you're thinking of markdown where *foo* means bold. =)
16:35hiredmanlike *out*
16:35hiredmanit means stuff that maybe rebound in a the context of a thread
16:35technomancyjbondeson: I don't use that for refs; I think using @ to deref is enough of a visual cue
16:40ChouserThis keeps coming up, which surprises me. Most things in Clojure code are constant, so putting ++ around them or something would mean you'd have to do that for almost every symbol.
16:43technomancysounds like a FAQ entry. =)
16:44technomancymaybe we could put "hey guys I haven't used lisp that much, but I have this great idea about how it could be more popular by getting rid of parens [...]" on the FAQ too.
16:45jbondesonthere's this bar i frequent here in dever that has a great entry under side items called "Stupid Questions: $0.94", and then a FAQ that says "Yes we really do charge for stupid questions."
16:45hiredmanclojurebot: FAQ?
16:45clojurebotFAQ #1 is http://groups.google.com/group/clojure/msg/8fc6f0e9a5800e4b
16:45WizardofWestmarc...jbondeson: Which bar?
16:45jbondesonFalling Rock
16:45WizardofWestmarchah
16:46BrackiHow can I zeropad numbers in clojure? (test-is "001" (zeropad 1))?
16:46WizardofWestmarcthat's downtown yes?
16:46hiredmanFAQ #2 is def is for constants
16:46ChouserFAQ #1 is out of date
16:46Bracki,(doc test-is)
16:46clojurebotjava.lang.Exception: Unable to resolve var: test-is in this context
16:46hiredman~FAQ #2 is def is for constants
16:46clojurebotc'est bon!
16:46hiredmanChouser: care to update?
16:46jbondesonWizardofWestmarc: Blake between 19th and 20th
16:46Chouser,(format "%03" 1)
16:46clojurebotjava.util.UnknownFormatConversionException: Conversion = '0'
16:47Chouser,(format "%03d" 1)
16:47clojurebot"001"
16:47Chouserhiredman: I mean, it's gone. The problem no longer exists.
16:47Chouser,(count (.getMethods Integer))
16:47clojurebot41
16:47hiredman~FAQ #1 is a solved problem
16:47clojurebotRoger.
16:54triddellDoes anyone know where clojure-contrib stands in terms of the recent clojure lazy changes? When I tried to compile contrib to class files I got some errors.
16:54technomancytriddell: the most popular libraries have been updated
16:55technomancythere may be some stragglers
16:56triddelltechnomancy: ok, thanks... I'll just try the jar file and see if it works... I think I'm only using the file io stuff on this project.
16:56AWizzArdtriddell: only yesterday I did run ant on a recent clojure-contrib, and it worked without problems
16:56AWizzArdjochu also updated clojure-swank, which now also works again. Thx :)
16:57technomancytriddell: you don't even have to compile at all; you can just put "[...]clojure-contrib/src/" on your classpath
16:57triddellAWizzArd: saw that, that's one reason I wanted to move my stuff today.
16:57triddellAWizzArd: did you do something like this: ant -Dclojure.jar=../clojure/clojure.jar
16:58AWizzArdno
16:58triddellotherwise I think it's just jarring the source
16:58AWizzArdI did: svn checkout http://clojure-contrib.googlecode.com/svn/trunk/ clojure-contrib then cd clojure-contrib then ant
16:58triddellI was trying to get the compiled class files
16:59triddelljust to speed things up a bit
16:59AWizzArdit produced a clojure-contrib.jar and there was also a dir classes in which the .class files were stored.
16:59AWizzArdBut I don't need/want the .class files when I have the clojure-contrib.jar file.
17:01triddellAWizzArd: previously, using the method I noted, the class files would be in the jar file which would save the compilation at runtime (I belive)
17:02danlarkintriddell: Ahead-of-Time compiling doesn't speed up code execution, just loading time (slightly)
17:02BrackiDo bindings work "globally"?
17:02danlarkinBracki: that question doesn't really make sense
17:03hiredman~javadoc String
17:03hiredman:)
17:03triddelldanlarkin: ok, thx... I knew there was a reason I wanted to qualify that statement with "I believe" :-)
17:03technomancyBracki: bindings have absolute effect inwardly. but they don't change anything outside the call to bindings.
17:04Vargr_In ring, how do I restart jetty, or better yet, how can I reload a function without jetty restarting? I called ring.jetty/run from a REPL, server runs, but someone seems to have forgotten a stop function or at least a ref to the server instance :)
17:05hiredman~jdoc java.util.Collection
17:05Brackitechnomancy: OK regarding mire, you couldn't have moved the *name* binding to another function, right?
17:05BrackiThat is have (read-name) handled as part of (execute input).
17:05technomancyBracki: that's right; it needs to wrap everything that needs that value of *name*
17:07technomancywow, wikipedia is surprisingly unhelpful on the topic of dynamic binding.
17:09WizardofWestmarcaww, simple.wikipedia.org doesn't have a s page for Dynamic Binding
17:09durka42you mean, in that it has almost no content and a trivial morbid example
17:10technomancydurka42: it's not even about FP dynamic binding. it's about some silly OOP notion.
17:13hiredmanclojurebot: Object Computing, Inc is <reply>see Subject Computer, Inc
17:13clojurebotYou don't have to tell me twice.
17:13hiredmanclojurebot: Object Computing, Inc is <reply>see Subject Computing, Inc
17:13clojurebotAck. Ack.
17:16AWizzArdclojurebot: Object Computing, Inc?
17:16clojurebotsee Subject Computing, Inc
17:19durka42~google subject computing inc
17:19clojurebotFirst, out of 20500000 results is:
17:19clojurebotMallorn Computing Copyright Notice
17:19clojurebothttp://www.mallorn.com/legal/copyright.html
17:20durka42http://www.google.com/search?q=subject+computing+inc&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a
17:20hiredmanha ha, Nice.
17:20hiredman"did you mean object computing?"
17:23hiredman~jdoc org.apache.struts.action.RequestProcessor
17:24hiredman~jdoc clojure.lang.IFn
17:24hiredmantoo bad
17:42stuhoodi really love laziness =)
17:42technomancyI'll love laziness when I need to.
17:43gnuvince_hahahah
17:43Chouserha!
17:43stuhoodhehe
17:50stuhoodis there shorthand for making a list that still executes the body?
17:51stuhoodi was using '(:blah (map...)) to create a list, but the map wasn't actually being executed
17:51technomancystuhood: you can wrap it in a dorun iirc
17:51jbondeson^^^
17:52stuhoodhm. thats not short =)
17:52technomancystuhood: but the question is why you want to control when it executes
17:52Chouserstuhood: you're sure you need a list and not a vector?
17:52technomancythat seems like the wrong thing to want. if you have side-effects in the function you're mapping with, you shouldn't be using map
17:52stuhoodi basically want the equivalent of (list :blah (map ...))
17:52hiredmaneh?
17:52stuhoodChouser: because i have a hunch that vectors are slower
17:52jonafanhello i am a fool for not learning clojure yet. I've been trying to get an old OOP program i've written to have fine grained locking and i've determined that it's basically impossible to do anything but a global lock. that is all
17:53stuhoodi'm creating a tuple!
17:53Chouserstuhood: [:blah (map ...)] may just do what you want.
17:53technomancystuhood: so why do you care about execution time?
17:53technomancyerr--about when it executes
17:53Chouserstuhood: otherwise (list :blah (map ...)) or `(:blah ~(map ...))
17:54stuhoodbecause it will never be executed unless a callee unescapes the map
17:55technomancystuhood: oh yeah; I see. right; list is what you want
17:55Chouserstuhood: don't optimize prematurely.
17:55stuhoodChouser: yea, you're right... the vector is the clearest
17:56stuhoodhickey probably has optimizations for small vectors
17:56Chouserstuhood: if the speed difference between vector and list actually matters for you application, you'll want to profile to be sure.
17:56technomancycould use cons as well if you're trying to emphasize the fact that they're pairs
17:57stuhoodheh... i'm sure it doesn't... just a bit of OCD
17:57Chouserstuhood: it's ok. but be OCD about program clarity. :-)
17:57technomancyyour future self will thank you.
17:57stuhoodChouser: indeed =)
18:02tomsw`what's the best / correct way to map a function across a collection for immediate side-effects - like mapc?
18:02technomancytomsw`: use doseq
18:02shooverjonafan: have you _still_ not learned clojure after realizing this?
18:03jonafanyep, my fault
18:03shooverget busy!
18:03jonafanhow do mutable java classes/controls/etc work in clojure?
18:04hiredmanjava is java
18:04jonafanare they like agents?
18:04stuhoodjonafan: they do exactly what they would if you modified them in java
18:05jonafanso potential for race conditions is still high
18:05technomancyjonafan: you can wrap them in clojure collections that guarantee immutability
18:05jonafanah
18:06hiredmanmostly you just use clojure and touch java only when you need it
18:06tomsw`is there anyway to use doseq inside doto, so as to ,er, do a collection of things to the victim?
18:06tomsw`Or do you have to use a let?
18:06hiredmanuh
18:07hiredmanreduce
18:07technomancytomsw`: doseq isn't *quite* like map
18:07hiredman,(reduce #(do (%2 %1) %1) thing [function1 funciton2])
18:07clojurebotjava.lang.Exception: Unable to resolve symbol: thing in this context
18:07technomancyit binds for you
18:08tomsw`(doto (new Obj) (.method1 "arg1") (doseq #(.method2 %) coll)) -- that method2 isn't going to work
18:08hiredmanuh
18:08hiredmanNo.
18:08hiredmanNo No
18:08technomancy~(doc doseq)
18:08clojurebotPardon?
18:08hiredman(doc doseq)
18:08clojurebotRepeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.; arglists ([seq-exprs & body])
18:09technomancy~(doseq [x [1 2]] (println x))
18:09clojurebotPardon?
18:09technomancy,(doseq [x [1 2]] (println x))
18:09clojurebot1 2
18:09technomancytomsw`: make it look like that
18:16tomsw`I'll change the question (thanks for correcting my doseq): to repeatedly call a method on an object over the values of a collection, doto is nogo?
18:19technomancylooks like it
18:19technomancythere may be a way, but it isn't obvious
18:21tomsw`I was only asking because of the vague similarities with "with" in various languages, that lets you call lots of methods on the same object - in a loop if you want
18:22tomsw`you can probably guess I'm making a real pig's arse of GUIs in clojure...
18:23durka42when trying to compile c.c.lazy-seqs: java.lang.VerifyError: Cannot inherit from final class
18:26stuhoodworking back and forth between java and clojure makes me wish for so many changes in java
18:26stuhoodwant a List literal? Arrays.asList(new String[]{"hello", "world"})
18:26stuhooduggh.
18:26technomancywow
18:27RaynesWhat is this new clojure-sources.jar for?
18:28technomancyhave there been any recent attempts to use terracotta w/ clojure?
18:32Raynesrhickey: What is this new clojure-sources.jar for?
18:36stuhoodRaynes: I believe it has to do with CI: http://groups.google.com/group/clojure/browse_thread/thread/5f5f63bb0ac6dbd/9316e4e13aab2caf?hl=en&amp;lnk=gst&amp;q=tapestry#9316e4e13aab2caf
18:37RaynesOh. Thanks.
19:37hiredman~def ensure
19:40technomancyhah; best comment on the removing parens thread: "Wait; hang on--those are load-bearing parentheses!"
19:42stuhoodlol
19:46clojurebotsvn rev 1302; mod fix [issue 23], patch from timothypratley
19:54slashus2hiredman: Should I use ensure inside of a transaction to look at a ref value?
19:56clojurebotsvn rev 1303; unwrap InvocationTargetException's around Errors in reflective calls [issue 44]
19:58rhickeyslashus2: you only need to use ensure if a) you are not changing that ref, and b) you are making a decision that would be invalid if the ref were changed by another transaction
19:59slashus2rhickey: Okay, thank you.
20:01durka42do we know why building contrib dies with a VerifyError (in lazy-seqs) with svn head?
20:01hiredmandurka42: I build it earlier today and it did not die
20:02durka42hmm, that's interesting
20:02hiredmanBUILD SUCCESSFUL
20:02hiredmanTotal time: 2 seconds
20:03durka42but did you give -Dclojure.jar=/path/to/clojure.jar to have it actually build the class files?
20:04hiredmannope
20:04hiredman<-- contrib rookie
20:04durka42,(use 'clojure.contrib.lazy-seqs)
20:04clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/lazy_seqs__init.class or clojure/contrib/lazy_seqs.clj on classpath:
20:04durka42well, anyway try that and the VerifyError comes up
20:05hiredmanstill didn't
20:05hiredmanbut I may be doing it wrong
20:05durka42all right a clean build worked
20:05durka42strange
20:07jbondesoni blame the gremlins.
20:10durka42re: gremlins http://my.safaribooksonline.com/1565925254/ch10-21965
20:12jbondesongotta love the "smash your face on the keyboard" testers...
20:24AWizzArdIs there a function that can be used instead of (first (filter ...))?
20:24AWizzArdsimilar to CLs find-if
20:26AWizzArdclojurebot: max people
20:26clojurebotmax people is 149
20:28hiredmanAWizzArd: does that seem reasonable to you?
20:28Chouser(some #(when (f %) %) coll)
20:28durka42with lazy seqs (first (filter ...)) doesn't actually do any extra work
20:28Chouser(first (filter f coll))
20:29durka42,(let [li (lazy-cat [1 2 3 (lazy-seq (prn "hi"))])] (first (filter #(= 3 %) li)))
20:29clojurebotjava.lang.NoClassDefFoundError: clojure/core$lazy_cat__4398$fn__4400
20:29hiredmanhuh
20:29durka42clojurebot: you are not lazy enough. please refrain from doing work
20:29clojurebotlazy is hard
20:29durka42user=> ,(let [li (lazy-cat [1 2 3 (lazy-seq (prn "hi"))])] (first (filter #(= 3 %) li)))
20:29durka423
20:31durka42wait, why doesn't this work
20:31lisppaste8durka42 pasted "lazy" at http://paste.lisp.org/display/76054
20:33durka42i would expect that to print out "hi"
20:33AWizzArd,(doc drop-while)
20:33hiredmandurka42: it makes a nested list
20:33hiredmanwhich doesn't = 5
20:34durka42oh
20:34durka42how are you supposed to use lazy-seq
20:36AWizzArdrhickey: is it intended in the doc for drop-while to mention only nil? It could for example also read: "... for which (pred item) returns nil or false."
20:36Chouser,(first (filter #(= 3 %) (lazy-cat [1 2 3] (lazy-seq (prn "hi")))))
20:37AWizzArdbot is still offline
20:37Chouseroh, clojurebot's gone. Anyway, that doesn't print "hi", but get rid of 'first' and it will
20:37durka42cool
20:37Chouserlazy-cat doesn't buy you anything over concat there, I think.
20:38durka42it needs lazy-cat or lazy-seq, but not both
20:39hiredman,(first (filter #(= 3 %) (lazy-cat [1 2 3] (lazy-seq (prn "hi")))))
20:39clojurebot3
20:39durka42,(first (filter #(= 3 %) (lazy-cat [1 2 3] (prn "hi"))))
20:39clojurebot3
20:39durka42,(first (filter #(= 3 %) (concat [1 2 3] (lazy-seq (prn "hi")))))
20:39clojurebot3
20:40hiredman,(doc lazy-cat)
20:40clojurebot"([& colls]); Expands to code which yields a lazy sequence of the concatenation of the supplied colls. Each coll expr is not evaluated until it is needed. (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))"
20:40hiredman,(doc concat)
20:40clojurebot"([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."
20:41hiredmanah
20:41hiredmanI see
20:43lisppaste8xitam pasted "fumbling with state" at http://paste.lisp.org/display/76057
20:44AWizzArdmaybe concat is now what lazy-cat was in the past?
20:44xitamwould someone be kind enough to look at this and give me a hint? pretty sure i'm just being an idiot somehow :)
20:56hiredman~jdoc Float
21:05Chouserxitam: I'm having a hard time picking out desired behavior from undesired
21:05Chouserxitam: can you trim down your example a bit?
21:06xitamChouser: yeah, i'll work on it. it's supposed to be adding the generated nodes to both maps together in the function add-to-open, so i dont see how they come out different sizes
21:08cmvkkIf I want to use proxy to extend java.io.InputStream, which requires implementing the method 'write' which takes no arguments and returns the next byte
21:08cmvkkfor example, if i wanted to use a lazy seq to do that...is it possible to do that without using some sort of mutation?
21:09cmvkki'm not sure how to do it, short of using an atom or something
21:10hiredmanuh
21:10hiredman~jdoc java.io.InputStream
21:10hiredmanyeah
21:11hiredmanInputStream doesn't have a write method
21:11cmvkkheh
21:11cmvkki meant 'read'
21:11cmvkk:/
21:11hiredmanyeah, you will need to use an atom or a ref
21:12cmvkkthanks, that's what i thought.
21:12hiredmanChouser: contrib should have a method that returns an InputStream backed by a seq
21:13hiredmaner
21:13hiredmanfunction
21:15Chousera seq of Characters?
21:15hiredmanugh
21:15hiredmannm
21:15hiredmanyeah
21:15hiredmanthat is right, java it's types
21:15hiredmanugh
21:18waltersi thought it was for the inputstream use case that the streams work came about? it's not a seq since it's stateful
21:19xitamunfortunately, i'm trying to come up with a simplified example and everything works exactly as expected
21:20waltersoh wait nevermind, reverse of what i thought, InputStream *from* a seq
21:20hiredmanwalters: I think streams are shelved, and scopes are going to be used for resource management
21:22waltersare seqs still referentially transparent?
21:24Chouserwalters: yes
21:25hiredman~scope
21:25clojurebotitym horizon
21:33gnuvince_clojurebot: scope is at http://paste.lisp.org/display/73838
21:33clojurebotOk.
21:49Chouserxitam: I think it's the dissoc, but i'm not sure why yet.
21:53Chouserhm, nope
21:58Chouserxitam: I think it's the sorted-map
21:58Chouser,(sorted-map-by #(even? %2) 1 1, 2 2, 3 3)
21:58clojurebot{1 3, 2 2}
22:00Chouserspecifically, your scoring function f sometimes indicates two unequal things are the same
22:00xitamChouser: the weird thing is if i do (dosync (alter my-sorted-map assoc that-right-node nil)) it'll take it
22:01xitamfrom the repl, i mean
22:02xitambut that's probably the reason somehow - i thought the comparator was only for sorting, and it would check hashes for equality
22:03ChouserI'll see if I can confirm it in the code.
22:04Chouseryeah, that's got to be it.
22:05Chouserit's using the func as a Comparator, and if it returns 0 it assumes they're equal
22:05Chouserhashes don't guarantee equality anyway, but it's not even use the = function.
22:11xitamwow, turns out i was totally wrong, i won't in fact take that node into the set no matter what i do. dunno how i thought otherwise
22:11xitamthanks chouser
22:12Chousernp.
22:12Chouserit's a painful way to learn, but it's a way.
22:12xitamyeah. i need to understand comparators
22:13Chouserclojure fns of 2 args implement comparators automatically
22:13Chouser,(instance? java.util.Comparator #())
22:13clojurebottrue
22:14hiredman~jdoc java.util.Comparator
22:15Chouserbut the .compare method provided expects the function itself to return true/false
22:17ChouserI think. I'm not finding the code. hm...
22:17Chouserah, either boolean or number
22:17hiredmanI it was true/false or 1,0,-1
22:18Chouserhttp://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/AFunction.java#27
22:18hiredmanthought
22:18Chouserhiredman: you're right
22:18rhickeywhat's the question?
22:18hiredmanusing fns as comparators
22:18Chouserrhickey: no question, we've got it all figured out.
22:18rhickeygreat!
22:18Chouser<-- smug
22:19Chouserxitam and i didn't know sorted maps relied entirely on the comparator fn to determine equality of keys
22:19Chousernow we do.
22:20rhickeyhas to
22:21Chouserbecause the keys may not be comparable any other way?
22:21hiredmanI didn't know either, but Chouser won't shutup about it, so the secret is out
22:22rhickeyChouser: right, it's an arbitrary function, might only use parts of values for instance
22:23rhickeythe numeric version has explicit = via 0, the boolean does x < y, y < x, if neither true, then =
22:23rhickeybut the sort doesn't know how much or what parts of the values matter, can't compare whole values with =
22:25xitamthe javadoc for comparator is very enlightening about the issue -- clearly this isn't a mistake a more experienced programmer would make, but a note or link in the docs might help newbies
22:27Chouserxitam: so you can just make sure your sort-by function only returns 0 when you really mean it to.
22:27rhickeyusing a simple boolean predicate is often easiest
22:28Chouserhe's trying to sort by a cost function
22:28rhickeylike < ?
22:28rhickeystill boolean
22:29Chouserbut equal cost does not mean same node
22:29Chouserhttp://paste.lisp.org/display/76057
22:29rhickeyah
22:30rhickeyhen you've got duplicates from the perspective of the map/set
22:30rhickeythen
22:30rhickeyyou'll have to further distinguish on equal cost
23:05DrakesonI am not sure if clojure-contrib is installed properly. How can I check it? is (require 'clojure.contrib.cond) supposed to work, for instance?
23:05Chouser(use 'clojure.contrib.repl-utils)
23:06Chousertry that
23:07Drakesonthanks. (does not work, so it means my setup is the culprit.)
23:07Drakeson(java.io.FileNotFoundException: Could not locate clojure/contrib/repl_utils__init.class or clojure/contrib/repl_utils.clj on classpath) ...
23:07Chouserjust put clojure-contrib/src in your classpath
23:08DrakesonI have put path to clojure-contrib.jar in a CLASSPATH env var. that is not enough then.
23:09Chouserthe jar itself needs to be in your classpath
23:10Drakesonis that enough, though? (export CLASSPATH=$HOME/.local/jars/*)
23:11Chouseror java.ext.dirs needs to include the directory that contains the jars
23:11Chouserput -Djava.ext.dirs=$HOME/.local/jars on your java command line
23:12Drakesonso I need to set both CLASSPATH and java.ext.dir ?
23:12Chouserno, one or the other
23:22Drakesonhmm, it's strange ..., I set CLASSPATH to a both clojure.jar and clojure-contrib.jar. Maybe swank-clojure is disrespecting CLASSPATH env var altogether?
23:22Chouserpaths separated by :
23:22Drakesonyes
23:23hiredmanwatchout, Chouser is a vim user
23:24Drakesoncan it be that java ignores CLASSPATH env var when swank-clojure uses -cp ... when calling java?
23:24hiredmanyes
23:25Chouserhm, yeah, you said "swank", I'm out. :-)
23:25hiredman-cp disregards CLASSPATH
23:25DrakesonI see, thanks
23:26DrakesonChouser: heh :)
23:52cmvkkone thing about clojure is that it's hard to complain about a problem with a java library when all you have is clojure code as an example.
23:56danlarkinWhyyyyyyyy: http://github.com/an-and/pleajure/tree/master
23:56jbondesonhaha
23:57jbondesonit's like screaming "I don't get it" at the top of your lungs.
23:57danlarkin1) -jure name 2) wtf syntax?
23:57jbondesonit's not even parenless or anything
23:58cmvkkwell, there's nothing...wrong with it, per se
23:58jbondesonyou're really are just getting rid of parens on forms you put on a newline
23:59hiredmanugh