#clojure logs

2009-03-20

00:06cmvkkwanted to test something on the repl only to discover i'm still running that reduce operation...
00:06cmvkki feel like i have too much invested to stop it now...
00:06Rayneso.o
00:08Victorr_is it ok to assume (if test 'foo) will return nil if test is false?
00:08hiredmanA) yes B) use when
00:09Victorr_oh right, thanks
00:09Victorr_BTW, I find it odd that there is a when-not instead of unless
00:13hiredmanI find it odd that you would use either of those
00:13hiredman,(doc compliment)
00:13clojurebotjava.lang.Exception: Unable to resolve var: compliment in this context
00:13hiredmanbah
00:13Victorr_do you mean complement?
00:13hiredmanyeah
00:13cmvkkheh
00:13Victorr_,(doc complement)
00:13clojurebot"([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."
00:13hiredmananyway, just negate the predicate
00:13Victorr_I fail to see how complement would be better
00:14cmvkkit's easier to just use not.
00:14hiredmanor use or
00:14hiredman,(or :foo (println :bar))
00:14clojurebot:foo
00:14hiredman,(or nil (println :bar))
00:14clojurebot:bar
00:16Victorr_I think (unless test expr1 expr2) is better than (and test (do expr1 expr2)), don't you think so?
00:16Victorr_make that when-not
00:16hiredmanand would not work there
00:17hiredman~def when-not
00:22Mecwhy wouldnt and work there?
00:23Victorr_I think he means when-not will return nil if the condition is true, but and won't
00:25Meccmvkk: is it still running that reduce? and how long has it been?
00:26Mec,(if nil :true:)
00:26clojurebotInvalid token: :true:
00:26Mec,(if nil :true)
00:26clojurebotnil
00:26cmvkka long time....
00:26Meccrap, ill need to find a new algorithm then
00:27cmvkkit's still chugging away at it though, it's being a real trooper. It's reducing it out till the bitter end.
00:27Meclol
00:27hiredmanit's a big number, and there are a lot of numbers greater then zero and less then it
00:27Mecthe problem is i need to filter the (range 1000000000000) first and then add them all together, i think that would take a lot longer
00:28hiredmandepends on your filter
00:29hiredmanyou 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
00:32hjlee,(doc frest)
00:32clojurebotjava.lang.Exception: Unable to resolve var: frest in this context
00:32hjlee,(doc rest)
00:32clojurebot"([coll]); Returns a possibly empty seq of the items after the first. Calls seq on its argument."
00:32hiredman,`fnext
00:32clojurebotclojure.core/fnext
00:34hjleeI guess, I found documented, but not implemented functions/macros.
00:34hiredmanuh
00:34hiredmanoh
00:34hiredmanclojurebot: api?
00:34hjleethey are frest, rrest, nthrest, rfirst, fnseq and lazy-cons
00:34clojurebotapi examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
00:34hiredmanclojurebot: api is <reply>the website api refers to last release
00:34hiredmanpffft
00:36Rayneshttp://www.ociweb.com/mark/clojure/audio/AnistonClosure1.mp3
00:36hiredmanclojurebot: api is <reply>the website api refers to last release
00:36clojurebotIk begrijp
00:36Mecsorry, had to answer a call of the wildebeest... hiredman: what does pmap do?
00:36hiredman,(doc pmap)
00:36clojurebot"([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."
00:37Meci only have 1 core :(
00:37hiredman:( indeed
00:37Mecthats why i wanted to hook up all of the comps in my house, then i'd have 10 cores
00:38RaynesI only have a half a core :(
00:39Meclol
00:39RaynesI ate the other half, cuz hungry. :)
00:39Mechmm i suppose most of the numbers in the range will be dismissed so maybe it wont take too long
00:41hiredmanwhat kind of numbers are you looking for?
00:42Mecso called semidivisible, but i dont think that's an actual term, http://projecteuler.net/index.php?section=problems&amp;id=234
00:45hiredman999966663333 is a very interesting looking number
00:46Mecits just because of it's squareroot
01:12Mecanyone know of a keysequence for emacs that will automatically close all open parenthesis/brackets
01:15durka42that depends
01:15durka42do you use paredit
01:16Meccouldnt say, whatever clojurebox uses
01:16durka42huh i thought paredit had a key like that, but i can't find it
01:18Meci'd prefer another editor but i dont know of any, i hate the bindings emacs uses
01:19durka42you should use vim :)
01:19Mecis it "possible" to install on windows and work with clojure?
01:20durka42i'm not sure if vimclojure has problems with windows
01:20RaynesYou should use Enclojure and proceed to flip Lau_Of_DK off.
01:21durka42how do you remove a plugin that causes a crash on startup
01:21Raynesdurka42: in the .netbeans folder.
01:21RaynesYou can search through it and find it and nuke it.
01:21durka42will do
01:21RaynesI had to do that with Enclojure. I still don't think it uninstalls right. Oh well, it doesn't screw up anymoar :D
01:22durka42yeah, the crasher in question is some old version of enclojure
01:22Meci tried enclojure, it was waaaaaaay too much for just a simple editor
01:22RaynesYeah, the old version didn't like my windows.
01:22RaynesMec: The Java stuff is inevitable for any language, even minor features require it.
01:23RaynesIt's going to improve of course.
01:23RaynesBut 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.
01:23Mecwell netbeans wanted like 150meg and it wouldnt even work right, the window wouldnt tie into the repl
01:24RaynesSay what? O_o
01:24RaynesI installed the PHP version and had like 11 megs of dependencies to download.
01:24Mecit was crazy im telling you
01:24RaynesIf you tried this recently, chances are Enclojure is fixed by now.
01:25Mecits not enclojure itself, its netbeans
01:25RaynesDarn, I need to finish this chapter so I'll be a l33t Clojure c0dur.
01:25Mecchapter of what
01:25RaynesMultimethods chapter of Programming Clojure
01:26RaynesLast important chapter.
01:27RaynesI still can't believe I signed up for prag with the wrong name... My middle name doesn't start with an E. :|
01:27Mecnetbook of physical book?
01:27RaynesPDF, the book isn't out yet.
01:28durka42Raynes: is .netbeans/modules/clojure-asm.jar the only thing i need to nuke?
01:28RaynesIt should be something like org.enclojure.<insertbullsh*there>
01:29RaynesUnless they named it something different back when you used it.
01:29Rayness/used/installed/
01:29durka42oh, there are five org-enclojure-*.jar
01:29durka42what's clojure-asm.jar then
01:29RaynesDunno, delete them all, you don't need anything that has clojure in it's name.
01:29durka42yeah, it was created at the same time as the others
01:30RaynesMec: Do you have a copy? No Clojure programmer is complete without it :|
01:30Mecjust heard about it
01:31RaynesI wish Ebooks were like dead tree books. You can let people borrow your dead tree books and it isn't copyright infringement :|
01:32cmvkkmany would like to claim otherwise!
01:37Meccan someone double check my logic here: 10! is (reduce * (range 1 11)) and 10!/7! is (educe * (range 8 11))
01:37durka42why 11...
01:37Mecrange isn't top inclusive
01:37durka42oh
01:37durka42i think that makes sense then
01:41Mecseems weird that you cant really simplify it mathematically but the programming construct is simple
01:43Mecam i getting slaphappy or does my function name !d! sound funny
01:50slashus2I 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.
01:51psticknemaybe there is not engine by that name?
01:51slashus2It works outside of the sandbox
01:52psticknemaybe there is no engine by that name in the sandbox?
01:52slashus2...
01:52slashus2I don't know for sure.
01:52psticknecheck the return of getEngineByName?
01:53hiredmangetEngineByName may try to load some sort of external resource
01:53slashus2nil :-(
01:53RaynesSIDE EFFECTS!
01:53slashus2hiredman: I think that is the case.
01:54Mecwe dont need to stinkin side effects
01:54slashus2I will try to do it outside of the sandbox.
01:54slashus2... the sandbox takes a string
01:55slashus2function that is
01:55slashus2eval-in-box
01:55hiredmanit's really read and eval in a box
01:57hiredman~sandbox
01:57clojurebotsandbox is http://calumleslie.blogspot.com/2008/06/simple-jvm-sandboxing.html
02:08slashus2creating the interpreter outside of the sandbox worked.
02:32cmvkkIf I have a macro 'foo', and its expansion contains a call to a macro 'bar', then bar should be expanded too right?
02:33cmvkkmy current code doesn't seem to work that way and I can't figure out what I'm doing wrong.
02:39cmvkkerk, nevermind.
03:41Mecif foo expands as a call to bar and bar expands as a call to foo, does the world implode?
03:42Carkgood morning
03:59Mecsleep is for the weak
04:00RaynesMec: Sleep is for the bored people who want to be competent tomorrow.
04:00Meccompetence is for the weak
04:01Mecbut ill agree with the bored part
04:01Mecnight night
04:03Meci dunno why but i keep thinking concat is append
04:22Mecsince sort takes a function that implements Comparator, how would i make my own?
04:24hjleeMec: check sort-by
04:25Mecah hah, thanks
04:26Mecit says the same thing, must implement Comparator
04:31RaynesMec: Why are you implementing everything yourself?
04:31Mecso much for sleep :D im not i just have a list of vectors and i need to sort it by comparing the 2nd element
04:33hjlee,(sort-by second '([7 2 3] [3 1 2] [4 5 6] [2 3 4]))
04:33clojurebot([3 1 2] [7 2 3] [2 3 4] [4 5 6])
04:33Mecah hah so thats how that works
04:35Mechmm didnt work right
04:36Mec,(sort-by second '([1 "1"] [2 "12"] [3 "241"]))
04:36clojurebot([1 "1"] [2 "12"] [3 "241"])
04:36Mec,(sort-by second '([1 "12"] [2 "1"] [3 "241"]))
04:36clojurebot([2 "1"] [1 "12"] [3 "241"])
04:37Mecah well doesnt matter either way
04:46cmvkkthis 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.
04:46cmvkkthere's too many different types of things...
04:48Mec(doc coll?)
04:48clojurebotReturns true if x implements IPersistentCollection; arglists ([x])
04:49cmvkkno good. it returns true for vectors too.
04:49cmvkk,(coll? [1 2 3])
04:49clojurebottrue
04:49cmvkkand list? is no good, because it returns false for conses.
04:49cmvkk,(cons 'a nil)
04:49clojurebot(a)
04:49cmvkk,(list? (cons 'a nil))
04:49clojurebottrue
04:49Mechow is that not a list
04:49cmvkkwhoa whoa, hold on
04:49Mecfail
04:50cmvkkweird...
04:50Mecseems like a cons doesnt actually exist
04:50cmvkk,(list? (cons 'a (cons 'b nil)))
04:50clojurebotfalse
04:50Mec,(cons 'a 'b)
04:50clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol
04:50cmvkk,(class (cons 'a nil))
04:50clojurebotclojure.lang.PersistentList
04:50cmvkk,(class (cons 'a (cons 'b nil)))
04:50clojurebotclojure.lang.Cons
04:50Mecthat makes no sense
04:51cmvkkit's an implementation defect, it has to do with the fact that cons operates differently for different inputs.
04:51cmvkkconsing onto a cons works differently than consing onto nil.
04:52Mecsince you cant cons onto something that isn't nil initially, it should always just be a list
04:52cmvkkwell, consing onto a list is different than consing onto nil, i mean.
04:52Mec,(class (cons 'a '(1 2)))
04:52clojurebotclojure.lang.Cons
04:53Meci dont see why, it's a list in both cases
04:53cmvkkwell it should be considered a list in my opinion (at least as far as list? goes)
04:53cmvkkbut internally it's a different structure.
04:53Mecweird
04:53Mec,(first (cons 'a (cons 'b nil))))
04:53clojurebota
04:53cmvkklists can be made up of all sorts of things...there's a bunch of different types of sequences and stuff
04:53Mec,(rest (cons 'a (cons 'b nil))))
04:53clojurebot(b)
04:54cmvkk,(class (seq [1 2 3]))
04:54clojurebotclojure.lang.APersistentVector$Seq
04:54cmvkk,(class (seq "hello"))
04:54clojurebotclojure.lang.StringSeq
04:54cmvkketc
04:54Mec#(or (cons? %) (list? %))
04:54Mecproblem solved :D
04:55cmvkkwell cons? doesn't exist, but other than that, yeah, you're right.
04:55Mecbah you cant be serious
04:55cmvkk(or (list? body) (instance? clojure.lang.Cons body))
04:55cmvkkis what i'm using
04:55Mecdoes cons onto a list return a list or cons
04:56cmvkkreturns a cons.
04:56Mecone 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
04:56cmvkkit's a bug.
04:56cmvkklist? should return true for conses.
04:57psticknebreaks it from being a list? :(
04:57pstickneoh, odd
04:57cmvkkthat's the only real difference; seq still works on them of course.
04:58Mecyou could just call seq on it and not worry if its a list or cons
04:58Mecthats what a lot of the library does
04:58psticknebut really, cons and conj are different, no?
04:58cmvkkin this case, though, what i'm trying to do is distinguish 'lists' from vectors.
04:58pstickne(cons head rest)
04:58Mecconj is the general for all of the different sequences
04:59pstickne(conj 1 [2]) ; oops
04:59pstickne(cons 1 [2]) ; \o/
05:00psticknecmvkk: why not seq?
05:01cmvkkbecause it includes vectors.
05:01cmvkkactually...
05:01psticknebut there is vector?
05:02cmvkkno, you're right, seq? apparently does what I want.
05:02pstickneyay
05:02cmvkkthanks.
05:03pstickneohh, odd, Clojure is really confusing :p
05:06Mecseq? works for cons?
05:06Mec,(seq? (cons 'a (cons 'b nil)))
05:06clojurebottrue
05:06Mechuh well then
05:20Mecwhy does putting time around defns give me unmatched delmieter exceptions?
05:21psticknehuh?
05:22Meci have 2 defns and 1 exp, putting (time (do )) around them throws an unmatched delimiter exception
05:26pstickne"works here"
05:27Mecbah if i highlight the 3 and run region it works fine
05:28pstickneso then maybe it's something else outside...
05:28Mechmm
05:28Mecthe (do ..) works fine, just not the call to time, it makes no sense
05:29psticknecode?
05:30Mecnvm it seems i was hitting eval-defn which only goes to the most recent defn
05:32pstickne:p
05:33Meci'd kill to get clojure working in scite
05:38pstickneso, there's this man I know...
06:02Mecis he big, harry, and go by the name jim-bob
06:49Mechmm i keep running out of heapspace but everything i use is lazy: reduce map filter map iterate
06:50Carkyou're retaining the head of your sequences
06:50Meci was initially but that was the first thing i fixed
06:53Mecit was holding at 90meg but i still ran out of heapspace
06:54lisppaste8Mec pasted "Euler problem 43" at http://paste.lisp.org/display/77334
07:06Mecis there a way to skip to the next values of a for instead of just putting a nil in the list there?
07:18Holcxjomec: 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?
07:18Mechmm
07:18Mecyou bring up a very good point
07:20Meci need a (take (! 10) ..) in there
07:20HolcxjoYou'll only want all uniq permutations, I guess? i.e. the first N! ones?
07:21Mecright
07:21HolcxjoShould still not grow the memory unbounded... just not terminate...
07:21Mectrue enough, im thinking the resultant number got so big it took the whole heap
07:21HolcxjoUnless your number in the reduce + grows out of bounds... :-)
07:22Mecwith an infinite sequence it should eventually
07:22HolcxjoBah -- you're always one second ahead of my typing
07:22Meclol
07:22Mecgah still heap space crash
07:23HolcxjoStrange 10! isn't all that much, or is it?
07:23Mec,(reduce * (range 10 1 -1))
07:23clojurebot3628800
07:23Meceven so its not storing that many, just the one at a time
07:25HolcxjoBTW: Why this weird converting to string and then picking out the integers again?
07:26HolcxjoHmm. Maybe I should read the problem before asking stupid questions...
07:26Mecnaw
07:26Mecthe permutation produces vectors, i need 3 digits so instead of doing (+ (* 100 digit1) (* 10 digit2) digit3) i substring and turn to int
07:27Mecprobably not the fastest but i just threw that part together
07:28HolcxjoHave a look at the 3-ary version or partition
07:28Holcxjo,(doc partition)
07:28clojurebot"([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."
07:29Holcxjo,(partition 3 1 (range 1 10))
07:29clojurebot((1 2 3) (2 3 4) (3 4 5) (4 5 6) (5 6 7) (6 7 8) (7 8 9))
07:29Mecif you have multiple ranges in a for, can you use multiple :when?
07:30Mecthat could be useful
07:30HolcxjoI don't understand
07:30HolcxjoYou can use as many :whens as you like, I believe...
07:30Mec(for [a somecoll :when (check-a a) b somecoll (check-b b)])
07:30Mec(for [a somecoll :when (check-a a) b somecoll :when (check-b b)])
07:32Mecoo you can
07:32Mecfor just gets better and better
07:32Holcxjo,(for [x (range 10) :when (> x 5) :when (= x 8)] x)
07:32clojurebot(8)
07:36Mecthe question is does it update the variables and check the :whens in the right orders
07:41lisppaste8Mec pasted "For mess" at http://paste.lisp.org/display/77335
07:42Mectell me that doesnt make your head hurt
07:43HolcxjoNot exactly readable, is it? :-)
07:43Meci just hope it does everything in the order i wrote, or it could take a very long time to run
07:43HolcxjoYou need to make an abstraction for multiplying out three digits -- that'll reduce some clutter
07:44Mectoo true
07:46HolcxjoThe different ranges for d4 and d6 are optimisations you derived from the tests they are used in?
07:46Mecdivisible by 2 and 5
07:46Mechttp://projecteuler.net/index.php?section=problems&amp;id=43
07:46Mecprobably simplest to read the problem description
07:48Mecwow the first result was almost instantaneous, this mess of For could really work
07:49Holcxjo:-)
07:49Mec230ms to run when the other version ran so long it ran out of heap space
07:49HolcxjoYou could make the duplicity test for numbers even earlier to avoid many false attempts.
07:50Mectrue
07:50Holcxjoi.e. instead of "d5 (range 10)" say "d5 (remove-func (range 10) (list d3 d4))"
07:50Mec(doc remove-func)
07:50clojurebotexcusez-moi
07:51HolcxjoI made that up
07:51Mechmm i know theres something
07:51HolcxjoI am not good with clojure
07:51Mec(doc difference)
07:51clojurebotExcuse me?
07:52Mec(doc difference)
07:52clojurebotGabh mo leithsc�al?
07:52Mecweird
07:52Mec(doc clojure.set.difference)
07:52clojurebotexcusez-moi
07:52Mecblah
07:52Mec(doc clojure.set/difference)
07:52clojurebotGabh mo leithsc�al?
07:52Mecit exists! its in the API! wtf
07:53Mec,(clojure.set/difference #{1 2} #{2 3})
07:53clojurebot#{1}
07:53Mechah, only problem is it takes sets
07:53Mecso there'll be some seq -> set -> seq overhead
07:54Holcxjofor takes sets
07:54Holcxjo,(for [x (set (range 10))] x)
07:54clojurebot(0 1 2 3 4 5 6 7 8 9)
07:54Mecya it converts them to seq in the background
07:55Mecmost of the lib functions call (seq) on everything for shits and giggles
07:55Holcxjo,(doc disj)
07:55clojurebot"([set] [set key] [set key & ks]); disj[oin]. Returns a new set of the same (hashed/sorted) type, that does not contain key(s)."
07:56Mec(disjoin (set (range 10)) 5 7)
07:56Mec,(disjoin (set (range 10)) 5 7)
07:56clojurebotjava.lang.Exception: Unable to resolve symbol: disjoin in this context
07:56Mec,(disj (set (range 10)) 5 7)
07:56clojurebot#{0 1 2 3 4 6 8 9}
07:56Mecill buy that for a dollar
07:57Holcxjodame dos -- as they say in Spanish
07:58HolcxjoIt'll even end up fairly readable...
07:58Meci dunno each one is getting longer and longer
07:59Meclol
07:59Mecfrom 230ms to 30ms
08:00lisppaste8Mec pasted "bigger for mess" at http://paste.lisp.org/display/77336
08:01Mec30ms is the fastest solution i've had on the entire euler problem set
08:11HolcxjoNow factor out the (disj some-expression excluded-numbers...) and you'll have a readable solution (after adding some comments about the special cases)
08:38rhickeyClojure enters TIOBE index: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
08:51lisppaste8Holcxjo annotated #77334 "tidier variant -- still veeeery slow" at http://paste.lisp.org/display/77334#1
08:53HolcxjoMec: my version gives 16695334890 -- after 2 or 3 minutes. :-) Is that at least correct?
08:55HolcxjoSeems ok -- same as your last "for" code
09:01AWizzArdrhickey: oh nice, I was waiting for that. Did you ask them for adding Clojure?
09:01rhickeynope
09:07hjleerhickey : 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.
09:07hjleethey are frest, rrest, nthrest, rfirst, fnseq and lazy-cons.
09:08hjleei guess "rest" thing changed to "next" thing :)
09:08gnuvincehjlee: the documentation reflects the latest stable release.
09:09hjleeah,, then they are removed since then?
09:15gnuvincetry fnext, nnext, nthnext, etc.
09:15gnuvincelazy-cons was removed completely
09:15gnuvinceNot sure what fnseq was
09:17hjleethank you! i forgot i'm not using stable version.. ashamed..
09:17rhickeyhttp://clojure.org/api updated to reflect svn 1335
09:22hjleewow! instant action, thank you!
09:38hjleerhickey : can u share the API page generation code?
09:42lisppaste8rhickey pasted "wiki doc gen" at http://paste.lisp.org/display/77339
09:43rhickeyhttp://code.google.com/p/clojure/downloads/detail?name=clojure_20090320.zip&amp;can=2&amp;q=#makechanges
09:43rhickeyerm, http://clojure.googlecode.com/files/clojure_20090320.zip
09:44rhickeynew release ^^
09:44hjleethank you, again. :)
09:51hiredman:D
10:17Chouserrhickey: would you call such a release a "pre-release" or "unstable" or "pre-1.0" or none of these?
10:19rhickeyChouser: hmm, do I need to call it something other than 20090320? Do you think it needs a label?
10:20Carkpre-unstable-not-quite-1.0-yet ?
10:23rhickeyIt 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:23ambientstable api
10:23jhawk28danlarkin: they want the concrete
10:24pjstadignot necessarily a 1.0 label, but a roadmap to the 1.0 label
10:24danlarkinbut... development will continue, the api will change
10:24jhawk28well, a roadmap is the easiest way to get to the goal
10:25jhawk28otherwise, there is no definition of what 1.0 would look like
10:25pjstadigbut maybe you'd know if you want to wait, or if it's not worth waiting and you should workaround
10:27danlarkinusing 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:29pjstadigi don't know i'm just playing the devil's advocate and making things up
10:30pjstadigi guess the thing about (versioned) releases is that people (can?) expect support for that version even while the development progresses on other branches
10:30pjstadigfor example if I decided to use the 20081217 release and there ended up being a bug in it
10:31pjstadigi wouldn't necessarily have to cross the "fully lazy border" just to get the bug fixed
10:31pjstadigthere would be a 20081217.1 release or something
10:32Chouserrhickey: "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:33rhickeyWell, 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:33Chouseralan cox
10:33pjstadigyeah don't get me wrong like i said i'm playing advocate
10:33pjstadigi don't think that anyone should come along and make demands where no money has changed hands
10:34pjstadigclojure is a gift that we should accept gratefully :)
10:35jhawk28its probably an opportunity for a support business
10:35rhickeye.g. there was a branch for 20091217, and some fixes could have been copied to it
10:35rhickey20081217
10:36rsynnottclojure, now from the future
10:37Chousersome 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:37ChouserI 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:39rhickeyright, 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:39pjstadigi think generally people expect backporting of bug fixes to major branches
10:39jhawk28depends on the severity
10:40ChouserI do think that would be an expecation, but they doesn't mean they'd assume rhickey was the one doing the backports.
10:40Carkhum any bugfixes should come with new versions
10:40Cark1.0.1
10:40pjstadigright a bump in a minor version number
10:40pjstadigbackports are something that someone could do unofficially for themselves or others without rich having to be involved
10:41Chouserbut it's certainly more work than not backporting fixes, though less work than people individually backporting fixes to a variety of older versions
10:41jhawk28in SVN, one ususally fixes the issue in the release and then merges to the trunk
10:42Chouserso 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:42pjstadiggood question
10:42pjstadigfirst thing i did was download the release, which was fairly recent at that point
10:43pjstadigthen promptly realized i had to live on the edge to really get the benefits
10:43jhawk28depends on the target market, alpha coders or corporations
10:43Chouserpjstadig: I think that's common
10:43tashafais there a clojure-contrib for dates?
10:43pjstadigof course then the AOT changes wreaked havoc
10:44pjstadigi think rich rolled back the changes or i bumped back to an earlier rev...i don't recall exactly
10:44tashafai'm tired of working with java date objects when i need to use date and time
10:44Chousertashafa: not yet. You might try Joda Time -- apparently it's already built on immutable date, it might not need a clojure wrapper.
10:44pjstadigbut that's just what I expect when working on the edge with an in development language
10:45tashafaChouser: thanks!
10:45jhawk28tashafa: which Date object? sql.Date, util.Date, Calender, GregorianCalendar, etc... ;)
10:45tashafajhawk28: all of em :) it would be nice to have a clojure wrapper around all of them
10:46tashafaor have the clojure wrapper know what you mean
10:46Chousertashafa: there's also Chrono: http://groups.google.com/group/clojure/browse_thread/thread/659503e698ede0b5/9dda25f36f102799
10:47rhickeyno 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:48Chouserseems like it would have to be two separate patches much of the time
10:48Chouserat the very least, each should have been tested.
10:49jhawk28releases are expensive, but a whole new group of people come when they are done
10:49Chouserperhaps the Issue page would be sufficient for coordination -- different devs even could submit patches for different branches
10:49rhickeyso, I could work on trunk and anyone that wanted to could pull fixes from my work and submit as patches to release branch
10:50pjstadigi think generally merges work better when the code doesn't change radically
10:50pjstadigso depending on the amount of change it may not be necessary to make two patches
10:50pjstadigbut i guess someone submitting a patch could do the leg work
10:50rhickeypjstadig: but merges require that I work on something other than trunk
10:50Chouserrhickey: 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:50pjstadigmerge with trunk themselves and then submit a second patch for trunk
10:51pjstadighehe
10:51pjstadigChouser: i'm thinking the same thing
10:51rhickeyI think the 'other people making patches' is easier than the scenario for me personally. I want to work in trunk only
10:51rhickeyso I'll fix things that will need to go in release
10:52pjstadigrhickey: i don't think that is an unreasonable expectation
10:52pjstadigperhaps someone could be a 'captain' of releases
10:52pjstadigand manage patching the releases and forward-porting to trunk or something
10:52danlarkinyeah, some projects have either a general release manager or a release manager for each supported release
10:54pjstadiggit!
10:54rhickeywell, before management comes the work itself, as I said, I've never gotten a patch for a release branch
10:54pjstadigyeah i just brought up a theoretical point, i don't know of any particular bugs in 20081217
10:55rhickeypjstadig: what about all the fixes that are in 20090320?
10:55pjstadigi guess i mean that i don't have any production apps depending on 20081217 that would require a backported bug fix
10:55danlarkinwell a manager could be in charge of backporting patches
10:56pjstadigi have no skin in the game...so to speak
10:56rhickeyI guess I'm just imagining that 20081217 was called 1.0
10:57rhickeywhat would have been different? How much work would have been expended keeping it patched, and would anyone care or still track trunk?
10:57Chousergenerally if a problem was discovered in 20081217, the discoverer was told it was fixed in trunk (or it then became fixed in trunk)
10:58Carki 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:58ChouserI 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:59rhickeyChouser: right, so in order for that to be different, someone would have to backport fixes, and also do dot releases?
11:00rhickeywould people be ok with pulling svn on a release branch?
11:00rhickeyto get fixes?
11:00pjstadigsome might also prefer a download i'd guess
11:01Chouserright, I have absloutely no idea. It's easier for distro's to deal with versioned downloads (compared to dated pulls from svn).
11:01AWizzArdOT: 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:01rhickeyI guess the versions need have no more identity than, .1 more than the last one
11:03danlarkinso 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:03Chouserdanlarkin: maybe not a new version for *every* fix, but otherwise I think that's right.
11:03Carkawizzard : your program should be gpl
11:04pjstadigperhaps a monthly release of fixes
11:04pjstadig20081217.200903
11:04pjstadighehe
11:04Chousergah
11:04pjstadigjust kidding
11:05pjstadiga kind of side point
11:05pjstadigin regards to terracotta
11:05rhickeySo, 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:06pjstadigwith the class replacement that TC does it really requires a specific release
11:06pjstadigthey recommend for clojure 1.0 you create an integration module named clojure-1.0-[your module's version] or something
11:08Chouserpjstadig: so that it's easier to make sure all hosts are running the same version of clojure?
11:08pjstadigthe class replacement will substitute modified versions of the classes for the original classes
11:09pjstadigin order for them to work well with the other non-replaced classes, then you need to target a specific version
11:09pjstadigclass replacement is only used in cases where you can't or don't want to actually modify the original code base
11:09pjstadigso i could substitute TC compatible versions of classes without rhickey having to make TC specific changes to clojure
11:11Chouserembeding 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:11hiredmanCark: "should be"?
11:13rhickeyChouser: we need an ant target for 'release' I think
11:13Chouserrhickey: to create a .zip?
11:14rhickeyyes, I do that by hand now, including prepping svninfo.txt and changes.txt
11:14ChouserI bet there's someone on the group just itching to write ant build code.
11:15pjstadighehe
11:15Carkhiredman : about version number ?
11:15pjstadigi'm allergic to ants
11:15pjstadigfireants actually
11:16Carkhiredman : oh about the gpl question ... right ... must be !
11:21jhawk28question about metadata, why is the metadata always null when I debug into the LispReader and Compiler?
11:22jhawk28is there a method that creates the metadata that I am missing?
11:23ChouserDo you have an example of where you'd expect metadata that you're not seeing any?
11:23jhawk28referring to Symbol.meta
11:23jhawk28I am wanting to see where it is in the code
11:25jhawk28Issue 17 is the context (counting arity)
11:26ChouserThe reader usually puts metadata on symbols only when specified directly using #^
11:26Chouser,(meta (read-string "#^Integer foo"))
11:26clojurebot{:tag Integer}
11:26jhawk28yes, thats what I am seeing
11:26Chouserarity is attached by defn to the Var being defined
11:27Chouser,(:arglists (meta (var map)))
11:27clojurebot([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])
11:27cemerickrhickey_: congrats on the "release". Can't thank you and the rest of the community enough.
11:28jhawk28so arity is on the Var not the function?
11:30Chouserjhawk28: I don't think there's currently a sane way to get the valid arities of a fn
11:30Chouserand in fact, I'm not sure that the var metadata is particularly trustworthy, since it can be adjusted by the programmer
11:31Chouser,(:arglists (meta (var defn)))
11:31clojurebot([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?])
11:31Chouserthose ?-suffix names are meant to indicate to a human reader that its an optional arg.
11:33jhawk28the 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:34Chouserparsing and compiling is not generally considered critical path, I think.
11:34jhawk28unless it was a map that could be accessed later which would mean more memory usage
11:34Chouserthe issue itself implies some amount of extra work being done at compile time.
11:37jhawk28based on the where I was looking in teh code, the logic would fit best in the FnExpr.parse
11:40jhawk28it does look like it is doing something with arity
11:40jhawk28it only is checking for the variadicMethod though
11:41jhawk28that is an interesting word: *variadic*
11:41jhawk28http://en.wikipedia.org/wiki/Variadic_function
12:43AWizzArdIs Stuart Sierra sometimes visiting this channel?
12:45gnuvinceI think he does
12:45gnuvince~seen stuartsierra
12:45clojurebotno, I have not seen stuartsierra
13:17cgrandgnuvince: 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:21gnuvincecgrand: okay
13:22gnuvinceGive me a few minutes, runhprof is pretty slow
13:22gnuvincecgrand: do you want cpu and heap?
13:22cgrandcpu should suffice
13:38pjstadig+
13:47cadshello
13:47cadsis anyone here attending the atlanta clojure group this saturday?
14:01blbrown_ltcads I might, what time is it? I might go.
14:01blbrown_ltI guess there aren't that many Atlanta people but I am one of them.
14:04gnuvincecgrand: http://gist.github.com/82477
14:05gnuvincecgrand: the html version looks truncated: http://gist.github.com/raw/82477/7ccf374088d7e2bce9a229071d8a9b7af409d286/gistfile1.txt
14:05cadsblbrown_lt: http://leafhopper.github.com/clojure.html
14:06cadsblbrown_lt: did you already get into contact with sari?
14:06blbrown_ltyea
14:06blbrown_lthow many do you think will go
14:07cadsit'll be at 10 am, till noon... the email said around 8 people will show up
14:09cadsit's close to where I am, so I figure why not
14:12cgrandgnuvince: "funny" 1st entry (and it wasn't in your previous profiling... I ignore it for now)
14:13RaynesToday is Rich Hickey appreciation day.
14:13blbrown_ltwoot!!
14:13gnuvinceYeah, 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:13blbrown_ltrhickey, thanks for the work on clojure.
14:14cgrand#2: no clue, #3 looks interesting: null-string
14:14RaynesI should post on the group declaring this, the first day of spring, Rich Hickey appreciation day. Everyone would think I was trolling though...
14:14blbrown_ltAnd 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:14RaynesI'm going to do it anyway I think.
14:15gnuvincecgrand: I could take a break and run a profile while my PC is relatively idle
14:15gnuvincesee if that changes the data
14:15cgrandapart from the 1st entry, both runs look similar
14:16bitbcktclojurebot: everyday is Rich Hickey Appreciation Day
14:16clojurebotOk.
14:16Chouserclojurebot: what is today?
14:16clojureboteveryday is Rich Hickey Appreciation Day
14:17rhickey:)
14:17bitbckthehe
14:17gnuvinceAlso, 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:18cmvkkoh hey, from last night, is this expected behavior:
14:18cmvkk,(list? (cons 'a nil))
14:18clojurebottrue
14:18cmvkk,(list? (cons 'a (cons 'b nil)))
14:18clojurebotfalse
14:18hiredman,(class (cons 'a (cons 'b nil)))
14:18clojurebotclojure.lang.Cons
14:18hiredman:/
14:18cmvkkapparently those don't implement whatever interface list? tests for.
14:19hiredman~def list?
14:19cgrandgnuvince: is null-string intended to always read n bytes and then truncate to the first NUL (when found)?
14:19gnuvincecgrand: yes.
14:20cadsyesterday 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:20hiredmanhuh
14:21hiredmanso clojure.lang.Cons is an IPersistentCollection, but not an IPersistentList
14:21hiredman,(class (seq (cons 'a (cons 'b nil))))
14:21clojurebotclojure.lang.Cons
14:21bitbcktwell... that's awkward
14:21Chouserbitbckt: the Cons class, or cads' comment?
14:22Cark,(class (list 1 2 3))
14:22clojurebotclojure.lang.PersistentList
14:22Carkhum
14:22bitbcktChouser: Yes.
14:22hiredmanwait
14:22Chouser,(class (cons 'a (list 1 2 3)))
14:22clojurebotclojure.lang.Cons
14:22Chouser,(class (conj (list 1 2 3) 'a))
14:22clojurebotclojure.lang.PersistentList
14:22Chouser,(cons 'a (list 1 2 3))
14:22clojurebot(a 1 2 3)
14:23Chouser,(conj (list 1 2 3) 'a)
14:23clojurebot(a 1 2 3)
14:23cmvkkimplementation details...
14:23cmvkkprobably though, the result of a cons should return true for list? though, right?
14:24Chouser,(class (rest (cons 'a (list 1 2 3))))
14:24clojurebotclojure.lang.PersistentList
14:24bitbckthaha
14:25Chouser,(class (rest (cons 'a (cons 'b (list 1 2 3)))))
14:25clojurebotclojure.lang.Cons
14:28RaynesI hope everyone doesn't think I'm trolling :\
14:31Chouserwell, 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:32Cark,(seq? (cons 1 nil))
14:32clojurebottrue
14:32Carkthat's all i need to know
14:32rhickeyChouser: in order to fix what? not sure I understand what is broken - consing doesn't necessarily create Conses
14:32rhickeythe idea is to track count whenever possible
14:33Cark,(doc counted?)
14:33clojurebot"([coll]); Returns true if coll implements count in constant time"
14:33rhickeycreating a persistent list when consing onto nil seeds that
14:33Cark(counted? (list 1 2 3))
14:33Cark,(counted? (list 1 2 3))
14:33clojurebottrue
14:33Cark,(counted (cons 'a (list 1 2 3))
14:33clojurebotEOF while reading
14:33rhickeylists are counted and conses are not
14:33cmvkkso the "list?" example is expected behavior after all?
14:34jhawk28_raynes: today is go get free Rita's day
14:34Cark,(counted? (cons 'a (list 1 2 3)))
14:34clojurebotfalse
14:34Carkok i see
14:34Raynesjhawk28_: Not any more. It's RHAD now.
14:35Lau_of_DKGood evening guys
14:35Carksince it's all persitent data structures, wouldn't it be possible to have conses be counted as well ?
14:35Lau_of_DKlkkkkkkkkkkkkkkkkkkk7lk
14:36RaynesLau_of_DK: Good evening, afternoon here. Happy Rich Hickey Appreciation day. :)
14:36Carkeach cons can carry the count of it's tail + 1
14:40Chouser,(take 5 (map counted? (iterate #(cons 1 %) nil)))
14:40clojurebot(false true false false false)
14:41Lau_of_DKRaynes, Oh is that today ?
14:41Lau_of_DK~counted?
14:41clojurebotNo entiendo
14:41ChouserCark: lazy seqs can't be counted, for example.
14:41Carkclojurebot: everyday ?
14:41clojureboteveryday is Rich Hickey Appreciation Day
14:41Lau_of_DKhaha
14:41RaynesLau_of_DK: It is now.
14:42RaynesI suppose everyone will probably think my group post is just me trolling, but I assure you otherwise. :>
14:43Lau_of_DKI believe you
14:43danlarkinoh gosh, this post is treading the line
14:43Lau_of_DKthis?
14:43danlarkinRaynes'
14:44Lau_of_DKjust... any one of Raynes?
14:44hiredman~def c.l.Cons
14:44danlarkin"March 20th 2009 Rich Hickey Appreciation Day!"
14:44danlarkinthat post
14:45RaynesAw c'mon. It's a nice post and Rich deserves it :|
14:45Lau_of_DKRaynes, I think thats a great post, and you actually succeeded in making a french person tell a joke!
14:45Raynes:D
14:45hiredmanpfft, 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:46Lau_of_DKclojurebot, how do we handle not-funny jokes?
14:46Lau_of_DK:)
14:48hiredmanclojurebot: whose job is it to be funny?
14:48clojurebotthat is durka42's job
14:48RaynesI thought that was my job.
14:48durka42but he's in problem session
14:48hiredmanclojurebot: whose job is it to smoke test releases?
14:48clojurebotthat is ffailla's job
14:48hiredmanclojurebot: whose job is it to tell Raynes what his job is?
14:48clojurebotthat is qebab's job
14:53pjstadigclojurebot: what is my job?
14:53clojurebotIt's greek to me.
14:53pjstadigclojurebot: does everyone have to have a job?
14:53clojurebotHuh?
14:54hiredmanclojurebot: whose job is it to placate pjstadig?
14:54clojurebotthat is dnolen_'s job
14:54triddell1clojurebot: whose job is it to show us what the pattern is to this job thing?
14:54clojurebotthat is msingh's job
14:55triddell1ah, then why didn't he/she speak up? :-)
14:58ChouserHow can a static method call be unresolved at compile time, but resolvable at run time?
14:58bitbcktMagic.
14:58Chouser:-/
14:59ChouserPerhaps 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:01Retonatori thought that when i would do this
15:01Retonatoruser> (defn t [n] n 1)
15:01Retonator#'user/t
15:01Retonatoruser> (t +)
15:01Retonator1
15:01Retonatorthat + 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:01rhickeyuser=> (set! *warn-on-reflection* true)
15:01rhickeytrue
15:01rhickeyuser=> (def x 4.2)
15:01rhickey#'user/x
15:01rhickeyuser=> (Math/round x)
15:01rhickeyReflection warning, line: 30 - call to round can't be resolved.
15:01rhickey4
15:02rhickeye.g. args overloaded on type
15:02AWizzArdalthough in principle it could be known
15:03AWizzArdthe user should need to do extra work to allow for assigning something else to x
15:03AWizzArdin that case she would be shooting in her own leg
15:04AWizzArd:)
15:05Chouserrhickey: ah, of course. thanks.
15:06rhickeynp
15:06ChouserRetonator: why would + be evaluated to by the reader to 0?
15:06ChouserRetonator: the reader reads the charater "+" as the symbol '+ Then the compiler resolves it to the Var clojure.core/+
15:07Retonatori 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:08hiredman,(do + 1)
15:08clojurebot1
15:08Retonator"While functions always evaluate all their arguments, macros can decide which of their arguments will be evaluated. "
15:09danlarkinRetonator: perhaps do you think you're doing: (defn t [n] (n 1))?
15:09ChouserRetonator: 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:09Chouser,(class? +)
15:10clojurebotfalse
15:10Chouser,(class +)
15:10clojurebotclojure.core$_PLUS___3313
15:10Retonatoraaa ok, i thought that i evaluated the function it self
15:10Chouser,(fn? +)
15:10clojurebottrue
15:10Retonatorbut the + symbol evaluates to the function not the function itself
15:11Chouser,(prn '+ + (+))
15:11clojurebot+ #<core$_PLUS___3313 clojure.core$_PLUS___3313@6e3fe4> 0
15:11dnolen_,[(+) +]
15:11clojurebot[0 #<core$_PLUS___3313 clojure.core$_PLUS___3313@6e3fe4>]
15:11Retonatoraaah okay so the () also evaluates the function inside?
15:12Retonatori still have to get my mind around the reader and the evaluation etc...
15:12WizardofWestmarcafternoon all
15:13ChouserRetonator: sure, the way to call a function is to put it at the front of a list.
15:13Chouser,[(+) (+ 1) (+ 1 2) (+ 1 2 3)]
15:13clojurebot[0 1 3 6]
15:14Chouser,(let [add +] [(add) (add 1) (add 1 2) add])
15:14clojurebot[0 1 3 #<core$_PLUS___3313 clojure.core$_PLUS___3313@6e3fe4>]
15:14Retonator(+), 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:14danlarkinRetonator: 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:16Chouserleft to right
15:16Retonatorbut then why does this still work (t (+))
15:16danlarkinreally?
15:17hiredmanRetonator: (+) becomes 0
15:17dnolen_Retonator: (+) evaluates to 0, then gets passed to the function t.
15:17hiredmanso substitutiong into your functio body you get (do 0 1)
15:17Retonatorbut i still get 1
15:17hiredman,(do 0 1)
15:17clojurebot1
15:17dnolen_because t returns 1
15:17hiredman,(doc do)
15:17clojurebotjava.lang.Exception: Unable to resolve var: do in this context
15:17danlarkinI thought (perhaps erroneously) that CL evals right-to-left, so I assumed clojure did too... but there I go assuming again
15:17hiredman(doc do)
15:17clojurebotexcusez-moi
15:18Lau_of_DKw00t, I just made my first post to the group I think :)~
15:18Chouser,(let [a (atom 0)] (list (swap! a inc) (swap! a inc)))
15:18clojurebot(1 2)
15:18RaynesLau_of_DK: In my post? It should be in my post.
15:18RaynesYep!
15:18Lau_of_DKYes sir!
15:18hiredmandanlarkin: if a form is a cons list, how would you walk it right-to-left to eval?
15:19danlarkinhiredman: I'm missing the gotcha, why can't you?
15:20danlarkinChouser: you and your "proof", bah!
15:20Retonatoris a function body wrapped in a do then?
15:20hiredmandanlarkin: 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:20Retonatoror am i doing that by not haveing it in a ()
15:20hiredmanRetonator: yes, there is an implicit do
15:22Retonatoraaa okay that figures, i get it ;). now if i do this
15:22Retonator(defn a [n] (n 1))
15:22danlarkinyeah 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:22Retonatori get what i want if i do (a (+))
15:23danlarkinRetonator: you probably want (a +) I think
15:23Retonatornaah actually not i was learning when the function got evaluated ;)
15:23hiredmandanlarkin: I have spent the last few days tinkering with my own lisp interpreter, so these things are on the top of my brain
15:26Retonatorso 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:27dnolen_Retonator: i think you might still be confused.
15:27Retonatorplease help me then ;), i think i get it maybe i explain it the wrong way
15:28dnolen_the standard Lisp form is (afunction arg1 arg2 arg3 ...)
15:28hiredmanfunction literals, which use % do not have an implicit do
15:28Chouseranytime you see % it is inside a #(), and they can always be replaced with (fn [myarg] ...)
15:28dnolen_if arg1 is a subform it's contents will be evaluated first
15:28dnolen_it's recursive.
15:29ChouserI can't believe I just did that. I mean of course, (fn [myarg] (...))
15:29dnolen_once all the values are evaluated
15:29dnolen_afunction is applied
15:29hiredmanChouser: don't worry, it's been logged
15:30dnolen_when you write (def a [afn] (afn 1)), you are saying afn is a local variable
15:30dnolen_which better be a function when you pass it in.
15:30dnolen_sorry (defn a [afn] (afn 1))
15:31Retonatoryes 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:31dnolen_you can use partial to do something like that.
15:31Retonatorto do the same in clojure i have to pass a anonymous function with a % right?
15:32Cark,(doc partial)
15:32clojurebot"([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:32Chouser(partial + 3) or #(+ 3 %) or (fn [x] (+ 3 x))
15:32Retonatoryes thanks chouser
15:33Retonatorand dnolen_
15:33Chousernot 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:33Carkthere should be the word "curry" in the docstring
15:34hiredmanpartial actually "uncurries"
15:34hiredmanoh
15:34hiredmannope
15:34hiredmancurry
15:35danlarkinhahah we are being so unhelpful I'm sure
15:35Retonatoryeah i was really thinking about your uncurries statement and was thinking that i had the concept of currying wrong
15:35Cark,(comp chicken partial)
15:35clojurebotjava.lang.Exception: Unable to resolve symbol: chicken in this context
15:36Carkyeah that doesn't sound half as good as ,(comp chicken curry) !
15:36Retonatorlol
15:36Retonator@danlarking: do you mean beeing unhelpfull to me?
15:37danlarkinRetonator: yes
15:38harpastumis there a standard clojure (not java) power function?
15:38harpastumi really enjoy clojure's absolute numerical accuracy
15:38Retonatornope actually very helpfull
15:38harpastum,(Math/pow 10 301)
15:38clojurebot9.999999999999999E300
15:38Retonatori have some functional back ground and i just have to learn the concepts of clojure
15:39Retonatorand 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:39Chouser,(.pow 10M 301)
15:39clojurebot10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000M
15:40gnuvinceThat's a lot of zeroes there
15:40harpastumhaha
15:41harpastumwhat are the arguments to that function?
15:41harpastum,(.pow 10 301)
15:41clojurebotjava.lang.IllegalArgumentException: No matching method found: pow for class java.lang.Integer
15:41harpastumbecause that doesn't work
15:41durka42,(type 10M)
15:41clojurebotjava.math.BigDecimal
15:41harpastumaahh
15:41Retonator,(/ (* 1/3 3) 3)
15:41clojurebot1/3
15:41Retonatori like that ;)
15:41harpastumme too
15:42harpastum,(= 10M 10)
15:42clojurebottrue
15:42harpastumok
15:43harpastumi was reading that as ten million, which had me confused
15:43harpastumbecause i threw this function together
15:43harpastum(defn power [number exponent] (if (zero? exponent) number (* number (power number (dec exponent)))))
15:43harpastumi couldn't figure out how to not load the stack
15:43harpastumusing trampoline
15:43pjstadighttp://clojure.pjstadig.staxapps.net/
15:44pjstadigcompojure on stax
15:45harpastumwhat is stax?
15:45Chouserharpastum: trampoline requires the caller to use trampoline, and for the called function to know it's being called by trampoline.
15:45harpastumwww.staxapps.net returns a 404
15:45pjstadigstax.com i think
15:46pjstadigstax is like google app engine for java
15:46durka42stax.net
15:46pjstadigor heroku
15:46Chouserharpastum: other solutions would include high-order functions or an accumulator
15:46durka42heroku is rails?
15:46pjstadigja
15:46pjstadigan very easy to use
15:46Chouser,(apply * (repeat 10 2))
15:46clojurebot1024
15:46pjstadigstax seems to be just about as easy to me
15:47waltershmm, how stax is different from ec2, firing up a fedora instance, and "yum install java-1.6.0-openjdk" ?
15:47harpastumchouser: thanks. I'll look into those
15:48pjstadignot sure i just started playing with stax
15:48Chouserpjstadig: free to get started?
15:48pjstadigi think the advantage is they handle the configuration, provisioning, management of the instances
15:48pjstadigthey also handle the load balancing
15:49pjstadigand make sure your database is available clusterwide
15:49pjstadigit's in beta and free for now
15:50pjstadigyou get a command like tool (just like heroku)
15:50pjstadigso you deploy with 'stax deploy -u pjstadig -p [password]'
15:50pjstadigthat's not my actual password, btw
15:54danlarkinhunter2
15:57Retonatornice binary multiplaction chouser ;)
15:58pjstadighttp://stax.stadigtech.com/
15:58pjstadigworks with custom domains too
15:59harpastumhow long did it take for them to send your invite email?
15:59pjstadigi signed up this morning and got an invite by midday
16:00Chouserpjstadig: are you using the ring fork of compojure?
16:00pjstadigi'm using weavejester's branch
16:01pjstadigwhichever one that is
16:01pjstadigi did have to comment out one line
16:02pjstadig65 of compojure.http.servlet
16:02pjstadigit tries to put a Ref into the session
16:02pjstadigwhich is not serializable
16:03pjstadigChouser: i used the master branch of weavejester's compojure not the ring branch
16:03pjstadigi don't know much about compojure, this is my first look at it
16:03WizardofWestmarcthat reminds me, need to finish getting Madison Square set up tonight
16:04WizardofWestmarcgot everything except fnparse downloaded and built last night.
16:05WizardofWestmarcmay just roll fnParse into another .jar file to make it cleaner heh
16:05WizardofWestmarcsince it currently doesn't even have an ant build.xml file
16:05Chouserpjstadig: ok, I haven't looked at it either, but I've got a cute little web app begging to be rewritten in clojure.
16:07Chouserright now it's so slow. http://movies.n01se.net/
16:08danlarkinWizardofWestmarc: fork it on github and issue joshua choi a pull request
16:08danlarkinChouser: perfect for madison!!
16:09Chouserwell it's currently written using a set of xslt scripts that produce ruby code, so really anything would be better.
16:09hiredmanwoa, slick
16:10ieureChouser, That's pretty badass.
16:11Chouserthe plot summaries quick working a while ago and I haven't looked into why yet.
16:12WizardofWestmarcdanlarkin: don't use git directly atm since my primary OS is windows and Git + windows = not great last I knew.
16:12WizardofWestmarcthough I'm probably going to start developing purely in linux vms soon...
16:12pjstadighehe "xslt to produce ruby"
16:12WizardofWestmarcand honestly I'll probably just make a single .jar for Madison Square w/all the dependencies
16:13WizardofWestmarconce I learn how to properly build ant build files ^_^
16:13WizardofWestmarcwell, I'll probably keep like Jetty seperate
16:14Chouserpjstadig: yessir. I thought at the time it might be a good way to get at xpath.
16:14danlarkinWizardofWestmarc: http://gist.github.com/82552 this is what I use for AOT compiling madison
16:14danlarkinpretty gross ATM
16:15WizardofWestmarcaot + jar or just aot?
16:15danlarkinaot+jar
16:15WizardofWestmarcn/m figured it out
16:15WizardofWestmarcnoticed the .jars for most of it
16:16danlarkinor if you don't want to AOT it, just running "ant" will build the jar
16:16WizardofWestmarcI prefer aot since it improves load time
16:17danlarkinslightly
16:17WizardofWestmarchey slightly is better then none
16:22hiredmanlisppaste8 has the highest count of urls in the channel, shockingly
16:43brennancWhat kind of concurrency model do I use if I want to have something like a global variable but it be thread specific?
16:43Chouservar
16:44brennancI want to keep the request headers in compojure somewhere global but have them independent of the other threads / requests
16:44Chouser(def *foo*) to create it, then use (binding [*foo* x] ...) to create a thread-local binding.
16:45brennancthanks
16:58brennancbinding doesn't seem to be working
16:58brennanc (GET "/map2" (binding [hdrs headers] (print-hdrs)))
16:58brennanc(defn print-hdrs [] (str hdrs))
16:58brennancjava.lang.Exception: Unable to resolve symbol: hdrs in this context ...
16:59Chouserah, you've got to (def hdrs) somewhere that print-hdrs can see.
17:01brennancyup, that did the trick
17:09kotarakHow 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:14dnoleninteresting, so the . operator isn't really a function?
17:14kotarak. is a special form.
17:14danlarkinit's speeeeecial
17:14hiredman,(doc .)
17:14clojurebotjava.lang.Exception: Unable to resolve var: . in this context
17:14dnolenblast it :)
17:15hiredmanit's the "Java Operator"
17:16Chouserdnolen: http://clojure.org/java_interop#toc6
17:17dnolenthx all.
17:22harpastumso, I have a large number, and i'm interested in addressing each digit separately
17:22harpastumhow would i go about doing that?
17:22cconstantineDoes lazy-seq incur a big speed penalty?
17:22cconstantineharpastum: You could divide it by 10 over and over
17:23harpastumcconstantine: 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:23harpastumbasically reverse str
17:24cconstantineharpastum: You could print it to a string and treat the string as a list
17:24cconstantineyou'd have to convert that character back to a num if you wanted to perform arithmetic on it though
17:24hiredmanharpastum: how large of a number? what is its type?
17:25harpastumthis isn't for any specific purpose, i'm just trying to understand how to do this type of operation in clojure
17:25harpastumbut the number i was looking at was 10!
17:25harpastum93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
17:25harpastumone of the project euler challenges is to sum the digits of the number
17:25harpastumand i could hook together a recursive function to do it
17:26harpastumbut i thought there might be a more elegant way
17:26hiredmanif 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:26pjstadig,(into [] (str 12345))
17:26clojurebot[\1 \2 \3 \4 \5]
17:27hiredman,(int \0)
17:27clojurebot48
17:27hiredman,(int \1)
17:27clojurebot49
17:27harpastumascii encoding?
17:28hiredman,((comp (partial + -48) int) \0)
17:28clojurebot0
17:28pjstadig(.parseInt (str \1))
17:28hiredmanunicode actually
17:28pjstadig,(.parseInt (str \1))
17:28clojurebotjava.lang.IllegalArgumentException: No matching field found: parseInt for class java.lang.String
17:28pjstadig,(Integer/parseInt (str \1))
17:28clojurebot1
17:28hiredmanbut that is icky
17:28hiredmanbuilding a string
17:28pjstadigwhy?
17:28hiredmanfor no reason
17:28pjstadighehe
17:28harpastumcan it handle unicode output?
17:29digash,(map #(- (int %) (int \0)) (str 123456789))
17:29clojurebot(1 2 3 4 5 6 7 8 9)
17:29pjstadigeww
17:29hiredmanharpastum: java, and hence clojure, is all about the unicode
17:29harpastum,(int \u2605)
17:29clojurebot9733
17:29cconstantinedigash: that is what I was thinking
17:29hiredman,(char 9733)
17:29clojurebot\?
17:29cconstantineis the '(fn [x] ...)' form frowned apon?
17:30harpastumok
17:30digash,(reduce + (map #(- (int %) (int \0)) (str 123456789)))
17:30clojurebot45
17:30hiredmanclojurebot: function literals?
17:30clojurebotFunction literals are cute, but overused
17:30pjstadigman now you just gave away the solution
17:30hiredmanI think you could just use apply
17:30hiredman(aply + ...)
17:30cconstantinehehe, this looks an awful lot like a project euler problem :)
17:30hiredmanapply
17:30harpastumdigash: thanks a lot, that was exactly what i was looking for
17:30harpastumyeah, it is
17:30harpastumi already had the answer
17:31cconstantineharpastum: did you make a prime number generator?
17:31digashharpastum: glad to help
17:31cconstantinenot for htis problem... but for another one
17:31lifflanderSo are there any LALR(1) parser generators for Clojure?
17:31pjstadigantlr?
17:31harpastumcconstantine: no, i haven't
17:31harpastumbut it sounds pretty exciting. I haven't tried lazy sequences yet
17:31cconstantineharpastum: I've made one on the seive design.. and it's reallly super slow
17:32harpastumi'd imagine it might be
17:32hiredman~Genuine Sieve
17:32clojurebotIt's greek to me.
17:32hiredmanclojurebot: Sieve
17:32clojurebotExcuse me?
17:32hiredmanclojurebot: Seive
17:32clojurebotHuh?
17:32hiredmanbah
17:32lisppaste8Chouser pasted "num->seq" at http://paste.lisp.org/display/77364
17:33cconstantineharpastum: my friends have made them in other languagues (C and somethign else...) and it takes theirs miliseconds to generate what mine takes minutes
17:33Chousercconstantine: ^^^ that's what I did
17:33lifflanderantlr looks like it is for human language or such?
17:33cconstantineChouser: what does it do?
17:33lifflanderI'm asking if there is a yacc like tool for Clojure
17:34lifflanderMaybe like the haskell tools alex and happy...
17:34Chouser(num->seq 1234512341235412341) ==> (1 2 3 4 5 1 2 3 4 1 2 3 5 4 1 2 3 4 1)
17:34cconstantineah, for harpastum's problem
17:34Chouseroh, sorry. mis-addressed. :-)
17:35harpastumYeah, i was confused for a second too
17:35harpastumbut that's a pretty clear way to do it
17:35lifflanderI'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:35harpastumcconstantine: did you use a lazy sequence, or are you just calculating to a specific value?
17:36cconstantineharpastum: lazy sequence
17:36ambientantlr is LL(k)
17:36lifflanderIs there any LR?
17:36Chouserharpastum: note that num->seq has an optional base argument.
17:36ambientsure, lex/yacc is LALR
17:36ambientand many others
17:36lifflanderfor Clojure
17:37jhawk28__CUP is LR
17:37lifflanderLike "happy" for Haskel
17:37Chouser(num->seq 234 2) ==> (1 1 1 0 1 0 1 0)
17:37cconstantineChouser: hehe :)
17:38lifflanderWould cup play nicely with Clojure?
17:38Chousercconstantine: I've got a fast seive around here somewhere too...
17:38jhawk28__it generates Java, so maybe
17:39harpastumcconstantine: any chance you could post the code, so I could take a look at it?
17:39cconstantineChouser: if you would share that would be awesome
17:39lifflanderOk. thanks for the help guys.
17:39harpastummaybe I'll be able to see why it's slow
17:39harpastumor, more likely, someone else will
17:40cconstantineharpastum: it's really ugly and hard to use right now
17:40cconstantineharpastum: will you be on later?
17:41lisppaste8Chouser pasted "primes-under (sieve)" at http://paste.lisp.org/display/77365
17:41harpastumcconstantine: probably. If not i'll be around.
17:41harpastumway later
17:42cconstantineharpastum: ok, it's on it's way
17:43cconstantineso Couser's doesn't do an arbitrary number of them?
17:47cconstantinehttp://paste.lisp.org/display/77367
18:30hjleehow can I next/previous key of some key value in sorted-map?
18:31hjleehow can I find next/previous key of some key value in sorted-map?
18:32hiredman,(sorted-map :a 1 :b 2 :c 3)
18:32clojurebot{:a 1, :b 2, :c 3}
18:33hiredman,,(let [a (sorted-map :a 1 :b 2 :c 3) k (keys a)] k)
18:33clojurebot(:a :b :c)
18:33hiredman,,(let [a (sorted-map :a 1 :b 2 :c 3) k (keys a)] (take-while #(not= % :c) k))
18:33clojurebot(:a :b)
18:33hiredman,,(let [a (sorted-map :a 1 :b 2 :c 3) k (keys a)] (last (take-while #(not= % :c) k)))
18:33clojurebot:b
18:34hjleeah.. but I want it in constant time. (so many keys, so many operations)
18:34hiredmanpffft
18:34hiredmanyour are out of your mind
18:35hiredmanconstant time
18:35hjleesorry. log(n)
18:36hiredmanyou are searching through the keys of a map
18:37hjleesorted-map keys in tree structure, i guess.
18:37hjleeand insert may take log(n).
18:37hjleeand i guess there are way to find prev/next key in log(n).
18:38hjlee(may not be in api anyway)
18:38hiredmanI would guess your guess is mistaken
18:39hjleewhy?
18:40hiredman,(class (sorted-map :a 1))
18:40clojurebotclojure.lang.PersistentTreeMap
18:40hiredman~def clojure.lang.PersistentTreeMap
18:43hjleeyes, PersitenentTreeMap uses red/black tree - one of balanced binary tree.
18:43hjlee(I saw the comment of the source)
18:44hjleeso the first guess is right.
18:44hjleewhy not 2nd guess?
18:45hiredmanlet me ask you this, how many keys are between :a and :f?
18:47hjleethat's not related to the problem.
18:48psticknehiredman: 42, just in case you still care
18:48Retonatormaybe stupid but can anyone tell me what a Var is in clojure?
18:49cmvkkcheck this page, for example: http://clojure.org/vars
18:50pstickneRetonator: think of a member in Java. Only they can behave nicely in multiple thread contexts.
18:50hjleeno counting needed.
18:51Retonator,(var +)
18:51clojurebot#'clojure.core/+
18:51Retonatorbut what does that mean then?
18:51Retonatoris plus a var pointing to the + function?
18:53Retonatorit is the object itself as i read now
18:55cmvkkthe symbol + refers to a Var which refers to the + function, I believe.
18:58psticknewth, a NPE? :(
18:59dreishnil is a null pointer.
19:04pstickneI was just expecting a more graceful death :(
19:04pstickne(swap! nil ...) ; no good ^^
19:05hiredman,(swap! nil identity)
19:06clojurebotjava.lang.NullPointerException
19:06hiredman,@nil
19:06clojurebotjava.lang.NullPointerException
19:08pstickneI've just introduced the first side-effect into my program!
19:08pstickneI feel so dirty! :(
19:08pstickneIt's just much easier to not have to keep updating bindings on the escape ...
19:11cmvkkI rewrote my program without using anything mutable, and you know what?
19:11cmvkknow it's like 10 times slower.
19:11cmvkk:/
19:11psticknecmvkk: :p
19:11pstickneI like controlled mutability.
19:11psticknealthough this program will be very slow :p
19:11pstickneI am using fnparse
19:12pstickneAnd since I don't pre-tokenize it..
19:12pstickne:p
19:12pstickneoh, well, it's only for a school project
19:31RaynesWell 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:32p_lRaynes: I think you might need heavier arguments. Just remember to take it easy on nukes
19:33Raynesp_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:34RaynesScrew him :\
19:34RaynesHe's one of the "How would we SURVIVE WITHOUT OOP. OMG!!1!" kind of people.
19:37p_lheh
19:39RaynesDo a Google search for "hate Clojure". Only a single result.
19:39durka42~google "hate clojure"
19:39clojurebotFirst, out of 1 results is:
19:39clojurebotDavid R. MacIver � Blog Archive � How do you talk about Scala?
19:39clojurebothttp://www.drmaciver.com/2009/02/how-do-you-talk-about-scala/
19:39RaynesThats it.
19:39p_lRaynes: is that him? :D
19:39RaynesNope.
19:40RaynesAt 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:41RaynesI 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:42hiredmanChouser and rhickey are neck and neck for the most non-bot pasted urls
19:43RaynesWhy do people love Java syntax so much?
19:43RaynesCurly braces are the most useless things I have ever seen in my life.
19:43hiredmanI really have no idea
19:43RaynesThat's too much useless "Enter-shift-curlybracket" for me.
19:44pstickneRaynes: curly braces aren't useless
19:44pstickne{:foo :bar}, for example, is nice :)
19:44p_lno, the braces are innocent. It's java that's the criminal :P
19:44slashus2IDE's make it more tolerable with automatic generation of abstract methods that you have to fill in.
19:45Raynespstickne: But not to denote code blocks.
19:45Raynesslashus2: IDE's shouldn't have too.
19:45pstickneRaynes: I personally like do/end :-)
19:45Raynesp_l: C is the criminal.
19:45RaynesKnow what I like?
19:45pstickneA big bowl of ...
19:45RaynesParentheses and whitespace. That's what I like.
19:46slashus2Raynes: I know, but programming java without them is more of a pain.
19:46Raynes:D
19:46Raynesslashus2: Programming with Java is a pain anyways. That hurt don't heal. :|
19:47slashus2I know someone who uses an editor without syntax highlighting to program in java. masochist
19:47Raynes:|
19:48p_lRaynes: C was directed at simplicity and for being autogenerated by more advanced tools
19:49p_lRaynes: It's good language for it's uses
19:49hiredmanC? auto-generated?
19:49p_lhiredman: many of the old-fashioned tools generated C code
19:49durka42Cfront
19:49slashus2Things like pyrex and ghc can produce C
19:50durka42ecl?
19:50p_lECL & Chicken
19:50p_lGCL too
19:50p_lGambit-C
19:50hiredman...
19:50ChousukeI don't think C was ever *designed* to be autogenerated...
19:50p_lYacc :D
19:50Chousuke:P
19:51hiredmanI 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:51p_lChousuke: 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:51p_lhiredman: yacc & lex
19:52p_lhiredman: some other tools from V7 era
19:52Chousukehmm.
19:52Raynesp_l: No, I mean it's the criminal for staring the whole curly braces trend.
19:52p_lRaynes: it was better than begin ... end
19:52slashus2algol
19:52RaynesPascal should die.
19:53p_land few other langs AFAIK supported either curly braces or begin ... end
19:53p_lRaynes: Wirth says the same. Nobody listens to him
19:53RaynesFrom #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:54RaynesIrrelevant but still funny.
19:54RaynesAnyways, I'll be back later.
19:54slashus2algol 68 had curly braces
19:55slashus2So that predated C a little.
19:57slashus2Raynes: Blame algol 68, not C :-P
19:58slashus2wait
19:58slashus2I think I am incorrect.
19:58RaynesI agree.
19:58Raynes:)
20:02p_lslashus2: what about Algol 60? :)
20:02p_lIt was a big inspiration :)
20:03p_lalso, I dunno, but what about B and BCPL?
20:03p_l(and CPL)
20:14cconstantineAda still uses begin/end
20:18cconstantineI 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:19cconstantineand the delete will always be the first sequence
20:26RaynesOh shit!
20:26RaynesLambda-the-ultimate is down
20:28cconstantineOh no! what does it do?
21:23p_lccmtaylor: Ada is the weirdo in that group ;-)
21:33hjleehiredman: are you there?
22:32slashus2If 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:36Rayneshttp://en.wikipedia.org/wiki/Falcon_(programming_language) Anyone ever used this? I bet it's a mess. Too many paradigms.
22:41pstickneRaynes: and Clojure isn't? ;-)
22:41p_lRaynes: well, CL feels alright...
22:41RaynesNo, I don't think you get it. Falcon has an /obscene/ amount of paradigms.
22:41pstickneSometimes I miss when programming languages are restricted to 7-bit ASCII input...
22:42RaynesIt tries to do everything.
22:42p_lRaynes: and CL has (1+ currently-known-paradigms)
22:43RaynesProcedural, Object Oriented, Prototype Oriented, Functional, Tabular and Message Oriented.
22:43Raynes"Pick the ingredients you prefer and let the code to follow your inspiration."
22:44brweber2hey all, is anyone around familiar with inlining in hotspot?
22:44RaynesOh boy they have an IRC channel
22:44p_lRaynes: don't troll too much
22:44RaynesThere is no one there too troll. :(
22:44RaynesOnly seven people.
22:48RaynesI need to properly learn Scala.
22:50pstickneFalcon looks ... interesting ...
22:50pstickneRaynes: yes you should ;)
22:51RaynesLearning 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:51Rayneso_o
22:53p_lRaynes: don't succumb to the Boring Side!
22:53RaynesCorrection: I need to have more OOP experience so that when I put OOP down, I can do it with facts.
22:54pstickneOOP is a silly term.
22:54pstickneI like to argue that Haskell is "OO" because it supports polymorphic behavior of abstract data types :p
22:55pstickne(most people say I'm wrong though)
22:55pstickne(I just think I have a liberal definition of OO :-)
22:55RaynesThat would spark wildfires in #Haskell
22:55pstickneWhich is silly...
22:56pstickneAnd then OOP can be done in languages that aren't "OO"
22:56pstickne(e.g. you can write OOP in C, which is not OO)
22:57p_lwhich can and has been done
22:57pstickneRaynes: oh noo!
22:57pstickneRaynes: my experience with NB+Scala[+Java] = the lose
22:57Raynespstickne: They fixed that in the last release.
22:58psticknewhew.
22:58pstickneRaynes: does it still have to filter through the ant-task?
22:58pstickne(the Eclipse builders are so much nicer -- when they work)
22:58RaynesI don't guess... It works fine for me.
22:58pstickneRaynes: cool :)
22:58pstickneI guess either Eclipse or NB is like Ford or Chevy :)
22:59RaynesProgramming in Scala is such a lonnnnng boooook.
22:59pstickneRaynes: with such a ... interesting unofficial acronym! :p
22:59p_lI consider NB to be like a good sericable car
22:59p_l*servicable
23:00RaynesNetbeans is like a car that is about to run out of gas.
23:00vagifHello, any emacs+slime users here ?
23:00RaynesChug Chug vrooooom Chug.
23:00p_lRaynes: And despite that it's still going to go for 100 km :P
23:00pstickneRaynes: did you put WATER in again?
23:00Raynes:p
23:01psticknep_l: until 50 km out of town it spontaneously explodes :(
23:01p_lEclipse 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:01vagifi'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:01psticknep_l: at least it comes with free towing service ;-)
23:02vagifis this feature implemented /
23:02vagif?
23:02slashus2Anyone have any idea how to turn a string into something I could use with eval?
23:02pstickne(disclaimer: not guaranteed to actually tow you back to town)
23:02p_lpstickne: last time I checked, the towing service put you on a flight to cambodia
23:02p_lpstickne: packaged as mackarel
23:03p_land they wanted to get paid for that
23:03pstickneslashus2: I think print-str or similar might do it
23:03pstickneslashus2: err, prn.
23:04slashus2pstickne: I am trying to slurp code from a file and evaluate it.
23:04pstickneslashus2: then you already have it as a string to eval...?
23:04slashus2eval uses code
23:04slashus2a form
23:04slashus2I think I almost have it working. Just namespace problems.
23:05pstickne(eval (pr-str "something something"))
23:05vagif 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:06slashus2pstickne: I don't want to print a string and return it.
23:06pstickneslashus2: that doesn't actually print anything though
23:08slashus2using
23:09slashus2(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:36Raynes"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:37Raynes"Rick" You can tell he's /really/ looked into Clojure eh.
23:40slashus2Something is lacking in his design if he can't keep track of a dynamic system.
23:40pstickneI think that static typing is great.
23:41pstickne(And yes, it is because I have a limited mental capacity.)
23:44RaynesI, 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:46Raynespstickne: Tell me something awesome about Scala that I don't know.
23:48pstickneRaynes: 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:48pstickne*know
23:48pstickneRaynes: so it has a number of ... less than ideal designs in it, many to work with Java and/or "fit Java programmers"
23:49pstickneRaynes: well, let me put it this way ... if you have a choice between Java and Scala ... ;-)
23:50RaynesI thought using it from Java was hell? Last time I checked the data structures were incompatible with Java.
23:50pstickneRaynes: 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:50pstickne(e.g. how do you call Vector.+ in Java?)
23:51Raynes:o
23:52pstickneRaynes: the thing I mist most coming to clojure is lack of static types (that are inferred)
23:52pstickne(Granted, inference isn't great in Scala, but I'm also coming a project in SML ... yet to try Haskell)
23:52pstickne*miss
23:52Raynespstickne: Scala intrigues me.
23:53slashus2pstickne: Type hints don't do it for you?
23:53pstickneslashus2: I don't even know what those are :-)
23:53RaynesBut Clojure has mah heart.
23:53Raynespstickne: (defn whatever [#^String x] (println x))
23:53pstickneIt's an interesting language.
23:54pstickne(whatever 10) :-/
23:54slashus2pstickne: 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:55slashus2pstickne: That works because println takes integers as well as strings
23:55pstickne(defn whatever [#^String x] (println (inc x))) (whatever "x") ;-(
23:56slashus2It doesn't check at compile time :-)
23:56psticknethat's the part I miss :p
23:56RaynesRuntime errors <3
23:57p_lhmmm.... is there java for MVS? It might be interesting to run clojure apps read from EBCDIC card images... :P