#clojure logs

2010-04-04

00:04underdevso maven is complaining that the JAVA_HOME environment variable is not set, while reporting that java home is /usr/lib/jvm/java-6-sun-1.6.0.15/jre and "echo $JAVA_HOME" reports that its been set
00:05underdevshould i just ignore the warning, 'cause it's really starting to piss me off...
00:09underdevthis is just getting so awesome... if i "JAVA_HOME=$JAVA_HOME;export JAVA_HOME" from the command line, maven is happy
00:10cemerickunderdev: sounds like you're just setting JAVA_HOME, as opposed to putting it into your profile
00:12underdevokay, for some reason every other variable is happy being set in my .bashrc, except JAVA_HOME, which can be exported from there. Maven's happy now.
00:12underdevmust be exported, i mean
00:13cemerickI've never been clear on the semantics of env vars across child processes, etc., but I always export stuff I want to make sure is available everywhere.
00:14underdevweeee, maven is satisfied
00:16underdevcemerick: no, you can't do that, because maven chokes if i export M2_HOME
00:16cemerickwell, I've never messed with the default .m2 location *shrug*
00:16underdevwell, i'm sure it works for you. i should say *I* can't do it
00:17underdevi'm not
00:17underdevplease Jesus, tell me i'm not
00:19underdevwouldn't it be great if the directions at maven.apache.org were outdated or wrong. that would be special.
00:22underdevyeah, it made a .m2 dir in ~
00:28_atobasically if a var is not exported then child processes won't inherit it
00:30_atosomething else may have exported it for you, which may be why other vars you're setting in your profile like say PATH don't appear to need it
00:31underdevhmm, maybe the child process needs the JAVA_HOME, but the shell needs the M2_HOME and M2?
00:32underdevi wonder why exporting M2_HOME screwed up mvn... it complained about class-loading issues, which i'm sure as hell not trying to get into now
00:33cemerickunderdev: you simply do not need to set M2_HOME
00:33cemerickunless you want the local repo to be somewhere other than ~/.m2
00:34underdevhmm, that doesn't appear to be what m2_home is refering to... it puts the repository in ~/.m2, but wants that env var to point at the maven home dir, and m2 to point at the /bin dir under that
00:35underdevagain, the whole point is i want to learn what is actually going on under the hood.. ignorance was bliss
00:35cemerickoh, I see
00:36cemerickI'm entirely ignorant of the inner plumbing of maven, thankfully.
00:40underdevme too, obviously. I'm tired of nievely searching for someone who has done whatever monkey trick i need to do with lein.
00:41underdevbut next time i'll definitely have apt take care of all this for me
00:42cemerickFWIW, maven 3 is a pretty thorough rewrite from what I hear (though it's all backwards compatible w.r.t. APIs and such), so any internal plumbing you're learning about may be different already.
00:42underdevright
00:49brian__noob question, is there an easy way for regex to return a string? ie (first (map #(re-seq #"a" %1) ["a" "b" "c"])) -> ("a") , I just want "a"
00:51underdevtaking a shot...
00:51underdev,(str (first (map #(re-seq #"a" %1) ["a" "b" "c"])))
00:51clojurebot"clojure.lang.LazySeq@80"
00:51underdevnope
00:53somnium,(re-find #"foo" "barfoobar") ?
00:53clojurebot"foo"
00:53brian__ok thnks
00:53somnium,(some #(re-find #"a" %) ["a" "b" "c"])
00:53clojurebot"a"
00:56underdev,(str (into [] (first (map #(re-seq #"a" %1) ["a" "b" "c"])))
00:56clojurebotEOF while reading
00:56underdevi suck
01:00defnsomeone mind testing out http://getclojure.org:8080/examples/$function-name where $function-name is anything like "zipmap", "concat", etc. -- I've been trying to iron out a kink. The last time i advertised the URL and a few people loaded things up it produced a problem
01:00defnfeel free to hit it a few times and let me know if you have any feedback
01:02underdevdefn: rockin'
01:03underdevironically, nothing found for defn.. you gotta easter egg that, man!
01:03cemerickdefn: is this being pulled from irc logs?
01:04underdevgotta add a homepage, obviously
01:04defncemerick: yes
01:04defnunderdev: *nod*
01:04underdevand some sort of landing page under /examples
01:05cemerickdefn: nice; is there a filter or something? Nothing there for send-off, and virtually nothing for send.
01:05somniumdefn: very cool
01:05defncemerick: yeah there is a filter -- stuff that runs in the sandbox shows up, if nothing is found it returns stuff which /didn't/ run in the sandbox
01:05cemerickah
01:05defnalso keep in mind it's from irc, so there might not be a ton of mentions of send-off in the first place
01:06defni can tell you how man, one second
01:07defncemerick: looks like there were 125 send-off examples, but probably not many run in the sandbox... I will make sure to add some options for what you want to see, so you can return all of the good AND bad examples if you so choose
01:08dxgriffithsI noticed that def brings back a lot of results with "def" the string in them, unrelated to the function.
01:09defndxgriffiths: yes i noticed that as well. I'm not 100 percent sure if that's something I want to filter or not. I can't think of a reason why not to at the moment, but there might be is all...
01:10dxgriffithsMaybe you could just float non-string results to the top.
01:11underdevi appreciate being able to get all the results from "re-", even if there are some cruft in there...
01:11defndxgriffiths: good idea
01:12defnso add some sorting options, syntax highlighting, intelligent indentation for long lines, a couple of filter options, homepage, and examples landing page
01:13bmasonwhat are we looking at? I missed the link
01:13defnhttp://getclojure.org:8080/examples/$function-name <--fill in a function-name like zipmap, or concat
01:13underdevbadgirlsinchains.com
01:13defn:X
01:14bmasonlol
01:14bmasonI see Clojure has a darker side
01:14clojurebotThat is the one thing Clojure can not do.
01:15somniummachine learning has so many applications...
01:15bmasonwhat triggered clojurebot to say that?
01:15somniumClojure
01:16Crowb4rdefn: you get it working?
01:16somniumhmm
01:16defnCrowb4r: looks like
01:16defnCrowb4r: pretty sure it was a problem with my truncate function
01:16Crowb4rcool
01:16Crowb4rahh
01:16Crowb4ris that code in github?
01:16defnthe latest? yes, should be
01:17Crowb4rdefn: good job, that is really cool
01:17doseqQ: is there one definitive place to get clojure info, like a programmer's manual or something? Preferably in a reader-friendly format.
01:17defnCrowb4r: wanna add your irc bot code into the mix? id like to have it add to refs when it sees sexps in the channel
01:17Crowb4rsyntax hilighting and maybe a noshow javascript for the answers would be cool
01:18defnyeah! noshow would be really cool
01:18underdevclojure.org isn't so bad...
01:18underdevdiscursive stuff on the left, api stuff on the right
01:18defnCrowb4r: ultimately id really like to be able to "rate" examples, so users get a big giant list of garbage when the site goes live, but over time the results are improved
01:19defnunderdev: kind of like a mullet -- business in the front, party in the back
01:19underdevdefn, excellent
01:19Crowb4rI'm basing my idea from the labrepl site
01:19doseqI downloaded a copy of the core API documentation from clojure.org, and have been re-organising it into categories.
01:19defnCrowb4r: ah yes -- i will possibly lift Stuart H's syntax hilighting and js stuff
01:19bmasondefn: http://getclojure.org:8080/examples/$concat just returns $concat... am I supposed to see something else?
01:20defnbmason: drop the $
01:20bmasonah nice
01:20bmasonall instances of calls to clojurebot?
01:20defnbmason: all instances of sexps in this channel's history
01:20defnwhich compile in a sandbox
01:20bmasonwonderful!
01:21bmasonthat's a great idea
01:21defnif none of them compile it shows you bad results
01:21underdev,(underdev is a strikingly handsome man)
01:21clojurebotjava.lang.Exception: Unable to resolve symbol: underdev in this context
01:21defnhaha, luckily that wont compile
01:21underdevyou know, just to make sure it's in there
01:22defn,{:rhickey "is" :our "fearless" :leader "."}
01:22clojurebot{:rhickey "is", :our "fearless", :leader "."}
01:24defnunderdev: :)
01:26underdev(and "underdev is a strikingly handsome man" "underdev is a giving lover")_
01:26underdevdidn't want to put the comma there :)
01:26defn=> false
01:27Crowb4rdefn: I can tr yto help you with some of this later if you want
01:27doseqHey, does anyone know if [1 2 3] is syntactic sugar for (vector 1 2 3)?
01:27defnCrowb4r: don't count on me to say no to help :)
01:28LeNsTRhttp://getclojure.org:8080/examples/3.14
01:28bmasondoseq: yes
01:28LeNsTRo_O wtf =)
01:28doseqbmason: thanks!
01:28defnLeNsTR: haha that's pretty cool
01:29bmason,(vector 1 2 3)
01:29clojurebot[1 2 3]
01:29defnuh oh -- need to escape html :X
01:29defnhttp://getclojure.org:8080/examples/h1
01:30doseqYeah I REPL'd it and they evaluate the same, I was just wondering if anyone knew if they were similar at the source code level.
01:30LeNsTRmagic! =)
01:30defnuntill someone puts something mean in there :)
01:31bmasonyou could dig into Clojure core to be sure, but I believe reading somewhere that they are
01:31doseqThanks again.
01:31bmasonnp
01:31underdevsomeone told me that they weren't equivalent in all cases, but i have yet to see it
01:32underdevdefn: very cool man. very fun. now back to maven hell...
01:32bmason,(class (vector 1 2 3))
01:32clojurebotclojure.lang.PersistentVector
01:32defnjust to make sure i do it... (str "<h1>NAUGHTY JAVASCRIPT AHEAD!</h1>")
01:32bmason,(class [1 2 3])
01:32clojurebotclojure.lang.PersistentVector
01:33underdevtold 'im so...
01:33bmasonjava classes don't lie, right?
01:34underdevthe topic was whether [] was syntactic sugar...
01:37doseqI learned today that "syntactic sugar", the phrase, was invented by a guy who was influential in bringing lambda calculus to programming, who later went on to be a prominent gay rights activist.
01:37Crowb4rdefn: cool, I want the exp. :)
01:37bmasonnice
01:37bmasongod knows where the phrase 'eye candy' came from
01:38defnCrowb4r: the biggest thing i want to add right now, if you're interested, is an irc bot which collects sexps from the channel after it has done its initial log parsing
01:38defnerr after walton has done its initial log parsing it should be ready to start grabbing new sexps from the channel and add them to the ref *sexps*
01:40Crowb4rk
01:40underdevbmason: i don't have clojure set up on this account yet, i made it specifically to mess with clojure, but (defn foo (vector a b) (println "bar baz")) fails on ideone
01:40underdevmess with maven, i mean
01:40Crowb4rI can make perrin (my little crappy watch for all of that soon.
01:41underdevoh, but that's a macro, right? one sec
01:43bmasonI see what you mean
01:44bmasonyeah, I think it is the way the macro expansion works
01:45underdevno, can't do it with fn either, it seems
01:45underdevbastard was right
01:47bmasonisn't fn a macro?
01:47underdevno, its a special form, i think is what they call it
01:47bmason(defmacro fn
01:47bmason "(fn name? [params* ] exprs*)
01:47bmason (fn name? ([params* ] exprs*)+)
01:48bmasonfrom clojure.core source
01:48_atoit's a macro, the special form is fn*
01:49underdevSTUART HALLOWAY IS A LIAR AND A FRAUD!
01:49bmasonhahaha!
01:49underdevor, maybe i understood it incorrectly... either way
01:50underdevOH, AND MARK VOLKMANN TOO
01:50underdevwho else perpetrates this pernicious lie?
01:50doseqA special form is any expression that either doesn't evaluate one of its arguments, or can take an indeterminate number of arguments.
01:51doseqSo fn is a special form.
01:51underdevoh, well, than never mind
01:51_atoin Clojure any normal function can take an indeterminate number of arguments
01:52_atoand any macro can not evaluate one of its arguments
01:52_atoso by that definition special forms aren't particularly special :-P
01:52_atohttp://clojure.org/special_forms
01:52bmason,(special-symbol? fn)
01:52clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/fn
01:52_atoit's probably authoratively considered a special form and fn* is probably considereed an implementation detail
01:53bmason,(doc special-symbol?)
01:53clojurebot"([s]); Returns true if s names a special form"
01:53_ato,(special-symbol? 'fn)
01:53clojurebotfalse
01:53_ato,(special-symbol? 'fn*)
01:53clojurebottrue
01:53bmasonah
01:53bmasonneeds symbol, gotcha
01:54doseqI'd say technically fn is a macro, and (fn x [y] y) is a special form that uses it.
01:56doseqThat's going by the original definition of special form from the LISP 1 and 1.5 manuals.
01:58LauJensenThats not how I see it. fn is a macro - end of story :)
01:58LauJensenWe've used 'Special Form' to refer to a few forms which were implemented in Java
01:59doseqThat's a confusing clash of terms :)
01:59somniumI thought special form meant the symbol is embedded in compiler.java and doesnt point to a var/lexical binding
02:00LauJensensomnium: Yep
02:00underdevLauJensen: it is widely popularized that fn is a special form
02:01doseqIn older texts a form is any symbolic expression that can be evaluated, and a special form is one that doesn't evaluate some arguments, like (def x 5).
02:01doseqWhat's the terminology for that in clojure?
02:02underdevin screencasts, print...
02:02LauJensendoseq: IFns is are functions, where all arguments are evaluated, macros are the opposite in that you control evaluation
02:02LauJensen,(doc fn)
02:02clojurebot"([& sigs]); (fn name? [params* ] exprs*) (fn name? ([params* ] exprs*)+) params => positional-params* , or positional-params* & next-param positional-param => binding-form next-param => binding-form name => symbol Defines a function"
02:02LauJensen~source fn
02:02LauJensenunderdev: Go see for yourself, its a pure macro
02:02underdevi did. bmason posted the code.
02:03underdevyou are right, and they are wrong.
02:03doseqI'm not saying it isn't one... I'm asking what's the clojure term for (def x 5) where x is not evaluated, versus (+ 1 2) where 1 and 2 both are?
02:04doseqLISP makes a distinction between them but I haven't seen any clojure material on it so far.
02:05LauJensendoseq: To my knowledge there is no distinction, except one is a macro and the other is a function
02:05_atodoseq: in Clojure a form that does not evaluate it's arguments is either a special form or a macro
02:06_ato,(keys (clojure.lang.Compiler/specials))
02:06clojurebot(new quote & var set! monitor-enter recur . clojure.core/import* do fn* throw monitor-exit letfn* finally let* loop* try catch if def)
02:06doseqRight, and a macro would therefore be a kind of special form. That makes sense to me.
02:06doseqWhen used, that is.
02:08underdev,(special-symbol? 'if)
02:08clojurebottrue
02:08underdevokay, well not everything ive heard is a lie :)
02:08doseqSo am I right in thinking that there's some term confusion between special forms in the mathematical sense and special forms in this other Java/special-symbol sense?
02:09doseqI can handle that, it's just not signposted :)
02:12somniumOT question: javascript has this nasty property where "" and 0 evaluate to false. To completely cure it (if x ...) needs to be (if (x || (x === "") || (x === 0)) ...), but this isnt always desirable. is it horribly ugly to present users with an 'if* (plain host if) and an 'if (if with safety ternary)?
02:12somniumwrt a lisp hosted in javascript
02:15defnsomnium: yeah the triple = is a must in JS
02:18_atosomnium: I think that's a reasonable way of doing it.
02:18_atoso that leaves null, false, undefined and NaN as false
02:18somniumsometimes x will never be 0 or "", and sometimes in loops there are some performance tricks with 0 evaluating to false and --
02:19somniumah yeah, I always forget about NaN, tacking on an isNaN would be going too far think
02:22_atoyeah, NaN probably doesn't matter enough to bother including
02:22psykoticNaN contamination is fun
02:23psykoticmost programs are so poorly situated to handle NaNs that they should probably have been signaling rather than non-signaling in most languages like JavaScript
02:24psykoticNaN contamination is where you get an initial NaN somewhere and over time it spreads to larger and larger parts of your data as the NaN is combined with non-NaNs, producing more NaNs in the process. it can be a pain in the ass.
02:25_atoI guess the commonest ways to get NaN are through casting a non-numeric string to an integer or 0/0
02:26_atoboth would be exceptions in Clojure's semantics, if you're following that for your lisp
02:27_atoactually probably parsing an invalid integer would be nil, so that fits with NaN being false
02:27psykoticin a dynamically typed language, i would definitely prefer trapping NaNs and converting to nils
02:27psykoticthat way you would get early signaling
02:28_atoyeah, good point
02:28somniumsince javascript is so close to scheme already, Ive come to think its a simpler task to write a scheme-like reader and compiler in javascript, and use that to build abstractions.
02:29somniumits a bit less to get wrong in any case
02:29psykoticprogramming with NaNs is like programming in a language where not only is (first nil) = nil, etc, but (+ nil x) = nil, and so on
02:29psykotica little 'silent nil pass-through' is convenient but too much is a nasty thing
02:32psykoticsomnium: there are already some things like that, i think
02:32somniumpsykotic: Ive seen a few, but none that actually seemed intended for use as an enhanced javascript
02:33psykotichas anyone tried clojure with gwt?
02:33psykotici assume it would be a dog but...
02:34somniumtheres this interesting project coffee-script on github, where they're wrestling a bit with adding macros to its lexer/parser
02:34somniumI think gwt works from java sources, no?
02:34psykotici thought it worked from bytecode but i haven't used it
02:34psykoticin any case there are round-trippable bytecode to java compilers
02:34psykoticdecompilers, even
02:35Crowb4rdefn: You still up?
02:38defnyes
02:39Crowb4rSo, you need me to just have abot idle in here parsing whenever clojurebot is called to eval somethin.
02:39Crowb4ror do you want when anyone does a sexp
02:40Crowb4rthe latter would lead to errors I have a feeling
02:42defnwhen anyone does a sexp
02:43Crowb4rk
02:43defntake a look at the extract-expression fn
02:43defnand also note the "add-sexp" fn
02:44defnif you follow that for reading the sexp in, and adding it to the *sexps*, it should act sane
02:44Crowb4rk
02:47Crowb4rOhh, this should be a bit easier then I thought. I think
02:47Crowb4rDo you want me to put them in a file for you to parse in?
02:49defnone second
02:49defnbusy with something atm
02:51Crowb4rk
02:58doseqDoes anyone know if there's a project underway to rewriter Little Schemer for clojure?
02:58doseqOr something Little Schemer-ish.
03:44defnCrowb4r: im still here fwiw
03:44defnCrowb4r: you're saying you're going to put what the bot gives back into a file?
03:44Crowb4rI can
03:45defnCrowb4r: not necessary since, when you start up walton it is going to need to re-parse all of the logs anyways
03:45defnso ill have logs for that day
03:45Crowb4rk
03:46Crowb4rSo, then what would you need an ircbot to do if you already have the logs for walton?
03:47doseqIs anyone here familiar with rhickey's Are We There Yet presentation? I'm wondering what he means by controlling the spin of CAS.
03:54defnCrowb4r: to basically just hang out in here, and run add-sexp on lines that return something for extract-expressions
03:54Crowbar7ahhh
03:54defn(add-sexp (extract-expressions line-from-irc))
03:54defnsomething like that
03:55Crowb4rummk
03:55Crowb4rThat is doable
03:55Crowb4rI will write something tomorrow probbably
03:55defnand then on top of that, id like it to be able to give random examples for a keyword
03:55defn(walton "concat") will do that
03:59Crowb4rso when you query the bot he will feed back a random example piece of code
04:00defncorrect
04:00Crowb4rk
04:01tufflaxWhy doesn't (.separator File) work? (. File separator) does work. Doesn't it work for static fields and methods?
04:01Crowb4rdid you mesn static fields and static methods?
04:02tufflaxyes
04:03Crowb4rshould work then
04:05tufflaxI get this error message: No matching field found: separator for class java.lang.Class
04:17MrEvilis their an easy way to convert a list to a set
04:20zmila,File/separatorChar
04:20clojurebotjava.lang.Exception: No such namespace: File
04:20zmila,java.io.File/separatorChar
04:20clojurebot\/
04:22zmila,(into (list) #{2 3 4})
04:22clojurebot(4 3 2)
04:27MrEvilsorted-set is what I was looking for
04:27MrEvilthanks though
04:28zmila,(into (sorted-set) ##{2 1 3 1000 4})
04:28clojurebotNo dispatch macro for: #
04:29zmila,(into (sorted-set) #{2 1 3 1000 4})
04:29clojurebot#{1 2 3 4 1000}
04:29zmila:)
04:33somnium,(apply sorted-set '(42 4 11 21))
04:33clojurebot#{4 11 21 42}
04:33somniumfwiw
05:05tomojhttps://gist.github.com/564f6f92e1d3e7b6155e
05:06tomojmaybe it would be better if it stuck with a mode until you changed it again
05:08bittiso problem 20 of project euler is really a one line in clojure :)
05:09bitti,(reduce + (map #(-> % int (- 48)) (-> (reduce * (range 1 100)) str)))
05:09clojurebot648
05:11Borkdude(macroexpand '(-> % int (- 48)))
05:11Borkdude,(macroexpand '(-> % int (- 48)))
05:11clojurebot(- (clojure.core/-> % int) 48)
05:12Borkdude,(clojure.contrib.macro-utils/mexpand-all '(-> % int (- 48)))
05:12clojurebot(- (int %) 48)
05:13tomoj,(->> 100 (range 1) (reduce *) str (map #(-> % int (- 48))) (reduce +))
05:13clojurebot648
05:13Borkdude,(clojure.contrib.macro-utils/mexpand-all '(-> (reduce * (range 1 100)) str))
05:13clojurebot(str (reduce * (range 1 100)))
05:13tomojclojurebot should be able to automatically take some code and totally mangle it into -> and ->>
05:13BorkdudeWhat is the problem here?
05:14somniumand I thought haskell's sigils could be inscrutable
05:14Borkdudewhy convert a number to a string and then to an int again?
05:14bittiok (str (reduce * (range 1 100))) might be shorter
05:15tomojBorkdude: splitting digits I assume
05:16zmilastr is not lazy, so you first traverse the 100! while converting to string, than the second time - while summing the digits.
05:16bittiBorkdude: easiest way to get the digist?
05:17Borkdudeah ok
05:19zmila,(loop [x (reduce * (range 1 100)), sum 0] (if (zero? x) sum (recur (quot x 10) (+ sum (rem x 10)))))
05:19clojurebot648
05:20zmilaloop-recur is used to get digits (rem x 10) and accumulating into sum
05:22zmilawhat is diff between (rem) and (quot) ? don't know :)
05:22bittizimila: nice. but with str you get the digits with a native function
05:23tomojzmila: that's a lot slower
05:23tomojfor me :(
05:24Borkdudein the repl, what is the symbol to retrieve the last result?
05:25somnium,*1
05:25clojurebotjava.lang.IllegalStateException: Var clojure.core/*1 is unbound.
05:25Borkdudetnx
05:27bittitomoj: a little slower, but not so much?
05:27bitti,(time (loop [x (reduce * (range 1 100)), sum 0] (if (zero? x) sum (recur (quot x 10) (+ sum (rem x 10))))))
05:27clojurebot648
05:27clojurebot"Elapsed time: 3.724 msecs"
05:27bitti(time (reduce + (map #(- (int %) 48) (str (reduce * (range 1 100))))))
05:28BorkdudeIt's about time we make the (-character the activating char for clojurebot...
05:28troutwineI'm new. Could someone help me out a bit here: http://paste.lisp.org/display/97303
05:28bitti,(time (reduce + (map #(- (int %) 48) (str (reduce * (range 1 100))))))
05:28clojurebot648
05:28clojurebot"Elapsed time: 2.272 msecs"
05:29bitti(yeah you're right)
05:33troutwineSorry for the noise everybody. I was looking at the wrong documentation.
05:35Gertmis the ELPA M-x clojure-install still the good way to install?
05:37zmilamy repl inside eclipse (on Windows) shows times near 1 msec for both one-liners. One need to test with bigger numbers to compare :)
05:38bittiGertm: don't know, I installed swank-clojure and when starting slime it installed the rest automatically
05:38bittiGertm: that was the only way I got slime running, all other ways lead to strange errors :(
05:39Gertmokay
05:39Gertmwell slime already works from my Lisp setup, but perhaps I should start from zero
05:39bittiI installed clojure-mode though, don't know if it's necessary
05:40zmilatomoj - when i run for 1000! your variant is faster to my (8-12 ms vs 42-48 ms)
05:42Gertmbitti: heh ok so: swank-clojure.el:47:1:Error: Cannot open load file: slime (when trying to install from ELPA)
05:43bitti:(
05:43Gertmugh, this is the main reason for me to ditch clojure right away
05:43bittiGertm: don't know if you have to start from scratch, I don't want to mess up your lisp setup...
05:44GertmI removed that part from my emacs config to be sure :)
05:45bittiand when you install slime with elpa?
05:46bittizimla: I see, maybe this typecasting (char -> int?) is expensive
05:46Gertmlemme check
05:47Gertmbitti: gonna do this tonight, got an easter lunch :) cya
05:47divGertm: have you tried following the instructions on github for swank-clojure ? http://github.com/jochu/swank-clojure/blob/master/README.md
05:47Gertmyup, that's what I'm reading
05:48divmaybe your previous slime install is causing your grief ?
06:01defnGertm: rm -rf ~/.emacs.d/elpa and reinstall all of it
06:01defni had that problem once upon a time i think
06:03RaynesAttention: I hate XML with the fury of a thousand angry Gods.
06:05bittizmila: ok, I take it back. my version seems to be 4-5x faster for bigger factorials ;)
06:06tomojbitti: the string version?
06:06bittiyeah
06:08zmilabitti, ok. this is one more confirmation of the rule: use map/filter/reduce first, but loop/recur only in last turn :)
06:08zmilaif there were seq over digits of a number ....
06:09Borkdude,(defn digits [n] (str n))
06:09clojurebotDENIED
06:10Borkdude,(str 10)
06:10clojurebot"10"
06:10zmilayes, i know, Borkdude, but this is seq of chars :)
06:11Borkdude,(let [digits (fn [n] (int (str n)))] (digits 123))
06:11clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
06:11Borkdudeah damn ;)
06:12Borkdude,(let [digits (fn [n] (map int (str n)))] (digits 123))
06:12clojurebot(49 50 51)
06:12Borkdudeoh no, ah wait
06:12LauJensenuser> (time (reduce + (map #(- (int %) (int 48)) (str (reduce * (range 1 100))))))
06:12LauJensen"Elapsed time: 0.815747 msecs"
06:12LauJensen648
06:12LauJensenuser> (time (reduce + (map #(- (int %) (int 48)) (str (fac 99)))))
06:12zmilaone step forward two back, yes
06:12LauJensen"Elapsed time: 0.491263 msecs"
06:12LauJensen648
06:12BorkdudeI shouldn't be trying here immediately ;)
06:12LauJensen
06:17RaynesLauJensen: My bot can check the weather now. My bot can check the weather, clojurebot cannot, therefore I am way more powerful. :D
06:20Borkdude(defn digits [n] (map #(Integer/parseInt (str %)) (str n)))
06:26Borkdude,(let [digits (fn [n] (map #(Integer/parseInt (str %)) (str n)))] (digits 1234))
06:26clojurebot(1 2 3 4)
06:28Raynes,(letfn [(digits [n] (map #(-> % str Integer/parseInt) (str n)))] (digits 1234))
06:28clojurebot(1 2 3 4)
06:28Raynesletfn ftw
06:28Raynes:>
06:28Borkdude(doc letfn)
06:28clojurebot"([fnspecs & body]); Takes a vector of function specs and a body, and generates a set of bindings of functions to their names. All of the names are available in all of the definitions of the functions, as well as the body. fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+)"
06:30Borkdudeyeh better ;)
06:31Borkdudea macro transforming regular code into clojurebot-friendly would be convenient
06:31Raynesdef-stuff is not allowed in general. Anything that could pollute the namespace.
06:31doseqI need some help with compojure... can anyone see what's wrong with this?
06:31doseq(defn remoteeval [request] (-> request :params :expression load-string))
06:32LauJensendepending on what is in params, that looks fine
06:32doseqI'm trying to do a simple browser-based REPL but it chokes on anything other than strings like "Hello"
06:32LauJensendoseq: put a (swank.core/break) right before that s-exp, then inspect the locals and you'll see whats in param
06:32doseqIf I send (+ 1 2 3) or anything like that it just hangs.
06:32LauJensenThen you can fiddle at the REPL with it
06:33doseqOk I'm going to have to unpack that instruction a bit, I'm still learning :)
06:35Borkdudehaha nice question: why is Scala complex, because we need to create complex software? http://stackoverflow.com/questions/2573899/why-is-scala-very-complex
06:36doseqLauJensen: I don't use Emacs, does that advice still apply?
06:37RaynesI can't even do swank.core/break /in/ a slime REPL, so... ;o
06:37doseq:)
06:38Borkdudeboth Clojure in Action and Programming Clojure go into mutually recursive functions
06:38Borkdudedoes that get used a lot in practice?
06:39zmilaScala's the most disadvantage - name :) one hardly google it.
06:43LauJensendoseq: No - You're stuck
06:43LauJensenYou have to use a println or something similar to peek at the locals, or attach JSwat
06:43doseqOk thanks, I'll keep working on it.
06:52patrkris_is there something similar to argmin (from math) in clojure?
06:54bittiLauJensen: why (int 48)? http://clojure.org/java_interop#Java%20Interop-Type%20Hints says type hints are not needed for statics
06:55psykoticdoseq: i didn't see your full question, but you might consider debug-repl
06:56doseqpsykotic: Cool, thanks.
06:56Fossisometimes these classloaders are driving me crazy...
06:57psykoticdoseq: http://clojars.org/org.clojars.gjahad/debug-repl
07:14doseqI got it... had the function order backwards. I had to cast it as a string before trying to return it to the browser:
07:14doseq(defn remoteeval [request] (-> request :params :expression load-string str))
07:15doseq:P
07:23hamzaguys, what is the state of native lib support for leiningen?
07:23psykotichamza: you need the native-deps plugin but then it works well.
07:24psykotichamza: one thing is that i don't think the repl works right when you're using native deps, but you can use lein swank just fine.
07:26hamzathis one right http://github.com/swannodette/native-deps ?
07:31Associat0ris there an online Clojure REPL somewhere?
07:34RaynesAssociat0r: http://lotrepls.appspot.com/ Closest thing I know of.
07:35Associat0rthanks Raynes
07:37psykotichamza: yep
07:40FossiAssociat0r: well, clojurebot has a repl :)
07:41Fossi"Caused by: java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V"
07:41Fossii guess that means the api changed in 1.2?
07:42RaynesFossi: It means your contrib and your Clojure aren't in sync.
07:42Associat0rFossi: thanks
07:42Fossii don't get that error in contrib, but in another package
07:42RaynesMeaning, the contrib you're using wasn't built against the Clojure you're using.
07:43Fossiwhich i don't have the source for atm :\
07:43RaynesAt least, that's what it almost always means.
07:43Fossiso, i guess now i can only go back to 1.1 for the time being
08:05defnMorning everyone
08:37esjmorning defn
08:37LauJensenbitti: it wasn't a type-hint to avoid reflection, it was making it a primitive
08:38bittiI see, but isnt 48 a primitive?
08:39zmila,(type 48)
08:39clojurebotjava.lang.Integer
08:39zmila,(type (int 48))
08:39clojurebotjava.lang.Integer
08:40bittiqed?
08:40LauJensen,(expression-info '(48))
08:40clojurebotnil
08:40LauJensen,(expression-info '(+ 2 2))
08:40clojurebot{:class java.lang.Number, :primitive? false}
08:40LauJensen,(expression-info '(+ (int 2) (int 2)))
08:40clojurebot{:class int, :primitive? true}
08:41zmilainteresting
08:42bittiwhere can I find this "expression-info"?
08:42bsteuber,`expression-info
08:42clojurebotclojure.contrib.repl-utils/expression-info
08:47LauJensenbitti: check out my latest blog-post for a few of these performance tips if u like
08:49defnpretty awesome, tbqh
08:58defncd ~/def
08:58defnls
10:01BorkdudeWhen I have this code:
10:01Borkdude(let [lzs (map #(do (println "side effect") (+ % 1)) [1 2 3])] (first lzs))
10:01BorkdudeI get:
10:01Borkdudeside effect side effect side effect 2
10:02Borkdudewhy not only one time "side effect"?
10:02bsteuberborkdude: chunked sequences
10:02Borkdudebsteuber, say what?
10:03bsteuberborkdude: http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/
10:03LauJensenWhich hopefully goes away soon
10:06BorkdudeI see
10:08Borkdudecan I call a function from a repl to see what version of clojure I'm using?
10:08LauJensen,*clojure-version*
10:08clojurebot{:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"}
10:08LauJensen1.1.0-MASTER
10:09bsteuber,(clojure-version)
10:09clojurebot"1.1.0-master-SNAPSHOT"
10:10Borkdudeah great, tnx
10:17Borkdudebtw how do you call x in (let [x expr] ...), obviously not a var, but what, symbol?
10:18BorkdudeIdentifier?
10:18BorkdudeVariable?
10:19LauJensena local ?
10:20BorkdudeI dislike calling them variables because they are immutable
10:20bsteuberlocal binding, I guess
10:20Borkdudebut in Clojure in Action they are called variables
10:21Borkdudebinding: the expr is bound to ... what?
10:21bsteuberif they differentiate between var and variable, this might be okay as well
10:22bsteuberbut yeah, feels a bit strange :)
10:22bsteuber"x is bound to expr"
10:23Borkdude"local identifier"?
10:24Borkdudelocal for short might be the nicest
10:31LauJensenBorkdude: They are referred to as locals
10:31Borkdudeok
10:33BorkdudeAh from the clojure.org website: Locals created with let are not variables. Once created their values never change!
10:33LauJensenYea, I'm sorry - The "?" threw you off
10:33Borkdudeyes, thanks for clarifying
10:34BorkdudeMaybe the books should stick to that also instead of calling them variables
10:35LauJensenI hope nobody calls them variables
10:35LauJensenAs Rich said, that would simply be too disappointing
10:36BorkdudeWe briefly saw the let form in chapter two, where we used it to create local variables. Let’s quickly look at another example of using it – (let [x 10 y 20] (println “x, y:” x “,” y)) Here, x and y are local variables.
10:36BorkdudeCiA p88
10:36LauJensenHmm
10:36LauJensenSend him an email, he can keep it mind for the next rev
10:36Borkdudeyes will do
10:37BorkdudeI'll post it on the manning forum which is the place for that
10:37LauJensenOh ok
10:39BorkdudeOnce they are starting to talk about closures, they should also have to use the expression: free local instead of free variable
10:39Borkdudewhich is not really usual when talking about closures, right?
10:46BorkdudeHmm java.lang.NoClassDefFoundError: clojure/contrib/repl_ln
10:47Raynes,(let [x 3, x (+ x 3)] x)
10:47clojurebot6
10:50Borkdude,(clojure.contrib.macro-utils/mexpand-all '((let [x 3, x (+ x 3)] x))
10:50clojurebotEOF while reading
10:50Borkdude,(clojure.contrib.macro-utils/mexpand-all '(let [x 3, x (+ x 3)] x))
10:50clojurebot(let* [x 3 x (+ x 3)] x)
10:57LauJensenhugod: I'm also seeing these *current-thread* unbound errors when I'm in the main-thread
11:02doseqRe: variables. In Rich's talk on time he goes to great lengths to describe how logical identities point to an immutable value now, but over time the value being pointed to changes. I don't understand why this can't just be called a variable.
11:03LauJensenbecause its immutable
11:03LauJensenvariable: a quantity that can assume any of a set of values
11:03LauJensen
11:04LauJensenThis does not in any way describe a local, it might describe a 'reference' type
11:05doseqThat doesn't really address my question though. If the symbol points to different values over time then it's a variable pointer.
11:05Gertmswank-clojure.el:47:1:Error: Cannot open load file: slime I removed the ELPA dir, reinstalled ELPA, checked 'swank-clojure' for installation and hit 'x'
11:05LauJensendoseq: A local does not point to different values over time, thats the difference
11:06doseqA local? Like in a let?
11:06LauJensenYes
11:07doseqRight, of course. I didn't mention locals.
11:07LauJensen(let [im-a-local 5 im-a-ref (ref 5)]..
11:07LauJensenThe first is never changing and will always be 5. The second can change, but via indirection, so ref is more descriptive than variable - it still points to something immutable
11:08doseqLet me re-read the original discussion...
11:08doseqSorry, I misread it.
11:08LauJensennp :)
11:09doseqIt is pretty hilarious that they can't be called variables though, since the whole point of a lambda is to order variables :)
11:11doseqSo really what we're talking about is an argument, which is a variable, being populated by a constant. I love the subtlety of it.
11:18IntertricityIs there a book to read for first time programmers for clojure?
11:19Fossiclojure in action is the only book so far
11:19Fossiso i guess that'd be it ;)
11:19doseqAnd it's not for first time programmers as far as I can tell.
11:20Chousukeonly book? what happened to Programming Clojure .P
11:20Fossiwell, not really i guess. might be that some other lisp book would be a better choice
11:20Fossiups, that's what i meant really
11:20LauJensenFossi: I think Programming Clojure is usually the recommended first stop
11:21Fossiso there is a clojure in action now?
11:21doseqAll the clojure material I've read assumes knowledge of Java or LISP or both.
11:21LauJensenFossi: Yea
11:21doseqMy wikipedia's been on overdrive.
11:21LauJensendoseq: not PC, I've skimmed it and it looks very entry level
11:23doseqI read the PC samples and they were sufficiently jargony and dense that I wouldn't recommend it to a beginner. No offense to the author, who is obviously very great.
11:23qbgProgramming Clojure looks pretty good to me
11:26psykoticdoseq: probably they were not meant to be read by themselves but with the text.
11:26psykoticdoseq: if he explains the jargon to his readers, what's the problem? jargon is good.
11:26doseqpsykotic: sorry, I meant the sample chapters.
11:26psykoticah.
11:27Gertmcan anyone point me to a good tutorial on getting clojure set up for emacs?
11:27GertmI'm following the guide on the swank-clojure page but it just doesn't work
11:27psykoticGertm: Lau has a good one on Vimeo. i'm sure he'll link you in a second. :)
11:27psykoticdoseq: what's your language background?
11:28GertmLauJensen?
11:28clojurebotLauJensen is some dane
11:28psykoticpsykotic?
11:28LauJensen~google Clojure 101 - Setting up SLIME and Emacs
11:28clojurebotFirst, out of 156 results is:
11:28clojurebotSLIME + clojure - SWiK
11:28clojurebothttp://swik.net/SLIME+clojure
11:28Gertmthanks!
11:28LauJensenouch, googleburned
11:28psykotichaha
11:28LauJensen:(
11:28Gertmow, not right one?
11:29LauJensenhttp://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/
11:29LauJensenGertm, thats mine
11:29LauJensen~google functional fluid dynamics
11:29clojurebotFirst, out of 205000 results is:
11:29clojurebotFunctional Fluid Dynamics in Clojure | BEST IN CLASS
11:29clojurebothttp://www.bestinclass.dk/index.php/2010/03/functional-fluid-dynamics-in-clojure/
11:30LauJensenYea! Google Domination
11:30Gertmthanks LauJensen
11:30LauJensennp
11:31doseqpsykotic: In time order, BASIC, QBasic, Access Basic, Java, ASP, PHP, ActionScript, JavaScript, Objective-C and now Clojure. I've been studying the history of languages from the LISP and ALGOL families as well as Smalltalk to get a better bearing on things.
11:31psykoticdoseq: what did you find jargony about it then?
11:31LauJensendoseq: So.. you did a quality study on PHP did you? :)
11:32psykoticdoseq: i'm curious because i skimmed the book and found it entry level... to a fault :)
11:32doseqpsykotic: I can't remember specifically... I'm a tech writer and editor so I read things more critically probably.
11:33psykoticit's really difficult to remember how much knowledge you take for granted when you're writing. but i assume they actually 'test drove' the book on some subset of the intended audience and adjusted the exposition level accordingl.
11:34psykoticLauJensen: quality study of PHP = memorizing these tables: http://php.net/manual/en/types.comparisons.php :)
11:34IntertricityFossi, thanks I'll look that up
11:34LauJensenpsykotic: hehe, powerful stuff
11:35LauJensenIf you havent seen it, you wont believe how much power can be crammed into just a few thousand lines of PHP
11:35psykoticLauJensen: with those kinds of semantics, you must either be autistic or resigned to writing code that almost but only sort of works
11:36psykoticyeah, i've done some PHP hacking. the best thing i can say about it (which is also its achilles' heel) is that it's very easy for someone who doesn't know the language to hack on it
11:36doseqLauJensen: PHP's a pretty fascinating success story. Personally I'm a big fan of static content serving, but I've had fun writing PHP before. I never did like the lack of dot syntax though.
11:36LauJensenYou had fun writing it?
11:37psykoticsome of my least fun programming has been trying to make wordpress to my bidding
11:37LauJensenThat is entirely different to my experience of trying to deploy it in industry - I remember only the pain, the tears, the lonely nights reviewing the progress on the bug tracker
11:37LauJensenBut ok, of all the things we could discuss this fine afternoon, let not PHP be one of them
11:38doseqLauJensen: I ran a decent-sized site on it for a while... taught me a lot about managing Apache processes, that's for sure!
11:39psykotici'm disappointed no one commented on my infix reader hack that i posted to the mailing list last week. i was expecting some flames at least :)
11:39LauJenseninfix?
11:39clojurebotinfix is not worth the trouble; see http://groups.google.com/group/clojure/browse_thread/thread/319a1c77ed718ba/3e4be7484b7cbe38
11:39LauJensenman thats fun
11:40psykoticLauJensen: http://groups.google.com/group/clojure/browse_thread/thread/170616bcc7d776f2/8231ea8bcada43d8?lnk=raot
11:40LauJensenIn the Functional Dynamics post I did - The thing which got echoed the most was my comment on infix. "Was he joking?" "No he couldnt me" "yes he was half joking" "he was not joking!".. :)
11:41psykoticprefix syntax isn't an end in itself
11:41LauJensenpsykotic: I'm naturally disgusted, but I'll be merciful since you did write that sickness was the cause of this code
11:41psykotichaha right
11:41Chousuke:P
11:42psykoticyou have to admit it's nice that it's totally seamlessly integrated with macros because it works at the reader levl
11:42psykoticalso, the implementation is like 20 lines of code (java code!)
11:43doseqI'm working on a visual form composer, thinking of simulating the look of infix notation by including GUI sugar.
11:43LauJensenpsykotic: Yea its cool that it was so simple to do
11:43LauJensenWhats the point ? Seriously, infix is an inferior notation form which demands precendence rules.
11:44psykoticLauJensen: aren't you the one preaching about code density?
11:45doseqRight, but it's a visual form builder so the actual containment is the same. It'd just be a presentational thing.
11:45LauJensenpsykotic: The only way I could see infix making an apperance in Clojure, would be if I freed up just a little more time and then integrated J into the Clojure syntax
11:45psykotici'm programmed in common lisp and scheme for like 12 years and there's no way that prefix s-expression syntax is an unqualified good blessing. does it outweigh the down sides? yes. but that isn't the same say as saying that it's superior in every way.
11:45psykoticLauJensen: oh, i don't want clojure to be infix.
11:45LauJensen(defn average [col] (+/ % #))
11:46LauJensen(defn average [col] (/ (reduce + col) (count col)))
11:46LauJensenThe Js numerical performance is incredible
11:46LauJensenSo it would be a winning combo
11:46psykoticalso, i don't believe J has precedence rules. incidentally, what i posted doesn't have precedence rules either. everything is equal precedence and right associative.
11:46doseqLauJensen: can you define J? I'm not sure what you mean.
11:47LauJensendoseq: Its a programming language
11:47LauJensenpsykotic: J has precendence rules, although they are different from C and Ks
11:47psykoticLauJensen: well, K has something very simple and uniform. basically, it has different binding strengths for nouns, verbs and adverbs, but that's it. there's no per-operator associativity or precedence.
11:47psykotici think J is similar.
11:48doseqOk, cool. I was just reading about Landin's J operator today so I've got things buzzing around in my head.
11:48LauJensenIt is - But in my terminology "binding strength" is read as precendence
11:48psykotici know but i'm saying that there are only three categories.
11:49LauJensendoseq: I have a couple of blog-posts on J if you want to add to the confusion :)
11:49psykoticand the categories are delinated on semantic lines.
11:49psykotic(J probably has more because it's so disgustingly baroque)
11:49doseqI eat confusion for breakf..ner!
11:49LauJensenJ adds a little trouble to the mix, by having forks, hooks and trains, depending on the number of verbs in each sub-expression
11:49psykoticK is tasteful. J is overindulgent. they didn't know when to stop.
11:49psykoticright.
11:50LauJensenJ is beautiful
11:50RaynesJ is terse.
11:50Raynes:o
11:50LauJensenK is just a letter
11:50doseqLauJensen: what is your blog address?
11:50LauJensendoseq: www.bestinclass.dk
11:50LauJensenOn J
11:50LauJensen1: http://www.bestinclass.dk/index.php/2009/11/mind-games-ascension/
11:50LauJensen2: http://www.bestinclass.dk/index.php/2009/11/life1d-in-clojur/
11:51psykoticLauJensen: that last one reminds me of how annoying it is to have your initial title with a typo in it, so it persists in the permaurl :)
11:51LauJensenhehe - Franky I'm more annoyed with the .php than the typo :D
11:52LauJensen(but it was very kind of you to bring up, in here.. thanks) :)
11:52psykoticcan't you have a rewriting rule to pretend you are php free? :)
11:52LauJensenActually I think it would be simple to have nginx replace it with .clj
11:52LauJensenThat would be cool - I think I'll try that
11:53doseqI just have to say, this channel is SO much friendlier than the jQuery channel.
11:53BorkdudeI'm trying to re-read the discussion, what do you guys mean with J and K?
11:53LauJensenBorkdude: If you check out my posts you'll definately know
11:54LauJensenHere are a couple of simple, and not so simple J examples: http://www.jsoftware.com/jwiki/Studio/Gallery
11:54psykoticLauJensen: one of my favorite things about J is the dev environment.
11:54LauJensenhehe, woot?
11:55LauJensenYou mean that Swing UI ?
11:55psykoticwell, i don't mean the aesthetics. it's nice for repl-style prototyping and i love the integrated tutorials.
11:55LauJensenyea those are great
11:55LauJensenAnd regarding the REPL - You _really_ get some mileage compared to Clojure
11:55psykoticthere's nothing like that for k. k's "ui" is an incredibly bad repl. it doesn't really have error messages. everytime you make a slight mistake, it will just quote what you wrote back at you. thanks, k!
11:56LauJensenReminds me of Clojures infamous "Exception: NO MESSAGE (SOURCE.CLJ:0)"
11:56psykoticyeah, that one rocks.
11:57LauJensenYea, makes me so happy. But then when I open up Source.clj, I get all disappointed :(
12:00Rayneshttp://i.nixeagle.net:8080/t is awesome. The site changes whenever nixeagle switches Emacs buffers or writes something.
12:00doseqSay, does the CLR run like individual virtual machine instances the way Java does?
12:09GertmLauJensen: thank you for the nice video. It helped in realizing I should clean out all my previous '.'-folders. Got a working swank-clojure now! :)
12:13doseqOk I think the answer is no, the CLR is singular and runs apps within itself simultaneously.
12:50LauJensenGertm: np - Glad u liked it :)
13:28LauJensendoseq: of course, how else would you obtain those system-wide crashes if everything was isolated?
14:01nullmanRaynes: that site is pretty cool; is the source code available?
14:01Raynesnullman: What site?
14:01RaynesOh.
14:01RaynesI don't know, I'll ask the guy.
14:01nullmanhttp://i.nixeagle.net:8080/t
14:04Raynesnullman: I'll get back to you on that.
14:04nullmanok, thanks; cool idea anyway
14:05nullmanfor me i would have to block it when i was editing my personal data (i use org-mode with an encrypted file for that), but everything else would be kind of cool
14:07Raynesnullman: The source is mixed in with some other stuff, but he's talking about packaging up and releasing it. Said to give him a day or so. I'll let you know.
14:11The-KennyRaynes: Oh wow, would it be possible to inform me too?
14:11RaynesThe-Kenny: Sure.
14:11The-KennyCool, thanks :)
14:15nullmangreat, thanks Raynes
14:34Crowb4rdefn: we should think about loading these results for walton into a db.
14:34Crowb4rbecause reloading at start is long
15:02TakeVIs there a way to make a new struct that has all the keys of another struct?
15:15hugodLauJensen: *current-connection* I take it?
15:15LauJensenhugod: yep
15:21LauJensen,(.getRGB Color/RED)
15:21LauJensen,(.getRGB java.awt.Color/RED)
15:21LauJensen-65536
15:22LauJensenIs there a simple quick math trick to get the RGB values from that int ?
15:34maravillashow about:
15:34maravillas,(bean Color/RED)
15:34LauJensenI need math tricks
15:35maravillasoh, no bot
15:35maravillasbit masks?
15:37LauJensenSomething like that
15:37maravillasor the algebraic equivalent, if you don't want to bit twiddle
15:37LauJensenI'd prefer bit twiddling
15:48bsteuberLaujensen: Why not (Color. -65536) and get the values from there?
15:48bsteuber(java.awt.Color. -65536)
15:48bsteuber#<Color java.awt.Color[r=255,g=0,b=0]>
15:49bsteuberlooks promising to me
15:49LauJensenIts not bit-twiddling my friend
15:49LauJensenI need über fast bit tricks here
15:49bsteuberah, okay
15:53carkhLauJensen : (bit-shift-right (bit-and 0xFF0000 -65536) 16)
15:54carkhnot quite sure if that's fast or not
15:55carkhi guess ine could check the source of that function
15:55carkhone*
15:55LauJensenLemme check, thanks a lot carkh
16:03TakeVI'd like to make a function that takes a map and a key, and returns a map that is the same as the passed map, except the key has been modified. How do I do that?
16:03LauJensen,(assoc {:one 1 :two 2} :one 5)
16:04bsteuberlife is hard without clojurebot
16:04LauJensenUnless you're chatting in Emacs and have a REPL in the next buffer :)
16:04bsteuberhaha
16:05LauJensenI made a funny?
16:05bsteubermaybe you can even make M-C-x work with it
16:06Fossiwould be pretty sleek
16:06Fossiprolly needs to run the clojurebot andbox
16:09jaojust put the cursor at the end of the expression, and M-x slime-eval-last-expression
16:10jao(you can easily bind a key to that)
16:10bsteubernice
16:11The-KennyIsn't slime-eval-last-expt bound to C-c C-e?
16:11jaonot in erc/rcirc buffers, i presume
16:12The-Kennyoh ok
16:13TakeVLauJensen: Thank you.
16:23Hali_303hi
16:24Hali_303it seems that the resource directory is not added to the classpath, even though swank-clojure docs say so. however, if I do (println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))), only the src, classes and test is added to the CP, not resources. any ideas?
16:25LauJensenHali_303: Could you check (System/getProperty "java.class.path")
16:25Hali_303sure, one sec
16:27Hali_303LauJensen: test, src and classes there only
16:27Hali_303and the libs from the /lib directory, but no resources folder
17:04BlackfootI'm having trouble loading SWT from a lien uberjar I compiled: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
17:07Crowb4rwow, I just spent an hour debugging why my utf-8 chars were showing up as ????
17:07Crowb4rhad to set java file.encoding to UTF-8
17:08albinojava by default pulls the encoding from the OS
17:50underdevi hate maven, life, everyone, and everything.
17:50underdevin approximately that order
17:52LauJensenunderdev: oops, you seem to have popped into #clojure, please return to #common-lisp
17:52LauJensen:]
17:55Chousuke:P
18:00Licensergreetings
18:01Licenserso I've a question, when I have an 'runable' jar I can't combine -cp and -jar since java thinks that isn't cool
18:01Licensercan I combine $CLASSPATH and jar?
18:02Crowb4rSo, what is the best way for me to remove a bunch of newlines that I have in a string scatered about?
18:02TakeVFilter?
18:02joshua-choiA regular expression?
18:03LicenserI'd go wiht a regexp
18:06underdevls
18:06underdevoops :)
18:06Licenser /tmp /usr /etc /home
18:07LauJensenCrowb4r: (.replaceAll s "\n" "")
18:07Licenserbut that is so javaish!
18:08LauJensen(apply str (remove #(= \newline %) s))
18:08Licenserin my eyes the only three reasons to call java directly is A) in a wrapper library B) if performance really matters C) if you are an extremely masochistic person
18:09LauJensenIf its more concise and clear than idiomatic Clojure I have no problem with a Java call
18:10TakeVIs there a library for working with OpenGL, yet? Or is there just LWJGL/JOGL?
18:10Crowb4rLauJensen: You have a point, and will use that.
18:10LauJensenTakeV: Penumbra!!
18:11TakeVSuch enthusiasm. Must be epic awesome. :P
18:11Licenserheh
18:11Crowb4rLauJensen: thanks
18:11LauJensenTakeV: Indeed it is, and the guy driving it fantastic
18:11LicenserI don't know, I think it makes it look javaish and that reminds me of all the horrible things I go through whenever I come close to it
18:12LauJensenTakeV: It even lets you outsource computations to the GPU
18:12Licenserjava has the usual sun problem: great idea but they didn't went through with it to the end
18:12TakeVNice, that'll be helpful.
18:12LauJensenLicenser: Rarely do I find myself in a development situation, where I find its optimal to base decisions based on emotion :)
18:12LauJensen(You'd get along great with my wife though, haha)
18:12Licenser:P
18:13LicenserLauJensen: well if I enjoy code it usually is better then when I don't, at least that is my experience
18:13TakeVHmm, how you incorporate it into your project? Just add project.clj?
18:15Licenserbut jokes aside, as much as I hate java for this taks you're right .replaceAll is actally a simple solution
18:15LauJensenTakeV: :dependencies [penumbra "0.5.0"]
18:15LauJensen
18:16TakeVHmm, it requires LWJGL?
18:16LauJensenYep
18:16LauJensenCheck out his Github page
18:16LauJensenGet started guide, source, etc
18:17TakeVYeah, on there now.
18:19LauJensenTakeV: And make sure you check out his blog http://ideolalia.com/creating-a-simple-game-in-clojure
18:20TakeVNeat, thanks. :)
18:25Crowb4r]
18:25Crowb4r
18:25Crowb4ropps
18:26Licenserhmm I just learned something interesting, leiningen, when compiling ajar compiles used libraries into the jar o.O
18:28Crowb4rwhen you run uberjar?
18:28Licenserno always
18:28LicenserI expected it for uberjar but it also happens with jar
18:28Licenserbut only some, that is very odd
18:28Licenserand makes me confused how leinigen decides what to include and what not
18:32underdevin both a manually installed maven2 and a apt-get installed maven2, when i try to install labrepl w/ maven, i get: "The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does not exist or no valid version could be found"
18:32Licenserfor defn's project, walton it lincludes cln-sandbox, clj_html but nothign else
18:32Licenserperhaps since they are not in the clojure namespace?
18:32LauJensenunderdev: repeat the question when cemerick is here. He is one of 4 people still alive who use Maven
18:33underdevif you're using lein, your using maven
18:33LicenserI still say we need a simple dependencie management system :P
18:33underdevbut i may give up on trying to grok maven
18:34underdevi don't feel comfortable not knowing wtf my build system is doing
18:35underdevon the other hand, i'm standing on the shoulders of giants with emacs, so...
18:39Crowb4runderdev: I hope you don't ever compile anything in C with your views on build-systems. :p
18:43Licenserhmm what the heck does 'Context classloader is not a DynamicClassLoader' tell me?
18:43Licenseryeems to yall at me for calling add-class-path
18:44Licenserseems I'm not allowed to call the whenI use compile?
18:45Crowb4rJava has about the worst debugger messages I have ever seen.
18:45defnhttp://www.harukizaemon.com/2010/03/functional-programming-in-object-oriented-languages.html : Is this accurate?
18:47LicenserCrowb4r: yap
18:47defnhi btw :)
18:49Crowb4rdefn: I will read that link later and tell you, but I'm off to eat some dinner.
19:33Licenserhmm is there a way to tell clojure to use the classloader from repl instead of the one from script runner?
19:36Crowb4rdefn: you around?
19:56defnCrowb4r: sort of
19:56defnwhat's up?
20:04Ankouhi, often when I write a macro I use a second syntax quote in an unquoted form of the first syntax quote. But then I have different # and can't use it for variables I defined in the outer syntax quote which I also need in the inner syntax quote.
20:05qbgYou could use gensym directly
20:07Ankouokay, thanks
20:20Crowb4rdefn: Walton takes a while to parse all those logs
20:25defnCrowb4r: did you do (background-walton-init) or (walton-init)
20:25defnalso, does anyone know the url for the clojure build snapshots
20:27Crowb4rdefn: background-walton-init
20:28Crowb4rI was thinking of figuring out how to toss all of that into a simple database for the irc bot
20:29defnCrowb4r: yeah that's a good idea
20:29Crowb4rSo when I reboot the bot everythign is not in memory.
20:29Crowb4rand lost on a crash
20:29Crowb4ror shitydown
20:29Crowb4rshutdown*
20:31LicenserCrowb4r: simple solution pr-str the map into a file and then just read it
20:37hiredmanwhy would you pr-str?
20:37Crowb4r,(doc pr-str)
20:37hiredmanpr and print both output to *out* which can be rebound directly to a printwriter on a file
20:38hiredmanno need to go through a string
20:38Licenserto print stuff, I know you can do it with pr and a writer but it's simpler to say (spit "file" (pr-str *maptingy*))
20:38hiredman:(
20:39LicenserYou are right so, it is a bad solution, I just suggested it for the sake of simplicity :P
20:41TakeVSwank doesn't seem to work, keeps saying that the files are not found. Is this normal?
20:42tufflaxEh, I have some trouble understanding the function amap, (amap a idx ret expr). Why would I need the ret, the copy? To use in the expr? What would be a example of some expr that uses ret in some useful way?
20:43Licensernow we'd need walton to find that :P
20:47Crowb4rLicenser: I was thinking of even just tossing it in something like a berkleydb, but I might just put it in something like a postgres or mysqldb
20:49Crowb4rdefn: Any ideasa what would be the easiest to attach to walton based on it's setup?
20:49_ato,(let [src (to-array [3 3 4 3])] (seq (amap src i dest (+ (aget src i) (if (pos? i) (aget dest (dec i)) 0)))))
20:50_atoah, no bot
20:50hiredman!
20:50_ato<clojurebot> (3 6 10 13)
20:50hiredmanI hadn't noticed
20:50Crowb4rlol
20:51LicenserCrowb4r: don't use BDB!
20:51Crowb4rpircbot libs seems kind of assholish to work with.
20:52Crowb4rohhh?
20:53LicenserIt brakes on updates, I#ve very bad experience with it
20:53Crowb4rahhh
20:54Licenserpr and read isn't such a bad combination :P
20:54tufflax_ato ok thanks... So how would that look if src wasn't an array but a clojure seq? :P
20:55_atotufflax: I've never used it before, but I assume you'd use amap's "ret" when you don't want to do a purely functional map (ie you want get or set indices other than the current one in each step). Like you could implement a shuffle with it.
20:55_ato,(doc amap)
20:55clojurebot"([a idx ret expr]); Maps an expression across an array a, using an index named idx, and return value named ret, initialized to a clone of a, then setting each element of ret to the evaluation of expr, returning the new array ret."
20:55_atoit wouldn't work at all?
20:56_ato,(amap [1 2 3] i ret 3)
20:56clojurebotjava.lang.IllegalArgumentException: No matching method found: aclone
20:56_ato,(amap (to-array [1 2 3]) i ret 3)
20:56clojurebot#<Object[] [Ljava.lang.Object;@1865b82>
20:56_ato,(seq (amap (to-array [1 2 3]) i ret 3))
20:56clojurebot(3 3 3)
20:57tufflaxI mean given a seq (3 3 4 3) as input, produce the same result as there, (3 6 10 13).
20:57_ato,(let [src (to-array '(3 3 4 3))] (seq (amap src i dest (+ (aget src i) (if (pos? i) (aget dest (dec i)) 0)))))
20:57clojurebot(3 6 10 13)
20:57_atooh
20:58_atoyou mean not using amap?
20:58tufflaxno, just clojure seqs
20:58_atohmm
20:58_atoprobably need to use a reduce, lets see
21:02_atomaybe something like this:
21:02_ato,(next (reduce (fn [v x] (conj v (+ x (v (dec (count v)))))) [0] [3 3 4 3]))
21:02clojurebot(3 6 10 13)
21:02tufflaxhm ok, let's see if i understand this... :P
21:03Crowb4rclojurebot: seen crowbar7
21:03clojurebotcrowbar7 was last seen quiting IRC, 3283 minutes ago
21:04_ato,(next (reduce (fn [v x] (conj v (+ x (last v)))) [0] [3 3 4 3]))
21:04clojurebot(3 6 10 13)
21:04_ato^ might be more understandable, but 'last' is not constant-time
21:05tufflaxthis is gonna take a while... thank you in the mean time :D
21:07Licenser_ato: count isn't either is it?
21:11_atoLicenser: count is constant time for most types. It's linear for cons lists and lazy seqs, but constant-time for persistent lists, vectors, maps etc
21:11Licenserah cool thanks :) learned something new again
21:15Crowb4rhiredman: My head hurts from trying to exactly understand how clojruebot works. :p
21:15Crowb4rclojurebot*
21:16tufflaxhm _ato now i understand the code... the one with amap is almost easier to understand though :P hehe
21:16hiredmanCrowb4r: it's an input processing pipeline
21:17hiredmanmessages come in and are placed in the pipe (call to responder)
21:18Crowb4rhiredman: I figured that part out. I was just figuring out how you are attaching things to that pipe.
21:18Crowb4rdefresponder defresponder2, etc
21:19hiredmanthey do the same things, just refining
21:19hiredmandefresponder2 doesn't actually need to be a macro
21:19hiredmanI just haven't gotten around to fixing it
21:19Crowb4rOHHHHHH
21:20Crowb4rok, well that helps out
21:20hiredmanit just takes a map with the correct entries
21:20hiredmanI need to rip out the irc specific stuff and split it out
21:20hiredmanthe xmpp stuff could be much nicer
21:21hiredmanI was playing a little more with smack last week
21:21tufflaxyou shouldn't do smack, it's bad for you
21:22Crowb4rsee, thats where I was getting lost kind of. I was just trying to figure out the irc parts.
21:23hiredmanbecause it was an irc only bot the irc stuff is kind of front and center, but now it really doesn't need to be
21:23hiredmanI also need to fix up the storage stuff
21:24Crowb4rhiredman: it's nice code, don't get me wrong.
21:24hiredman:P
21:24hiredmanyou obviously haven't looked at factoids.clj for example
21:24hiredmanhideous
21:25Crowb4rno, mainly clojurebot.clj and core.clj and a couple of random modules
21:25_atotufflax: it may well be. The amap one is pretty close to an imperative 'for' loop and reduces aren't usually the most readable things.
21:26tufflaxYes, but I'm a beginner, which one feel more natural to you?
21:27Crowb4rhiredman: oh wow factoid is a cluster
21:27_atoI'm not too happy with either. ;-) I'm now thinking it might be better written as a lazy-seq
21:27tufflaxhehe ok
21:37_atotufflax: here's a lazy variant (it'll only calculate as much as you ask for) http://gist.github.com/355896
21:38tufflaxHmm, (instance? Integer n) doesn't work if n is big. Is there an easy way to test if n in an integer, big or small? (instance? BigInteger n) doesn't seem to work either, maybe I'm doing something wrong.
21:39_ato,(integer? 5)
21:39clojurebottrue
21:39_ato,(integer? 50000000000000000000000000)
21:39clojurebotjava.lang.ExceptionInInitializerError
21:39_atohmm
21:39Licenserit's a long then
21:40Licenserfirst it becomes long then it becomes BigInteger
21:40hiredman,(meta #'integer?)
21:40clojurebot{:ns #<Namespace clojure.core>, :name integer?, :file "clojure/core.clj", :line 2275, :arglists ([n]), :doc "Returns true if n is an integer"}
21:40_atostrange...
21:40_atoworks for me
21:40_ato,5000000000000000000000000
21:40clojurebot5000000000000000000000000
21:40hiredman,(integer? 5e10)
21:40clojurebotfalse
21:40hiredman,(integer? 5e1000)
21:40clojurebotfalse
21:40tufflaxoh, yeah, forgot about that one :D
21:41_ato~def integer?
21:41Licenseryou can try (isa? (type 1000000000) Number)
21:41_ato,(number? 5e100)
21:41clojurebottrue
21:41_ato,(number? 50.0)
21:41clojurebottrue
21:42_ato,(class 5e100)
21:42clojurebotjava.lang.Double
21:42tufflax5e1000 => Infinity :P
21:42_ato,(class 5000000000000000000000)
21:42clojurebotjava.lang.ExceptionInInitializerError
21:42_atoah
21:42Licenser, 5000000000000000000000
21:42clojurebot5000000000000000000000
21:43Licenser(let [x 5000000000000000000000] (type x))
21:43_atoworks in my repl
21:43Licenser,(let [x 5000000000000000000000] (type x))
21:43clojurebotjava.lang.ExceptionInInitializerError
21:43_atomaybe a bug in clojurebot's expression checking?
21:43Licensershouldn't be
21:43LicenserIt might be something in the jvm sandbox
21:44hiredman*shrug*
21:44Crowb4rhiredman: do you have clojurebot call every method and have it traverse the regex in each module for a match?
21:45hiredmancall every method?
21:45hiredmanclojurebot calls the predicate provided for each responder
21:46Crowb4rhiredman: To elaberate I mean when a message comes down the pipe, does it call every hook looking for a match?
21:46hiredmanresponder doesn't need to be a multimethod either
21:46Crowb4rOhh predicate check
21:46hiredmanright
21:47hiredmandefresponder's syntax doesn't make it clear
21:47Crowb4rI was seeing all the multi-methods and wondering
21:47hiredmandefresponder2 is better about it
21:47hiredmanthe output stuff needs to be a mm
21:48hiredman(it is)
21:49tufflax1e10 => 1.0e10, and (int 1e10) => 2147483647. So, I'm forced to write 10000000000? :P
21:49Crowb4r(it is)?
21:49hiredmanuh
21:49hiredmannew-send-out?
21:49Crowb4rohh
21:49hiredmanfor selecting irc or xmpp output (possibly twitter if I ever got that working)
22:00Crowb4rhiredman: Ahh, I see
22:12Licenser~defn add-class
22:12clojurebotadd-classpath is bad, avoid it. I mean it!
22:12Crowb4r0.o
22:12TakeVThat's neat.
22:12Licenserclojurebot: you silly peace of soap, I want the source of it
22:12clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
22:13Licenserclojurebot: no the source of add-classpath
22:13clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
22:13mikem~def add-class
22:13clojurebotGabh mo leithscéal?
22:13hiredman~def add-classpath
22:13Licensernice hiredman thanks
22:13TakeV,(doc add-classpath)
22:13clojurebot"([url]); DEPRECATED Adds the url (String or URL object) to the classpath per URLClassLoader.addURL"
22:14TakeVOh, the source.
22:14TakeVMisread.
22:14Licensermeh why is it depreclated :(
22:20Licenserhmm why does clojurebot says add-classpath is evil?
22:21bmasonbecause it's deprecated :)
22:21Licenseris there an replcement?
22:21hiredmanjava's classloader scoping stuff can bite you with add-classpath
22:22Licenserhmmm?
22:23Licenseras in 'overloading' something already loaded
22:23hiredmanno
22:23bmasonI read the rationale for this once, but unfortunately I can't find a link atm
22:24bmasonthe general idea is that it's not appropriate to set a java classpath from within clojure, and it should be done from your build tools or whatever environment setup you have
22:25bmasonthe leiningen project is an excellent way to manage your classpath
22:25LicenserI think it is a horrible way to be frank
22:25Licenserit falls into the 'way too complicated' section in my eyes
22:25hiredmanhttp://clojure-log.n01se.net/date/2008-06-03.html#17:33
22:25hiredmanhas an example of things that break when using add-classpath
22:26bmasonok
22:26Licenserthanks
22:27Licenser*sighs*
22:30Licenserso the bottom line is clojure can't (should not) handle class path stuff and we end up with using the jvm things?
22:30bmasonyup
22:31Licenserthat is horrible
22:31Crowb4rLicenser: Yeah, the thought is lets not be an asshole to the jvm.
22:31Crowb4rpardon my language
22:31Licenserbut the jvm is one too :P
22:32Crowb4rLicenser: sort of, but if dynamically adding classpaths can easily break things, it's best no to have that hack around.
22:33Crowb4rI also see that as a huge exploit
22:33Licenserit makes things horribly more complicated :(
22:36bmasonI hear what you're saying... I've been through plenty of pain with the classpath
22:36LicenserI figured I try to write a nice library that handles dependencies somewhat like rubygems since it is simple, no fuss and works just great most of the time. But I fail to get it work beyond the repl
22:37bmasonwhat's your beef with lein?
22:37Licenserbmason: too complicated and too sammy most of the time
22:38Licenseralso it is based on maven which makes it even more cimplicated
22:38bmasonwell making a project.clj file is pretty straightforward
22:38Licenserit is great for building stuff but the dependency management is a horror
22:38bmasonhah
22:39bmasonthere really isn't any dependency management that I'm aware of
22:39hiredman~dirt simple
22:39clojurebothttp://www.thelastcitadel.com/dirt-simple-clojure
22:40Licenserno I mean seriousely, a week ago I tried to write a little wiki like thing and getting compojure to work correctly with all the deps took me longer then getting a first running version
22:40Licenserhiredman: that does not solve the problem of dependenceies
22:40hiredmansure it does
22:41hiredmanfind the jar and drop it in ~/.jars/
22:41TakeVI still can't figure out how to use it to get Penumbra running...
22:41Licenserthat isn't a solution that is way to complicated
22:41bmasonhiredman: he's talking about hierarchical dependencies
22:41Licenserit shoud be as simple as <whatever tool to use> install <library>
22:41bmasonat least, I think :)
22:41Crowb4rLicenser: I think what would be nice is if you could invoke a clojure script, and have it just grab the missing dependencies then run.
22:41Crowb4rpython has something like that
22:41hiredmanbmason: finding the jars and dropping them in ~/.jars fixes those to
22:41Crowb4ras I recall
22:42Crowb4rself-check so to speak
22:42LicenserCrowb4r: that was my goal I fail on the classpath stuff :(
22:42bmasonyeah, but if I 'apt-get install gimp' I don't want to have to hunt for X and all it's dependencies
22:42somniumLicenser: really? what deps messed up with compojure? last time I used it [compojure "..whatever"] in project.clj and it worked on the first try
22:43somniumthough I havent managed to install penumbra yet :/
22:43bmasonsame could be true of clojure libs if the dependencies are deeply nested, it could be a PITA to get them all manually... though I have to say I haven't encountered this myself
22:44Licenser"whaterver" was the first problem, since 0.4.0 (as int he doc) wasn't existing, a search on clojars showed up like a gazillon versions of compojure, only one of them actually automatically got all the stuff like jetty and such stuff
22:44Licensertook me over an hour to get it work, that is a thing that just can't e
22:44somniumoh, 0.3.2 was the one I used I think
22:45Crowb4rLicenser: I can tell you that compojure "0.4.0-SNAPSHOT" does work
22:45Licenserbmason: I am very much used to ruby where the whole dependency managemnt thing really ever was in issue to me
22:45LicenserCrowb4r: I don't know what it was exactly but the one that was in the README didn't worked when I tried it out
22:46somniumhaskell's cabal system is quite nice, wish we could do `lein list "penumbra"` for example
22:46Crowb4rI guess it is an unofficial thing currently, but anything development and bleeding edge gets a SNAPSHOT
22:46Licensersomnium: exactly such things are needed in my eyes
22:46bmasonaye
22:46bmasonthat's the one thing I was finding myself looking for today
22:46Licenserit is just much too complicated :(
22:46bmasonsomething to search currently mapped repos
22:47bmasoninstead of me trying to hit them in my browser and locate the libs/versions
22:47Licenserand the force to use versions
22:47Crowb4radopt the same naimg as apt-cache
22:47bmasonnow versions I think is good
22:47Crowb4rsearch, info, list,
22:47LicenserCrowb4r: the exactl names are not too important
22:47bmasonCrowb4r: I agree
22:48bmasonwe've basically got a package manager here... it's a solved problem
22:48bmasondo what has worked before
22:48Licenserbmason: I think they are important and good most of the time but it should be as simple as when I say ... install penumbra it installes the current stable version
22:48Licenserand if I then (use 'penumbra.something) it loads the latest installed version
22:49Licenser bmason you mean maven?
22:49bmasonyeah, that's valid
22:49bmasonum
22:49Crowb4rWhen there are missing dependencies do what spt does and restart the program after the deps and updates are resolved. :p
22:49bmasonI have no maven experience outside of lein
22:49Crowb4rs/spt/apt
22:50bmasonbut I think the general concept of a package manager is fairly constant
22:50Licenserbmason: I disagree strongly
22:50bmasonwhy's that?
22:50Crowb4rever use yum or yast?
22:50Crowb4rthumbs down
22:50bmasonCrowb4r: yes, and yes :)
22:50Licenserbecause there are generally two approaches: make it very very expressive, or make it 'just work' simple
22:51Licenseryast is horrible
22:51bmasonyeah, I'm a much bigger fan of apt
22:51bmasonI suppose I get what you mean then
22:51LicenserI am not sure it is correct to compare dependency management systems for os's with one for used in a language
22:51Crowb4rhowever we could expand this and look at some of the best package managers around for programing langs.
22:52Crowb4rCPAN is really nice imo.
22:52ztellmanif I'm getting a runtime error for "incorrect number of args" passed to a macro, what does that mean?
22:52ztellmanshouldn't that be caught at compile time?
22:52LicenserI personally have my best experience with rubygems
22:52bmasonyou're just for simplifying the syntax and having a sensible default action
22:52bmasonI hated managing versions with rubygems
22:53somniumrvm ftw! :P
22:53bmasonbut I only worked with rails for one project
22:54Licenserbmason: rails is nearly it's own world it can be confusing since it does so many things on it's own
22:54Crowb4rpython is such a jerk with adding libs.
22:54bmason:-D
22:54bmasonand my experience was they broke compatibility with nearly every release
22:54LicenserI mean your bar experience might very well one with rails and not one with gems
22:54Licenserbmason: yea but that is a rails issue not a gem issue
22:54Crowb4rI thin CPAN is nice because it gives you a lot of options to look for mirrors, or etc.
22:54bmasontrue
22:55Licensera dep management system can't stop maintainers to be silly
22:56Crowb4rI think lein could really use a dry-run mode
22:56Licenserhmm Crowb4r I even found cpan a bit complicated but that might be that I had not worked much with it
22:56Crowb4rLicenser: Well, take the complicated part, and add a simpler more intuitive way to work with it.
22:56bmasonlein is really close to being what I need... add the ability to search for packages and resolve hierarchical deps and I'd be a happy baby
22:56Licenserbmason: also remove the silly version stuff
22:57bmasondefault version, agreed
22:57bmasonnot removed, just a sensible default
22:57Licenser*nods*
22:57Crowb4rLicenser: How abotu defult version that is considered stable unless otherwise specified.
22:57LicenserCrowb4r: yea latest stable or otherwise specified I totally Agree
22:58Licenserwhat I did was it either takes the latest or you can specify a set of rules for versions
22:58Crowb4ryou could also add a suggested version so incase there is a major overhaul to a dependency that is needed it can try to use what was stable at the time.
22:59Licenserlike you could say "clj-sandboy" ">=0.2.5" "<0.3.0" that would give you a version between 0.2.5 and 0.2.99999999999(watever)
22:59bmasonso assuming none of us is actually going to submit a patch for lein... it might be good to at least document these feature requests
22:59Licenserbmason: I am not sure if you CAN do that with maven
22:59hiredmanyou can
22:59bmasondo what?
23:00Licenserlisting stuff and so
23:00bmasonah
23:00Licenserlanother issue with leiningen is that it copies everything into the lib directory which I find horrible :(
23:00bmasonI find it tolerable :)
23:00Licensernot really
23:01Licensersince it can bite you in the a*
23:01Crowb4rLicenser: I understand that, but you could make a symlink option to use.
23:01bmasonsym links might be better
23:01Licensersymlinks are not os indipendant
23:01Licenseralso it really has some bad issues
23:01bmasonwho uses windows? :-D
23:01Crowb4rbut not change the default deps downloading into libs
23:01hiredmanneither is the shell script that starts lien
23:01Licenserbmason: while I agree with that to quote Crowb4r we should not be asses to windows users :P
23:01Crowb4rumm vista and up supports symlinks
23:02bmasonyeah j/k :)
23:02bmasonthere is a windows batch script available for lein though
23:02Licenserseriousely the libs should be in one central place (either user or system wide)
23:02Licenserthere is no reason at all to download libs more then once
23:02bmasonand... hey, not every feature has to be supported on windows
23:02bmasonno reason not to offer the *option* for those who have the capability
23:03bmasonLicenser: it doesn't actually download them more than once
23:03Licenserthe issue is the following: lein deps (update prjoject.clj to use a newer version of library X) lein deps; lein compile => brakes every now and then since you've two versions of the library
23:03bmasonLicenser: it puts them in a central location then copies them to each project
23:04Licenserbmason: okay badly worded sorry, I meant having them on your disk more then once
23:04bmasonno, newer versions are stored with unique names
23:04Licenserbmason: different versions is OK, but not the same version
23:05LicenserProjects heinz$ find . | grep "jar$" | wc -l
23:05Licenser 129
23:05Licenserthat is just horrible
23:05Crowb4rLicenser: The other thing is that with swank it's awesome to have the entire development enviroment in one folder so you can do a remote session and have a development set-up that is unique to each project.
23:06_atoevery project is self-contained
23:06LicenserCrowb4r: then it should be an option to copy the stuff there
23:06_atoyou can copy to a different PC and it just works
23:06Crowb4rI like the way it works, but it could use a bigger feature set I think.
23:07bmasonCrowb4r: I'm in agreement with that
23:08Crowb4rif you did some default versioning you could so a lein deps-update and it would grab the newest default (minor) version.
23:08Crowb4rmajor versions are ment for breaking things, not minor, so that should be a well established standard.
23:09Crowb4rwell generally is
23:11Crowb4rso the compjure rewrite should technically be a major version update because 0.4.0 is way different then 0.3.2, however that should be a 1.0 and 2.0, but I could be wrong.
23:11bmasoncould prompt on major versions
23:11_atowith central system location for libs you need to install all the libs on all your PCs. Which makes sense for languages that compile natively (or have lots of native extensions) as half the time you're going to need to recompile anyway, but one of the nice things about java is you can just copy something to a random machine and expect it to just work
23:12Crowb4rotherwise you will have to try to write some absurd corner cases to program for. However when you are the package system, you can dictate how things will be versioned..
23:12LicenserI mean I have 177MB of jars for clojure by now that is a bit too much
23:13Crowb4r_ato: yeah, it's a straight copy, but people are lazy, and support is a headache.
23:13Crowb4rif it does not do it for you, people don't adopt to it quickly.
23:13Crowb4rin programming that is.
23:13Crowb4r:p
23:14LicenserCrowb4r: there is a nice text about semver in the interwebs that explains a good standard for versioning
23:14Licenser0.* is generally concided as unstable and is 'allowed' to break with every release 1.0.0 is the first version with a stable API
23:14Crowb4rI could be wrong, but people don't want to go back to the fun of linking that C is and was.
23:14_atoI don't buy the argument about disk space as disk space is ridiculuously cheap and in comparison to data sizes the size of the code is nothing. If you're that worried about it you'd probably want to write a script to deduplicate your disk and replace all duplicate files with hard links. Your browser cache is probably bigger than that. ;-)
23:15hyp3rvigi1anthttp://semver.org/
23:15Licenserexactly that one
23:15Crowb4r_ato: A softlink would be fine
23:16bmasonhardware < peopleware
23:16Crowb4rso then when one project gets removed it does not delete the whole package that other places use.
23:16Licenser_ato: heinz$ du -sh Library/Safari/ => 14M Library/Safari/
23:16bmasonmaking the job easier is worth a lot :)
23:16rpenguin_ato: you're just going to have to accept a lot of us are very concerned and a little insecure about the size of our disk.
23:16_atohaha
23:17_atoyeah ok, anyway technomancy's said he's happy to accept a patch that adds symlink support to lein
23:17_atoso feel free to do it
23:17Licenser_ato: but I don't want simlinks I want a centrelaized palce :P
23:18bmasonfor development?
23:18Crowb4rLicenser: I mean, I see the argument about diskspace, but still I just found out after 6 months that I lost 25GB of diskspace to google chrome dev build. I really did not flinch about it till I went looking to cut down some space and about had a stroke when my apps folders in my windows home folder was 27GB.
23:18Crowb4rStupid memory dumps
23:18Crowb4ron crash
23:19bmasonrofl
23:19Licenserheh
23:19bmason*makes a note to check his chrome folder*
23:19LicenserCrowb4r: sadly I've a small disk :P
23:19Licenseronly 22GB free :P
23:20Crowb4rI would advise you to not use google chrome.
23:20Crowb4rthe dev build
23:21_atoLicenser: why do you want a central place? (I mean other than disk-space.)
23:21Licenserbmason: to answer your questions, yes and no, if I install a version of a forign library for it and want it from a repository, then yes it should be central
23:21Crowb4rMy name is google and I need to save my ENTIRE MEMORY STATE ON CRASH BY DEFAULT! Because people ar egoing to upload 1gb memory dump profile for bug fixing.
23:22bmasonis this mainly for sanity of knowing that all projects are referencing the same version?
23:22Licenserhmm _ato actual a good question, it seems cleaner to me when you have multiple projects that share the same deps that they use the same
23:23LicenserI mena would you intsal a version of python for every single python program? Or a version of java for every project?
23:24bmasonI think it's a gray area... it's a question of when you reach critical mass and there are a lot of things referencing you so the duplicates would get out of hand
23:25Licenser:P
23:25bmasonjava and python are at that point where there could be hundreds of things referencing them on a single system
23:25Crowb4rimagine the corner cases on that. :p
23:25LicenserCrowb4r: yes that would be nice, for every c project you install it's own version of libc :P
23:25bmasonlol
23:25Apage43*shudder*
23:26Licenserbmason: but it would be the same, actually lein installs a own version of clojure for every project
23:26Apage43differing libcs
23:26Crowb4rOhh I ment in reguards to trying to make real improvments.
23:26bmasonyeah... this is true
23:26Apage43reminds me of weird quirks running clojure on IBM jvms.
23:26_atoFor distros which have a large team of people making sure versions work with each other and such it's nice to be able to share libs. (There's also memory benefits for C programs, but not for Java unless you do some special precaching stuff). If you don't have that sort of infrastructure then no it's much easier just for everything to have its own copy.
23:27somniumat least it doesnt copy a new JDK into lib
23:27_atoActually at work for Ruby projects we found the gems central way quickly became a nightmare and ended up making a GEM_HOME inside each project
23:27Crowb4r_ato: yeah, ok you get better memory, maybe if you have no leaks at all.
23:29somniumCrowb4r: have you tried vala?
23:29Licenser_ato: which is understandable BUT the difference is gems give you the option, and for most of the time the central thing works just great and without any problems
23:29Licenserleins way already broke for me and gave me very nasty bugs I had a really hard time to track
23:30Crowb4rsomnium: I have not
23:30Crowb4rbrb
23:31Licenserbut really if there wouldn't be such issues I could care for small libs but at least clojure itself should not be in every simgle project :(
23:33_atoLicenser: well, you could always use maven, which doesn't copy libs to projects ;-)
23:34Licensergoing back to the versioning stuff, since I need to add a version to every library , (even clojure) I got: 1.1.0-alpha-SNAPSHOT, 1.1.0, 1.1.0-master-SNAPSHOT and 1.2.0-SNAPSHOT as clojure verions (just checked) scattered over my projects. I mean leinigen should not force me to tell it which version I want, since 1.1.0 is the current stable (I think, point proven here again in my eyes) just use that if I don't tell it explictly to use something
23:34Licenser:/
23:35_atowhich is all fine and good until 1.2 is released and suddenly all your projects break and you can't figure out why
23:35Licenser_ato: if I install 1.2 as a new clojure I think I'd know that :P
23:36technomancyLicenser: it's kind of inconsistent to complain about problems with leiningen you had while trying to get compojure to work and then say rubygems is great even though it's a pain to work with Rails. =)
23:36Licensertechnomancy: kind of true :P
23:37Licenserso I think the problems are somewhat different
23:37_atoanyway, not saying there isn't room for a dependency tool that works like gems, just that acting like gems doesn't magically solve everything and there reasons why you'd want to do things differently
23:37technomancythere's also a patch in the dev version of lein to use symlinks instead of copying to lib
23:37technomancybut nobody uses it
23:37technomancybecause nobody cares about wasting five megabytes
23:38LicenserI picked the problem with compojure to explain the general issue lein has at the momen in my eyes
23:38Licenserit's often easyer to explain an issue with an example then the abstract underlaying problem
23:39Licenserbut the copying is the smallest issue I have with leiningen (save for that I find it silly to copy clojure itself in ever project)
23:40Crowb4rIt's a young language and as such I make concessions.
23:41LicenserCrowb4r: of cause, I won't say I stop using clojure, but if we don't talk about the issues we have or see clojure will not improve (or at least much slower)
23:41Crowb4rI would like to point out that I am olny making consessions because of the small, but really active community.
23:42Crowb4rLicenser: I can't wait to see how clojure can work with the JAVA 7 JVM.
23:43Licenserit goes well
23:43LicenserI tried it already
23:43technomancyI've seen a lot of breakage with Ruby in production in situations like where we move to servers that have 1.8.7 instead of 1.8.6 installed
23:43technomancybeing able to lock to an exact version is really important
23:43Licensertechnomancy: very true, but that should not be a reason for us to say we can do it too :P we should try to make it better
23:44chouserwe an clojure app breaking under load the other day, until the dev seeing it upgraded his jvm. The GC had been segfaulting.
23:44LicenserI think the key word there is 'being able to' not 'Being forced to'
23:44Licenserchouser: was that defn?
23:45technomancyI don't think you'd ever want to just pick the latest version except by accident.
23:45_atoI don't think hiding the classpath and versions under the rug is a good way to go, it just encourages ignorance and means when something does break (and it will) you don't know what to do.
23:46_atoI mean sure for absolute beginners a sandbox that comes with a few useful jars prebundled is nice, just so you can get up and play around quickly, but anyone who seriously uses the language should understand this.
23:46Licensertechnomancy: hmm I am not sure what you mean, would be using clojure 1.1.0 bad?
23:46technomancy_ato: you mean the labrepl? =)
23:47_atoYou'd expect a C programmer to be able to use gcc's -I and -L flags
23:47Licenseri think at the start of development of a project, choosing the 'currently latest version' is the best way - at least for the most project
23:47technomancyLicenser: it would be bad if it used 1.1.0 today and 1.2.0 tomorrow and broke things without any warning.
23:48technomancyLicenser: it does that if you use "lein new"
23:48technomancyI thought you meant you should be able to leave off the version and have it use whatever is latest at the time; that's what I'm against.
23:49_atoI do think there's scope for a "lein search" that tells you the latest version, but when you add the dependency to the project it should be locked to that version unless you explicitly change it
23:50technomancyI also think there's room for "lein install $FOO" that works outside the scope of a project
23:50technomancyonce we add bin script wrappers
23:50technomancybut's that several point-releases down the road
23:50technomancyunless someone else wants to do the legwork. =)
23:50technomancy(that would be a lot like Rubygems)
23:51technomancythere just aren't that many CLI-launched clojure apps available yet, so I guess it's not a bad thing to wait on.
23:51Licensertechnomancy: yes that would be nice
23:51technomancyLicenser: if you're looking for a project to hack on... =)
23:52Licenserhmm so sataying with the 'all int the project' how about lein install <library> to fetch the latest stable version adding it to project.clj and freezing it's version
23:52Licenserlein update <library> to update that library to the latest stable versions
23:53technomancyI'd call it "add" instead of "install" (for the first)
23:53technomancybut it would be worth having
23:53_atoyes
23:53Licenserah add, isntall, get, fetch, whatever :)
23:53Licenserimportant is the functionality
23:53Licenserit would be a long way in the right direction I think
23:54technomancygo for it. =)
23:54technomancyLicenser: it's only 700 LOCG
23:54technomancy*LOC
23:54Licensertechnomancy: I'm not so much scared of leins LOC but of the entire marven and ant stuff in the background
23:55_atothe ant stuff is ok
23:55_atothe maven stuff isn't
23:55_ato:p
23:55Licenserheh
23:55albinowhat's wrong with the maven stuff?
23:58_atoactually the maven stuff in lein is ok to, cause its wrapped in an ant API
23:58cp2the last guy who investigated that never came back... or so i heard...
23:58Licenseralbino: I don't know everything about it
23:58albinoheh
23:58Licensermaven scares me
23:58albinoThat's one way to disappear then
23:58albinoLicenser: the source or the concept?
23:58albinocause the concept seems okay to me
23:59Licenserthe concept already :P huge XML files with tons of things in it scare me
23:59somnium~XML
23:59clojurebotXML is like violence; if it doesn't solve your problems, you're not using enough of it.
23:59Licenserlol
23:59_atoraw maven repository API is ugly, I used it in Clojars. Even the Maven developers agree: "The primary reasons for replacing the code are that it is unmaintainable and nearly impossible to navigate"
23:59_atothey're rewriting it for maven 3