#clojure log - Feb 17 2009

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:01 Chouser: I like "don't be so eager", but the logo placement on the front is kinda lame.

0:01 blbrown: yea, kind of right there at the stomach

0:02 Chouser: maybe it should only be on the back

0:03 durka42: yeah that one might be better if the logo was moved to the back

0:03 Chouser: maybe swap the text too?

0:04 durka42: eh, i dunno

0:06 Chouser: put another way, that account has almost (but not quite) earned a free shirt.

0:06 this is really not an effective money-making venture. :-)

0:06 blbrown: if you are creating them, you might just have a simple one. clojure logo on the front and then a description on the back. Clojure, lisp dialect for the JVM or something

0:06 hiredman: like the /topic

0:07 blbrown: yea

0:14 cp2: 23:50:36 [Chouser] So far we've sold 7, so Zazzle owes Rich almost $20.

0:14 never fear

0:14 im about to buy a few

0:15 Chouser: ooh

0:15 cp2: possibly tomorrow

0:15 durka42: it is tomorrow here...

0:15 which means i should probably go to bed soon

0:15 cp2: well, its tomorrow here too

0:15 didnt notice

0:15 Chouser: well, as I said, it's not really about making money. I just hope the quality of the T-shirts is good -- I haven't actually seen one yet.

0:16 cp2: ill let you know

0:17 Chouser: http://www.zazzle.com/i_get_more_done_when_im_lazy_clojure_on_back_tshirt-235284015952434496

0:17 better?

0:17 hiredman: there isn't some api function that takes a function and changes the order of paramters is there?

0:18 Chouser: #() :-)

0:18 hiredman: :(

0:18 #(fn [& x] (apply % (reverse x)))

0:19 ,((#(fn [& x] (apply % (reverse x))) map) (range 10) inc)

0:19 clojurebot: (1 2 3 4 5 6 7 8 9 10)

0:19 hiredman: ,((#(fn [& x] (apply % (reverse x))) map) (range 10) (range 9 20) +)

0:19 clojurebot: (9 11 13 15 17 19 21 23 25 27)

0:20 Chouser: ,(#(% %3 %2) map (range 10) inc)

0:20 clojurebot: (1 2 3 4 5 6 7 8 9 10)

0:20 hiredman: clever

0:20 Chouser: oh, you want them all reversed. hm.

0:20 hiredman: I am willing to take what I can get

0:21 Chouser: ,(#(apply % (reverse %&)) map (range 10) (range 9 20) +)

0:21 clojurebot: (9 11 13 15 17 19 21 23 25 27)

0:21 ayrnieu: ,(#(fn [f & rst] (apply f (reverse rst))) list 1 2 3)

0:21 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--1021$fn

0:22 hiredman: anyway, I can write it fine, I just was hoping something like that existed in the api and I just missed it

0:23 Chouser: no, Clojure core isn't actually terribly rich function-manipulation functions.

0:23 I don't miss them personally.

0:23 hiredman: :(

0:24 clojure.higher-order-functions

0:24 Chouser: isn't any fn that takes a fn as an arg higher-order?

0:24 we've got plenty that take predicates or mapping fns or whatever.

0:24 ayrnieu: yes, you're thinking of clojure.combinators

0:25 hiredman: pardon my mistake

0:25 Chouser: it's the ones that return fns that are less common: comp, complement

0:25 hiredman: partial

0:25 constantly

0:25 memoize?

0:25 silkarn: multimethods, arent they just calling one function that handles dispatch ?

0:25 Chouser: not to be confused with clojure.contrib.combinatorics. :-)

0:26 ayrnieu: silkarn - yes.

0:26 defmulti examples: http://paste.lisp.org/display/74647

0:26 Chouser: identity

0:26 ;-)

0:29 hiredman: I think what draws me to point free style is not having to think up argument names

0:29 (I always just pick i or x anyway)

0:29 durka42: or %

0:30 sometimes point-free is nice when you can see how the fns logically connect

0:30 but when it gets really convoluted maybe it should just be written out...

0:41 silkarn: scheme > clojure?

0:41 hiredman: uh

0:41 durka42: nil

0:41 hiredman: no?

0:41 durka42: ,(> 'scheme 'clojure)

0:41 clojurebot: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number

0:41 silkarn: , (> scheme clojure)

0:41 clojurebot: java.lang.Exception: Unable to resolve symbol: scheme in this context

0:42 Chouser: java.lang.ClassCastException: scheme cannot be cast to clojure.lang.IFn

0:42 ayrnieu: http://blog.thinkrelevance.com/2009/2/17/programming-clojure-beta-7-is-out

0:42 hiredman: ,(let [ton #(apply + (map int %)] (> (ton "scheme") (ton "clojure")))

0:42 clojurebot: Unmatched delimiter: ]

0:43 hiredman: ,(let [ton #(apply + (map int %))] (> (ton "scheme") (ton "clojure")))

0:43 clojurebot: false

0:43 hiredman: :)

0:43 durka42: ,(let [ton #(apply + (map int %))] (vec (ton "scheme") (ton "clojure")))

0:43 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$vec

0:43 durka42: ,(let [ton #(apply + (map int %))] (list (ton "scheme") (ton "clojure")))

0:43 clojurebot: (629 756)

0:44 ayrnieu: silkarn, it depends on what you're interested in.

0:48 hiredman: ...

0:48 technomancy: if you're interested in implementing a lisp for fun, scheme is probably a better choice.

0:50 blbrown: is the book going to be updated per the new clojure language changes I wonder

0:50 ayrnieu: blbrown, RTFA.

0:50 technomancy: blbrown: stuart said as long as it's decided this week it should make it into the book

0:52 blbrown: ayrnieu, it doesnt say anything about examples in the book

0:52 ayrnieu: I'd actually recommend clojure for the 'language for fun', over scheme, but call/cc seems more intimidating than thread pools and STM.

0:53 it's hard to say that you'd end up with 'clojure', though. You'd have a 'clojure-like', a pointless designator in scheme.

0:53 durka42: point-free you mean

0:54 cooldude127: scheme has simpler syntax then clojure

0:54 technomancy: yeah, my scheme never got call/cc. =\

0:56 hiredman: cooldude127: did you notice my sublis?

0:57 cooldude127: hiredman: no i did not

0:58 hiredman: found it in the history

0:58 hiredman: it uses my transform function, to which there is a link a few lines back from the sublis

0:59 and the both rely on clojure.zip :as zip

0:59 technomancy: do many people use the tests-with-code approach of test-is?

0:59 cooldude127: technomancy: i do

0:59 hiredman: i appreciate the effort, but i actually think i have a straightforward recursive solution

0:59 hiredman: bah

1:00 zippers, dude, zippers

1:00 cooldude127: are more than what is necessary for this problem

1:04 lisppaste8: cooldude127 annotated #75625 "simpler" at http://paste.lisp.org/display/75625#1

1:07 hiredman: ,(vec {:a 1})

1:07 clojurebot: [[:a 1]]

1:08 hiredman: ,((comp vec concat) {:a 1})

1:08 clojurebot: [[:a 1]]

3:46 Raynes: Has anyone made a Clojure wallpaper?

3:54 eevar2: how about t-shirts and coffee mugs? ;)

3:55 Raynes: Wallpapers are more important to me right now.

3:57 gregh: putting a t-shirt over your screen makes your screen hard to read

4:00 AWizzArd: Moin

4:02 Raynes: Someone make me a wallpaper :>

4:05 gregh: you could scale up http://en.wikipedia.org/wiki/File:Clojure-glyph.svg

4:07 Chousuke: that logo alone gives Clojure a +10 boost to coolness.

4:47 Raynes: New beta of Programming Clojure released. Content complete, last beta before publish.

4:54 I wonder if he rewrote the seq chapter. I suppose he would of had to due to the lazy stuff now.

5:12 Someone /really/ needs to talk to Rich about read-line

5:12 It's still screwed up.

5:15 read-line is completely redefined in the newest revisions. The release version works though.

5:16 Wonder why he changed it.

5:16 * Raynes notes to ask him.

5:22 Raynes: What's the Clojurebot command to check the current SVN revision?

5:24 clojurebot: svn?

5:24 clojurebot: svn is http://clojure.googlecode.com/svn/trunk/

5:33 * Raynes made his own read-line using Riches old definition.

5:33 Raynes: >:]

5:36 eevar2: clojurebot: git?

5:36 clojurebot: git is http://www.github.com

5:37 Raynes: clojurebot: hiredman

5:37 clojurebot: hiredman is The Batman

5:51 timothypratley: user=> (clojure.inspector/inspect "fun")

5:51 java.lang.ClassNotFoundException: clojure.inspector (NO_SOURCE_FILE:157)

5:52 am I missing something?

5:56 Raynes: A file apparently.

5:56 ,(clojure.inspector/inspect "fun")

5:56 clojurebot: java.lang.ClassNotFoundException: clojure.inspector

5:57 Raynes: Hrm

5:57 alinp: timothypratley: (use 'clojure.inspector)

5:58 and after that, it will work

5:58 timothypratley: indeed! thanks

5:58 alinp: yw

5:58 timothypratley: zip doesn't appear to need use... what's the distinction?

5:58 alinp: maybe because it's using some swing, it's not loaded by default

5:58 (imho)

5:58 timothypratley: ic

5:59 alinp: inspector and one more is not loaded by default

5:59 "All namespaces are loaded by the runtime except clojure.inspector, clojure.parallel"

5:59 :)

5:59 http://clojure.org/api

6:00 timothypratley: hehehe

6:00 Raynes: alinp: You... You.. API reader!

6:01 alinp: :)

6:01 Raynes: Me ... Me ... What ? :)

6:01 I don't get it :P

6:01 Raynes: You read the API. That makes you an API reader :|

6:01 alinp: lol

6:02 The fact is that I had the same problem in the past

6:02 and I checked the API

6:02 and saw what's going on

6:02 Chousuke: hmm

6:02 ,(use 'clojure.inspector)

6:02 clojurebot: nil

6:03 Chousuke: not very useful though ;(

6:03 alinp: yes, indeed

6:03 Chousuke: ,(clojure.inspector/inspect ['test])

6:03 clojurebot: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

6:03 alinp: but if the namespace is not there, exception will be thrown

6:03 the inspect will open a swing window

6:03 in which the inspection is displayed

6:04 Chousuke: yeah, I wanted to see what happens :)

6:04 timothypratley: okie here's a harder one: say I have a zipper, and I want to call 'right' X times, what's a neat way? (take X (repeatedly #(right loc)))? or a better way?

6:04 alinp: maybe this can be skipped and reduced only to console ... don't know for sure

6:05 timothypratley: sorry, that's out of my knowledge about clojure ... I'm at the beginning of learning it

6:06 Chousuke: wouldn't (right loc) always return the same thing :/

6:06 wait, I need to check how repeatedly works

6:07 hm

6:07 right

6:07 you want (take n (iterate right loc)), assuming (right loc) returns a new loc

6:07 timothypratley: ah, that's nicer :) yes thanks

6:09 * Raynes puts a config parser on his Clojure todo list.

6:10 * Raynes will contribute it to clojure-contrib if it's useful enough

6:11 Chousuke: what kind of format? :)

6:12 Raynes: INI probably. Just a simple config parser.

6:14 alinp: is there in clojure something like progn ?

6:15 progn from clisp

6:15 let seems to be working this way

6:15 ,(let [] "x" "y" "z")

6:15 clojurebot: "z"

6:16 alinp: ,(let [] (+ 1 2) (+ 10 20) (+ 100 200))

6:16 clojurebot: 300

6:16 alinp: ,(let [] (println (+ 1 2)) (println (+ 10 20)) (+ 100 200))

6:16 clojurebot: 300

6:16 3 30

6:16 Chousuke: why the lets? :/

6:16 there's do :)

6:17 alinp: oh, thanks :)

6:17 that's why I asked

6:17 Chousuke: ah, right. missed the question itself.

6:17 alinp: didn't know if it's a better way

6:17 Chousuke: ,(do (println "foo") 2)

6:17 clojurebot: 2

6:17 foo

6:17 alinp: ,(do (println (+ 1 2)) (println (+ 10 20)) (+ 100 200))

6:17 clojurebot: 300

6:17 3 30

6:17 timothypratley: its annoying that (do) is not in the API page

6:18 Chousuke: it's a special form, isn't it.

6:18 timothypratley: only on the special forms

6:18 yup

6:18 but let is in both :) so why not do?

6:18 Chousuke: the API page is autogenerated I think.

6:19 and let is not actually a built-in special form (it's a macro)

6:19 timothypratley: I guess let has some special quality... according to doc, let qualifies as a macro and a special, but do is only a special

6:19 ,(doc let)

6:19 clojurebot: "([bindings & body]); Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."

6:19 alinp: ,(doc do)

6:19 clojurebot: java.lang.Exception: Unable to resolve var: do in this context

6:19 Chousuke: ,(doc let*)

6:19 clojurebot: java.lang.Exception: Unable to resolve var: let* in this context

6:20 alinp: ,(doc do*)

6:20 Chousuke: let* is the special form I guess.

6:20 timothypratley: wierd, I can do it at my repl

6:20 clojurebot: java.lang.Exception: Unable to resolve var: do* in this context

6:20 Chousuke: ,(let* [a 1] a)

6:20 clojurebot: 1

6:20 timothypratley: :)

6:20 Chousuke: ~source let

6:20 alinp: ,(let [a 1] a)

6:20 clojurebot: 1

6:20 alinp: Chousuke: what's the difference between macro and special form ?

6:20 general clojure speaking

6:21 Chousuke: hmmh

6:21 Raynes: alinp: A macro is a macro and a special form is a special form ;)

6:21 Chousuke: nothing user-visible.

6:21 alinp: the results seems to be the same

6:21 Chousuke: a special form is "built-in"

6:21 so let* is a special form, let is not

6:21 alinp: yes, I got that

6:21 thanks

6:22 Chousuke: but let* is an implementation detail, so the docs lie a bit and call let the special form

6:25 (defmacro comment [& body]) ; heh

6:42 eevar2: ,(doc let)

6:42 clojurebot: "([bindings & body]); Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."

6:42 eevar2: ,(doc let*)

6:42 clojurebot: java.lang.Exception: Unable to resolve var: let* in this context

6:47 rsynnott: I think clojure's let behaves much like cl's let* anyway

7:22 Raynes: I has a Satin pillowcase.

7:30 * Raynes made a Clojure offtopic channel. Even if Rich doesn't want one, I can still talk to myself in there. :D

7:36 Raynes: Speaking of Rich, there are a lot of him in here o.o

7:40 karmazilla: One Rich for trunk, and then a couple for the branches

7:44 Raynes: karmazilla: :D

8:25 alinp: ,(println "x" "z")

8:26 clojurebot: x z

8:26 alinp: how can this be done without the white space ?

8:26 ,(println "x""z")

8:26 clojurebot: x z

8:26 karmazilla: ,(println (str "x" "z"))

8:26 clojurebot: xz

8:27 alinp: ,(println (str "a" "b"))

8:27 clojurebot: ab

8:28 Raynes: Rayne has a tummy ache :[

9:01 Why is this returning false? (if (and (or (and (false? false) (true? false) true false) (true? true)) (identical? [1 2 3] [1 2 3])) true false)

9:03 ,(if (and (or (and (false? false) (true? false) true false) (true? true)) (identical? [1 2 3] [1 2 3])) true false)

9:03 clojurebot: false

9:03 Raynes: Hrm, that just isn't right.

9:05 rfgpfeiffer: ,(doc identical?)

9:05 clojurebot: "([x y]); Tests if 2 arguments are the same object"

9:05 Raynes: ,(identical? [1 2 3] [1 2 3])

9:05 clojurebot: false

9:05 Raynes: OH

9:06 rfgpfeiffer: ,(= [1 2 3] [1 2 3])

9:06 clojurebot: true

9:06 Raynes: Mystery solved.

9:39 cooldude127: i have to say, functions needing to be defined before they are referenced is pretty much the most annoying thing to me about clojure

9:41 i suppose it's good that something so small is my biggest complaint

9:43 gnuvince: cooldude127: yeah. I like that in Haskell, you can put the most important functions at the top, and the supporting ones below.

9:47 cooldude127: gnuvince: the way i like to write, i'll do the big function first, and while i'm writing it, i'll write it as tho those helper functions are already defined. and then i go below and actually write them. and then when i compile the whole file it says NO

9:48 i hate having to mess around with the ordering

9:48 but alas, i most go

9:48 Chouser: that's so interesting. It's never bothered me, and the thought of using a function before I write it kinda freaks me out.

9:50 wlr: Chouser: SOP for many CLers

9:50 Chouser: apparently

9:52 Raynes: I have a habit of defining helper functions below the functions that use them.

9:52 It is rather annoying.

10:03 kefka: Is anyone else having problems with S3 this morning?

10:03 drewr: kefka: My backup to there just ran fine.

10:05 kefka: drewr: I'm getting this error: (home)/private/current/awssecret: No such file or directory

10:06 drewr: Do I need to have a ~/private/current ? I've never had that directory before.

10:07 drewr: kefka: What produced that error?

10:08 kefka: drewr: Never mind. This has nothing to do with S3. It's a local problem.

10:09 S3 is working fine.

10:19 Lau_of_DK: kefka: drewr: Whats S3 ?

10:21 Raynes: I was wondering the same thing.

10:22 Fib: Amazon S3? The storage service?

10:23 drewr: Lau_of_DK: http://s3.amazonaws.com

10:26 Lau_of_DK: k

10:26 thanks

11:16 alinp: what's the clojure way to iterate over a collection ?

11:16 is there a recommended approach ?

11:16 Chouser: map, for, doseq

11:17 depends on what you want to do as you iterate over it.

11:17 alinp: ok, cool

11:17 Chouser: loop/recur

11:17 alinp: yes, I know about recur

11:17 Chouser: filter, reduce. lots of options. :-)

11:17 alinp: this is the one that I'm using

11:17 yes, depends on what I need to do with that collection

11:17 Chouser: theres usually only one or two good choices though, for any given usage.

11:18 alinp: thanks

11:20 Chouser: sure

11:25 AWizzArd: clojurebot: max people

11:25 clojurebot: max people is 149

11:25 alinp: Chouser: I'm wondering ...

11:25 ,(loop [a 10] (if (not (zero? a)) (do (println a) (recur (dec a)))))

11:25 clojurebot: 10 9 8 7 6 5 4 3 2 1

11:25 alinp: this is the right usage of loop ?

11:25 :)

11:26 AWizzArd: in principle yes

11:26 for this task one could do something different though

11:26 alinp: like ?

11:26 AWizzArd: ,(dotimes [i 10] (println (- 10 i)))

11:26 clojurebot: 10 9 8 7 6 5 4 3 2 1

11:26 alinp: oh, I see

11:26 dotimes

11:26 gracias :)

11:27 AWizzArd: ,(doseq [i (range 10)] (println (- 10 i)))

11:27 clojurebot: 10 9 8 7 6 5 4 3 2 1

11:27 alinp: but the idea was that I want to check the iteration over collections

11:27 and to see which are the diffs between them

11:27 WizardofWestmarc: ,(take 10 (iterate dec 10))

11:27 clojurebot: (10 9 8 7 6 5 4 3 2 1)

11:28 WizardofWestmarc: though that's a list, but still <_<

11:28 alinp: thank you, I'll check the API further

11:30 AWizzArd: or okay, for this specfic task the best thing would be:

11:30 ,'(10 9 8 7 6 5 4 3 2 1)

11:30 clojurebot: (10 9 8 7 6 5 4 3 2 1)

11:31 AWizzArd: uhm, with println of course

11:31 ,(println 10 9 8 7 6 5 4 3 2 1)

11:31 clojurebot: 10 9 8 7 6 5 4 3 2 1

11:31 alinp: :)

11:32 not the same thing

11:32 instead of printing, I was thinking applying a function or something

11:32 of course, there is apply, I know

11:32 AWizzArd: yes, or reduce also

11:33 sometimes that could also be nice

11:33 WizardofWestmarc: reduce is for lumping a list of stuff together into a single item

11:33 AWizzArd: ,(apply + [10 20 30])

11:33 clojurebot: 60

11:33 AWizzArd: ,(reduce + [10 20 30])

11:33 clojurebot: 60

11:34 rsynnott: that's because the >2 arg + does an effective reduce itself, though

11:40 AWizzArd: yes

11:42 Chouser: alinp: I made an attempt to categorize the various seq-related functions on the bottom half of this page: http://clojure.org/sequences

11:43 alinp: oh, yes, I see

11:43 thanks again

11:43 It seems to me that I'm too lazy to search myself all the stuff

11:43 Chouser: I don't know if that's helpful or not, but it was an attempt to help people find the function they need.

11:43 alinp: yes yes

11:43 it helps alright

11:43 Raynes: http://groups.google.com/group/clojure/browse_thread/thread/550628c650edb5ec# In case anyone is interested.

11:45 alinp: Chouser: also this one helped me a lot to understand http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples

11:45 Chouser: alinp: great!

11:46 WizardofWestmarc: yeah the api_examples page is great

11:46 it helped me understand -> a lot better

12:31 gnuvince: Hello everyone

12:32 technomancy: hi vince

12:32 gnuvince: Hey technomancy, what's up?

12:33 technomancy: gnuvince: writing an interactive test-is runner in elisp

12:33 gnuvince: For elisp code?

12:33 technomancy: gnuvince: should be able to highlight test failures in the buffer itself rather than switching between slime-repl and the tests

12:33 gnuvince: written in elisp, but for testing clojure.

12:33 gnuvince: oh!

12:33 Nice!

12:34 technomancy: gnuvince: it looks like test-is has hooks to make this pretty easy; just need to store pass/fail status in metadata.

12:34 from there it's just a matter of reaching through slime to grab it, and rendering it.

12:34 gnuvince: ok

12:34 Very nice

12:34 technomancy: I did this for Ruby test suites, and it was really handy to be able to see the feedback superimposed on top of the tests.

12:35 durka42: reaching through slime sounds unpleasant

12:35 slimy

12:35 technomancy: durka42: M-x equip-latex-gloves

12:35 durka42: hmm, you could even highlight defns that fail their tests in bright red or something

12:36 technomancy: durka42: exactly

12:36 well, as long as they're still readable. =)

12:36 then there's a binding to see the expected vs the actual

12:36 it's pretty simple in terms of functionality, but it's dramatic in how it changes your workflow.

12:36 durka42: error: latex-gloves incompatible with package "skin"

12:56 danlarkin: technomancy: wow I'm really looking forward to that, super cool

12:56 cooldude127: what coolness is technomancy creating now?

12:57 gnuvince: An Emacs integration to clojure.contrib.test-is

12:57 cooldude127: BRING IT ON :)

13:00 Drakeson`: would it make sense to port clojure to gnome (with GObject and friends as the underlying object system)?

13:01 cooldude127: Drakeson`: may we ask why?

13:01 it won't really be clojure, as clojure is kind of java-centric

13:01 technomancy: http://augment.rubyforge.org/ <= this is the ruby version of what I'm doing w/ clojure

13:01 slime will make the clojure implementation *much* simpler

13:02 cooldude127: technomancy: that's AWESOME

13:03 Drakeson`: cooldude127: to develop gnome applications

13:03 cooldude127: Drakeson`: i think there are java gtk bindings (i think)

13:06 Drakeson`: cooldude127: I tried two of them, they were not that good. I think directly targeting gnome's run-time is a bit more straight forward. There is a project (vala) inspired by .Net that directly targets the gnome run-time.

13:06 cooldude127: Drakeson`: you can do it if you want, but i think you're in for more than you realize

13:11 Lau_of_DK: Good evening gentlemen

13:12 cgrand1: evening Lau!

13:13 walters: Drakeson: i work on http://live.gnome.org/JGIR

13:13 cooldude127: walters: that looks like an interesting project

13:13 danlarkin: greetings Lau

13:14 walters: Drakeson: languages like clojure being based on the JVM is one reason i was motivated to make more extensive bindings (as compared to java-gnome which is more like a limited Swing competitor)

13:15 Drakeson: i think probably the biggest win would be improving clojure's Java integration, rather than trying for a Clojure-specific layer

13:16 cooldude127: what's wrong with clojure's java integration!? everyone knows clojure is perfect at everything :p

13:16 walters: practically speaking, function-to-single-method-interface conversion is pretty high up there in terms of things Clojure doesn't do now

13:16 cooldude127: oh. that.

13:17 walters: since in GTK+ applications you connect to signals very often, and JGIR represents signals as single method interfaces

13:17 now what we *really* want is standard JVM types for closures

13:18 cooldude127: YEAH

13:19 gnuvince: tagged numbers?

13:21 walters: Drakeson: anyways if you try it and tell me what the pain points are i'd be happy to try to fix it

13:22 Drakeson: walters: sure, I'll try again. It guess is currently a bit messy to get JGIR to run on debian

13:23 walters: btw, what is your opinion about a clojure-like language targeting gnome runtime?

13:23 Lau_of_DK: danlarkin: Any name yet?

13:23 walters: Drakeson: yeah, understood. I just finally got the last of my JNA patches upstreamed a few days ago, and gobject introspection isn't quite baked yet either...but it's getting closer

13:25 Drakeson: without the JVM you mean?

13:25 danlarkin: Lau_of_DK: nope, but I'm cleaning everything up for upload in anticipation of you giving me a good one!

13:25 Drakeson: walters: yes

13:25 Lau_of_DK: ah - the pressure

13:26 Drakeson: to fixup the gnome's "programming language of choice" problem.

13:26 walters: Drakeson: well i think you do have to keep in mind that the JVM (libraries, tools, deployment etc.) is a big part of the Clojure value for a lot of people, but that said it seems like what you're asking for is just a custom Clojure runtime

13:27 Drakeson: you know, C is not fun, and having to use perl, python, C#, ruby, vala, etc. for application logic is not fun either.

13:28 WizardofWestmarc: I dunno python can be pretty fun

13:28 but if there are good libs for what I'm doing I prefer clojure at this point

13:28 walters: Drakeson: well...my take on this as a GNOME developer is that we should use Vala for core library extensions, JavaScript for core applications (panel/wm/nautilus etc.), while maintaining the ability for 3rd parties to write applications to whatever runtime they desire (JVM/JavaScript/.NET/OCaml etc.)

13:29 Drakeson: but anyways we're offtopic for this channel

13:29 Drakeson: WizardofWestmarc: I meant having *many* languages at the same time is not fun. It makes code sharing more difficult, at best.

13:29 WizardofWestmarc: ah that, yeah

13:30 Drakeson: walters: I feel a bit better about vala, but it could just clone clojure instead of C#.

13:31 walters: Drakeson: i don't see how...a lot of Clojure seems pretty closely tied to having garbage collection

13:31 Vala just superficially looks like C# at a skeletal level

13:31 fundamentally they are very different

13:32 cooldude127: any lisp is tied to having garbage collection

13:32 Drakeson: walters: what about guile? is it going to stay, or just keep lingering?

13:33 walters: Drakeson: if you're interested there's #gnome-hackers on GIMPNet, I don't want to take up more bandwidth here though

13:34 Drakeson: sorry guys about being off-topic. (going to #gnome-hackers channel)

13:34 cooldude127: lol

13:35 * technomancy has no problem with offtopic stuff as long as others aren't trying to hold a serious conversation concurrently

13:37 Drakeson: oh, btw, is the new fully-lazy thing usable at the moment? currently svn up (actually "git svn fetch") is stuck at rev 1279. how can I get 1282?

13:38 technomancy: Drakeson: the github mirror is only tracking trunk

13:38 walters: Drakeson: one more ontopic thing is that besides the JVM, some of the most innovative stuff in Clojure I see like the STM just aren't very useful for most desktop applications. It definitely won't work to use GTK+ or Clutter for example inside a STM transaction =)

13:39 technomancy: yeah, desktop apps don't really play to clojure's strengths since they're mostly IO-bound

13:39 kreig: that is why we are waiting for the Clojure/Java2d/AWT implementation of CLIM to fall from the sky

13:39 Drakeson: technomancy: is it going to land in trunk soon?

13:39 technomancy: Drakeson: sounds like it

13:40 kreig: mmm, presentation types

13:40 technomancy: Drakeson: rhickey was asking last night if anyone had any objections to merging

13:40 * cooldude127 loves clim if he could understand it all

13:40 tkadlubo: What new features will be in this branch?

13:40 technomancy: if elisp would grow some concurrency features, I'd never want to write any UI code in anything else.

13:40 cooldude127: yeah emacs isn't best with that

13:40 * technomancy throws up a little in the back of his throat every time he sees a modal dialog now... too spoiled.

13:42 gnuvince: Is there a "nice" way to catch exceptions when using with-open?

13:43 durka42: tkadlubo: fully lazy sequences. there's a little documentation at clojure.org/lazier

13:44 shoover`: technomancy: distel's erl package grows some concurrency onto emacs

13:44 cooldude127: durka42: how lazy are our current sequences?

13:44 kreig: college kid lazy

13:44 cooldude127: lol

13:44 durka42: maybe not quite that lazy

13:45 kreig: the new ones are gonna be stoner lazy

13:45 oh, sorry, same thing

13:45 trust-funder lazy!

13:45 Drakeson: walters: I see. But, will it ever happen to get a fast UI toolkit in clojure? will it be achieved using gtk/gnome java bindings?

13:47 tkadlubo: I wrote a Erastotenes sieve on lazy sequences, but I couldn't make it really infinite, because there's no way to retrieve a lazy-cons'ed sequence from within an infinite loop / recur.

13:47 technomancy: shoover`: via external processes though right?

13:47 That's Not Good Enough.

13:48 Drakeson: technomancy: but it seems they are considering the coroutines approach (for emacs 24, I guess)

13:49 technomancy: Drakeson: yeah, I've got my fingers crossed

13:49 shoover`: technomancy: the building block uses buffers to act like mailboxes supporting send/receive

13:49 gnuvince: Drakeson: link?

13:49 Drakeson: gnuvince: emacs devel mailing list :p

13:49 gnuvince: bastard :)

13:49 shoover`: technomancy: that part does not use external processes and can be used in any elisp program

13:50 Drakeson: (sorry, I became more lazy recently :p)

13:50 technomancy: shoover`: right, but you'll still be blocked on I/O

13:50 gnuvince: I knew Haskell would have bad repurcussions on the world!

13:50 walters: Drakeson: i'm actively interested in supporting Clojure well and being a better choice than Swing/SWT/Qt-Jambi for what it's worth, though it's certainly a competitive field

13:51 WizardofWestmarc: competition just means the "consumers" win

13:52 which is a pro :)

13:53 danlarkin: ugh... why is File.setExecutable() only in java 6 :(

13:54 Drakeson: walters: I image it can catch on if there are 1. easy ways to install the required bindings (for both Debian/Ubuntu and Fedora), 2. clean, java-less API's to gnome/gtk UI design, 3. useful tutorials and examples on writing GUIs using clojure + gtk (with no java knowledge required).

13:54 s/image/imagine , d'oh!

13:54 walters: Drakeson: yeah, 1. should come pretty soon

13:55 Lau_of_DK: Ok, let me see if I got this. When I declare my namespace and include a gen-class section which :extends a.arbitrary.class, then clojure compiles something like Javas 'public class myclass extends xyzclass' and all functions prefixed with '-' will be methods in this class - But how can I control wether these methods are then private, public, protected or static?

13:56 kreig: so dutrs

13:56 is trunk from github relatively stable?

13:56 Drakeson: kreig: it is

13:57 kreig: or should I stick to the Dev17th release

13:57 otay

13:57 Drakeson: it just doesn't have the new lazy juice in yet

13:57 kreig: I mean trunk from SVN

13:58 that's ok, I don't need the lazy juice

13:58 walters: technomancy: regarding elisp, i'd say 60% of the value is actually the powerful Emacs buffer/frame abstraction, of course it has nice elisp bindings like save-excursion etc. Emacs is really a toolkit *and* a language (elisp)

13:58 Drakeson: walters: and a community.

13:58 walters: yeah

13:59 technomancy: definitely; it's a UI toolkit

14:01 zakwilson: walters: taking a quick look back, handling a Swing callback by sending it off to an agent is very useful.

14:02 I'm guessing other GUI callbacks would be similar.

14:03 walters: zakwilson: that's just using an agent as a thread pool, no?

14:03 zakwilson: It's using it as a queue.

14:03 That runs in its own thread.

14:05 technomancy: gnuvince, cooldude127, danlarkin: http://gist.github.com/65906

14:05 all that's remaining is pulling the metadata out of slime and displaying it, I think

14:06 walters: zakwilson: yeah, though it's fairly easy to use Executors.newSingleThreadExecutor in Java too

14:06 cooldude127: technomancy: nope. you also need to have the hook look for with-test as well

14:06 because at least for me, i don't use deftest at all

14:07 rhickey: merge is ready!

14:07 danlarkin: *gasp*

14:07 gnuvince: Good luck!

14:07 technomancy: cooldude127: right; forgot about that

14:07 cooldude127: wooo

14:07 technomancy: yeah that's what i'm here for

14:07 technomancy: cooldude127: I'll commit it to a clojure-mode branch later today

14:08 cooldude127: technomancy: awesome

14:09 danlarkin: technomancy: I look forward to it

14:09 zakwilson: walters: I wouldn't know. In any case, your STM probably doesn't belong it your GUI code.

14:10 technomancy: the only marginally tricky thing remaining is figuring out *when* the tests have finished running and triggering a "grab test metadata" function then

14:12 walters: zakwilson: actually i wouldn't say agents are what you typically want for a GUI app, since you have to explicitly await on it, no? The biggest problem I think in GUI apps is doing something on a thread, then getting the result back as an event. This is what SwingWorker does, and JGIR has MainLoop.threadInvoke which takes two callbacks

14:13 Lau_of_DK: rhickey: http://groups.google.com/group/clojure/browse_thread/thread/3d4a2e8ec39f355/1e730d2e5fd626ef?lnk=gst&q=gen-class+macro#1e730d2e5fd626ef <--- Is this done automatically now with genclass somehow?

14:17 zakwilson: walters: depending on what you're doing, watchers are probably the best way to handle that.

14:18 walters: zakwilson: from the docs it looks like watchers run in the agent thread, so you'd need to queue an idle handler on the mainloop thread

14:19 ayrnieu: walters, a watcher on the agent will activate whenever the agent function returns. A watcher on something else that the agent sets will activate after it is set.

14:19 walters: maybe though if agent had an API to say "run watchers from the thread that created this agent"

14:20 but, can't do that without integrating with the mainloop

14:20 ayrnieu: the watching agent does not also need to be the agent that does the work.

14:20 walters: ayrnieu: yeah, the issue is not when it runs, but on which thread it runs

14:21 zakwilson: walters: Why do you want the watchers to run in the same thread?

14:21 ayrnieu: bleh, *that* limitation.

14:21 walters: zakwilson: you can only mutate the GUI from one thread

14:22 zakwilson: Put the GUI in an agent and send off to that.

14:23 walters: yeah, that could make sense if your app is structured as some large computation, with the GUI as an aside

14:29 cemerick: am I correct in thinking that a types cannot be parameterized in gen-class specs?

14:29 rhickey: cemerick: right

14:30 zakwilson: It could work for a more interactive/involved GUI, though you might want to stick the elements of the GUI in a data structure (a tree of maps, or some such in most cases) appropriate for the situation.

14:33 durka42: would there be trouble with the jvm initializing the gui in its main thread and not wanting to give it to an agent?

14:33 Lau_of_DK: rhickey: clojure.org is bookring

14:33 boorking

14:33 durka42: thinking of that -XStartOnFirstThread OSX bug

14:34 clojurebot: svn rev 1287; merged lazy branch -r1236:1286

14:34 cooldude127: OMG

14:34 it is done

14:34 technomancy: sweet!

14:34 Lau_of_DK: uuuuuuuuuuuh :)

14:34 big moment

14:34 cooldude127: crap does that mean i need to go through all my damn code and replace rest with next?

14:35 durka42: hmm, maybe this update deserves an "ant clean"

14:35 hiredman: !

14:35 danlarkin: durka42: the default ant task runs clean first :)

14:35 Chouser: cooldude127: nope. just don't update your clojure checkout ever again.

14:35 durka42: oh, so it does

14:35 cooldude127: lol

14:36 durka42: has contrib been lazified?

14:36 Chouser: I'm only slightly kidding, though. If you're not ready to deal with the changes yet, don't update.

14:36 durka42: Not all of it, I think.

14:36 cooldude127: btw, i have a fairly decent ported version of the macsyma thing from PAIP, so i do have symbolic math now

14:36 danlarkin: yeah... I'm waiting a few days to update

14:37 durka42: heh, gorilla doesn't quite build

14:38 hiredman: nuts

14:41 Chouser: so ... should we merge the contrib lazy branch back in?

14:41 technomancy: that was short-lived. =)

14:41 Chouser: yeha

14:41 yeah

14:41 technomancy: but yeah, no reason to delay

14:42 hiredman: what is that build flag that is useful for doing lazy

14:42 Chouser: ant -Dclojure.assert-if-lazy-seq=please

14:42 hiredman: thank you

14:43 technomancy: -Dclojure.please.help.me=if-its-not-too-much-trouble

14:43 cemerick: rhickey: I'm certain it's a low-priority item for you (and for me as well, really), but being able to specify parameterized types in gen-class specs would be handy for comforting our java-only brethren

14:46 durka42: !

14:48 danlarkin: hwhat? clojure-json works as-is? how convenient!

14:49 cooldude127: what's the function that takes a seq like this: ([:a 1] [:b 2]) and makes it a map {:a 1, :b 2}

14:49 Chouser: (into {} lst)

14:49 danlarkin: (apply hash-map (flatten coll))

14:49 or that

14:50 cooldude127: i like chouser's way :)

14:51 hiredman: so clojurebot is lazy, but most of the plugins are disabled

14:51 clojurebot: map?

14:51 hmmm

14:52 clojurebot: how much do you know?

14:52 danlarkin: clojure.core/rrest is gone?

14:54 rhickey: danlarkin: nnext

14:54 danlarkin: ah of course

15:08 taggart: seq fns are now: first, next, more ?

15:10 rhickey: taggart: first/rest/next

15:11 http://clojure.org/lazy

15:11 taggart: thx, I was going off of ISeq.java

15:13 rhickey: ISeq may still change, the names are different now to force people to consider this change

15:13 gnuvince: rhickey: does destructuring have the same behavior as before? seq or nil?

15:13 rhickey: gnuvince: yes, & args are forced

15:13 gnuvince: Thanks

15:18 * danlarkin is surprised clojure-json didn't have *any* explicit calls to rest

15:21 hiredman: (doc map)

15:21 clojurebot: Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments.; arglists ([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])

15:21 hiredman: ^- lazy

15:23 clojurebot: how much do you know?

15:23 clojurebot: I know 203 things

15:23 taggart: <3 clojurebot

15:23 hiredman: ~def map

15:23 oh

15:23 right

15:25 ~def map

15:25 ~def lazy-seq

15:27 that is some crazy joo joo

15:29 jbondeson: heh, poor swank clojure...

15:30 durka42: clojurebot: welcome back

15:30 too lazy to respond?

15:31 hiredman: fuzzer nickle

15:32 git just bit me

15:35 I think I just lost all my lazy changes to clojurebot

15:35 Chouser: :-(

15:35 hiredman: not that there where a lot

15:36 or maybe not

15:36 cp2: thats what happens when you're lazy

15:36 !

15:37 AWizzArd: (doc plist)

15:37 ,(doc plist)

15:37 clojurebot: java.lang.Exception: Unable to resolve var: plist in this context

15:38 AWizzArd: ,(doc pvalue)

15:38 clojurebot: java.lang.Exception: Unable to resolve var: pvalue in this context

15:39 AWizzArd: hiredman: iirc I have seen you requesting the doc of some functions without the leading comma.

15:39 jbondeson: so i thought i fixed swank-clojure by changing the lazy-cons -> (lazy-seq (cons ...)), and now it doesn't error, but my slime window isn't opening.

15:39 Chouser: (doc pvalues)

15:39 missed it by that much

15:40 technomancy: hiredman: have you checked the git reflog?

15:40 if anything's been added to the index, you should be able to get it back

15:40 hiredman: nah

15:40 AWizzArd: ,(doc pvalues)

15:40 hiredman: my changes are still there

15:40 I somewhere switched branches without noticing

15:40 AWizzArd: oh, that bot left us

15:40 hiredman: :P

15:40 Chouser: so i've got what I think to be a contrib trunk with correctly-merged changes from lazy.

15:41 should I just delete the lazy branch and check this in?

15:41 technomancy: Chouser: delete all the files from the lazy branch except a readme that describes what just happened?

15:41 AWizzArd: why not check it in and leave the lazy branch alive until we see your new checkin works :)

15:41 Chouser: so cautious you guys...

15:42 technomancy: I guess the branch has only been around a few days; anyone playing with it will expect breakage and know what to do

15:42 AWizzArd: if you want to check it in now it would be great timing, because i just wanted to get the freshest version now

15:42 hiredman: (doc pvalues)

15:42 clojurebot: Returns a lazy sequence of the values of the exprs, which are evaluated in parallel; arglists ([& exprs])

15:42 AWizzArd: (doc +)

15:42 clojurebot: Returns the sum of nums. (+) returns 0.; arglists ([] [x] [x y] [x y & more])

15:42 AWizzArd: k

15:43 taggart: clojurebot: welcome back

15:43 hiredman: that is a problem

15:43 clojurebot: hello?

15:43 clojurebot: BUENOS DING DONG DIDDLY DIOS, fRaUline hiredman

15:43 hiredman: hmmm

15:44 Lau_of_DK: When I want to assign a value to a field in a java class, how do I do ?

15:44 Chouser: contrib 478 has lazy merged into trunk

15:44 AWizzArd: Lau_of_DK: is there a setter method for that task?

15:44 Otherwise I imagine even in Java it can't be done?!

15:44 Lau_of_DK: Yes

15:45 Chouser: Lau_of_DK: if no setter method, use (set! (.field obj) new-value)

15:45 Lau_of_DK: There probably is... I was just thinking C# get/set, but Javas not the same

15:45 Thanks

15:45 AWizzArd: oki

15:45 Good good, so the lazy branch has won the game

15:47 durka42: did anything change with :gen-class?

15:47 * durka42 will most likely not succeed in diagnosing gorilla's lazy problems

15:47 Raynes: Does anyone know why read-line was redefined?

15:47 AWizzArd: Chouser: now after this checkin the api page needs lots of updates, no?

15:48 danlarkin: aw clojure-contrib doesn't compile :(

15:49 Chouser: AWizzArd: clojure.org pages generally document the lastest release, not svn HEAD, the lazy and stream pages notwithstanding.

15:49 durka42: danlarkin: wfm...

15:51 AWizzArd: the exception is the api page?

15:51 danlarkin: durka42: what's wfm?

15:51 durka42: works for me

15:51 danlarkin: durka42: it compiles to .class files?

15:52 durka42: well, i dunno

15:52 "ant" works and builds the jar

15:52 danlarkin: oh, no, to build .class files you have to do ant -Dclojure.jar=/path/to/clojure.jar

15:53 durka42: unable to resolve symbol: rrest

15:54 danlarkin: test-is needs updating

15:54 durka42: user=> (use 'clojure.contrib.javadoc)

15:54 java.lang.Exception: Unable to resolve symbol: rrest in this context (shell_out.clj:53)

15:54 so the jar hides the compile errors for later

15:54 danlarkin: oh yes, and shell out too

15:54 durka42: sounds like lazy evaluation to me

15:55 Chouser: command-line is ok though

15:56 durka42: is rrest gone?

15:56 or is called nnext or something?

15:56 danlarkin: iya

15:56 ya, rather

15:56 hiredman: ugh

15:56 looks like inits doesn't like lazy

16:02 Lau_of_DK: The java notation "45.0f", means (float 45) ? Any short hand for that?

16:03 Chouser: ,(class 45.0)

16:03 clojurebot: java.lang.Double

16:03 Chouser: ,(class (float 45.0))

16:03 clojurebot: java.lang.Float

16:03 Chouser: Lau_of_DK: I don't think so.

16:05 Lau_of_DK: k

16:06 gnuvince: People using Slime: swank-clojure is broken after the lazy branch merge

16:06 beware

16:06 WizardofWestmarc: yeah jbondeson already warned me

16:06 hiredman: what ever happened to reductions?

16:06 technomancy: they got reduced?

16:07 gnuvince: ,(find-doc "^red")

16:07 clojurebot: ------------------------- clojure.core/reduce ([f coll] [f val coll]) f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is return

16:07 gnuvince: hiredman: hmmm, I guess it was never checked in

16:07 hiredman: :(

16:08 jbondeson: gnuvince: also don't try to naively fix it like me. Infinite loops in swank FTL

16:08 gnuvince: jbondeson: heheh ;)

16:08 jbondeson: I've downgraded back to r1286

16:08 I'll wait until I get the word that swank is ok

16:08 WizardofWestmarc: I'm just going to wait until swank and clojure contrib are fixed

16:08 once all that is fully up and running I'll switch

16:08 jbondeson: i'll just suffer through straight inferior lisp =)

16:09 WizardofWestmarc: weird, twitter is going crazy on clojure but almost none of it is references to the lazy branch

16:09 I'd've expected such a burst right now to be tied to that.

16:10 7 posts in the last ~hour, 2 about it (including one from me)

16:11 * gnuvince is dumb

16:11 danlarkin: lisppaste8: url

16:11 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

16:11 gnuvince: I had a function where I named a parameter map

16:11 and I could not figure out why calling the function map didn't work

16:12 jbondeson: haha, lisp-2 mentality has bitten me too

16:12 WizardofWestmarc: haha

16:12 so glad I was more of a scheme guy for my prior lisp experienc

16:12 lisppaste8: danlarkin pasted "shell_out patch" at http://paste.lisp.org/display/75660

16:12 WizardofWestmarc: *experience

16:12 I don't expect the million namespaces :P

16:12 jbondeson: got soooo used to naming lists "list" and then in clojure it really hurt

16:13 danlarkin: Chouser: shell-out patch: http://paste.lisp.org/display/75660

16:15 kreig: is clojure.contrib includes in the base clojure svn repo?

16:15 Chouser: danlarkin: thanks! I've got that and a few others already ... coming soon...

16:15 danlarkin: Chouser: great :)

16:16 kreig: never mind..

16:18 technomancy: man... it's really confusing when using swank-clojure to try and figure out what's breaking because it's not implemented for clojure and what's breaking because you're doing it wrong.

16:18 I don't suppose anyone in here is familiar with swank-clojure?

16:20 danlarkin: I think you get the title of resident elisp expert

16:20 gnuvince: Given a seq of tuples, what's the Clojure way to turn that into a hash map?

16:20 Chouser: ,(into {} '([a b] [c d] [e f]))

16:20 clojurebot: {e f, c d, a b}

16:20 danlarkin: gnuvince: two-tuples? chouser demonstrated (into {} tuples) earlier

16:21 gnuvince: wow

16:21 * gnuvince sucks

16:21 gnuvince: :)

16:21 Thanks Chouser

16:21 technomancy: that's what I was afraid of

16:21 problem is slime is so coupled to CL; it's pretty hard to read if you're used to regular elisp

16:22 Chouser: gnuvince: np

16:26 taggart: where does one go to see this clojure-related twittering?

16:26 WizardofWestmarc: http://search.twitter.com/search?q=clojure

16:27 taggart: thx

16:27 WizardofWestmarc: will update whenever a new tweet is up telling you to refresh

16:27 heh I see gnuvince just hit up proggit

16:28 * gnuvince is a karma whore

16:28 WizardofWestmarc: haha

16:28 Chouser: "hey everybody, don't update!"?

16:28 WizardofWestmarc: You're a library bitch, so you update! :P

16:29 gnuvince: "Don't update if you mind having a working SLIME installation"

16:29 AWizzArd: yup, I found that out a few seconds ago :)

16:30 gnuvince: There

16:30 jbondeson: SISSIES

16:30 gnuvince: http://www.reddit.com/r/programming/comments/7y59u/rich_hickey_adds_fully_lazy_sequences_to_clojure/c07q57n

16:30 jbondeson: gotta loooove life out on the bleeding edge.

16:30 Chouser: re-find is now definitely better than re-seq if all you want is a truth value

16:31 jbondeson: Chouser: totally lazified?

16:31 Chouser: yeah, re-seq returns a lazy-seq, so you can't use it in a nil pun

16:31 (if (seq (re-seq #"foo" blah)) ...)

16:32 (if (re-find #"foo" blah) ...) ; FTW

16:33 WizardofWestmarc: heh someone's only half following clojure, started asking "what's up with next?

16:34 bitbckt: wait, what's up with next?

16:34 * bitbckt ducks

16:35 taggart: there's ...more... to it than that

16:35 oh ya it's not more anymore

16:35 jbondeson: Chouser: maybe it's just me, but i'd think the latter is more logical than the former.

16:42 Chouser: jbondeson: well, I've previously avoided re-find because it actually mutates

16:43 jbondeson: Chouser: that i didn't know. haven't played with regex in clojure yet.

16:43 which is odd for an ex-perl programmer to say ;)

16:43 WizardofWestmarc: I didn't know that about re-find

16:43 which I use semi-regularly >(

16:44 of course usually I just re-find a string and then throw that string away :P

16:44 Chouser: hm -- looks like only the one-arg form can leak the mutation

16:46 ,(let [m (re-matcher #"x\d" "x1x2x3")] [(re-find m) (re-find m)])

16:46 clojurebot: ["x1" "x2"]

16:46 hiredman: ick

16:47 jbondeson: the entire code base i'm working in is a testament to the superiority of functional programming...

16:47 Chouser: so it's really re-matcher (which is just a java Matcher) that's at fault

16:48 WizardofWestmarc: jbondeson: your PS?

16:48 hiredman: clojurebot: well?

16:48 clojurebot: I don't understand.

16:48 Chouser: as long as you don't pass those matchers around, I guess you're ok, and re-find won't hurt you.

16:48 WizardofWestmarc: or something new?

16:48 jbondeson: i have a function called SectionExists, that returns a boolean and takes an optional parameter that is also an output

16:48 god i hate this

16:48 WizardofWestmarc: no work.

16:48 WizardofWestmarc: oh

16:48 the other side

16:48 "this shit is so horrible..."

16:49 I dunno how many of our coworkers would understand functional code though...

16:49 jbondeson: course it could just be the russian programming...

16:52 hiredman: I think FP is supposed to make things simpler, no?

16:53 WizardofWestmarc: it's simpler to debug and work with once the framework is in place at a minimum

16:53 hiredman: ~google how I learned to be lazy

16:53 clojurebot: First, out of 297000 results is:

16:53 IceBlah: Things I&#39;ve learned whilst being lazy

16:53 http://iceblah.typepad.com/mostly_music_lots_of_it_i/2008/12/things-ive-learned-whilst-being-lazy.html

16:53 WizardofWestmarc: you could argue it's got a bit more difficulty at first but long term is better.

16:53 hiredman: so it seems like danlarkin's json lib works in lazy

16:53 danlarkin: hiredman: it passes all the tests unmodified! color me surprised

16:54 hiredman: very cool

16:54 clojurebot: latest?

16:54 clojurebot: latest is 1287

16:55 technomancy: I'm just going to code this *pretending* that the slime-eval function actually works; then when it gets fixed, my mode will be awesome!

16:56 jbondeson: technomancy: close your eyes and see the awesomeness that is your working product.

16:57 mind altering substances may enhance this...

17:03 hiredman: clojurebot: clojure is also the brand

17:03 clojurebot: Ack. Ack.

17:04 danlarkin: so we can't nil-pun re-seq? seems odd that a function with seq in its name needs to have seq called on it :)

17:04 jbondeson: it's a lazy seq

17:04 so that's going to be quite common

17:06 fanda: ,(var seq?)

17:06 clojurebot: #'clojure.core/seq?

17:06 fanda: ,(meta (var seq?))

17:06 clojurebot: {:ns #<Namespace clojure.core>, :name seq?, :file "core.clj", :line 115, :arglists ([x]), :doc "Return true if x implements ISeq"}

17:07 fanda: ,(:name (meta (var seq?)))

17:07 clojurebot: seq?

17:07 hiredman: ~def seq?

17:07 clojurebot: Huh?

17:07 hiredman: clojurebot: are you for real?

17:07 clojurebot: for is not used often enough

17:07 danlarkin: haha

17:07 hiredman: ~def seq?

17:08 fanda: how do I get the same info, if function (any function) is inside e.g. vector?

17:08 ,(def x [seq? 123])

17:08 clojurebot: DENIED

17:08 fanda: ,(let [x [seq? 123]] (first x))

17:08 clojurebot: #<core$seq_QMARK___3043 clojure.core$seq_QMARK___3043@3deff3>

17:09 fanda: ,(let [x [seq? 123]] (var (first x)))

17:09 clojurebot: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol

17:09 fanda: I cannot apply 'var'

17:09 hiredman: ~def var

17:10 whoops

17:10 fanda: var isn't a function

17:11 fanda: is there any other way around it?

17:11 hiredman: ,(find-var 'seq?)

17:11 clojurebot: java.lang.IllegalArgumentException: Symbol must be namespace-qualified

17:11 fanda: just want to print the function name

17:11 hiredman: ,(find-var (resolve 'seq?))

17:11 clojurebot: java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Symbol

17:11 hiredman: ,(resolve 'seq?)

17:11 clojurebot: #'clojure.core/seq?

17:11 hiredman: ,((comp :name meta resolve) 'seq?)

17:11 clojurebot: seq?

17:12 hiredman: ,((comp :name meta resolve first) [seq?])

17:12 clojurebot: java.lang.ClassCastException: clojure.core$seq_QMARK___3043 cannot be cast to clojure.lang.Symbol

17:12 Chouser: a function does not know its own name

17:12 hiredman: yeah

17:12 ,((comp :name meta resolve) 'seq?)

17:12 clojurebot: seq?

17:13 Chouser: fanda: var is a special form

17:13 hiredman: a symbol can be resolved to a var and the var maybe bound to a fuction

17:13 fanda: Chouser: too sad that function doesn't know its name

17:13 just wanted to print its name

17:13 Chouser: right, you can store either the var or the symbol in a collection and get the name, but the fn doesn't have a name

17:14 hiredman: rhickey_: any chance fn objects may get metadata?

17:16 actually, I don't care about metadata on fn objects, I just want to be able to quary a fn object for arity information

17:17 fanda: Chouser, hiredman: thanks for help!

17:17 Chouser: I've asked before. I get the impression that he's not opposed, but that the code-gen for that would be tricky.

17:17 hiredman: I see

17:17 technomancy: just need to implement decompilation; that's all

17:18 hircus: hiredman: this is to do so programmatically, right?

17:18 technomancy: if spidermonkey can do it, why can't we? =)

17:18 Chouser: fanda: if this is just for debugging, you could try to munge something useful out of the str representation.

17:18 hiredman: hircus: yes

17:18 * technomancy is not volunteering

17:18 hircus: because if it's for human consumption, (doc fn) works

17:18 hiredman: I am aware

17:19 tashafa: ,(doc seq)

17:19 clojurebot: "([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable."

17:19 Chouser: arity checking at compile time is on the todo, I imagine making the arity aviable through some api could be done at the same time.

17:32 technomancy: how do you turn a fully-namespace-qualified var into just a string with the top-level name? not sure of the terminology here, but #'clojure.foo.bar/my-var => "my-var"

17:34 dnolen: (str (:name (meta #'user/x)))

17:35 technomancy: ah thanks

17:37 tashafa: ,(meta seq?)

17:37 clojurebot: nil

17:37 tashafa: ,(meta '#seq?)

17:37 clojurebot: No dispatch macro for: s

17:37 tashafa: ,(meta #'seq?)

17:37 clojurebot: {:ns #<Namespace clojure.core>, :name seq?, :file "core.clj", :line 115, :arglists ([x]), :doc "Return true if x implements ISeq"}

17:38 tashafa: ,(*1)

17:38 clojurebot: java.lang.IllegalStateException: Var clojure.core/*1 is unbound.

17:38 hiredman: ,'foo

17:38 clojurebot: foo

17:38 hiredman: ,`foo

17:38 clojurebot: sandbox/foo

17:38 tashafa: thx

17:39 dnolen: technomancy: np

17:39 tashafa: ,(`*1)

17:39 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: Symbol

17:40 tashafa: ,(`*1 :name)

17:40 clojurebot: nil

17:40 hiredman: clojure bot does not bind *1 like the repl does

17:40 tashafa: ah..so whats the deal with the sandbox

17:41 sry new here

17:41 hiredman: it executes code with a restricted set of permisions on the jvm, "sandbox" also happens to be the name of the namespace where it evaluates expressions

17:42 tashafa: gotcha

17:42 hiredman: `some-symbol just gives you a symbol, uh, "resolved" in the current namespace

17:42 tashafa: thanks again

17:42 hiredman: de nada

17:43 taggart: clojurebot: how much do you know?

17:43 clojurebot: I know 203 things

17:58 hiredman: ~def doall

18:00 hircus: speaking of backquote...

18:00 is there a way to get the Scheme behavior somehow?

18:01 `(1 2 ,(+ 1 2) 4) => '(1 2 3 4)

18:01 AWizzArd: hircus: the comma is whitespace in Clojure

18:01 so your example is the same as if the , were a space

18:02 hircus: AWizzArd: yup, but I'm showing the Scheme example

18:02 hiredman: ,`(1 2 ~(+ 1 2) 4)

18:02 clojurebot: (1 2 3 4)

18:02 hircus: aha!

18:02 AWizzArd: use ~ instead of ,

18:02 hircus: thanks

18:02 AWizzArd: and ~@ instead of ,@

18:02 * hircus slaps head, wondering why he has not noticed the ~s floating around macros before

18:02 hircus: and @ does .. ?

18:03 hiredman: splicing

18:03 AWizzArd: ,`(1 2 ~(list 10 20) 3)

18:03 clojurebot: (1 2 (10 20) 3)

18:03 AWizzArd: ,`(1 2 ~@(list 10 20) 3)

18:03 hiredman: ,`(1 2 ~@(map inc (range 5)) 4)

18:03 clojurebot: (1 2 1 2 3 4 5 4)

18:03 (1 2 10 20 3)

18:03 hircus: cool

18:15 danlarkin: anyone write a build.xml for a project that uses contrib? when I try to compile to classfiles it complains about contrib files not being on my classpath, but they are

18:39 technomancy: http://gist.github.com/66070 <= barely works, but here it is

18:40 (clojure-test-mode.el)

18:41 that was way harder than it should have been. swank is a minefield.

18:44 that won't work.

18:52 try that instead: http://gist.github.com/66076

18:54 even better: http://github.com/technomancy/clojure-mode/blob/b76283ae1e3611a6581cf490d0b566c58dd24ba3/clojure-test-mode.el

18:54 gnuvince: let me know how that works for you

18:54 or rather, let me know the ways in which it spectacularly fails

18:59 stimuli: hi

19:00 so the lazy branch is either an exciting new age for Clojure ... or a big giant pain in the butt ... I haven't decided yet

19:01 Drakeson: if it is the latter, you might need to fix your butt :p

19:01 stimuli: true

19:02 slashus2: Is the laziness for both consistency and performance?

19:03 stimuli: both of course

19:03 :)

19:03 slashus2: Consistency is beautiful.

19:13 AWizzArd: clojurebot: def source

19:20 Chouser: I've got a pair of lazy-seq objects (in genclass.clj) that both print as ()

19:21 The class of each prints as clojure.core$map__3709$fn__3711

19:21 And (= (vec a) (vec b)) is true

19:21 but (= a b) is false

19:23 stimuli: cho : the changeover promises to be painful

19:24 hiredman: if you don't realize the lazy seqs, how do you know if they are the same?

19:24 stimuli: you have to realize them, I think

19:24 cooldude127: hiredman: magic

19:25 stimuli: unless they are the same object, perhaps

19:25 durka42: that would be identical? not =

19:25 stimuli: yeah

19:25 durka42: i hope clojure never has as many kinds of equality as CL

19:25 cooldude127: yeah but it might check identical? first, just to make sure

19:26 stimuli: right

19:26 cooldude127: durka42: yeah i think the two it has now are just fine

19:26 durka42: = identical? same? close-enough?

19:26 stimuli: if they are identical .. you don't ahve to force the lazy

19:26 durka42: (close-enough? 2 3)

19:26 :for-government-work

19:26 cooldude127: durka42: i actually had a close-enough? function for dealing with floating-point numbers

19:26 durka42: maybe = should realize them though

19:26 heh

19:26 stimuli: I don't know if it does that, however

19:26 durka42: if = is about value equality

19:26 stimuli: true

19:27 but if they are HUGE .. it would be a nice optimization

19:27 durka42: to use magic?

19:27 i mean, lazy seqs are things you kind of have to handle carefully to keep them lazy, right

19:27 stimuli: well .. yeah .. magic is a lovely optimization .. 'cept if you have negated rules then it gets hard (Datalog joke)

19:27 durka42: so "don't compare them until you want to realize them" seems ok

19:27 cooldude127: technomancy: is the test-is emacs stuff in a branch yet?

19:28 stimuli: is it too early to wonder when contrib will be 100% fixed w/ the new lazy stuff?

19:28 technomancy: cooldude127: yeah, not sure about if it works though

19:28 http://github.com/technomancy/clojure-mode/blob/b76283ae1e3611a6581cf490d0b566c58dd24ba3/clojure-test-mode.el

19:29 cooldude127: technomancy: well obviously that is my job

19:29 make sure your shit works

19:33 technomancy: clojure-test-mode is mean. it changed the package of my slime repl

19:33 just by requiring it

19:34 technomancy: yes. it is very mean.

19:34 it will probably push you over and take your cotton candy.

19:34 cooldude127: technomancy: also, you can fix the embedded clojure font-lock problem very easily

19:34 technomancy: I'll work on its attitude problem right after I fix its brokenness problem.

19:35 cooldude127: add a space before (ns, (defonce, and (defn

19:35 technomancy: oh, thanks

19:35 cooldude127: it's probably too broken to really hack right now for stuff other than that

19:35 gimme a few minutes

19:35 cooldude127: technomancy: yeah, you still haven't shown with-test any love

19:35 :(

19:36 technomancy: one step at a time

19:36 cooldude127: this is an important step :)

19:36 Chouser: ,(= (map identity nil) (map inc nil))

19:36 cooldude127: it's the difference between useful and useless :)

19:36 clojurebot: false

19:37 cooldude127: really?

19:37 Chouser: that doesn't seem right

19:37 And rhickey's not here (only rhickey_ and rhickey__)

19:37 cp2: ,(inc nil)

19:37 clojurebot: java.lang.NullPointerException

19:37 cooldude127: Chouser: i get true in my repl

19:37 Chouser: ,(= (map identity ()) (map inc ()))

19:37 clojurebot: false

19:37 cooldude127: is clojurebot on lazy?

19:38 Chouser: yes

19:38 cooldude127: or the new truck, i suppose

19:38 oh that's got something to do with it then

19:38 that USED to be true

19:38 durka42: ,(inc nil)

19:38 ,(doall (map inc nil))

19:38 i believe it is

19:38 what happened to that last evaluation...

19:38 clojurebot: java.lang.NullPointerException

19:38 LazySeq used in 'if'

19:38 Chouser: cooldude127: right

19:38 cooldude127: Chouser: it really still should be, this looks like a bug

19:38 durka42: user=> (doall (map inc nil))

19:38 ()

19:38 that definitely doesn't seem right

19:39 Chouser: cooldude127: yes

19:39 cooldude127: durka42: sure it is

19:39 Chouser: durka42: no, that's correct.

19:39 durka42: it didn't do it, because if it had it would have thrown exception

19:39 cooldude127: map and stuff will always return a seq

19:39 which if empty will be ()

19:39 or a sequence i guess

19:39 not a seq

19:39 durka42: so map swallows exceptions now?

19:39 cooldude127: durka42: no

19:39 * durka42 is confused

19:39 cooldude127: durka42: there is no null pointer exception

19:39 durka42: (inc nil) throws an exception

19:39 cooldude127: durka42: cuz nil has no elements, it doesn't call inc at all

19:40 durka42: oh

19:40 got it

19:40 hiredman: (doall (map inc [nil]))

19:40 Chouser: sorry, didn't mean to confuse

19:40 hiredman: ,(doall (map inc [nil]))

19:40 clojurebot: java.lang.RuntimeException: java.lang.NullPointerException

19:40 cooldude127: map used to return nil or a seq, now it returns a sequence, which can be empty

19:40 locks: I heard that clojure sucks

19:40 * locks ends trolling O:)

19:40 hiredman: ,(doall (map inc (range 10)))

19:40 clojurebot: LazySeq used in 'if'

19:40 cooldude127: and apparently those sequences are not always equal

19:40 which seems wrong

19:40 Chouser: ,(= (map [] []) (map [] []))

19:40 clojurebot: false

19:40 hiredman: doall seems kind of broken

19:41 Chouser: locks: at this very moment it's sucking slightly more than usual. :-)

19:41 cooldude127: a lot of things are temporarily broken

19:41 locks: ic

19:41 technomancy: cooldude127: ok, pull again from the clojure-test-mode branch

19:41 I think it works in the base deftest case

19:41 Chouser: clojure svn rev 1286 doesn't suck at all.

19:41 technomancy: and now at least there's a TODO so you can know what stuff is known broken

19:42 I gotta get back to work, so fork and hack if you want to make changes.

19:42 Chouser: there is?

19:42 oh

19:42 cooldude127: technomancy: yeah i might just do that

19:43 technomancy: Chouser: heh; talking about my elisp mode. =)(

19:43 * cooldude127 has many forks of technomancy's repositories

19:43 Chouser: yeah, sorry, I figured that out eventually.

19:45 slashus2: I ran across an interesting sentence in my programming languages text book. Talking about functional languages: "Other factors, such as efficiency, however, have prevented functional languages from becoming more widely used."

19:45 technomancy: that was true in the 80's; you had to have special hardware for lisp.

19:46 slashus2: This is comparing it to C, C++, and Java, I imagine.

19:46 hiredman: well, with a completely lazy language it can be difficult to figure out at what point in your code work is happening

19:47 slashus2: It mentions those languages immediately before it.

19:47 cooldude127: hiredman: or if it's happening at all

19:47 hiredman: well, that could just be a boldface lie

19:47 textbooks are full of those

19:47 technomancy: could be an excuse for not wanting to spend much time covering them in the book.

19:47 cooldude127: lol

19:48 slashus2: It has a whole chapter on functional languages.

19:48 technomancy: "This stuff looks hard. I wonder if I could ignore it?"

19:48 ah, ok

19:48 durka42: fixing lazy sequences is hard, let's go shopping

19:48 cooldude127: technomancy: elisp's imperativeness bugs the crap out of me sometimes

19:48 technomancy: yes

19:49 hiredman: slashus2: I dunno why your textbook said that, but is in manifestly untrue these days

19:49 cooldude127: i have no idea how to transform your regexp into something that matches both with-test and deftest

19:49 slashus2: Not sure, probably just an unsupported rationalization.

19:50 technomancy: cooldude127: luckily that's the only place that uses deftest; the rest of the line numbering stuff comes straight from test-is.

19:50 cooldude127: technomancy: the part that finds the name of a focused test isn't even used yet, right

19:50 ?

19:50 technomancy: cooldude127: the only problem is that it's going to suck hard for tests that are in the same namespace but a different file

19:50 yeah

19:50 anyway, you can just M-x clojure-test-mode for now

19:50 cooldude127: k well i think i fixed the hook then

19:50 slashus2: Lazy sequences aren't that lazy. At least they do something when you tell them to.

19:51 cooldude127: technomancy: a simple or worked for the hook i think (it looks like it will, but who knows

19:51 technomancy: k

19:51 hiredman: they are a controled subset of complete laziness

19:51 slashus2: hehe

19:51 durka42: it's more of a procrastinating seq

19:51 slashus2: This is nearly equivalent to the effect of generator functions in python? Could they be called generating sequences too?

19:52 cooldude127: technomancy: error in process filter

19:52 idk even what that means

19:53 technomancy: cooldude127: it means something happened in the async handler

19:53 cooldude127: NOOOO

19:53 technomancy: cooldude127: M-x toggle-debug-on-error to see what's going on

19:53 hiredman: slashus2: obviously it is not nearly equivalent. it is far superior

19:53 technomancy: though... all the elisp-cl-ish macro stuff can make debugging kinda tricky some times

19:53 slashus2: Well for one, the sequences are not functions.

19:53 I realize that.

19:53 cooldude127: technomancy: wrong number of arguments, who knows where

19:54 technomancy: bleh

19:54 cooldude127: did you M-x slime before launching clojure-test-mode?

19:54 cooldude127: technomancy: i had slime up already

19:54 technomancy: ok

19:54 cooldude127: technomancy: does it need to already be in the right ns inside the repl?

19:54 hiredman: ,((comp (partial take 10) iterate) inc 0)

19:54 clojurebot: LazySeq used in 'if'

19:54 technomancy: cooldude127: it shouldn't, but you could check that

19:54 hiredman: mother fitzer

19:55 technomancy: actually... that might be it

19:55 hiredman: this is not cool

19:55 cooldude127: technomancy: no it's not

19:55 technomancy: i mean it might still be an issue, but that's not what this is

19:55 hiredman: ~def partial

19:55 ~def comp

19:55 technomancy: cooldude127: well it's a start at least. it has worked on at least one test file. =)

19:55 cooldude127: technomancy: this appears to be somewhere inside clojure-test-extract-result

19:57 hiredman: ,(comp identity identity identity)

19:57 clojurebot: #<core$comp__3675$fn__3677 clojure.core$comp__3675$fn__3677@b2c64>

19:57 hiredman: ,((comp identity identity) :a)

19:57 clojurebot: :a

19:57 hiredman: ,((comp identity identity identity) :a)

19:57 clojurebot: :a

19:57 hiredman: hmmm

19:57 technomancy: cooldude127: what does this get you in your test namespace? (map #(cons (str (:name (meta %))) (:status (meta %))) (vals (ns-interns *ns*)))

19:58 cooldude127: technomancy: a big mess of gross

19:58 hiredman: ,((partial :a nil) :b)

19:58 clojurebot: :b

19:58 hiredman: ,((comp identity (partial :a nil)) :b)

19:58 clojurebot: :b

19:59 dreish: ,(keyword "-)")

19:59 clojurebot: :-)

19:59 cooldude127: dreish: LOL

20:00 hiredman: ,(replicate 10 1)

20:00 clojurebot: LazySeq used in 'if'

20:00 hiredman: ,(replicate 10 '(1))

20:00 clojurebot: LazySeq used in 'if'

20:00 hiredman: oh

20:00 I get it

20:00 this is clojurebot's fault

20:00 (acutally doall's fault)

20:01 * hiredman will fix this later

20:03 cooldude127: technomancy: I FIGURED IT OUT

20:03 it's the destructuring bind in extract-result

20:03 destructuring-bind throws up an error if the thing you pass it doesn't have all the stuff you're trying to get out of it

20:04 technomancy: cooldude127: yeah, but you need that stuff!

20:04 if it doesn't have enough elements, something is wrong

20:05 cooldude127: technomancy: well i have a couple with-tests that don't actually have tests

20:05 technomancy: hah! well screw that

20:05 cooldude127: just useless wrappers

20:05 lol

20:05 technomancy: yeah, so you can add a clause skipping empty tests

20:05 cooldude127: i need to go eat, but i'll work on this later

20:06 technomancy: k

20:12 slashus2: I know you can do (.contains [1 2 3 4] 1) if you want to test for collection membership, but will anything like (inseq? sequence member) be added to the api?

20:15 technomancy: ,(doc contains)

20:15 clojurebot: java.lang.Exception: Unable to resolve var: contains in this context

20:15 technomancy: ,(doc contains?)

20:15 clojurebot: "([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."

20:16 technomancy: slashus2: I think that's in contrib's seq-utils

20:16 slashus2: That is interesting.

20:16 Will the contrib items be moved into the main language, or do they stay in contrib?

20:17 technomancy: slashus2: some will get moved

20:18 slashus2: It is basically a testing ground?

20:18 technomancy: well, core is never going to contain everything

20:18 but some things are near-universally useful

20:27 taggart: anyone know of a good web reference for lisp-y terms like "destructuring bing" and "arity"?

20:27 erm... bind

20:29 Chouser: taggart: destructuring is documented here http://clojure.org/special_forms#toc4

20:30 arity just means the number of args a fn takes

20:30 taggart: thx, just didn't want to have to keep bugging ppl for definitions of words as they come up

20:31 reading through SICP now, so very nubish with lisp

20:32 Chouser: well, I haven't read that yet, so you're ahead of me.

20:32 taggart: heh, I'll take what I can get

20:35 slashus2: Chouser: Have you read Programming Clojure yet?

20:35 taggart: not yet

20:36 sry lol, not to me

20:41 * cooldude127 is back :)

20:42 slashus2: Will the whole language becoming lazy make "Programming Clojure" obsolete as it currently stands?

20:53 Chouser: slashus2: I've read much of it -- I haven't gotten to some of the more recent chapters yet.

21:09 arohner: anyone else get seriously annoyed at all the XML java projects want?

21:10 I'm seriously thinking about re-purposing one of the clojure HTML generators to make XML for java projects I try to run alongside clojure

21:13 Chouser: like lancet

21:13 ?

21:18 arohner: sort of

21:18 I thought lancet was more geared towards ant-style stuff

21:18 I want a general purpose XML generator so I don't have to write XML config files

21:18 Chouser: oh, yes, but I mean ant is meant to be run by xml files, but you can run it via lancet instead.

21:19 arohner: ah, right

21:19 does lancet generate XML or does it call ant code directly?

21:20 Chouser: calls ant directly, I believe.

21:32 hiredman: ,(map identity (range 10))

21:32 clojurebot: LazySeq used in 'if'

21:32 * hiredman dies

21:32 Chouser: works for me

21:33 hiredman: ,(map identity (range 10))

21:33 clojurebot: LazySeq used in 'if'

21:33 hiredman: yeah, eval-in-box bug

21:33 Chouser: ah

21:34 hiredman: ,(map identity (range 10))

21:34 clojurebot: (0 1 2 3 4 5 6 7 8 9)

21:34 hiredman: ,((comp (partial take 10) iterate) inc 0)

21:34 clojurebot: (0 1 2 3 4 5 6 7 8 9)

21:34 Chouser: congrats

21:34 hiredman: I guess

21:34 this looks real ugly

21:41 clojurebot: svn rev 1288; fixed LazySeq and EmptyList equals/equiv

21:41 hiredman: svn rev 1287

21:41 clojurebot: svn rev 1287; merged lazy branch -r1236:1286

21:51 svn rev 1289; fixed nil punning in genclass, patch from Chouser

21:53 durka42: woo contrib builds

21:54 ,nthnext

21:54 clojurebot: Don't know how to create ISeq from: core$nthnext__4325

21:54 durka42: nthrest => nthnext?

21:54 Chouser: yep

21:54 hiredman: ,foo

21:54 clojurebot: java.lang.Exception: Unable to resolve symbol: foo in this context

21:55 hiredman: ,partial

21:55 clojurebot: Don't know how to create ISeq from: core$partial__3681

21:55 hiredman: ugh

21:55 still not fixed

21:56 clojurebot: svn rev 1290; fixed (cycle [])

21:58 hiredman: ,partial

21:58 clojurebot: Don't know how to create ISeq from: core$partial__3681

22:01 hiredman: ,partial

22:01 clojurebot: #<core$partial__3681 clojure.core$partial__3681@167c6fd>

22:01 hiredman: ,:a

22:01 clojurebot: :a

22:11 svn rev 1291; added sequence

22:12 rhickey: everyone ported to lazy?

22:13 cp2: im doing so as you mentioned it

22:13 although, i dont have much to port :)

22:16 hiredman: ditto

22:16 actually, I think I just finished

22:16 cp2: eh, so

22:16 the lazy branch is just a replacement for clojure-contrib ?

22:17 sorry, dont quite understand the ordering of the svn

22:17 hiredman: ,((comp (partial take 10) iterate) inc 0)

22:17 clojurebot: (0 1 2 3 4 5 6 7 8 9)

22:17 hiredman: cp2: no

22:17 there was a seperate branch in the clojure svn

22:17 clojurebot: svn?

22:17 clojurebot: svn is http://clojure.googlecode.com/svn/trunk/

22:17 cp2: yes i know

22:18 its /branches/lazy

22:18 hiredman: yes

22:18 cp2: not /trunk etc

22:18 hiredman: but it just got merged into trunk

22:18 cp2: oh ok

22:18 hiredman: svn rev 1288

22:18 clojurebot: svn rev 1288; fixed LazySeq and EmptyList equals/equiv

22:18 cp2: so all i have to do is checkout from trunk again?

22:18 hiredman: svn rev 1287

22:18 clojurebot: svn rev 1287; merged lazy branch -r1236:1286

22:18 cp2: ah

22:18 sounds good

22:18 hiredman: yes

22:18 but that is completely serperate from contrib

22:19 clojurebot: contrib?

22:19 clojurebot: contrib is http://code.google.com/p/clojure-contrib/

22:19 cp2: well, when i built it the resulting jar was named clojure-contrib

22:19 so it threw me off

22:19 hiredman: on which lazy porting is on going

22:19 cp2: yes i know contrib is seperate ;)

22:19 hiredman: uh

22:19 cp2: i see

22:19 hiredman: contrib makes clojure-contrib

22:20 Wizardofwestmarc: has Swank been updated yet anyone know?

22:20 hiredman: clojure makes clojure.jar

22:20 cp2: oh damnit

22:20 i had the wrong url

22:20 for some reason

22:20 Wizardofwestmarc: err swank-clojure

22:20 cp2: there we go

22:36 durka42: hmm, 1291 breaks contrib because c.c.monads defines a fn "sequence"

22:36 that would be better phrased as "c.c.monads is broken in 1291"

22:38 danlarkin: ~source seq

22:40 durka42: that one's not so illuminating...

22:40 danlarkin: oh, that was just for my reference

22:41 Chouser: fixed in contrib rev 482

22:43 durka42: ,(.startsWith "--goo" "--")

22:43 clojurebot: true

22:43 durka42: ,(.startsWith "-goo" "--")

22:43 clojurebot: false

22:43 durka42: interesting

22:45 ,(.startsWith nil "--")

22:45 clojurebot: java.lang.NullPointerException

22:46 hiredman: ...

22:46 durka42: weird things happening with gorilla

23:00 will you look at that, i fixed gorilla

23:00 nil at the end of a seq

23:06 * danlarkin cheers

23:06 cooldude127: technomancy: i sent you a pull request!

23:07 technomancy: cooldude127: excellent

23:07 cooldude127: technomancy: i still don't know if it works. i don't get any highlighting

23:07 technomancy: cooldude127: I predict things are going to get confusing distinguishing between your clojure-mode and clojure-code repos

23:07 heh

23:07 cooldude127: lol

23:07 technomancy: cooldude127: does C-c ' work over a failing test?

23:08 danlarkin: mode code

23:08 cooldude127: technomancy: HOLY SHIT!

23:08 danlarkin: code mode code

23:09 cooldude127: technomancy: yeah it worked

23:10 technomancy: ok that's really cool

23:11 technomancy: ok it doesn't always work

23:12 durka42: the humble vim user wonders what C-c ' does

23:12 cooldude127: durka42: in theory, it shows the result of a failing test

23:12 hiredman: well, in slime.vim it sends the form under the cursor to the repl

23:12 ah

23:13 actaully C-c C-c

23:13 cooldude127: technomancy: ok it worked when i messed up the last (is) in a test, but earlier ones don't show

23:14 yeah, confirmed, only the last is block works

23:19 technomancy: durka42: it shows the reason for the test failure under point

23:19 cooldude127: technomancy: is there a reason that once test mode is enabled, it is global? all my buffers say Test

23:20 technomancy: cooldude127: even non-clojure ones?

23:20 cooldude127: technomancy: ALL OF THEM! even rcirc!

23:20 technomancy: that's a bug; heh

23:20 cooldude127: lol

23:20 really? :p

23:21 technomancy: unless you want to test snippets that other people paste into the channel on the fly

23:21 which *would* be awesome

23:21 * durka42 wonders how many people write tests for one-off snippets

23:21 cooldude127: technomancy: yeah not what i want tho :)

23:21 technomancy: but any idea why only the last "is" in a test block gets highlighted? does this happen for you too?

23:23 technomancy: cooldude127: let me see. (failures are not done on a per-test basis but a per-is basis)

23:24 cooldude127: I see; yeah, there's a problem there

23:25 cooldude127: technomancy: yeah i'm not sure why

23:27 technomancy: cooldude127: I think I see the problem; it's in clojure-test-load-reporting

23:27 where test-is's report gets redefined

23:27 cooldude127: technomancy: ok, what about it is wrong?

23:27 technomancy: it resets the metadata for the test var for each failure

23:28 where it should append it to a vector or something

23:28 cooldude127: oh

23:28 technomancy: is that the problem tho when you only have one failure, it's just not the last?

23:29 technomancy: cooldude127: I don't know about that; haven't repro'd

23:29 cooldude127: oh

23:29 do you know what you're doing to fix it?

23:30 technomancy: I'm not sure. I want to avoid data structures that don't have elisp equivalents, so I must stick to vectors and lists

23:31 cooldude127: lists are probably the best bet

23:31 technomancy: alists! woo hoo!

23:31 since I need to correlated line numbers with failure data

23:32 cooldude127: technomancy: so is status only used by you? it's not part of test-is normally?

23:32 s/status/:status/

23:32 technomancy: right

23:33 cooldude127: cool

23:33 i was hoping that was the case

23:46 technomancy: ugh. now I have to figure out a way to clear metadata in between test runs

23:50 cooldude127: uh oh

23:50 technomancy: is there something like set-meta!

23:51 ah; reset-meta!

23:53 cooldude127: technomancy: don't get too crazy reseting metadata, as my testing vars are probably functions, which have important metadata

23:53 only reset the stuff that needs it

23:54 technomancy: right; I realized I want to alter with assoc to only set :status to []

23:54 cooldude127: technomancy: cool :)

23:57 technomancy: the second you have something that kinda works, PUSH

Logging service provided by n01se.net