#clojure log - Mar 20 2009

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

0:06 cmvkk: wanted to test something on the repl only to discover i'm still running that reduce operation...

0:06 i feel like i have too much invested to stop it now...

0:06 Raynes: o.o

0:08 Victorr_: is it ok to assume (if test 'foo) will return nil if test is false?

0:08 hiredman: A) yes B) use when

0:09 Victorr_: oh right, thanks

0:09 BTW, I find it odd that there is a when-not instead of unless

0:13 hiredman: I find it odd that you would use either of those

0:13 ,(doc compliment)

0:13 clojurebot: java.lang.Exception: Unable to resolve var: compliment in this context

0:13 hiredman: bah

0:13 Victorr_: do you mean complement?

0:13 hiredman: yeah

0:13 cmvkk: heh

0:13 Victorr_: ,(doc complement)

0:13 clojurebot: "([f]); Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value."

0:13 hiredman: anyway, just negate the predicate

0:13 Victorr_: I fail to see how complement would be better

0:14 cmvkk: it's easier to just use not.

0:14 hiredman: or use or

0:14 ,(or :foo (println :bar))

0:14 clojurebot: :foo

0:14 hiredman: ,(or nil (println :bar))

0:14 clojurebot: :bar

0:16 Victorr_: I think (unless test expr1 expr2) is better than (and test (do expr1 expr2)), don't you think so?

0:16 make that when-not

0:16 hiredman: and would not work there

0:17 ~def when-not

0:22 Mec: why wouldnt and work there?

0:23 Victorr_: I think he means when-not will return nil if the condition is true, but and won't

0:25 Mec: cmvkk: is it still running that reduce? and how long has it been?

0:26 ,(if nil :true:)

0:26 clojurebot: Invalid token: :true:

0:26 Mec: ,(if nil :true)

0:26 clojurebot: nil

0:26 cmvkk: a long time....

0:26 Mec: crap, ill need to find a new algorithm then

0:27 cmvkk: it's still chugging away at it though, it's being a real trooper. It's reducing it out till the bitter end.

0:27 Mec: lol

0:27 hiredman: it's a big number, and there are a lot of numbers greater then zero and less then it

0:27 Mec: the problem is i need to filter the (range 1000000000000) first and then add them all together, i think that would take a lot longer

0:28 hiredman: depends on your filter

0:29 you can also try pmap with the mapped function return nil or the value depending on if the number passes the predicate, then just filter on identity

0:32 hjlee: ,(doc frest)

0:32 clojurebot: java.lang.Exception: Unable to resolve var: frest in this context

0:32 hjlee: ,(doc rest)

0:32 clojurebot: "([coll]); Returns a possibly empty seq of the items after the first. Calls seq on its argument."

0:32 hiredman: ,`fnext

0:32 clojurebot: clojure.core/fnext

0:34 hjlee: I guess, I found documented, but not implemented functions/macros.

0:34 hiredman: uh

0:34 oh

0:34 clojurebot: api?

0:34 hjlee: they are frest, rrest, nthrest, rfirst, fnseq and lazy-cons

0:34 clojurebot: api examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples

0:34 hiredman: clojurebot: api is <reply>the website api refers to last release

0:34 pffft

0:35 * hiredman punches clojurebot

0:36 Raynes: http://www.ociweb.com/mark/clojure/audio/AnistonClosure1.mp3

0:36 hiredman: clojurebot: api is <reply>the website api refers to last release

0:36 clojurebot: Ik begrijp

0:36 Mec: sorry, had to answer a call of the wildebeest... hiredman: what does pmap do?

0:36 hiredman: ,(doc pmap)

0:36 clojurebot: "([f coll] [f coll & colls]); Like map, except f is applied in parallel. Semi-lazy in that the parallel computation stays ahead of the consumption, but doesn't realize the entire result unless required. Only useful for computationally intensive functions where the time of f dominates the coordination overhead."

0:37 Mec: i only have 1 core :(

0:37 hiredman: :( indeed

0:37 Mec: thats why i wanted to hook up all of the comps in my house, then i'd have 10 cores

0:38 Raynes: I only have a half a core :(

0:39 Mec: lol

0:39 Raynes: I ate the other half, cuz hungry. :)

0:39 Mec: hmm i suppose most of the numbers in the range will be dismissed so maybe it wont take too long

0:41 hiredman: what kind of numbers are you looking for?

0:42 Mec: so called semidivisible, but i dont think that's an actual term, http://projecteuler.net/index.php?section=problems&id=234

0:45 hiredman: 999966663333 is a very interesting looking number

0:46 Mec: its just because of it's squareroot

1:12 anyone know of a keysequence for emacs that will automatically close all open parenthesis/brackets

1:15 durka42: that depends

1:15 do you use paredit

1:16 Mec: couldnt say, whatever clojurebox uses

1:16 durka42: huh i thought paredit had a key like that, but i can't find it

1:18 Mec: i'd prefer another editor but i dont know of any, i hate the bindings emacs uses

1:19 durka42: you should use vim :)

1:19 Mec: is it "possible" to install on windows and work with clojure?

1:20 durka42: i'm not sure if vimclojure has problems with windows

1:20 Raynes: You should use Enclojure and proceed to flip Lau_Of_DK off.

1:20 * durka42 still has to fix my netbeans installation

1:21 durka42: how do you remove a plugin that causes a crash on startup

1:21 Raynes: durka42: in the .netbeans folder.

1:21 You can search through it and find it and nuke it.

1:21 durka42: will do

1:21 Raynes: I had to do that with Enclojure. I still don't think it uninstalls right. Oh well, it doesn't screw up anymoar :D

1:22 durka42: yeah, the crasher in question is some old version of enclojure

1:22 Mec: i tried enclojure, it was waaaaaaay too much for just a simple editor

1:22 Raynes: Yeah, the old version didn't like my windows.

1:22 Mec: The Java stuff is inevitable for any language, even minor features require it.

1:23 It's going to improve of course.

1:23 But people who like and use Emacs for Clojure should stick with Emacs because I'm sure it's 1,000 times better than Enclojure will ever be.

1:23 Mec: well netbeans wanted like 150meg and it wouldnt even work right, the window wouldnt tie into the repl

1:24 Raynes: Say what? O_o

1:24 I installed the PHP version and had like 11 megs of dependencies to download.

1:24 Mec: it was crazy im telling you

1:24 Raynes: If you tried this recently, chances are Enclojure is fixed by now.

1:25 Mec: its not enclojure itself, its netbeans

1:25 Raynes: Darn, I need to finish this chapter so I'll be a l33t Clojure c0dur.

1:25 Mec: chapter of what

1:25 Raynes: Multimethods chapter of Programming Clojure

1:26 Last important chapter.

1:27 I still can't believe I signed up for prag with the wrong name... My middle name doesn't start with an E. :|

1:27 Mec: netbook of physical book?

1:27 Raynes: PDF, the book isn't out yet.

1:28 durka42: Raynes: is .netbeans/modules/clojure-asm.jar the only thing i need to nuke?

1:28 Raynes: It should be something like org.enclojure.<insertbullsh*there>

1:29 Unless they named it something different back when you used it.

1:29 s/used/installed/

1:29 durka42: oh, there are five org-enclojure-*.jar

1:29 what's clojure-asm.jar then

1:29 Raynes: Dunno, delete them all, you don't need anything that has clojure in it's name.

1:29 durka42: yeah, it was created at the same time as the others

1:30 Raynes: Mec: Do you have a copy? No Clojure programmer is complete without it :|

1:30 Mec: just heard about it

1:31 Raynes: I wish Ebooks were like dead tree books. You can let people borrow your dead tree books and it isn't copyright infringement :|

1:32 cmvkk: many would like to claim otherwise!

1:33 * Raynes wishes that Stu would have Creative-Common'd his book like Real World Haskell did :\

1:37 Mec: can someone double check my logic here: 10! is (reduce * (range 1 11)) and 10!/7! is (educe * (range 8 11))

1:37 durka42: why 11...

1:37 Mec: range isn't top inclusive

1:37 durka42: oh

1:37 i think that makes sense then

1:41 Mec: seems weird that you cant really simplify it mathematically but the programming construct is simple

1:43 am i getting slaphappy or does my function name !d! sound funny

1:50 slashus2: I am trying to figure out why something like (.eval (.getEngineByName (ScriptEngineManager.) "JavaScript") "5+5") won't work with hiredman's sandbox when I remove eval from the *bad-forms* . It throws a null pointer exception when ran inside of the sandbox. Outside it produces 10.

1:51 pstickne: maybe there is not engine by that name?

1:51 slashus2: It works outside of the sandbox

1:52 pstickne: maybe there is no engine by that name in the sandbox?

1:52 slashus2: ...

1:52 I don't know for sure.

1:52 pstickne: check the return of getEngineByName?

1:53 hiredman: getEngineByName may try to load some sort of external resource

1:53 slashus2: nil :-(

1:53 Raynes: SIDE EFFECTS!

1:53 slashus2: hiredman: I think that is the case.

1:54 Mec: we dont need to stinkin side effects

1:54 slashus2: I will try to do it outside of the sandbox.

1:54 ... the sandbox takes a string

1:55 function that is

1:55 eval-in-box

1:55 hiredman: it's really read and eval in a box

1:57 ~sandbox

1:57 clojurebot: sandbox is http://calumleslie.blogspot.com/2008/06/simple-jvm-sandboxing.html

2:08 slashus2: creating the interpreter outside of the sandbox worked.

2:32 cmvkk: If I have a macro 'foo', and its expansion contains a call to a macro 'bar', then bar should be expanded too right?

2:33 my current code doesn't seem to work that way and I can't figure out what I'm doing wrong.

2:39 erk, nevermind.

3:41 Mec: if foo expands as a call to bar and bar expands as a call to foo, does the world implode?

3:42 Cark: good morning

3:58 * Raynes goes to sleep

3:59 Mec: sleep is for the weak

4:00 Raynes: Mec: Sleep is for the bored people who want to be competent tomorrow.

4:00 Mec: competence is for the weak

4:01 but ill agree with the bored part

4:01 * Raynes huggles Mec and goes to sleep for real this time

4:01 Mec: night night

4:03 i dunno why but i keep thinking concat is append

4:22 since sort takes a function that implements Comparator, how would i make my own?

4:24 hjlee: Mec: check sort-by

4:25 Mec: ah hah, thanks

4:26 it says the same thing, must implement Comparator

4:31 Raynes: Mec: Why are you implementing everything yourself?

4:31 * Raynes isn't asleep because he's waiting for a minor case of nausea to pass.

4:31 Mec: so much for sleep :D im not i just have a list of vectors and i need to sort it by comparing the 2nd element

4:33 hjlee: ,(sort-by second '([7 2 3] [3 1 2] [4 5 6] [2 3 4]))

4:33 clojurebot: ([3 1 2] [7 2 3] [2 3 4] [4 5 6])

4:33 Mec: ah hah so thats how that works

4:35 hmm didnt work right

4:36 ,(sort-by second '([1 "1"] [2 "12"] [3 "241"]))

4:36 clojurebot: ([1 "1"] [2 "12"] [3 "241"])

4:36 Mec: ,(sort-by second '([1 "12"] [2 "1"] [3 "241"]))

4:36 clojurebot: ([2 "1"] [1 "12"] [3 "241"])

4:37 Mec: ah well doesnt matter either way

4:45 * Raynes goes sleep now for the last time

4:46 cmvkk: this is kind of weird, but what I want is a predicate that returns true for anything that would be represented by a set of parentheses.

4:46 there's too many different types of things...

4:48 Mec: (doc coll?)

4:48 clojurebot: Returns true if x implements IPersistentCollection; arglists ([x])

4:49 cmvkk: no good. it returns true for vectors too.

4:49 ,(coll? [1 2 3])

4:49 clojurebot: true

4:49 cmvkk: and list? is no good, because it returns false for conses.

4:49 ,(cons 'a nil)

4:49 clojurebot: (a)

4:49 cmvkk: ,(list? (cons 'a nil))

4:49 clojurebot: true

4:49 Mec: how is that not a list

4:49 cmvkk: whoa whoa, hold on

4:49 Mec: fail

4:50 cmvkk: weird...

4:50 Mec: seems like a cons doesnt actually exist

4:50 cmvkk: ,(list? (cons 'a (cons 'b nil)))

4:50 clojurebot: false

4:50 Mec: ,(cons 'a 'b)

4:50 clojurebot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol

4:50 cmvkk: ,(class (cons 'a nil))

4:50 clojurebot: clojure.lang.PersistentList

4:50 cmvkk: ,(class (cons 'a (cons 'b nil)))

4:50 clojurebot: clojure.lang.Cons

4:50 Mec: that makes no sense

4:51 cmvkk: it's an implementation defect, it has to do with the fact that cons operates differently for different inputs.

4:51 consing onto a cons works differently than consing onto nil.

4:52 Mec: since you cant cons onto something that isn't nil initially, it should always just be a list

4:52 cmvkk: well, consing onto a list is different than consing onto nil, i mean.

4:52 Mec: ,(class (cons 'a '(1 2)))

4:52 clojurebot: clojure.lang.Cons

4:53 Mec: i dont see why, it's a list in both cases

4:53 cmvkk: well it should be considered a list in my opinion (at least as far as list? goes)

4:53 but internally it's a different structure.

4:53 Mec: weird

4:53 ,(first (cons 'a (cons 'b nil))))

4:53 clojurebot: a

4:53 cmvkk: lists can be made up of all sorts of things...there's a bunch of different types of sequences and stuff

4:53 Mec: ,(rest (cons 'a (cons 'b nil))))

4:53 clojurebot: (b)

4:54 cmvkk: ,(class (seq [1 2 3]))

4:54 clojurebot: clojure.lang.APersistentVector$Seq

4:54 cmvkk: ,(class (seq "hello"))

4:54 clojurebot: clojure.lang.StringSeq

4:54 cmvkk: etc

4:54 Mec: #(or (cons? %) (list? %))

4:54 problem solved :D

4:55 cmvkk: well cons? doesn't exist, but other than that, yeah, you're right.

4:55 Mec: bah you cant be serious

4:55 cmvkk: (or (list? body) (instance? clojure.lang.Cons body))

4:55 is what i'm using

4:55 Mec: does cons onto a list return a list or cons

4:56 cmvkk: returns a cons.

4:56 Mec: one of the lectures said to use cons instead of conj for performance on lists, but if it breaks it from being a list then thats a problem

4:56 cmvkk: it's a bug.

4:56 list? should return true for conses.

4:57 pstickne: breaks it from being a list? :(

4:57 oh, odd

4:57 cmvkk: that's the only real difference; seq still works on them of course.

4:58 Mec: you could just call seq on it and not worry if its a list or cons

4:58 thats what a lot of the library does

4:58 pstickne: but really, cons and conj are different, no?

4:58 cmvkk: in this case, though, what i'm trying to do is distinguish 'lists' from vectors.

4:58 pstickne: (cons head rest)

4:58 Mec: conj is the general for all of the different sequences

4:59 pstickne: (conj 1 [2]) ; oops

4:59 (cons 1 [2]) ; \o/

5:00 cmvkk: why not seq?

5:01 cmvkk: because it includes vectors.

5:01 actually...

5:01 pstickne: but there is vector?

5:02 cmvkk: no, you're right, seq? apparently does what I want.

5:02 pstickne: yay

5:02 cmvkk: thanks.

5:03 pstickne: ohh, odd, Clojure is really confusing :p

5:06 Mec: seq? works for cons?

5:06 ,(seq? (cons 'a (cons 'b nil)))

5:06 clojurebot: true

5:06 Mec: huh well then

5:20 why does putting time around defns give me unmatched delmieter exceptions?

5:21 pstickne: huh?

5:22 Mec: i have 2 defns and 1 exp, putting (time (do )) around them throws an unmatched delimiter exception

5:26 pstickne: "works here"

5:27 Mec: bah if i highlight the 3 and run region it works fine

5:28 pstickne: so then maybe it's something else outside...

5:28 Mec: hmm

5:28 the (do ..) works fine, just not the call to time, it makes no sense

5:29 pstickne: code?

5:30 Mec: nvm it seems i was hitting eval-defn which only goes to the most recent defn

5:32 pstickne: :p

5:33 Mec: i'd kill to get clojure working in scite

5:38 pstickne: so, there's this man I know...

6:02 Mec: is he big, harry, and go by the name jim-bob

6:49 hmm i keep running out of heapspace but everything i use is lazy: reduce map filter map iterate

6:50 Cark: you're retaining the head of your sequences

6:50 Mec: i was initially but that was the first thing i fixed

6:53 it was holding at 90meg but i still ran out of heapspace

6:54 lisppaste8: Mec pasted "Euler problem 43" at http://paste.lisp.org/display/77334

7:06 Mec: is there a way to skip to the next values of a for instead of just putting a nil in the list there?

7:18 Holcxjo: mec: I don't see the memory leak, but I also don't see how that code will ever terminate. Won't the iterate give you an infinite sequence?

7:18 Mec: hmm

7:18 you bring up a very good point

7:20 i need a (take (! 10) ..) in there

7:20 Holcxjo: You'll only want all uniq permutations, I guess? i.e. the first N! ones?

7:21 Mec: right

7:21 Holcxjo: Should still not grow the memory unbounded... just not terminate...

7:21 Mec: true enough, im thinking the resultant number got so big it took the whole heap

7:21 Holcxjo: Unless your number in the reduce + grows out of bounds... :-)

7:22 Mec: with an infinite sequence it should eventually

7:22 Holcxjo: Bah -- you're always one second ahead of my typing

7:22 Mec: lol

7:22 gah still heap space crash

7:23 Holcxjo: Strange 10! isn't all that much, or is it?

7:23 Mec: ,(reduce * (range 10 1 -1))

7:23 clojurebot: 3628800

7:23 Mec: even so its not storing that many, just the one at a time

7:25 Holcxjo: BTW: Why this weird converting to string and then picking out the integers again?

7:26 Hmm. Maybe I should read the problem before asking stupid questions...

7:26 Mec: naw

7:26 the permutation produces vectors, i need 3 digits so instead of doing (+ (* 100 digit1) (* 10 digit2) digit3) i substring and turn to int

7:27 probably not the fastest but i just threw that part together

7:28 Holcxjo: Have a look at the 3-ary version or partition

7:28 ,(doc partition)

7:28 clojurebot: "([n coll] [n step coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap."

7:29 Holcxjo: ,(partition 3 1 (range 1 10))

7:29 clojurebot: ((1 2 3) (2 3 4) (3 4 5) (4 5 6) (5 6 7) (6 7 8) (7 8 9))

7:29 Mec: if you have multiple ranges in a for, can you use multiple :when?

7:30 that could be useful

7:30 Holcxjo: I don't understand

7:30 You can use as many :whens as you like, I believe...

7:30 Mec: (for [a somecoll :when (check-a a) b somecoll (check-b b)])

7:30 (for [a somecoll :when (check-a a) b somecoll :when (check-b b)])

7:32 oo you can

7:32 for just gets better and better

7:32 Holcxjo: ,(for [x (range 10) :when (> x 5) :when (= x 8)] x)

7:32 clojurebot: (8)

7:36 Mec: the question is does it update the variables and check the :whens in the right orders

7:41 lisppaste8: Mec pasted "For mess" at http://paste.lisp.org/display/77335

7:42 Mec: tell me that doesnt make your head hurt

7:43 Holcxjo: Not exactly readable, is it? :-)

7:43 Mec: i just hope it does everything in the order i wrote, or it could take a very long time to run

7:43 Holcxjo: You need to make an abstraction for multiplying out three digits -- that'll reduce some clutter

7:44 Mec: too true

7:46 Holcxjo: The different ranges for d4 and d6 are optimisations you derived from the tests they are used in?

7:46 Mec: divisible by 2 and 5

7:46 http://projecteuler.net/index.php?section=problems&id=43

7:46 probably simplest to read the problem description

7:48 wow the first result was almost instantaneous, this mess of For could really work

7:49 Holcxjo: :-)

7:49 Mec: 230ms to run when the other version ran so long it ran out of heap space

7:49 Holcxjo: You could make the duplicity test for numbers even earlier to avoid many false attempts.

7:50 Mec: true

7:50 Holcxjo: i.e. instead of "d5 (range 10)" say "d5 (remove-func (range 10) (list d3 d4))"

7:50 Mec: (doc remove-func)

7:50 clojurebot: excusez-moi

7:51 Holcxjo: I made that up

7:51 Mec: hmm i know theres something

7:51 Holcxjo: I am not good with clojure

7:51 Mec: (doc difference)

7:51 clojurebot: Excuse me?

7:52 Mec: (doc difference)

7:52 clojurebot: Gabh mo leithsc�al?

7:52 Mec: weird

7:52 (doc clojure.set.difference)

7:52 clojurebot: excusez-moi

7:52 Mec: blah

7:52 (doc clojure.set/difference)

7:52 clojurebot: Gabh mo leithsc�al?

7:52 Mec: it exists! its in the API! wtf

7:53 ,(clojure.set/difference #{1 2} #{2 3})

7:53 clojurebot: #{1}

7:53 Mec: hah, only problem is it takes sets

7:53 so there'll be some seq -> set -> seq overhead

7:54 Holcxjo: for takes sets

7:54 ,(for [x (set (range 10))] x)

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

7:54 Mec: ya it converts them to seq in the background

7:55 most of the lib functions call (seq) on everything for shits and giggles

7:55 Holcxjo: ,(doc disj)

7:55 clojurebot: "([set] [set key] [set key & ks]); disj[oin]. Returns a new set of the same (hashed/sorted) type, that does not contain key(s)."

7:56 Mec: (disjoin (set (range 10)) 5 7)

7:56 ,(disjoin (set (range 10)) 5 7)

7:56 clojurebot: java.lang.Exception: Unable to resolve symbol: disjoin in this context

7:56 Mec: ,(disj (set (range 10)) 5 7)

7:56 clojurebot: #{0 1 2 3 4 6 8 9}

7:56 Mec: ill buy that for a dollar

7:57 Holcxjo: dame dos -- as they say in Spanish

7:58 It'll even end up fairly readable...

7:58 Mec: i dunno each one is getting longer and longer

7:59 lol

7:59 from 230ms to 30ms

8:00 lisppaste8: Mec pasted "bigger for mess" at http://paste.lisp.org/display/77336

8:01 Mec: 30ms is the fastest solution i've had on the entire euler problem set

8:11 Holcxjo: Now factor out the (disj some-expression excluded-numbers...) and you'll have a readable solution (after adding some comments about the special cases)

8:38 rhickey: Clojure enters TIOBE index: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

8:51 lisppaste8: Holcxjo annotated #77334 "tidier variant -- still veeeery slow" at http://paste.lisp.org/display/77334#1

8:53 Holcxjo: Mec: my version gives 16695334890 -- after 2 or 3 minutes. :-) Is that at least correct?

8:55 Seems ok -- same as your last "for" code

9:01 AWizzArd: rhickey: oh nice, I was waiting for that. Did you ask them for adding Clojure?

9:01 rhickey: nope

9:07 hjlee: rhickey : i don't know you already knows about that, anyway i found some function/macros that exist in reference doc in clojure home but not in implementation.

9:07 they are frest, rrest, nthrest, rfirst, fnseq and lazy-cons.

9:08 i guess "rest" thing changed to "next" thing :)

9:08 gnuvince: hjlee: the documentation reflects the latest stable release.

9:09 hjlee: ah,, then they are removed since then?

9:15 gnuvince: try fnext, nnext, nthnext, etc.

9:15 lazy-cons was removed completely

9:15 Not sure what fnseq was

9:17 hjlee: thank you! i forgot i'm not using stable version.. ashamed..

9:17 rhickey: http://clojure.org/api updated to reflect svn 1335

9:22 hjlee: wow! instant action, thank you!

9:38 rhickey : can u share the API page generation code?

9:42 lisppaste8: rhickey pasted "wiki doc gen" at http://paste.lisp.org/display/77339

9:43 rhickey: http://code.google.com/p/clojure/downloads/detail?name=clojure_20090320.zip&can=2&q=#makechanges

9:43 erm, http://clojure.googlecode.com/files/clojure_20090320.zip

9:44 new release ^^

9:44 hjlee: thank you, again. :)

9:51 hiredman: :D

10:17 Chouser: rhickey: would you call such a release a "pre-release" or "unstable" or "pre-1.0" or none of these?

10:19 rhickey: Chouser: hmm, do I need to call it something other than 20090320? Do you think it needs a label?

10:20 Cark: pre-unstable-not-quite-1.0-yet ?

10:20 * rhickey is still concerned about pouring concrete by calling something 1.0

10:23 rhickey: It could be a 1.0 beta, i.e. feature complete but possible bugs, or a release candidate. All that presume streams are 1.1

10:23 * danlarkin doesn't understand why people want the 1.0 label so badly

10:23 ambient: stable api

10:23 jhawk28: danlarkin: they want the concrete

10:24 pjstadig: not necessarily a 1.0 label, but a roadmap to the 1.0 label

10:24 danlarkin: but... development will continue, the api will change

10:24 jhawk28: well, a roadmap is the easiest way to get to the goal

10:25 otherwise, there is no definition of what 1.0 would look like

10:25 pjstadig: but maybe you'd know if you want to wait, or if it's not worth waiting and you should workaround

10:27 danlarkin: using software is like buying apple hardware. Yes, they could come out with new models a week after you bought your new computer, but you have to evaluate what you're buying and be happy with that at the moment you're buying it

10:29 pjstadig: i don't know i'm just playing the devil's advocate and making things up

10:30 i guess the thing about (versioned) releases is that people (can?) expect support for that version even while the development progresses on other branches

10:30 for example if I decided to use the 20081217 release and there ended up being a bug in it

10:31 i wouldn't necessarily have to cross the "fully lazy border" just to get the bug fixed

10:31 there would be a 20081217.1 release or something

10:32 Chouser: rhickey: "none of these" is fine with me. I guess I was starting to form a reddit post in my mind. Not sure why, though. *shrug*

10:33 rhickey: Well, I think this conversation is interesting - the expectation of a maintained release in parallel with ongoing work on trunk - who will do that maintenance?

10:33 Chouser: alan cox

10:33 pjstadig: yeah don't get me wrong like i said i'm playing advocate

10:33 i don't think that anyone should come along and make demands where no money has changed hands

10:34 clojure is a gift that we should accept gratefully :)

10:35 jhawk28: its probably an opportunity for a support business

10:35 rhickey: e.g. there was a branch for 20091217, and some fixes could have been copied to it

10:35 20081217

10:36 rsynnott: clojure, now from the future

10:37 Chouser: some people used a pre-lazier version until at least very recently, but I don't know if they were using a release or some other checkout.

10:37 I also don't know if they patched it at all, such as by backporting fixes, or if they just used as-is (as-was?)

10:39 rhickey: right, that's the question - given a branch that represents a release, can't backporting be largely independent, or if the release was called 1.0 would there be an expectation that all bug fixes that don't represent additions would go there as well as trunk?

10:39 pjstadig: i think generally people expect backporting of bug fixes to major branches

10:39 jhawk28: depends on the severity

10:40 Chouser: I do think that would be an expecation, but they doesn't mean they'd assume rhickey was the one doing the backports.

10:40 Cark: hum any bugfixes should come with new versions

10:40 1.0.1

10:40 pjstadig: right a bump in a minor version number

10:40 backports are something that someone could do unofficially for themselves or others without rich having to be involved

10:41 Chouser: but it's certainly more work than not backporting fixes, though less work than people individually backporting fixes to a variety of older versions

10:41 jhawk28: in SVN, one ususally fixes the issue in the release and then merges to the trunk

10:42 Chouser: so are there people not using clojure (or using it less?) because there's not a "stable" version for which they can expect ongoing fixes without breaking changes? If so, are there enough of such people that we'd want to support them?

10:42 pjstadig: good question

10:42 first thing i did was download the release, which was fairly recent at that point

10:43 then promptly realized i had to live on the edge to really get the benefits

10:43 jhawk28: depends on the target market, alpha coders or corporations

10:43 Chouser: pjstadig: I think that's common

10:43 tashafa: is there a clojure-contrib for dates?

10:43 pjstadig: of course then the AOT changes wreaked havoc

10:44 i think rich rolled back the changes or i bumped back to an earlier rev...i don't recall exactly

10:44 tashafa: i'm tired of working with java date objects when i need to use date and time

10:44 Chouser: tashafa: not yet. You might try Joda Time -- apparently it's already built on immutable date, it might not need a clojure wrapper.

10:44 pjstadig: but that's just what I expect when working on the edge with an in development language

10:45 tashafa: Chouser: thanks!

10:45 jhawk28: tashafa: which Date object? sql.Date, util.Date, Calender, GregorianCalendar, etc... ;)

10:45 tashafa: jhawk28: all of em :) it would be nice to have a clojure wrapper around all of them

10:46 or have the clojure wrapper know what you mean

10:46 Chouser: tashafa: there's also Chrono: http://groups.google.com/group/clojure/browse_thread/thread/659503e698ede0b5/9dda25f36f102799

10:47 rhickey: no one's ever submitted a patch for a release branch, so I don't know how that workflow would work (apply patch to branch, merge to trunk), also how does one verify their patch to branch will work with trunk, especially if the merge requires intervention?

10:48 Chouser: seems like it would have to be two separate patches much of the time

10:48 at the very least, each should have been tested.

10:49 jhawk28: releases are expensive, but a whole new group of people come when they are done

10:49 Chouser: perhaps the Issue page would be sufficient for coordination -- different devs even could submit patches for different branches

10:49 rhickey: so, I could work on trunk and anyone that wanted to could pull fixes from my work and submit as patches to release branch

10:50 pjstadig: i think generally merges work better when the code doesn't change radically

10:50 so depending on the amount of change it may not be necessary to make two patches

10:50 but i guess someone submitting a patch could do the leg work

10:50 rhickey: pjstadig: but merges require that I work on something other than trunk

10:50 Chouser: rhickey: I'd think so. Or if someone submitted a patch for a release, someone else might forward-port to trunk, attach that patch to the same issue for you to apply.

10:50 pjstadig: merge with trunk themselves and then submit a second patch for trunk

10:51 hehe

10:51 Chouser: i'm thinking the same thing

10:51 rhickey: I think the 'other people making patches' is easier than the scenario for me personally. I want to work in trunk only

10:51 so I'll fix things that will need to go in release

10:52 pjstadig: rhickey: i don't think that is an unreasonable expectation

10:52 perhaps someone could be a 'captain' of releases

10:52 and manage patching the releases and forward-porting to trunk or something

10:52 danlarkin: yeah, some projects have either a general release manager or a release manager for each supported release

10:54 pjstadig: git!

10:54 rhickey: well, before management comes the work itself, as I said, I've never gotten a patch for a release branch

10:54 pjstadig: yeah i just brought up a theoretical point, i don't know of any particular bugs in 20081217

10:55 rhickey: pjstadig: what about all the fixes that are in 20090320?

10:55 pjstadig: i guess i mean that i don't have any production apps depending on 20081217 that would require a backported bug fix

10:55 danlarkin: well a manager could be in charge of backporting patches

10:56 pjstadig: i have no skin in the game...so to speak

10:56 rhickey: I guess I'm just imagining that 20081217 was called 1.0

10:57 what would have been different? How much work would have been expended keeping it patched, and would anyone care or still track trunk?

10:57 Chouser: generally if a problem was discovered in 20081217, the discoverer was told it was fixed in trunk (or it then became fixed in trunk)

10:58 Cark: i can only tell about me : i download trunk when i feel i'm too far behind, or a bug i meet is fixed there

10:58 Chouser: I suppose at that point the discoverer either moved to trunk or decided it was "too early" to start using Clojure and walked away for a while.

10:59 rhickey: Chouser: right, so in order for that to be different, someone would have to backport fixes, and also do dot releases?

11:00 would people be ok with pulling svn on a release branch?

11:00 to get fixes?

11:00 pjstadig: some might also prefer a download i'd guess

11:01 Chouser: right, I have absloutely no idea. It's easier for distro's to deal with versioned downloads (compared to dated pulls from svn).

11:01 AWizzArd: OT: when I have a java lib (a .jar file) which is under the gpl and I use classes/methods from that lib, do I then have to put my program also under the gpl? Or does it not count as derivative work to just use a lib, without modifying its sources?

11:01 rhickey: I guess the versions need have no more identity than, .1 more than the last one

11:03 danlarkin: so for 20081217 -- you'd backport a fix to the branch, make a new tag (20081217.1) and make a new download (20081217.1.zip or whatever)

11:03 Chouser: danlarkin: maybe not a new version for *every* fix, but otherwise I think that's right.

11:03 Cark: awizzard : your program should be gpl

11:04 pjstadig: perhaps a monthly release of fixes

11:04 20081217.200903

11:04 hehe

11:04 Chouser: gah

11:04 pjstadig: just kidding

11:05 a kind of side point

11:05 in regards to terracotta

11:05 rhickey: So, I think we need some way to embed version numbers in a release, and some volunteers for backporting fixes to release branches and making dot releases - I'd like to stay creative and productive by doing all my work (fix or feature) in trunk, and never having to merge

11:06 pjstadig: with the class replacement that TC does it really requires a specific release

11:06 they recommend for clojure 1.0 you create an integration module named clojure-1.0-[your module's version] or something

11:08 Chouser: pjstadig: so that it's easier to make sure all hosts are running the same version of clojure?

11:08 pjstadig: the class replacement will substitute modified versions of the classes for the original classes

11:09 in order for them to work well with the other non-replaced classes, then you need to target a specific version

11:09 class replacement is only used in cases where you can't or don't want to actually modify the original code base

11:09 so i could substitute TC compatible versions of classes without rhickey having to make TC specific changes to clojure

11:11 Chouser: embeding a version number could be as simple as an ant command-line option the controls output zip (and jar?) file name, and the root binding of a *version* var, right?

11:11 hiredman: Cark: "should be"?

11:13 rhickey: Chouser: we need an ant target for 'release' I think

11:13 Chouser: rhickey: to create a .zip?

11:14 rhickey: yes, I do that by hand now, including prepping svninfo.txt and changes.txt

11:14 Chouser: I bet there's someone on the group just itching to write ant build code.

11:15 pjstadig: hehe

11:15 Cark: hiredman : about version number ?

11:15 pjstadig: i'm allergic to ants

11:15 fireants actually

11:16 Cark: hiredman : oh about the gpl question ... right ... must be !

11:21 jhawk28: question about metadata, why is the metadata always null when I debug into the LispReader and Compiler?

11:22 is there a method that creates the metadata that I am missing?

11:23 Chouser: Do you have an example of where you'd expect metadata that you're not seeing any?

11:23 jhawk28: referring to Symbol.meta

11:23 I am wanting to see where it is in the code

11:25 Issue 17 is the context (counting arity)

11:26 Chouser: The reader usually puts metadata on symbols only when specified directly using #^

11:26 ,(meta (read-string "#^Integer foo"))

11:26 clojurebot: {:tag Integer}

11:26 jhawk28: yes, thats what I am seeing

11:26 Chouser: arity is attached by defn to the Var being defined

11:27 ,(:arglists (meta (var map)))

11:27 clojurebot: ([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])

11:27 cemerick: rhickey_: congrats on the "release". Can't thank you and the rest of the community enough.

11:28 jhawk28: so arity is on the Var not the function?

11:30 Chouser: jhawk28: I don't think there's currently a sane way to get the valid arities of a fn

11:30 and in fact, I'm not sure that the var metadata is particularly trustworthy, since it can be adjusted by the programmer

11:31 ,(:arglists (meta (var defn)))

11:31 clojurebot: ([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?])

11:31 Chouser: those ?-suffix names are meant to indicate to a human reader that its an optional arg.

11:33 jhawk28: the problem that I see with the issue is that *hypothetically* if the metadata was added to handle the arity checking at compile time, it would slow the parsing down

11:34 Chouser: parsing and compiling is not generally considered critical path, I think.

11:34 jhawk28: unless it was a map that could be accessed later which would mean more memory usage

11:34 Chouser: the issue itself implies some amount of extra work being done at compile time.

11:37 jhawk28: based on the where I was looking in teh code, the logic would fit best in the FnExpr.parse

11:40 it does look like it is doing something with arity

11:40 it only is checking for the variadicMethod though

11:41 that is an interesting word: *variadic*

11:41 http://en.wikipedia.org/wiki/Variadic_function

12:43 AWizzArd: Is Stuart Sierra sometimes visiting this channel?

12:45 gnuvince: I think he does

12:45 ~seen stuartsierra

12:45 clojurebot: no, I have not seen stuartsierra

13:04 * walters builds new clojure into fedora

13:17 cgrand: gnuvince: can you post the whole profiling data (like you did here: https://gist.github.com/82136/d9968b44ddf691d3eabe3737ad1bea863f221d11) it will help to interpret the summary data

13:21 gnuvince: cgrand: okay

13:22 Give me a few minutes, runhprof is pretty slow

13:22 cgrand: do you want cpu and heap?

13:22 cgrand: cpu should suffice

13:38 pjstadig: +

13:47 cads: hello

13:47 is anyone here attending the atlanta clojure group this saturday?

14:01 blbrown_lt: cads I might, what time is it? I might go.

14:01 I guess there aren't that many Atlanta people but I am one of them.

14:04 gnuvince: cgrand: http://gist.github.com/82477

14:05 cgrand: the html version looks truncated: http://gist.github.com/raw/82477/7ccf374088d7e2bce9a229071d8a9b7af409d286/gistfile1.txt

14:05 cads: blbrown_lt: http://leafhopper.github.com/clojure.html

14:06 blbrown_lt: did you already get into contact with sari?

14:06 blbrown_lt: yea

14:06 how many do you think will go

14:07 cads: it'll be at 10 am, till noon... the email said around 8 people will show up

14:09 it's close to where I am, so I figure why not

14:12 cgrand: gnuvince: "funny" 1st entry (and it wasn't in your previous profiling... I ignore it for now)

14:13 Raynes: Today is Rich Hickey appreciation day.

14:13 blbrown_lt: woot!!

14:13 gnuvince: Yeah, I'm at work now, and my CPU is being used quite a lot, so that may have something to do with it (plus, I'm using vmware)

14:13 blbrown_lt: rhickey, thanks for the work on clojure.

14:14 cgrand: #2: no clue, #3 looks interesting: null-string

14:14 Raynes: I should post on the group declaring this, the first day of spring, Rich Hickey appreciation day. Everyone would think I was trolling though...

14:14 blbrown_lt: And I am still a strong believer in the evolution and pervasiveness of a technology. I hope more companies and people get involved with Clojure.

14:14 Raynes: I'm going to do it anyway I think.

14:15 gnuvince: cgrand: I could take a break and run a profile while my PC is relatively idle

14:15 see if that changes the data

14:15 cgrand: apart from the 1st entry, both runs look similar

14:16 bitbckt: clojurebot: everyday is Rich Hickey Appreciation Day

14:16 clojurebot: Ok.

14:16 Chouser: clojurebot: what is today?

14:16 clojurebot: everyday is Rich Hickey Appreciation Day

14:17 rhickey: :)

14:17 bitbckt: hehe

14:17 gnuvince: Also, in my real program, null-string is called about 5 or 6 times, so the real guy we should probably be focusing on is read-field-aux

14:18 cmvkk: oh hey, from last night, is this expected behavior:

14:18 ,(list? (cons 'a nil))

14:18 clojurebot: true

14:18 cmvkk: ,(list? (cons 'a (cons 'b nil)))

14:18 clojurebot: false

14:18 hiredman: ,(class (cons 'a (cons 'b nil)))

14:18 clojurebot: clojure.lang.Cons

14:18 hiredman: :/

14:18 cmvkk: apparently those don't implement whatever interface list? tests for.

14:19 hiredman: ~def list?

14:19 cgrand: gnuvince: is null-string intended to always read n bytes and then truncate to the first NUL (when found)?

14:19 gnuvince: cgrand: yes.

14:20 cads: yesterday my girl gave me a most luxurious hickey. rhickey, I don't know if there's a right way to take this, but when I saw it I thought of clojure. Cheers on the work man.

14:20 hiredman: huh

14:21 so clojure.lang.Cons is an IPersistentCollection, but not an IPersistentList

14:21 ,(class (seq (cons 'a (cons 'b nil))))

14:21 clojurebot: clojure.lang.Cons

14:21 bitbckt: well... that's awkward

14:21 Chouser: bitbckt: the Cons class, or cads' comment?

14:22 Cark: ,(class (list 1 2 3))

14:22 clojurebot: clojure.lang.PersistentList

14:22 Cark: hum

14:22 bitbckt: Chouser: Yes.

14:22 hiredman: wait

14:22 Chouser: ,(class (cons 'a (list 1 2 3)))

14:22 clojurebot: clojure.lang.Cons

14:22 Chouser: ,(class (conj (list 1 2 3) 'a))

14:22 clojurebot: clojure.lang.PersistentList

14:22 Chouser: ,(cons 'a (list 1 2 3))

14:22 clojurebot: (a 1 2 3)

14:23 Chouser: ,(conj (list 1 2 3) 'a)

14:23 clojurebot: (a 1 2 3)

14:23 cmvkk: implementation details...

14:23 probably though, the result of a cons should return true for list? though, right?

14:24 Chouser: ,(class (rest (cons 'a (list 1 2 3))))

14:24 clojurebot: clojure.lang.PersistentList

14:24 bitbckt: haha

14:25 Chouser: ,(class (rest (cons 'a (cons 'b (list 1 2 3)))))

14:25 clojurebot: clojure.lang.Cons

14:28 Raynes: I hope everyone doesn't think I'm trolling :\

14:31 Chouser: well, that does seem odd, but looking at the definition of RT.cons(), I wonder if the fix would just be to have the null coll case return Cons( x, null ) instead of a PersistentList.

14:32 Cark: ,(seq? (cons 1 nil))

14:32 clojurebot: true

14:32 Cark: that's all i need to know

14:32 rhickey: Chouser: in order to fix what? not sure I understand what is broken - consing doesn't necessarily create Conses

14:32 the idea is to track count whenever possible

14:33 Cark: ,(doc counted?)

14:33 clojurebot: "([coll]); Returns true if coll implements count in constant time"

14:33 rhickey: creating a persistent list when consing onto nil seeds that

14:33 Cark: (counted? (list 1 2 3))

14:33 ,(counted? (list 1 2 3))

14:33 clojurebot: true

14:33 Cark: ,(counted (cons 'a (list 1 2 3))

14:33 clojurebot: EOF while reading

14:33 rhickey: lists are counted and conses are not

14:33 cmvkk: so the "list?" example is expected behavior after all?

14:34 jhawk28_: raynes: today is go get free Rita's day

14:34 Cark: ,(counted? (cons 'a (list 1 2 3)))

14:34 clojurebot: false

14:34 Cark: ok i see

14:34 Raynes: jhawk28_: Not any more. It's RHAD now.

14:35 Lau_of_DK: Good evening guys

14:35 Cark: since it's all persitent data structures, wouldn't it be possible to have conses be counted as well ?

14:35 Lau_of_DK: lkkkkkkkkkkkkkkkkkkk7lk

14:36 Raynes: Lau_of_DK: Good evening, afternoon here. Happy Rich Hickey Appreciation day. :)

14:36 Cark: each cons can carry the count of it's tail + 1

14:40 Chouser: ,(take 5 (map counted? (iterate #(cons 1 %) nil)))

14:40 clojurebot: (false true false false false)

14:41 Lau_of_DK: Raynes, Oh is that today ?

14:41 ~counted?

14:41 clojurebot: No entiendo

14:41 Chouser: Cark: lazy seqs can't be counted, for example.

14:41 Cark: clojurebot: everyday ?

14:41 clojurebot: everyday is Rich Hickey Appreciation Day

14:41 Lau_of_DK: haha

14:41 Raynes: Lau_of_DK: It is now.

14:42 I suppose everyone will probably think my group post is just me trolling, but I assure you otherwise. :>

14:43 Lau_of_DK: I believe you

14:43 danlarkin: oh gosh, this post is treading the line

14:43 Lau_of_DK: this?

14:43 danlarkin: Raynes'

14:44 Lau_of_DK: just... any one of Raynes?

14:44 hiredman: ~def c.l.Cons

14:44 danlarkin: "March 20th 2009 Rich Hickey Appreciation Day!"

14:44 that post

14:45 Raynes: Aw c'mon. It's a nice post and Rich deserves it :|

14:45 Lau_of_DK: Raynes, I think thats a great post, and you actually succeeded in making a french person tell a joke!

14:45 Raynes: :D

14:45 hiredman: pfft, everyone knows "Rich Hickey Appreciation Day!" is just an ancient pagan fertility rite that the roman catholic church co-opted in order to gain more converts

14:46 Lau_of_DK: clojurebot, how do we handle not-funny jokes?

14:46 :)

14:48 hiredman: clojurebot: whose job is it to be funny?

14:48 clojurebot: that is durka42's job

14:48 Raynes: I thought that was my job.

14:48 durka42: but he's in problem session

14:48 hiredman: clojurebot: whose job is it to smoke test releases?

14:48 clojurebot: that is ffailla's job

14:48 hiredman: clojurebot: whose job is it to tell Raynes what his job is?

14:48 clojurebot: that is qebab's job

14:53 pjstadig: clojurebot: what is my job?

14:53 clojurebot: It's greek to me.

14:53 pjstadig: clojurebot: does everyone have to have a job?

14:53 clojurebot: Huh?

14:54 hiredman: clojurebot: whose job is it to placate pjstadig?

14:54 clojurebot: that is dnolen_'s job

14:54 triddell1: clojurebot: whose job is it to show us what the pattern is to this job thing?

14:54 clojurebot: that is msingh's job

14:55 triddell1: ah, then why didn't he/she speak up? :-)

14:58 Chouser: How can a static method call be unresolved at compile time, but resolvable at run time?

14:58 bitbckt: Magic.

14:58 Chouser: :-/

14:59 Perhaps I should say: can someone give me an example of a static method call that cannot be resolved at compile time, but can be at run time?

15:01 Retonator: i thought that when i would do this

15:01 user> (defn t [n] n 1)

15:01 #'user/t

15:01 user> (t +)

15:01 1

15:01 that + got evaluated by the reader to 0 and that i had to use the quoted form but it isn't, could some one explain this?

15:01 rhickey: user=> (set! *warn-on-reflection* true)

15:01 true

15:01 user=> (def x 4.2)

15:01 #'user/x

15:01 user=> (Math/round x)

15:01 Reflection warning, line: 30 - call to round can't be resolved.

15:01 4

15:02 e.g. args overloaded on type

15:02 AWizzArd: although in principle it could be known

15:03 the user should need to do extra work to allow for assigning something else to x

15:03 in that case she would be shooting in her own leg

15:04 * AWizzArd still hopes that rhickey is at least mildly interested in gradual typing d)

15:04 AWizzArd: :)

15:05 Chouser: rhickey: ah, of course. thanks.

15:06 rhickey: np

15:06 Chouser: Retonator: why would + be evaluated to by the reader to 0?

15:06 Retonator: the reader reads the charater "+" as the symbol '+ Then the compiler resolves it to the Var clojure.core/+

15:07 Retonator: i thought that with my limited knowledge of clojure. i read some article that said that the only way for a function to not evaluate it's arguments it has to be done with a macro

15:08 hiredman: ,(do + 1)

15:08 clojurebot: 1

15:08 Retonator: "While functions always evaluate all their arguments, macros can decide which of their arguments will be evaluated. "

15:09 danlarkin: Retonator: perhaps do you think you're doing: (defn t [n] (n 1))?

15:09 Chouser: Retonator: that's true, but it means that when (t +) is evaluated, the value of the Var clojure.core/+ is fetched (it is the addition function) and that is passed as t's argument n

15:09 ,(class? +)

15:10 clojurebot: false

15:10 Chouser: ,(class +)

15:10 clojurebot: clojure.core$_PLUS___3313

15:10 Retonator: aaa ok, i thought that i evaluated the function it self

15:10 Chouser: ,(fn? +)

15:10 clojurebot: true

15:10 Retonator: but the + symbol evaluates to the function not the function itself

15:11 Chouser: ,(prn '+ + (+))

15:11 clojurebot: + #<core$_PLUS___3313 clojure.core$_PLUS___3313@6e3fe4> 0

15:11 dnolen_: ,[(+) +]

15:11 clojurebot: [0 #<core$_PLUS___3313 clojure.core$_PLUS___3313@6e3fe4>]

15:11 Retonator: aaah okay so the () also evaluates the function inside?

15:12 i still have to get my mind around the reader and the evaluation etc...

15:12 WizardofWestmarc: afternoon all

15:13 Chouser: Retonator: sure, the way to call a function is to put it at the front of a list.

15:13 ,[(+) (+ 1) (+ 1 2) (+ 1 2 3)]

15:13 clojurebot: [0 1 3 6]

15:14 Chouser: ,(let [add +] [(add) (add 1) (add 1 2) add])

15:14 clojurebot: [0 1 3 #<core$_PLUS___3313 clojure.core$_PLUS___3313@6e3fe4>]

15:14 Retonator: (+), so how do i translate this to english: excecute the next function, get the meaning of the symbol plus and this yield a function

15:14 danlarkin: Retonator: the way list evaluation works is that each parameter inside the list is evaluated, right to left, and then all the args (except the first) are passed to the first

15:16 Chouser: left to right

15:16 Retonator: but then why does this still work (t (+))

15:16 danlarkin: really?

15:17 hiredman: Retonator: (+) becomes 0

15:17 dnolen_: Retonator: (+) evaluates to 0, then gets passed to the function t.

15:17 hiredman: so substitutiong into your functio body you get (do 0 1)

15:17 Retonator: but i still get 1

15:17 hiredman: ,(do 0 1)

15:17 clojurebot: 1

15:17 dnolen_: because t returns 1

15:17 hiredman: ,(doc do)

15:17 clojurebot: java.lang.Exception: Unable to resolve var: do in this context

15:17 * hiredman is offended

15:17 danlarkin: I thought (perhaps erroneously) that CL evals right-to-left, so I assumed clojure did too... but there I go assuming again

15:17 hiredman: (doc do)

15:17 clojurebot: excusez-moi

15:18 Lau_of_DK: w00t, I just made my first post to the group I think :)~

15:18 Chouser: ,(let [a (atom 0)] (list (swap! a inc) (swap! a inc)))

15:18 clojurebot: (1 2)

15:18 Raynes: Lau_of_DK: In my post? It should be in my post.

15:18 Yep!

15:18 Lau_of_DK: Yes sir!

15:18 hiredman: danlarkin: if a form is a cons list, how would you walk it right-to-left to eval?

15:19 danlarkin: hiredman: I'm missing the gotcha, why can't you?

15:20 Chouser: you and your "proof", bah!

15:20 Retonator: is a function body wrapped in a do then?

15:20 hiredman: danlarkin: it would be kind of silly because you have to walk the list to the last element, flipping pointers, and then walk backwards evaling

15:20 Retonator: or am i doing that by not haveing it in a ()

15:20 hiredman: Retonator: yes, there is an implicit do

15:22 Retonator: aaa okay that figures, i get it ;). now if i do this

15:22 (defn a [n] (n 1))

15:22 danlarkin: yeah google is telling me that other lisps eval left-to-right too. Don't know how I got that mixed up... I'd thought that for years, jeez

15:22 Retonator: i get what i want if i do (a (+))

15:23 danlarkin: Retonator: you probably want (a +) I think

15:23 Retonator: naah actually not i was learning when the function got evaluated ;)

15:23 hiredman: danlarkin: I have spent the last few days tinkering with my own lisp interpreter, so these things are on the top of my brain

15:26 Retonator: so now i get why anonymous functions are used as arguments to other function with an %, because there is no other way(except macro's), to get in a function un-evaluated

15:27 dnolen_: Retonator: i think you might still be confused.

15:27 Retonator: please help me then ;), i think i get it maybe i explain it the wrong way

15:28 dnolen_: the standard Lisp form is (afunction arg1 arg2 arg3 ...)

15:28 hiredman: function literals, which use % do not have an implicit do

15:28 Chouser: anytime you see % it is inside a #(), and they can always be replaced with (fn [myarg] ...)

15:28 dnolen_: if arg1 is a subform it's contents will be evaluated first

15:28 it's recursive.

15:29 Chouser: I can't believe I just did that. I mean of course, (fn [myarg] (...))

15:29 dnolen_: once all the values are evaluated

15:29 afunction is applied

15:29 hiredman: Chouser: don't worry, it's been logged

15:30 dnolen_: when you write (def a [afn] (afn 1)), you are saying afn is a local variable

15:30 which better be a function when you pass it in.

15:30 sorry (defn a [afn] (afn 1))

15:31 Retonator: yes that is what i get dnolen, i think i am looking for the word currying in another functional language (clean) you could pas a function like (+ 3) and it would get back a function with just one parameter and not get evaluated

15:31 dnolen_: you can use partial to do something like that.

15:31 Retonator: to do the same in clojure i have to pass a anonymous function with a % right?

15:32 Cark: ,(doc partial)

15:32 clojurebot: "([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."

15:32 Chouser: (partial + 3) or #(+ 3 %) or (fn [x] (+ 3 x))

15:32 Retonator: yes thanks chouser

15:33 and dnolen_

15:33 Chouser: not exactly the same, though, because the function returned by partial will take any number of args. The other two forms take exactly 1 arg.

15:33 Cark: there should be the word "curry" in the docstring

15:34 hiredman: partial actually "uncurries"

15:34 oh

15:34 nope

15:34 curry

15:35 danlarkin: hahah we are being so unhelpful I'm sure

15:35 Retonator: yeah i was really thinking about your uncurries statement and was thinking that i had the concept of currying wrong

15:35 Cark: ,(comp chicken partial)

15:35 clojurebot: java.lang.Exception: Unable to resolve symbol: chicken in this context

15:36 Cark: yeah that doesn't sound half as good as ,(comp chicken curry) !

15:36 Retonator: lol

15:36 @danlarking: do you mean beeing unhelpfull to me?

15:37 danlarkin: Retonator: yes

15:38 harpastum: is there a standard clojure (not java) power function?

15:38 i really enjoy clojure's absolute numerical accuracy

15:38 Retonator: nope actually very helpfull

15:38 harpastum: ,(Math/pow 10 301)

15:38 clojurebot: 9.999999999999999E300

15:38 Retonator: i have some functional back ground and i just have to learn the concepts of clojure

15:39 and i am dutch so i am not always correct in my wordings and sometimes i get it write in my mind but not in words ;)

15:39 Chouser: ,(.pow 10M 301)

15:39 clojurebot: 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000M

15:40 gnuvince: That's a lot of zeroes there

15:40 harpastum: haha

15:41 what are the arguments to that function?

15:41 ,(.pow 10 301)

15:41 clojurebot: java.lang.IllegalArgumentException: No matching method found: pow for class java.lang.Integer

15:41 harpastum: because that doesn't work

15:41 durka42: ,(type 10M)

15:41 clojurebot: java.math.BigDecimal

15:41 harpastum: aahh

15:41 Retonator: ,(/ (* 1/3 3) 3)

15:41 clojurebot: 1/3

15:41 Retonator: i like that ;)

15:41 harpastum: me too

15:42 ,(= 10M 10)

15:42 clojurebot: true

15:42 harpastum: ok

15:43 i was reading that as ten million, which had me confused

15:43 because i threw this function together

15:43 (defn power [number exponent] (if (zero? exponent) number (* number (power number (dec exponent)))))

15:43 i couldn't figure out how to not load the stack

15:43 using trampoline

15:43 pjstadig: http://clojure.pjstadig.staxapps.net/

15:44 compojure on stax

15:45 harpastum: what is stax?

15:45 Chouser: harpastum: trampoline requires the caller to use trampoline, and for the called function to know it's being called by trampoline.

15:45 harpastum: www.staxapps.net returns a 404

15:45 pjstadig: stax.com i think

15:46 stax is like google app engine for java

15:46 durka42: stax.net

15:46 pjstadig: or heroku

15:46 Chouser: harpastum: other solutions would include high-order functions or an accumulator

15:46 durka42: heroku is rails?

15:46 pjstadig: ja

15:46 an very easy to use

15:46 Chouser: ,(apply * (repeat 10 2))

15:46 clojurebot: 1024

15:46 pjstadig: stax seems to be just about as easy to me

15:47 walters: hmm, how stax is different from ec2, firing up a fedora instance, and "yum install java-1.6.0-openjdk" ?

15:47 harpastum: chouser: thanks. I'll look into those

15:48 pjstadig: not sure i just started playing with stax

15:48 Chouser: pjstadig: free to get started?

15:48 pjstadig: i think the advantage is they handle the configuration, provisioning, management of the instances

15:48 they also handle the load balancing

15:49 and make sure your database is available clusterwide

15:49 it's in beta and free for now

15:50 you get a command like tool (just like heroku)

15:50 so you deploy with 'stax deploy -u pjstadig -p [password]'

15:50 that's not my actual password, btw

15:54 danlarkin: hunter2

15:57 Retonator: nice binary multiplaction chouser ;)

15:58 pjstadig: http://stax.stadigtech.com/

15:58 works with custom domains too

15:59 harpastum: how long did it take for them to send your invite email?

15:59 pjstadig: i signed up this morning and got an invite by midday

16:00 Chouser: pjstadig: are you using the ring fork of compojure?

16:00 pjstadig: i'm using weavejester's branch

16:01 whichever one that is

16:01 i did have to comment out one line

16:02 65 of compojure.http.servlet

16:02 it tries to put a Ref into the session

16:02 which is not serializable

16:03 Chouser: i used the master branch of weavejester's compojure not the ring branch

16:03 i don't know much about compojure, this is my first look at it

16:03 WizardofWestmarc: that reminds me, need to finish getting Madison Square set up tonight

16:04 got everything except fnparse downloaded and built last night.

16:05 may just roll fnParse into another .jar file to make it cleaner heh

16:05 since it currently doesn't even have an ant build.xml file

16:05 Chouser: pjstadig: ok, I haven't looked at it either, but I've got a cute little web app begging to be rewritten in clojure.

16:07 right now it's so slow. http://movies.n01se.net/

16:08 danlarkin: WizardofWestmarc: fork it on github and issue joshua choi a pull request

16:08 Chouser: perfect for madison!!

16:09 Chouser: well it's currently written using a set of xslt scripts that produce ruby code, so really anything would be better.

16:09 hiredman: woa, slick

16:10 ieure: Chouser, That's pretty badass.

16:11 Chouser: the plot summaries quick working a while ago and I haven't looked into why yet.

16:12 WizardofWestmarc: danlarkin: don't use git directly atm since my primary OS is windows and Git + windows = not great last I knew.

16:12 though I'm probably going to start developing purely in linux vms soon...

16:12 pjstadig: hehe "xslt to produce ruby"

16:12 WizardofWestmarc: and honestly I'll probably just make a single .jar for Madison Square w/all the dependencies

16:13 once I learn how to properly build ant build files ^_^

16:13 well, I'll probably keep like Jetty seperate

16:14 Chouser: pjstadig: yessir. I thought at the time it might be a good way to get at xpath.

16:14 danlarkin: WizardofWestmarc: http://gist.github.com/82552 this is what I use for AOT compiling madison

16:14 pretty gross ATM

16:15 WizardofWestmarc: aot + jar or just aot?

16:15 danlarkin: aot+jar

16:15 WizardofWestmarc: n/m figured it out

16:15 noticed the .jars for most of it

16:16 danlarkin: or if you don't want to AOT it, just running "ant" will build the jar

16:16 WizardofWestmarc: I prefer aot since it improves load time

16:17 danlarkin: slightly

16:17 WizardofWestmarc: hey slightly is better then none

16:22 hiredman: lisppaste8 has the highest count of urls in the channel, shockingly

16:43 brennanc: What kind of concurrency model do I use if I want to have something like a global variable but it be thread specific?

16:43 Chouser: var

16:44 brennanc: I want to keep the request headers in compojure somewhere global but have them independent of the other threads / requests

16:44 Chouser: (def *foo*) to create it, then use (binding [*foo* x] ...) to create a thread-local binding.

16:45 brennanc: thanks

16:58 binding doesn't seem to be working

16:58 (GET "/map2" (binding [hdrs headers] (print-hdrs)))

16:58 (defn print-hdrs [] (str hdrs))

16:58 java.lang.Exception: Unable to resolve symbol: hdrs in this context ...

16:59 Chouser: ah, you've got to (def hdrs) somewhere that print-hdrs can see.

17:01 brennanc: yup, that did the trick

17:09 kotarak: How is the view of rhickey for auditing some of the macros in core? Eg. binding: (defn binding* [the-map thunk] (try (Var/pushThreadBindings the-map) (thunk) (finally (Var/popThreadBindings)))) (defmacro binding [the-vec & body] (let ..... `(binding* (hash-map ~(var-ize the-vec)) (fn [] ~@body))))

17:09 * kotarak finds himself wanting binding* from time to time.

17:14 dnolen: interesting, so the . operator isn't really a function?

17:14 kotarak: . is a special form.

17:14 danlarkin: it's speeeeecial

17:14 hiredman: ,(doc .)

17:14 clojurebot: java.lang.Exception: Unable to resolve var: . in this context

17:14 dnolen: blast it :)

17:15 hiredman: it's the "Java Operator"

17:16 Chouser: dnolen: http://clojure.org/java_interop#toc6

17:17 dnolen: thx all.

17:22 harpastum: so, I have a large number, and i'm interested in addressing each digit separately

17:22 how would i go about doing that?

17:22 cconstantine: Does lazy-seq incur a big speed penalty?

17:22 harpastum: You could divide it by 10 over and over

17:23 harpastum: cconstantine: I thought about that, but it would be more convenient if i could break it up into a vector of each digit or something

17:23 basically reverse str

17:24 cconstantine: harpastum: You could print it to a string and treat the string as a list

17:24 you'd have to convert that character back to a num if you wanted to perform arithmetic on it though

17:24 hiredman: harpastum: how large of a number? what is its type?

17:25 harpastum: this isn't for any specific purpose, i'm just trying to understand how to do this type of operation in clojure

17:25 but the number i was looking at was 10!

17:25 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

17:25 one of the project euler challenges is to sum the digits of the number

17:25 and i could hook together a recursive function to do it

17:26 but i thought there might be a more elegant way

17:26 hiredman: if you have it has a string it very easy to just take each number as a character then using a function to map characters to digits

17:26 pjstadig: ,(into [] (str 12345))

17:26 clojurebot: [\1 \2 \3 \4 \5]

17:27 hiredman: ,(int \0)

17:27 clojurebot: 48

17:27 hiredman: ,(int \1)

17:27 clojurebot: 49

17:27 harpastum: ascii encoding?

17:28 hiredman: ,((comp (partial + -48) int) \0)

17:28 clojurebot: 0

17:28 pjstadig: (.parseInt (str \1))

17:28 hiredman: unicode actually

17:28 pjstadig: ,(.parseInt (str \1))

17:28 clojurebot: java.lang.IllegalArgumentException: No matching field found: parseInt for class java.lang.String

17:28 pjstadig: ,(Integer/parseInt (str \1))

17:28 clojurebot: 1

17:28 hiredman: but that is icky

17:28 building a string

17:28 pjstadig: why?

17:28 hiredman: for no reason

17:28 pjstadig: hehe

17:28 harpastum: can it handle unicode output?

17:29 digash: ,(map #(- (int %) (int \0)) (str 123456789))

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

17:29 pjstadig: eww

17:29 hiredman: harpastum: java, and hence clojure, is all about the unicode

17:29 harpastum: ,(int \u2605)

17:29 clojurebot: 9733

17:29 cconstantine: digash: that is what I was thinking

17:29 hiredman: ,(char 9733)

17:29 clojurebot: \?

17:29 cconstantine: is the '(fn [x] ...)' form frowned apon?

17:30 harpastum: ok

17:30 digash: ,(reduce + (map #(- (int %) (int \0)) (str 123456789)))

17:30 clojurebot: 45

17:30 hiredman: clojurebot: function literals?

17:30 clojurebot: Function literals are cute, but overused

17:30 pjstadig: man now you just gave away the solution

17:30 hiredman: I think you could just use apply

17:30 (aply + ...)

17:30 cconstantine: hehe, this looks an awful lot like a project euler problem :)

17:30 hiredman: apply

17:30 harpastum: digash: thanks a lot, that was exactly what i was looking for

17:30 yeah, it is

17:30 i already had the answer

17:31 cconstantine: harpastum: did you make a prime number generator?

17:31 digash: harpastum: glad to help

17:31 cconstantine: not for htis problem... but for another one

17:31 lifflander: So are there any LALR(1) parser generators for Clojure?

17:31 pjstadig: antlr?

17:31 harpastum: cconstantine: no, i haven't

17:31 but it sounds pretty exciting. I haven't tried lazy sequences yet

17:31 cconstantine: harpastum: I've made one on the seive design.. and it's reallly super slow

17:32 harpastum: i'd imagine it might be

17:32 hiredman: ~Genuine Sieve

17:32 clojurebot: It's greek to me.

17:32 hiredman: clojurebot: Sieve

17:32 clojurebot: Excuse me?

17:32 hiredman: clojurebot: Seive

17:32 clojurebot: Huh?

17:32 hiredman: bah

17:32 lisppaste8: Chouser pasted "num->seq" at http://paste.lisp.org/display/77364

17:33 cconstantine: harpastum: my friends have made them in other languagues (C and somethign else...) and it takes theirs miliseconds to generate what mine takes minutes

17:33 Chouser: cconstantine: ^^^ that's what I did

17:33 lifflander: antlr looks like it is for human language or such?

17:33 cconstantine: Chouser: what does it do?

17:33 lifflander: I'm asking if there is a yacc like tool for Clojure

17:34 Maybe like the haskell tools alex and happy...

17:34 Chouser: (num->seq 1234512341235412341) ==> (1 2 3 4 5 1 2 3 4 1 2 3 5 4 1 2 3 4 1)

17:34 cconstantine: ah, for harpastum's problem

17:34 Chouser: oh, sorry. mis-addressed. :-)

17:35 harpastum: Yeah, i was confused for a second too

17:35 but that's a pretty clear way to do it

17:35 lifflander: I'm from a haskell background but want to write this interpreter in Clojure. I saw the "fnparse" library, but is there a tool that generates the parser, which would be an LALR parser?

17:35 harpastum: cconstantine: did you use a lazy sequence, or are you just calculating to a specific value?

17:36 cconstantine: harpastum: lazy sequence

17:36 ambient: antlr is LL(k)

17:36 lifflander: Is there any LR?

17:36 Chouser: harpastum: note that num->seq has an optional base argument.

17:36 ambient: sure, lex/yacc is LALR

17:36 and many others

17:36 lifflander: for Clojure

17:37 jhawk28__: CUP is LR

17:37 lifflander: Like "happy" for Haskel

17:37 Chouser: (num->seq 234 2) ==> (1 1 1 0 1 0 1 0)

17:37 cconstantine: Chouser: hehe :)

17:38 lifflander: Would cup play nicely with Clojure?

17:38 Chouser: cconstantine: I've got a fast seive around here somewhere too...

17:38 jhawk28__: it generates Java, so maybe

17:39 harpastum: cconstantine: any chance you could post the code, so I could take a look at it?

17:39 cconstantine: Chouser: if you would share that would be awesome

17:39 lifflander: Ok. thanks for the help guys.

17:39 harpastum: maybe I'll be able to see why it's slow

17:39 or, more likely, someone else will

17:40 cconstantine: harpastum: it's really ugly and hard to use right now

17:40 harpastum: will you be on later?

17:41 lisppaste8: Chouser pasted "primes-under (sieve)" at http://paste.lisp.org/display/77365

17:41 harpastum: cconstantine: probably. If not i'll be around.

17:41 way later

17:42 cconstantine: harpastum: ok, it's on it's way

17:43 so Couser's doesn't do an arbitrary number of them?

17:47 http://paste.lisp.org/display/77367

18:30 hjlee: how can I next/previous key of some key value in sorted-map?

18:31 how can I find next/previous key of some key value in sorted-map?

18:32 hiredman: ,(sorted-map :a 1 :b 2 :c 3)

18:32 clojurebot: {:a 1, :b 2, :c 3}

18:33 hiredman: ,,(let [a (sorted-map :a 1 :b 2 :c 3) k (keys a)] k)

18:33 clojurebot: (:a :b :c)

18:33 hiredman: ,,(let [a (sorted-map :a 1 :b 2 :c 3) k (keys a)] (take-while #(not= % :c) k))

18:33 clojurebot: (:a :b)

18:33 hiredman: ,,(let [a (sorted-map :a 1 :b 2 :c 3) k (keys a)] (last (take-while #(not= % :c) k)))

18:33 clojurebot: :b

18:34 hjlee: ah.. but I want it in constant time. (so many keys, so many operations)

18:34 hiredman: pffft

18:34 your are out of your mind

18:35 constant time

18:35 hjlee: sorry. log(n)

18:36 hiredman: you are searching through the keys of a map

18:37 hjlee: sorted-map keys in tree structure, i guess.

18:37 and insert may take log(n).

18:37 and i guess there are way to find prev/next key in log(n).

18:38 (may not be in api anyway)

18:38 hiredman: I would guess your guess is mistaken

18:39 hjlee: why?

18:40 hiredman: ,(class (sorted-map :a 1))

18:40 clojurebot: clojure.lang.PersistentTreeMap

18:40 hiredman: ~def clojure.lang.PersistentTreeMap

18:43 hjlee: yes, PersitenentTreeMap uses red/black tree - one of balanced binary tree.

18:43 (I saw the comment of the source)

18:44 so the first guess is right.

18:44 why not 2nd guess?

18:45 hiredman: let me ask you this, how many keys are between :a and :f?

18:47 hjlee: that's not related to the problem.

18:48 pstickne: hiredman: 42, just in case you still care

18:48 Retonator: maybe stupid but can anyone tell me what a Var is in clojure?

18:49 cmvkk: check this page, for example: http://clojure.org/vars

18:50 pstickne: Retonator: think of a member in Java. Only they can behave nicely in multiple thread contexts.

18:50 hjlee: no counting needed.

18:51 Retonator: ,(var +)

18:51 clojurebot: #'clojure.core/+

18:51 Retonator: but what does that mean then?

18:51 is plus a var pointing to the + function?

18:53 it is the object itself as i read now

18:55 cmvkk: the symbol + refers to a Var which refers to the + function, I believe.

18:58 pstickne: wth, a NPE? :(

18:59 dreish: nil is a null pointer.

19:04 pstickne: I was just expecting a more graceful death :(

19:04 (swap! nil ...) ; no good ^^

19:05 hiredman: ,(swap! nil identity)

19:06 clojurebot: java.lang.NullPointerException

19:06 hiredman: ,@nil

19:06 clojurebot: java.lang.NullPointerException

19:08 pstickne: I've just introduced the first side-effect into my program!

19:08 I feel so dirty! :(

19:08 It's just much easier to not have to keep updating bindings on the escape ...

19:11 cmvkk: I rewrote my program without using anything mutable, and you know what?

19:11 now it's like 10 times slower.

19:11 :/

19:11 pstickne: cmvkk: :p

19:11 I like controlled mutability.

19:11 although this program will be very slow :p

19:11 I am using fnparse

19:12 And since I don't pre-tokenize it..

19:12 :p

19:12 oh, well, it's only for a school project

19:31 Raynes: Well I almost managed to get a person who thinks OOP is the end all and be all of what we do for a living to try Clojure, he saw that Scala had OOP and made a B-Line for the door.

19:32 p_l: Raynes: I think you might need heavier arguments. Just remember to take it easy on nukes

19:33 Raynes: p_l: If I were too have went any heavier I would have scared him away. He just thinks that everything Rich said about OOP is "Opinionated and not true"

19:34 Screw him :\

19:34 He's one of the "How would we SURVIVE WITHOUT OOP. OMG!!1!" kind of people.

19:37 p_l: heh

19:39 Raynes: Do a Google search for "hate Clojure". Only a single result.

19:39 durka42: ~google "hate clojure"

19:39 clojurebot: First, out of 1 results is:

19:39 David R. MacIver � Blog Archive � How do you talk about Scala?

19:39 http://www.drmaciver.com/2009/02/how-do-you-talk-about-scala/

19:39 Raynes: Thats it.

19:39 p_l: Raynes: is that him? :D

19:39 Raynes: Nope.

19:40 At least I managed to get him interested in functional programming. Even if he did choose a language that I know he will abuse to the point where the functional programming part of it doesn't even matter.

19:41 I had to be careful what I said when talking too him, if I said one wrong thing about Java it was oh noes the world imploded.

19:42 hiredman: Chouser and rhickey are neck and neck for the most non-bot pasted urls

19:43 Raynes: Why do people love Java syntax so much?

19:43 * durka42 hates it

19:43 Raynes: Curly braces are the most useless things I have ever seen in my life.

19:43 hiredman: I really have no idea

19:43 Raynes: That's too much useless "Enter-shift-curlybracket" for me.

19:44 pstickne: Raynes: curly braces aren't useless

19:44 {:foo :bar}, for example, is nice :)

19:44 p_l: no, the braces are innocent. It's java that's the criminal :P

19:44 slashus2: IDE's make it more tolerable with automatic generation of abstract methods that you have to fill in.

19:45 Raynes: pstickne: But not to denote code blocks.

19:45 slashus2: IDE's shouldn't have too.

19:45 pstickne: Raynes: I personally like do/end :-)

19:45 Raynes: p_l: C is the criminal.

19:45 Know what I like?

19:45 pstickne: A big bowl of ...

19:45 Raynes: Parentheses and whitespace. That's what I like.

19:46 slashus2: Raynes: I know, but programming java without them is more of a pain.

19:46 Raynes: :D

19:46 slashus2: Programming with Java is a pain anyways. That hurt don't heal. :|

19:47 slashus2: I know someone who uses an editor without syntax highlighting to program in java. masochist

19:47 Raynes: :|

19:48 p_l: Raynes: C was directed at simplicity and for being autogenerated by more advanced tools

19:49 Raynes: It's good language for it's uses

19:49 hiredman: C? auto-generated?

19:49 p_l: hiredman: many of the old-fashioned tools generated C code

19:49 durka42: Cfront

19:49 slashus2: Things like pyrex and ghc can produce C

19:50 durka42: ecl?

19:50 p_l: ECL & Chicken

19:50 GCL too

19:50 Gambit-C

19:50 hiredman: ...

19:50 Chousuke: I don't think C was ever *designed* to be autogenerated...

19:50 p_l: Yacc :D

19:50 Chousuke: :P

19:51 hiredman: I have yet to hear an example that either somehow predated C so C targeted it, or was created at the same time as C and C was just hte output format for it

19:51 p_l: Chousuke: It was designed with syntax that was easily understandable for the time, with assumption that for more complex functionality you'd write a compiler for a better language that used C as portable assembly

19:51 hiredman: yacc & lex

19:52 hiredman: some other tools from V7 era

19:52 Chousuke: hmm.

19:52 Raynes: p_l: No, I mean it's the criminal for staring the whole curly braces trend.

19:52 p_l: Raynes: it was better than begin ... end

19:52 slashus2: algol

19:52 Raynes: Pascal should die.

19:53 p_l: and few other langs AFAIK supported either curly braces or begin ... end

19:53 Raynes: Wirth says the same. Nobody listens to him

19:53 Raynes: From #Scala [18:49] <xocoatl> btw. the first language i mastered was pascal... and then delphi... from that perspective java and scala code was like all { commented out } ;-)

19:54 Irrelevant but still funny.

19:54 Anyways, I'll be back later.

19:54 slashus2: algol 68 had curly braces

19:55 So that predated C a little.

19:57 Raynes: Blame algol 68, not C :-P

19:58 wait

19:58 I think I am incorrect.

19:58 Raynes: I agree.

19:58 :)

19:58 * Raynes will be back later. Gone for real this time.

20:02 p_l: slashus2: what about Algol 60? :)

20:02 It was a big inspiration :)

20:03 also, I dunno, but what about B and BCPL?

20:03 (and CPL)

20:14 cconstantine: Ada still uses begin/end

20:18 I have a set of lists "( ( 1 2 3 ...) (2 4 6 ...) (3 6 9 ...) ) and I want to keep them sorted by the collection's ffirst element. I'll only ever be doing one insert/delete at a time, is there anyway to keep the collection of sequences sorted on insert/delete instead of doing a conj and sorting the entire thing?

20:19 and the delete will always be the first sequence

20:26 Raynes: Oh shit!

20:26 Lambda-the-ultimate is down

20:28 cconstantine: Oh no! what does it do?

21:23 p_l: ccmtaylor: Ada is the weirdo in that group ;-)

21:33 hjlee: hiredman: are you there?

22:32 slashus2: If I was slurping code from a file, what is the best way to turn a string into something that I could use with eval?

22:36 Raynes: http://en.wikipedia.org/wiki/Falcon_(programming_language) Anyone ever used this? I bet it's a mess. Too many paradigms.

22:41 pstickne: Raynes: and Clojure isn't? ;-)

22:41 p_l: Raynes: well, CL feels alright...

22:41 Raynes: No, I don't think you get it. Falcon has an /obscene/ amount of paradigms.

22:41 pstickne: Sometimes I miss when programming languages are restricted to 7-bit ASCII input...

22:42 Raynes: It tries to do everything.

22:42 p_l: Raynes: and CL has (1+ currently-known-paradigms)

22:43 Raynes: Procedural, Object Oriented, Prototype Oriented, Functional, Tabular and Message Oriented.

22:43 "Pick the ingredients you prefer and let the code to follow your inspiration."

22:44 brweber2: hey all, is anyone around familiar with inlining in hotspot?

22:44 Raynes: Oh boy they have an IRC channel

22:44 * Raynes joins

22:44 p_l: Raynes: don't troll too much

22:44 Raynes: There is no one there too troll. :(

22:44 Only seven people.

22:48 I need to properly learn Scala.

22:50 pstickne: Falcon looks ... interesting ...

22:50 Raynes: yes you should ;)

22:51 Raynes: Learning different languages in quick succession normally bothers me, but I doubt it would matter in this case, I couldn't forget Clojure if I tried.

22:51 o_o

22:52 * Raynes strongly needs more OOP experience.

22:53 p_l: Raynes: don't succumb to the Boring Side!

22:53 Raynes: Correction: I need to have more OOP experience so that when I put OOP down, I can do it with facts.

22:54 pstickne: OOP is a silly term.

22:54 I like to argue that Haskell is "OO" because it supports polymorphic behavior of abstract data types :p

22:55 (most people say I'm wrong though)

22:55 (I just think I have a liberal definition of OO :-)

22:55 Raynes: That would spark wildfires in #Haskell

22:55 pstickne: Which is silly...

22:56 And then OOP can be done in languages that aren't "OO"

22:56 (e.g. you can write OOP in C, which is not OO)

22:57 p_l: which can and has been done

22:57 * Raynes searches around for his Scala netbeans plugin

22:57 pstickne: Raynes: oh noo!

22:57 Raynes: my experience with NB+Scala[+Java] = the lose

22:57 Raynes: pstickne: They fixed that in the last release.

22:58 pstickne: whew.

22:58 Raynes: does it still have to filter through the ant-task?

22:58 (the Eclipse builders are so much nicer -- when they work)

22:58 Raynes: I don't guess... It works fine for me.

22:58 pstickne: Raynes: cool :)

22:58 I guess either Eclipse or NB is like Ford or Chevy :)

22:59 Raynes: Programming in Scala is such a lonnnnng boooook.

22:59 pstickne: Raynes: with such a ... interesting unofficial acronym! :p

22:59 p_l: I consider NB to be like a good sericable car

22:59 *servicable

23:00 Raynes: Netbeans is like a car that is about to run out of gas.

23:00 vagif: Hello, any emacs+slime users here ?

23:00 Raynes: Chug Chug vrooooom Chug.

23:00 p_l: Raynes: And despite that it's still going to go for 100 km :P

23:00 pstickne: Raynes: did you put WATER in again?

23:00 Raynes: :p

23:01 pstickne: p_l: until 50 km out of town it spontaneously explodes :(

23:01 p_l: Eclipse on the other hand is like this shiny popular car that guzzles 50l/100km has ton of weirdly named parts, expensive service and dies randomly

23:01 vagif: i'm running emacs+slime and is able to slime-connect to clojure. But when i move cursor to any function name in the source code, i see Evaluation Aborted instead of function definition

23:01 pstickne: p_l: at least it comes with free towing service ;-)

23:02 vagif: is this feature implemented /

23:02 ?

23:02 slashus2: Anyone have any idea how to turn a string into something I could use with eval?

23:02 pstickne: (disclaimer: not guaranteed to actually tow you back to town)

23:02 p_l: pstickne: last time I checked, the towing service put you on a flight to cambodia

23:02 pstickne: packaged as mackarel

23:03 and they wanted to get paid for that

23:03 pstickne: slashus2: I think print-str or similar might do it

23:03 slashus2: err, prn.

23:04 slashus2: pstickne: I am trying to slurp code from a file and evaluate it.

23:04 pstickne: slashus2: then you already have it as a string to eval...?

23:04 slashus2: eval uses code

23:04 a form

23:04 I think I almost have it working. Just namespace problems.

23:05 pstickne: (eval (pr-str "something something"))

23:05 vagif: i'm running emacs+slime and is able to slime-connect to clojure. But when i move cursor to any function name in the source code, i see Evaluation Aborted instead of function definition. Is this feature implemented ?

23:06 slashus2: pstickne: I don't want to print a string and return it.

23:06 * pstickne shrugs

23:06 pstickne: slashus2: that doesn't actually print anything though

23:08 slashus2: using

23:09 (map eval (map (comp symbol slurp str) (filter #(.endsWith (.getName %) ".clj") (file-seq (java.io.File. "plugins/"))))) I am getting class not found on a lot of the things. Even though I have the plugins/ in my classpath and the base src directory in my classpath.

23:36 Raynes: "I have a hard time believing that Clojure could be used *exclusively* to create a serious, full-scale application. Don't get me wrong, Rick, your presentations are great, but I honestly don't think that I have the sheer mental ability required to keep track of a dynamic system of truely enterprise magnitude. That's where Scala comes in..."

23:37 "Rick" You can tell he's /really/ looked into Clojure eh.

23:40 slashus2: Something is lacking in his design if he can't keep track of a dynamic system.

23:40 pstickne: I think that static typing is great.

23:41 (And yes, it is because I have a limited mental capacity.)

23:44 Raynes: I, for some reason can't bring myself to open up this book and read anything about Scala. I guess it will have to wait. I'm so tied up in Clojure that it would take a good Scala beating to loosen the ropes.

23:45 * Raynes continues to watch the battle being waged between his fingers and his PDF viewer.

23:46 Raynes: pstickne: Tell me something awesome about Scala that I don't know.

23:48 pstickne: Raynes: you likely now it. The best thing about Scala is that it /tries/ be a commercially-accepted FP/OO hybrid (some could argue this is the same for F#).

23:48 *know

23:48 Raynes: so it has a number of ... less than ideal designs in it, many to work with Java and/or "fit Java programmers"

23:49 * Raynes wraps himself up and parentheses and crawls under his chair in the fetal position.

23:49 pstickne: Raynes: well, let me put it this way ... if you have a choice between Java and Scala ... ;-)

23:50 Raynes: I thought using it from Java was hell? Last time I checked the data structures were incompatible with Java.

23:50 pstickne: Raynes: they mostly are, but there are wrappers (and support is getting better). I avoid this by only using Java in Scala and not the other way around.

23:50 (e.g. how do you call Vector.+ in Java?)

23:51 Raynes: :o

23:51 * Raynes will think about it very carefully while reading the last chapter of Programming Clojure.

23:52 pstickne: Raynes: the thing I mist most coming to clojure is lack of static types (that are inferred)

23:52 (Granted, inference isn't great in Scala, but I'm also coming a project in SML ... yet to try Haskell)

23:52 *miss

23:52 Raynes: pstickne: Scala intrigues me.

23:53 slashus2: pstickne: Type hints don't do it for you?

23:53 pstickne: slashus2: I don't even know what those are :-)

23:53 Raynes: But Clojure has mah heart.

23:53 pstickne: (defn whatever [#^String x] (println x))

23:53 pstickne: It's an interesting language.

23:54 (whatever 10) :-/

23:54 slashus2: pstickne: You can give type hints while initializing a function to speed up things a little, or make sure you are accepting the right types.

23:55 pstickne: That works because println takes integers as well as strings

23:55 pstickne: (defn whatever [#^String x] (println (inc x))) (whatever "x") ;-(

23:56 slashus2: It doesn't check at compile time :-)

23:56 pstickne: that's the part I miss :p

23:56 Raynes: Runtime errors <3

23:57 p_l: hmmm.... is there java for MVS? It might be interesting to run clojure apps read from EBCDIC card images... :P

Logging service provided by n01se.net