#clojure logs

2011-06-16

02:49terom,(take 2 (sort > [14 6 43 195 3214 31]))
02:49clojurebot(3214 195)
03:56TobiasRaederMorning :)
04:37tsdhHi
04:40tsdhI have a macro that expands into a function definition. That function should have meaningful parameters, but of course I don't want to interfer with locals the user uses in the macro. How do I handle that?
04:41gkoHow can I change the value of io/*buffer-size* ? I have a java.lang.Exception: Can't create defs outside of current ns
04:43gkoI mean duck-streams/*buffer-size*
04:43hoeck1tsdh: you could change the :args item of the metadata the functions var carries to have the tools (slime, doc etc.) display nice signatures for the generated function
04:44hoeck1gko: binding, set! or ultimatively (on the repl) alter-var-root
04:44hoecktsdh: you could change the :args item of the metadata the functions var carries to have the tools (slime, doc etc.) display nice signatures for the generated function
04:45hoeckgko: binding, set! or ultimatively (on the repl) alter-var-root
04:46tsdhhoeck: I'd like to use keyword parameters, cause I have three args that are exclusive and equally likely to be used. Do you have an expample at hand?
04:46gkohoeck: oh, binding works through namespaces? OK, I'll try.
04:48hoeckgko: of course, just namespace-qualify the var you want to bind, note that in 1.3, binding is limited to vars declared ^:dynamic
04:49gkohoeck: OK thanks. Regarding declare, it's better to do (declare my-dynamic-variable) than (def my-dynamic-variable xxx)?
04:49gkohoeck: in the 2nd case, it's nicer when testing functions from some random source file...
04:50gkohoeck: as there won't be undefined error messages
04:50gkohoeck: and no need to (def ...) the variables...
04:51TobiasRaederAnyone here using the current clojure-mode/clojure-jack-in?
04:51TobiasRaederWhen starting it i get an exception "Exception in thread "main" java.lang.IllegalArgumentException: No value supplied for key: 15692 (NO_SOURCE_FILE:1)" which makes sense since there is just the port as a parameter parsed.
04:52hoeckgko: declare is for when you need to 'forward' declare something, because of two functions calling each other, I wouldn't use it for defining unbound dynamic vars
04:52hoeckgko: and rather use (def ^:dynamic *my-var*) for unbound vars
04:54hoecktsdh: so are the parameters exclusively determined by the macro, or has can the user of the macro add additional ones?
04:55tsdhhoeck: They are fixed by the macro.
04:58hoeck,(:arglists (meta #'sort))
04:58clojurebot([coll] [comp coll])
04:59hoecktsdh: you can look at existing functions to see how their arglists are formatted
05:03hoecktsdh: just a list of their normal argument vectors, some clojure.core functions even have some kind of mini BNF in their :arglists
05:03tsdhhoeck: I think formatting is not enough here. If I use keyword parameteres, the user will have to use the real names anyway, like (my-generated-fn :foo 17).
05:05hoecktsdh: but instead of binding them using destructuring you could grab the keyword arg map directly
05:06tsdhhoeck: You mean, my generated function would be `(defn my-generated-fn [& [keys#]]) and users would call (my-generated-fn {:foo 17})?
05:06hoecki.e. the macro defines a function (defn gen123 [& args_123] generated_body)
05:07hoecktsdh: right, keyword arg destructuring is just some sugar over & rest args
05:09tsdhhoeck: Hm, well, I'd prefer if (my-generated-fn :foo 17), but in this case, I think passing a map is fine as well. Thanks.
05:09hoecktsdh: you can do that
05:11hoeck,((fn [& keyword-args] (let [argmap (apply hashmap keyword-args)] (:key argmap))) :key 'here)
05:11clojurebotjava.lang.Exception: Unable to resolve symbol: hashmap in this context
05:11hoeck,((fn [& keyword-args] (let [argmap (apply hash-map keyword-args)] (:key argmap))) :key 'here)
05:11clojurebothere
05:11hoecktsdh: ^
05:11tsdh,((fn [& map] (apply hash-map map)) :foo "foo")
05:11clojurebot{:foo "foo"}
05:11tsdhhoeck: Just found out on my own. :-)
05:11hoecktsdh: great :)
05:12tsdhTotally awesome.
05:15clgvwhat is the easiest way to measure (additional) memory consumption within a clojure function?
05:16hoecktsdh: and then let you macro expand to: (defn foo {:arglists '([:keys [foo bar baz]])} [& args] nil) to get a nicer arglist
05:17hoeckclgv: informal or reliable?
05:19hoeckclgv: for informal investigation I'd just fire up jvisualvm, run the function manually a few times and watch the graph memory graph moving up or down
05:19clgvhoeck: informal
05:19clgvok that would be an option
05:22clgvah k about 30MB. more than I would have guessed
05:24gkohoeck: OK, thanks!
05:24clgv0.5 MB per constructed instance. but I am constructing them lazy anyway
05:32clgvhmm is there a way to measure the consumed memory of a given data item in clojure exactly? e.g. (mem-usage {:hello 'world})
05:32hoeckclgv: no, please invent one
05:33clgvhoeck: damn... ;) ok maybe there is a java way ...
05:33hoeckclgv: in {:hello 'world}, at least the keyword is only referenced, and hello may be an interned string, how do you mesure those?
05:33fliebelclgv: Even in Java they mostly say "you shouldn't care"
05:33hoeckmeasure
05:34clgvah well , it's just motivated by curiosity and no real problem behind it ^^
05:34hoeckclgv: there are java memory profilers, but their output is a mess, especially considering the clojure persistent hashmaps and all their different anonymous node classes
05:37VinzentWhen I hit enter in auto-complete-mode in REPL, the current input string is evaluated, so auto-complete doesn't work. How can I avoid that?
05:46gkoI'm trying to use (duck-streams/to-byte-array (.getInputStream socket)) but it times out whereas it works with (.read ins array) + (pos? read-size) (> (.available ins) 0)...do I need to do something special after copy?
05:46noctuxhello guys, I'm a little bit into java programming and know oop/imperial programming stuff. So I wanted to get some insight into functional programming. As Clojure is for the jvm, it seemed to fit for me. so I'm searching for a nice tutorial. Has anyone here checked http://blip.tv/clojure/clojure-for-java-programmers-1-of-2-989128 already? Is it ok, to start with?
05:51raekgko: I think it tries to read the whole stream all the way to EOF
05:51Vinzentnoctux, I had not watched it, but many people advised it for beginners, so I think it'd a good start. Also, checkout http://learn-clojure.com/
05:52raekgko: also, duck-streams has been superseded by clojure.java.io
05:54TobiasRaederAnyone ever had the problem that (System/getProperty "java.home") returned something else then echo $JAVA_HOME in a shell?
05:56bsteuberTobiasRaeder: it sometimes returned nil for me after really severe exceptions happened
05:57raeknoctux: Those videos (Clojure Concurrency is very nice too) is what I started with. They are a great overview of what's in the (core) language.
05:57TobiasRaeder@bsteuber my problem is normally its /opt/java but from the repl its /opt/java/jre which is bad because i need classes that are in the jdk only
05:58TobiasRaeder@bsteuber and i cant seem to find why it is set to something else
05:58bsteuberTobiasRaeder: sorry, can't help you with that
05:59TobiasRaeder@bsteuber thx anyways :)
05:59bsteubernoctux: the videos are great, but please note there've been some API changes since then, so not all details are true anymore
06:01raekyeah, the laziness stuff is slightly different. any more changes?
06:03raeksure, more stuff has been added (datatypes and protocols, for example)
06:04tsdhhoeck: The :arlist work great, except that the args show up qualified by namespace. Can that be turned off?
06:04hoecktsdh: yep, use ~'argname in the macro, instead of argname
06:05raeknoctux: 1.0 changes 1.1: https://github.com/clojure/clojure/blob/1.1.x/changes.txt
06:06raeknoctux: 1.1 to 1.2 changes: https://github.com/clojure/clojure/blob/1.2.x/changes.txt
06:06tsdhhoeck: Works fine. Thanks.
06:06bsteuberraek: also, next vs rest was changed later I think
06:07bsteuberand for 1.3 a lot of other stuff like long-arithmetic without overflow check as default
06:07raekbut they still check for overflow, don't they?
06:08raekbut an exception is thrown instead of turning it to a BigInteger
06:08raekah, "auto-promotion" is the word
06:10bsteuberraek: right, I got that wrong - just tested
06:10bsteuberno auto-promotion but still an exception
06:11raeks/allowing/using/
06:19noctuxraek: sry, was afk. Thanks a bunch for the advise. Lets hope clojure is for me :D
06:21zakwilsonI think primative math by default is a mistake. Autopromotion should be the default and things like +' should be the operators that overflow, throw or otherwise treat numbers like bits instead of numbers.
06:49gkoraek: ok, i'll check clojure.java.io.
06:49gkothanks
07:48timvisherhey all
07:48timvisheri'm struggling to install lein-search. is it still supported?
08:18sunnibohello
08:20TobiasRaederhi :)
08:21sunnibo:)
08:29sunniboHere is a question: I made a web page including "utf-8" characters with the Compojure. All characters are shown "????" in a web browser. Any tips?
08:31raeksunnibo: include the "Content-Type" "text/html; charset=utf-8" header in the response
08:32raekthe servlet container "helpfully" converts "text/html" to "text/html; charset=iso-8859-1"
08:35sunniboraek: oh. thank you. how can i insert that string into the header?
08:35shanmuhi, I was using swank-clojure on windows, happily launching swank server and connecting from withing emacs fine... from swank-clojure 1.3.1 swank does not launch fine from withing emacs
08:35shanmuis that a known problem
08:36raeksunnibo: can you give an example of how you generate the response now?
08:37sunniboshanmu: this is not the right answer, but why don't you use a ClojureBox?
08:38raekshanmu: how do you launch swank from emacs?
08:38raekshanmu: also: http://technomancy.us/149
08:40sunniboraek: I just tested with a compojure example (https://github.com/weavejester/compojure-example)
08:41shanmusunnibo: thanks, I use commonlisp ccl as well - so I need a full fledged emacs + slime :) as I said swank-clojure 1.3.0 works but swank-clojure 1.3.1 does not - the problem seems to be with the {:encoding "iso-latin-1-unix"} map entry being passed to swank.swank/start-server - it complains that iso-latin-1-unix is missing a key entry
08:41raekshanmu: launching the swank server from emacs with swank-clojure.el (typical usage: M-x slime, or M-x swank-clojure-project, this is what clojurebox uses) is deprecated. consider using the new clojure-jack-in approach
08:41shanmuraek: thanks! clojure-jack-in does not work from windows
08:42raekshanmu: there is known problems (see the clojure mailing list thread) wich I think there is workarounds for
08:42shanmuraek: checking the mailing list....
08:43sunniboclojure-jack-in doesnt work in windows? i didn't know that. that's too bad..
08:43shanmualso, lein plugin install swank-clojure 1.3.1 does not work from windows...
08:43raekshanmu: also consider using UTF-8. swank-clojrue will default to it in recent versions. if you use the latest version of clojure-mode, you dont need to customize-variable slime-net-coding-system to utf-8-unix
08:43raekshanmu: also, are you using the latest lein version?
08:44raekshanmu: you should file a bug report on https://github.com/technomancy/swank-clojure/issues if it's not there
08:44shanmuraek: yes... 1.5.2 I think
08:44shanmuraek: Leiningen 1.5.2 on Java 1.6.0_24 Java HotSpot(TM) Client VM
08:46raeksunnibo: wrap the html5 form like this: (-> (html5 ...) (response) (content-type "text/html; charset=utf-8"))
08:46shanmueven with utf-8-unix encoding, it is returning "java.lang.IllegalArgumentException: No value supplied for key: utf-8-unix (NO_SOURCE_FILE:0)"
08:46raeksunnibo: and (:use [ring.util.response :only [response content-type]])
08:46raekshanmu: try "UTF-8"
08:50shanmuraek: emacs itself throws an error for "UTF-8" - if: Invalid slime-net-coding-system: UTF-8. (iso-latin-1-unix iso-8859-1-unix binary utf-8-unix emacs-mule-unix euc-jp-unix)
08:52sunniboraek: i got an exception: java.lang.Exception: Unable to resolve symbol: content-type in this context
08:52sunniboah. i did'nt add USE. sorry. :p
08:54sunniboraek: wow. i can see Korean chars
08:55sunnibothank you so much. i've googled this problem about a hours, but i couldn't find any answers. :p you're my hero
08:55raekshanmu: ah, does it work to have utf-8-unix as slime-net-coding-system?
08:56raekshanmu: the swank-clojure side accepts the names as "UTF-8", I think (so that's why I suggested it)
08:56raekshanmu: are you providing the "iso-latin-1-unix" option?
08:57shanmuraek: hmmm...looks like slime does not accept it... let me dig through
08:57shanmuraek: no, thats the defauly
08:57raekshanmu: not in recent versions
08:57raekof swank-clojure
08:57shanmuraek: thats probably why its erroring... hmmm
08:58raekmy recommendation: use the defaults for swank-clojure (make sure you don't have any old version in project.clj or ~/.lein/plugins/) and config slime to use utf-8-unix
08:58raekthe last step is not needed if you use the clojure-mode.el from last night
08:59shanmuraek: just did a git pull
08:59shanmutrying again
09:01shanmuraek: clojure-jack-in works with latest clojure-mode and windows cmd command shell (I was using msys shell earlier) checking the old way of launching
09:03shanmuraek: swank-clojure-project does not work - it complains about the utf-8-unix key missing... but then as clojure-jack-in works, I am fine for now... still wondering why one would want to change character encoding identifier strings!!
09:05raekshanmu: swank-clojure-project is deprecated
09:06raekbut for some reason some piece of code gives it utf-8-unix instead of utf-8
09:06shanmuraek: yes... thanks, will use clojure jack in from now :D. you are a star, as usual!!
09:16sunniboraek: can you explain or give me a link why (-> (html5 ...) (response) (content-type "text/html; charset=utf-8")) works? i want to know why...
09:21raeksunnibo: do you know what a response is?
09:23shanmuwith the latest swank-clojure, when I hit C-c C-c in an sexp in a clojure script file, it does not compile in the correct namespace.. Is this is a known issue as well?
09:24tsdhWith kw args [{:keys [...] :or {...} :as everything}] is there something just like the :as but contains the complete map after applying the defaults declared in the :or?
09:24sunniboraek: no. i'm a newbie.. :(
09:25raeksunnibo: ok. :) then I guess you haven't seen this: https://github.com/mmcgrana/ring/blob/master/SPEC
09:26raekI recommend reading it; it's not very long
09:26raekthe functions i used are very simple:
09:26raek(defn response [body] {:status 200, :headers {}, :body body})
09:27raek(defn content-type [response ctype] (assoc-in response [:headers "Content-Type"] ctype))
09:27raekso you manily use them to not have to type so much :)
09:28raekshanmu: I get that behavior if I don't eval the ns for m first
09:29raekafter the ns form is evaluated, it seems to remember what namespace belongs to that file
09:31sunniboraek: oh. very simple! thank you. i'll read the link, too.
09:32raekshanmu: so I usually press C-c C-k the first time to eval the whole file. after that I can use C-M-x to eval the current top-level form
09:36sunniboi want to merge two map {:a 1 :b 2} {:c 3 :d 4} to {:a 1 :b 2 :c 3 :d 4}. which function can i use?
09:38chousersunnibo: merge
09:45gfrlogThere should be a word for the kind of refactoring where you just delete characters in your code and it ends up doing the same thing
09:46gfrloglike (let [x (foo bar)] x) => (foo bar)
09:46gfrlogI feel like that happens unusually often in clojure
09:50opqdonutsimplifying, evaluating, expanding
09:59shanmuraek: it works fine if I remove loading an external slime!! hmm... I have to breakout my common lisp programming to a different way...
10:02sunnibochouser: thanks. there was an answer in my question, haha.
10:20Cozeycan clojure call a java method with variable argument list ?
10:22scgilardiI think so. under the covers a varargs list is an array of objects. from clojure, you need pass that explicitly.
10:24Cozeyscgilardi: ah, ok this explicitnes is what I was asking about - thanks for confirming
10:25chouserI'm a maven unbeliever living in a maven world.
10:25DanCchouser, do you practice maven, then? or use something else?
10:26chouserI allow maven to use me ...er, I mean yes, I use maven.
10:27DanCok.
10:27DanCin ant, copying a .war file to the jboss deployment directory is one line.
10:27DanCcan I do that with maven? or is that heresy?
10:28DanCI gather there's an orthodox way to do .war deployment
10:28DanCit seems that maven wants to control the .war container
10:29DanCmaybe there's some orthodox way to use jboss.
10:30cemerickDanC: There's no reason why you can't use Ant — but in that case, make sure you use the ant maven plugins so you can have sane dependency management.
10:30chouserI haven't done .wars in maven yet. In fact, I managed to pawn that task off to a co-worker recently.
10:30chouserSo maybe now I'll never have to.
10:31cemerickchouser: Not sure you won that one. ".wars in maven" is a one-line change to the pom.
10:31cemerick:-)
10:31chousernope, definitely a win
10:31DanCok, that's the 2nd suggestion of ant+maven plugins.
10:31DanCcemerick, I'm curious what you use; care to say?
10:32Cozeyand this: http://cargo.codehaus.org/ ?
10:32cemerickDanC: To be clear, I certainly don't *recommend* it, but if you're predisposed to ant, I won't argue with that.
10:32cemerickCozey: Cargo is tough. It's original author has stepped away AFAIK (he's the jclouds lead now FWIW).
10:33cemericks/It's/Its
10:33DanCI've got a few hours invested in ant, but nothing I'm not willing to throw away. (I have decades invested in plain old make)
10:33cemerickDanC: I'm all-maven over here.
10:33cemerickDanC: Since you asked: http://cemerick.com/2010/03/25/why-using-maven-for-clojure-builds-is-a-no-brainer/
10:34DanCI certainly agree with "It’s the community, stupid."
10:34cemerickIt sounds like you want to control jboss locally for development purposes?
10:35DanCthe java community is so so enterprise-y; the web is so often treated as secondary. so I struggle with that a bit
10:36cemerickFunny, I linked to Cargo myself in that post! :-P
10:36sunniboquestion: there is a map, {:outer 3 :inner {:a 1 :b 2}}. can i extract :outer and :a? {:outer 3 :a 1}
10:36Cozeysonatype polyglot - nice
10:37DanCFWIW, "Fun and Frustration with Scala" gives a bit of my background w.r.t. the JVM http://www.advogato.org/person/connolly/diary/71.html
10:37cemerickScala in jedit and textmate? *shudder*
10:37sunniboselect-keys seems to works only with one-level (not-nested) map.
10:39cemerickDanC: Also FWIW, some posts of mine related to deployment, etc: http://cemerick.com/category/devops/
10:39cemerickThere's a painfully-long screencast in the most recent one that you may or may not find useful. :-P
10:40chousersunnibo: with what other input? something like [:outer] and [:inner :a], or ...?
10:43CozeyDoes anyone know of any real debugger for clojure initiative ?
10:45raekCozey: http://georgejahad.com/clojure/swank-cdt.html is one
10:45cemerickCozey: http://georgejahad.com/clojure/cdt.html — but that's probably not what you mean by a debugger
10:45raekI think there is at least one other
10:45Cozeyi read about cdt but setup process scared me a bit
10:45gfrlogdebugger == println, right?
10:45chouserDanC: try Ctrl-\ instead of Ctrl-C for backtrace fun on the JVM
10:45Cozeyso i put it on pending list of my todo... and it's still there
10:45Cozeyis it good?
10:45DanCmany thanks, cemerick; just what I was looking for
10:46DanCyes, chouser, I got that clue from the ##scala folks; I should have updated the blog post
10:46raekhttps://github.com/davidsantiago/swank-clj
10:46cemerickCozey: It's the best game in town at the moment.
10:46sunnibo_chouser: here is a example: user> tt
10:46sunnibo_{:a 2, :b 3, :user {:inner_a 5, :inner_b 9}}
10:46sunnibo_user> (merge (select-keys tt [:a]) (select-keys (:user tt) [:inner_a]))
10:47cemerickccw and Enclojure both have debuggers, and they're essentially easy-to-use, but don't have nearly the same level of Clojure-specific functionality as CDT
10:47Cozeyi'll try it, thanks!
10:47redingerI'm curious to hear reports on this one: https://github.com/hugoduncan/swank-clj
10:48Cozeyfor me the lack of good debugger is a big showstopper for clojure adoption
10:49chousersunnibo: hm. Is that better than this? {:a (-> tt :a) :inner_a (-> tt :user :inner_a)}
10:51sunnibochouser: looks good. but i have many keys to extract..
10:52gfrlog,((comp (partial apply hash-map) (juxt (constantly :a) :a (constantly :inner_a) (comp :inner_a :user))) {:a 2, :b 3, :user {:inner_a 5, :inner_b 9}})
10:52clojurebot{:a 2, :inner_a 5}
10:52gfrlog^ don't do it that way
10:53sunnibouser> (def tt {:a 2 :b 3 :c 4 :inner {:i1 5 :i2 6 :i3 7}})
10:53sunnibo#'user/tt
10:53sunnibouser> (merge (select-keys tt [:a :b]) (select-keys (:inner tt) [:i1 :i3]))
10:53sunnibo{:i1 5, :i3 7, :b 3, :a 2}
10:53sunnibohow about this one?
10:53sunnibonot bad?
10:54gfrlogsunnibo: I'd probably extract the inner map first: (let [other-map (tt :inner)] (merge ...))
10:54gfrlogdunno
10:57chouser(into {} (for [ks [[:outer] [:inner :a]]] [(last ks) (get-in {:outer 3 :inner {:a 1 :b 2}} ks)]))
10:58DanCcemerick, I just hit the part of your maven screencast where you mention you use netbeans. My machine bogs down when I try to use eclipse or netbeans or intellij. It's an Ubuntu linux box with 4GB RAM. What am I doing wrong?
10:59DanC(I'm also running 3 web browsers and oracle sql developer)
10:59DanCI can't tell whether linux is doing something stupid or whether the working set size of this stuff is just more than 4GB or somethine else
11:02raek(merge (dissoc tt :inner) (get tt :inner))
11:07cemerickDanC: That's old; I've used Eclipse + counterclockwise for almost a year now.
11:07cemerickBut…4GB is certainly sufficient.
11:07cemerickI use Eclipse heavily as just one of 20+ apps I have running at a time on a 4GB laptop.
11:08DanCok; that suggests that what I'm doing wrong is using linux.
11:10bsteuberdoes leiningen allow a global project.clj like cake?
11:10sunniboraek: thanks
11:11bsteuberkind if weird adding the swank-clojure dev-dependency to every single project
11:11bsteuber*of
11:13the-kennybsteuber: You don't have to do this with newer versions of leiningen
11:14the-kennylein plugin install swank-clojure <version> and then simply lein swank
11:25bsteuberthe-kenny: oh, cool, I'll try that :)
11:52TimMcDanC: I can't imagine that's the trouble.
11:53DanChmm... got any other theories?
11:53TimMcNot really. Does the system monitor show Eclipse as being a big CPU hog?
11:54TimMcouch
11:54TimMcDo other Java apps do the same?
11:55DanCsometimes I think so
11:55DanCother times, it seems that evolution is the culprit
11:55TimMcIn my opinion, Evolution is *always* the culprit, even when it isn't installed.
11:55TimMcBut that's just me.
11:59DanCunfortunately, I'm in a Novell Groupwise enterprise.
11:59manutterDanC: can you just to "top" at the command line?
11:59manutters/just to/just do/
11:59DanCI'm not aware of any alternative native client. the groupwise web client looks better every time evolution goes haywire, though
12:00DanCI can do "top" as long as the machine isn't so bogged down that i can't get the CPU cycles to get a terminal window to the foreground
12:00DanCsometimes I ctrl-alt-1 and log in at the raw console and run top
12:00TimMcWow, you really mean it when you say "bogged down"...
12:01cemerickDanC: is this a 4GB hamster wheel or something?
12:02manutterDanC: fwiw, you can do "top -n 1" to get just a one-shot snapshot of your current machine state
12:02DanCno, I think the machine was new about 6 months ago.
12:02DanCordinary looking HP PC
12:02TimMcDanC: I don't suppose there's any weird suckware installed, like antivirus, etc.
12:02manutterand it's running linux? Which flavor?
12:03TimMcUbuntu
12:03DanCno, I did a clean Ubuntu install myself.
12:03DanCok, since I've got several people holding my hand, I'll try it; and I'll start top first...
12:03manuttermy favorite Ubuntu cycle-hog is the search indexer, whatever the name of that thing was
12:04DanCoh crap! I haven't turned that off
12:04DanCanyway... let's see...
12:05TimMcaha
12:05TimMcI wouldn't be surprised if Eclipse generates a lot of filesystem flack with all its auto building and preference writes.
12:06TimMcDanC: < and > to choose column
12:06zakwilsonSQL has the ability to do "select ... join table1 foo on... join table1 bar on..." to join the same table twice. Can I do that with ClojureQL? How or why not?
12:06TimMcDanC: Alternatively, time to learn Emacs. :-)
12:06gfrlogDefinitely not vim, you'll be stuck forever
12:07DanCI'm an emacs addict, but I don't see the relevance
12:07manutterIt's always time to learn emacs, even if you don't need it now you'll need the head start ;)
12:07DanCevolution 10%, chromium 9.1, firefox-bin, java, chromium, java, e-calendar-fact, ...
12:08gfrlogemacs: it's macs brought into the internet age
12:08DanCMem: 3950224k total, 3871192k used, 79032k free, 8740k buffers
12:08DanCfiring up netbeans...
12:08manutterDanC: I'm a netbeans fan myself, but clojure seems to work best for me in an emacs setting
12:08TimMcDanC: Relevance? Well, if you want to write you some Clojure, Emacs is pretty nice.
12:09manutterMan, you have 3.8G used *before* firing up netbeans? Wow
12:09manutterWhat's eating all your ram?
12:09TimMcI wonder if you're thrashing your swap.
12:09DanCI still struggle to read linux memory numbers. I think most of that is cache
12:10DanCSwap: 4086780k total, 2546920k used, 1539860k free, 284912k cached
12:11DanCI'd be quite content to stay in emacs, but it's hard to find documentation on how to do anything without eclipse or the like
12:11technomancyo_O
12:11TimMcDanC: For Clojure?
12:12technomancythat's ironic, because the #1 problem that people report with using Emacs with Clojure is that there is too much documentation.
12:12DanCtruth be told, closure isn't a big part of actual task. I'm just sort of a reluctant java guy, and I like my of the closure sensibilities
12:13DanCI'm trying to learn about ant vs ivy vs maven for building .war files
12:13DanCs/my/many/
12:14cemerickthe hazards of phone tethering for internet :-/
12:15halfprogrammerCan I create a common-lisp style maplist in clojure with (reduce ...) or something?
12:15halfprogrammerhttps://gist.github.com/1029596
12:15halfprogrammerThis is my current implementation. I want to see if I am missing something obvious...
12:16DanC"a broken appliance always works properly for the repairman." the machine isn't doing the bog-down thing, at least not badly
12:19chouserhalfprogrammer: I don't think Clojure's got anything quite like that built in.
12:19cemerickDanC: oh, the sordid past!
12:19cemerickDanC: Eclipse and maven are entirely orthogonal.
12:19halfprogrammerchouser: okay
12:19technomancycemerick: if only that were true =(
12:19dnolencemerick: how did the meetup go yesterday? sad I couldn't make it.
12:19technomancysome shops use eclipse as their build tool
12:19chouserhalfprogrammer: your impl would be fine if you wrap the when-not not in (lazy-seq ...)
12:20chouser...and change the when-not to (when (some seq colls) ...)
12:20cemericktechnomancy: oh, yes. Evil, that. Eclipse is hardly alone among the IDEs in semi-encouraging bad behaviour w.r.t. local builds tho.
12:20halfprogrammerchouser: I will do that.
12:20cemericklocal == interactive, unrepeatable
12:21manutterDanC: Nepomuk/Virtuoso, that was the name of the cycle-hog on my machine
12:21cemerickThe Eclipse plugin development process is a particularly pernicious instance, tho.
12:21halfprogrammerchouser: I was looking into the implementation of 'map'. There is a function (step) being used. What does it do?
12:21chouserhalfprogrammer: without the lazy-seq, it'll overflow the stack for large colls
12:21chouser'step' there should be local
12:21halfprogrammerI could not find any documentation step
12:22chouserah yes, 'step' is defined in the enclosing 'let'
12:22cemerickdnolen: Good. Not a huge turnout — probably half due to the short notice of the talk, half to its content ;-) But, a good group, all new-ish to Clojure. Mostly the right audience, I think.
12:22halfprogrammeroops. Din't look at it properly
12:22halfprogrammer:D
12:22cemerickI was glad to catch up with Rich and pepper him with some questions.
12:24halfprogrammercemerick: any interesting q&a with Rich?
12:26cemerickhalfprogrammer: The most interesting discussion was about programming language ontologies, provoked by his seeing how Clojure Atlas is implemented.
12:26cemerickAlso some minutiae about type declarations and such.
12:31dnolen... hmm with groundness testing many core.logic program can just leverage Clojure's ridiculously fast operations on sequences and avoid the overhead of vars and unification entirely ...
12:40zakwilsonI don't intend any offense here, but I'm starting to get the impression ClojureQL is a bit half-baked. Am I right to think that, or am I doing it wrong?
12:40dnolenzakwilson: what's the problem? I haven't used it much, what little I did I liked.
12:41zakwilsonI can't find a way to alias table names when doing a join.
12:41manutterI think it's more a question of "not fully implemented yet"
12:42manutterI haven't looked at it in a while, though
12:43zakwilsonI suppose unfinished might be a better way of putting it. I don't think the concept is ill-conceived - quite the opposite. My objection is that I keep not being able to do things.
12:43dnolenzakwilson: do you mean provide your own alias?
12:44manutterselect * from foo f1 left join foo f2 on f1.parent_id = f2.id
12:45manutterDoes it let you do stuff like that, or is that the problem?
12:45zakwilsondnolen: what manutter said.
12:45zakwilsonhttp://pastebin.com/c5bNeVFj <-- this is what I actually want to do. I don't care about aliases as such; I just want to join the same table twice.
12:50zakwilsonhttp://pastebin.com/364rcjv9 <-- this returns the sort of result I want, but using three queries instead of a join is the Wrong Thing.
12:52dnolenzakwilson: I'm taking it that the first thing just produces the wrong SQL.
12:53zakwilsondnolen: pretty much - it produces SQL that would be valid IF it could alias the name of the users table.
12:56dnolenzakwilson: clojureql seems pretty small and clean.
12:58zakwilsondnolen: conceptually, it seems brilliant. It just seems like it isn't *done*.
12:58dnolenwhat I mean is probably not be much effort to patch.
12:59gfrlogzakwilson: what do you feel like is missing?
12:59zakwilsongfrlog: right this second? A way to join the same table twice.
12:59manutterI just did some googling on "ClojureQL self join" and it looks like it's intended to support self joins
12:59gfrlogzakwilson: you mean join A to B twice?
13:00manutterselect * from foo f1 left join foo f2 on f1.parent_id = f2.id
13:00gfrlogah
13:01zakwilsonTo be specific, I mean this: http://pastebin.com/c5bNeVFj
13:04gfrlogyeah I'm having trouble using the table aliases :(
13:04gfrlogbut it will produce ambiguous SQL for a self-join :)
13:09timvisherhey all
13:09timvisheris lean-search still-supported?
13:09timvisherlein*
13:11technomancytimvisher: it's included in lein 1.6
13:11technomancy(due out one of these days)
13:11technomancybut it's only for search now, not for editing project.clj
13:12technomancytimvisher: https://github.com/technomancy/lein-search/tree/lucene works with older versions though
13:15timvishertechnomancy: Ah! I had quoted the version number.
13:19gfrlogman IRSSI is so bad I might have to learn emacs :(((
13:19hiredman~guards
13:19clojurebotSEIZE HIM!
13:20gfrloghiredman: the jabber plugin seems to "work" but I can't for the life of me figure out how to list contacts or initiate conversations
13:20hiredmannever used it
13:20technomancyjabber from irissi is probably done better via bitlbee than directly
13:20technomancynot that I advocate irissi
13:21gfrlogsides if I switched to emacs then I could be a part of the perpetual "what is wrong with my slime" conversations
13:22timvishergfrlog: but slime is so much fun.
13:22timvisheras are the conversations. ;)
13:22technomancythe intellectual stimulation from such discussions should not be discounted
13:22technomancy~swank
13:22clojurebotswank is try the readme. seriously.
13:22gfrlog~vim
13:22clojurebotGesundheit!
13:22timvishermy wife actually hangs out behind me watching the irc go by as we talk about it. It's that impressive.
13:23gfrlogtimvisher: that's a property of slime?
13:23technomancywhy else would people ask their questions in here rather than reading the readme?
13:23timvisheryeah. she came with the download too!
13:23gfrlogalso maybe I would finally know the difference between slime and swank :) (answer: only the second one comes before "server")
13:24timvisheralso you could 'bang on files' in dired mode.
13:24gfrlog:-| wut?
13:24timvisherwhich has become my favorite phrase in the last 2 days
13:24technomancytimvisher: you mean wdired?
13:24timvisherno, just plain dired
13:24timvishermark a bunch of files and then press !
13:25timvisherdoes a shell command only on those files
13:25timvisherin a number of different ways
13:25timvisherand it's awesome
13:25technomancylike interactive xargs?
13:25timvisheras in self-actually awesome
13:25gfrlogI guess I can use emacs for erc without having to use it for text editing at first
13:25timvisherhmm
13:25gfrlogpresumably...
13:25amalloytechnomancy: more like interactive find -exec, i'd imagine
13:25timvishernot even sure what you'd mean be interactive xargs
13:25timvisheramalloy: yes
13:26gfrlogor like interactive "open windows explorer and perform your task on each file manually one-by-one" but automatically too
13:26timvishernow you're getting the picture!
13:26gfrlog:)
13:27timvishertechnomancy: if you've never read the '37.8 Shell Commands in Dired" section of the manual, you really should. :)
13:27timvisherI regret having gone so long without it.
13:27timvisheris wdired in vanilla emacs?
13:28timvisheror do I have to install it?
13:28technomancyI think it was added in 23?
13:28timvishergoogle answered me
13:28technomancyhttp://www.youtube.com/watch?v=qhTLb59Eumo
13:28timvisherah
13:28gfrlogemacs-chess??
13:28timvisherI didn't even know that was called that
13:28timvisherI _love_ that feature of dired
13:29timvisherespecially combined with find-dired
13:29timvishergfrlog: and Go!
13:29gfrlogaw golly
13:29gfrlogokay I'm about to try erc for the first time
13:30gfrlogwell, if I can figure out how to start it :(
13:30Scriptorgfrlog: good luck! erc is awesome, especially since you can split the screen and watch multiple channels a the same time
13:30ScriptorM-x erc?
13:30hiredmanoh come on, does any console irc client not have the ability to split screen?
13:30Scriptorhiredman: console? No :p
13:31gfrlog_hiredman: I don't know how to do it in centerim or irssi; but I am lazy about looking stuff up
13:31Scriptorbut in case he's coming from a gui irc backgroun
13:31gfrlogtest from erc
13:31amalloyhow does the kool-aid taste?
13:32gfrlogwell; don't know how to do nothing :) but if I keep this screen session running forever, I can just leave it open and not worry about how I got it open in the first place
13:34gfrlogemacs got jabber too?
13:34technomancygfrlog: yeah, there are two jabber clients, but most people prefer bitlbee
13:35technomancy(one in pure lisp, one based on libpurple)
13:35gfrlogtechnomancy: technomancy: is your emacs workshop @SL filled up yet?
13:35technomancygfrlog: not as far as I know =)
13:36gfrlogtechnomancy: okay, so I can avoid any difficult learning until then, and you will magically make me an expert?
13:36technomancydepends, how do you feel about potions and elixirs?
13:36technomancyare you or are you not comfortable with the act of quaffing?
13:36gfrlogtechnomancy: you're referring to Ctrl-alt-meta key combinations?
13:37amalloytechnomancy: more of an art than an act
13:37technomancyactually I'd recommend watching the peepcode before the workshop
13:38gfrlogdang if I can find it on their site OR google
13:38gfrlogoh wait
13:38DanCok, enough soaking it in... trying out maven... holy cow! 75.3 MB!
13:38gfrloghagelberg is a better search term than technomancy apparently
13:39technomancyhttp://peepcode.com/products/meet-emacs I do believe
13:40gfrlogtechnomancy: please tell me some of this money goes to you
13:40technomancygfrlog: the peepcode royalties are very generous, yes =)
13:40gfrlogokay good
13:40technomancyhighly recommended if you are looking for a publisher for that matter
13:41hiredmantens of bitcoins a year
13:41gfrlogthat's a million dollars in future money
13:41Scriptortechnomancy: do you have to get the recording software yourself? What about editing?
13:41technomancyScriptor: for the two that I did in 09 I just provided the script and sample projects
13:41hgoodmanselling point looks like the return of Wordstar! :-)
13:42technomancyScriptor: I think now they prefer it if you can do rough video silent recordings and they do all the editing and voice-overs
13:43gfrlogha: their "comments" section has an apparently outdated: “The PeepCode Emacs screencast is the awesomesauce and worth far more than $9 if you're just starting with Emacs.”
13:43gfrlogI hope "far more than $9" is >= $12
13:44technomancyand wall street
13:44gfrlogyeah! blame bush!
13:44gfrlogand jimmy carter!
13:45gfrloganyhow, thants for all the emacs tips folks
14:03Scriptorhas anyone here ever used the emacs plugin that gives you vim keybindings?
14:07ilyakhi *
14:07ilyakIs it possible to type hint an aget?
14:07ilyakI have an array of strings
14:08ilyakI do a lot of (aget array n)
14:08ilyakand I get a lot of reflection warnings
14:08hiredmanyou need to type hint the array and type hint n
14:09ilyakn is a constant
14:09ilyakHow do I hint the array of String?
14:09ilyakI mean, n is a literal
14:10hiredman^objects should be good enough
14:14ilyakCool! Thanks a lot
14:18dnolen_,(class (make-array String 10))
14:18clojurebot[Ljava.lang.String;
14:18dnolen_ilyak: ^
14:19ilyakdnolen_: Are you sure you can say ^[LString in clojure?
14:19dnolen_^"[Ljava.lang.String;"
14:21cemerickSome very surprising results in the survey so far…
14:21dnolen_cemerick: ?
14:21timvishercemerick: which survey?
14:22cemerickah, I've found the unconverted! :-D
14:22cemericktimvisher: http://wp.me/p10OJi-94
14:22gfrlogeverybody uses vim?
14:22cemerickAnyone here who hasn't completed the survey, please do so: http://wp.me/p10OJi-94
14:22cemerickgfrlog: Nice try. :-)
14:22manutterEverybody loves Raymond. SOME people use vim.
14:23manutter:)
14:23gfrlogare the results publicly viewable somewhere?
14:23Scriptorcemerick: leak us some results pleease? :)
14:23cemerickgfrlog: they will be once the survey is closed
14:24gfrlogokay
14:24cemerickScriptor: Nope, no cheating! :-)
14:24cemerickgfrlog: same shtick as last year, FWIW: http://cemerick.com/2010/06/07/results-from-the-state-of-clojure-summer-2010-survey/
14:24cemerickonline votes with open results just beg to be gamed
14:25gfrlogwhat makes it more gameable?
14:26jcromartieseeing the gamed result is an incentive to game it, in itself
14:26cemerickproviding feedback seems to provide some sense of motivation for box-stuffers
14:26gfrlogdoes Clojure-in-Clojure lead almost immediately to Clojure-in-JavaScript?
14:26cemerickMaybe that's not actually true, but there's no downside to holding back results for a week.
14:27Scriptorgfrlog: it opens it up to other platforms, but it wouldn't be immediate
14:27cemerickgfrlog: it makes things a helluva lot easier, at least for those aspects of Clojure that are possible on the host
14:28Scriptoralthough I think there's something like clj->js already out there
14:28gfrlogI guess you have a lot of decisions to make about interaction with the host platform
14:28Scriptorhttps://github.com/kriyative/clojurejs
14:28cemerickScriptor: Big difference between clojure-generating-javascript (e.g. scriptjure) and Javascript-as-clojure-runtime.
14:30halfprogrammercemerick: filled the survey form :)
14:30gfrlogthere was something called clojurescript somewhere right?
14:30Scriptorcemerick: what else is needed beyond the code generation? Better interop?
14:30cemerickhalfprogrammer: fabulous. Get 5-10 of your Clojure-using, Clojure-tinkering friends to do the same.
14:30halfprogrammercemerick: sure
14:31cemerickgfrlog: Yup, that's chouser's baby.
14:33cemerickScriptor: Things like scriptjure and clojurejs perform a naive source-to-source translation. Useful as far as it goes, but there's no runtime, no compiler, namespaces, proper data structures, reference types, protocols…
14:35gfrlogno integer data types :)
14:35technomancy=(
14:35gfrlogI don't know how you can call something a programming language when it doesn't have integers
14:36dnolen_cemerick: of course it's not clear how much of Clojure is useful in JS ... Featherweight Clojure ?
14:37gfrlogI think it'd be useful. You could finally write client-side code you were proud of
14:39dnolen_gfrlog: a lot of things would be difficult to port or pointless. I'd be happy with Clojure 1.1 sans immutable datastructures (just copy on write)
14:39gfrlogI think new-javascript provides immutability
14:39gfrlogObject.freeze or something like that
14:40gfrlogand you can imitate immutability otherwise
14:40Scriptorimmutable data structures are more than that though
14:40cemerickdnolen_: I think that's probably what the target would be
14:40gfrlogScriptor: sure, but all you need is the building block
14:41gfrlogwithout that you have to use closures
14:41Scriptorgfrlog: well, you really don't even need Object.freeze, maybe as a way to prevent mistakes
14:41chouseror improve performance
14:41gfrlogScriptor: how else to implement immutability?
14:41Scriptorbut immutable data structures could be done in the js we have now
14:42chouserI translated Rich's whole bit-partitioned hash-trie for maps and vectors to JavaScript
14:42chouserThey work today, if you really want them.
14:42stuartsierrachouser: What was perf like?
14:42gfrlogchouser: how do you prevent modification?
14:42chouserstuartsierra: I don't think I ever really tested that
14:42stuartsierraok
14:43chousergfrlog: I didn't, but if you use conj and assoc, nothing would get modified.
14:43gfrlogright
14:43dnolen_Scriptor: *dog slow* immutable data structures you mean.
14:43Scriptordnolen_: sure, but object.freeze isn't going to change that
14:43chousergfrlog: if you go poking around in the internals, doing my_hash.whatever = "thing", well, you're on your own.
14:44gfrlogI like hard-immutability better :)
14:44Scriptorgfrlog: it's not about preventing modification
14:44Scriptorwell
14:44gfrlogScriptor: java does it
14:44__name__gfrlog: Building tree based persistent datastructures?
14:44__name__That do not involve copying stuff around.
14:44chousergfrlog: you don't have truely enforced immutability in Java Clojure either.
14:44Scriptorgfrlog: for a deeper look, read into purely functional data structures
14:44Scriptorby okasaki
14:44chouserreflection, using mutables as keys and values, etc.
14:45gfrlogScriptor: I know how the data structures are built
14:45Scriptorgfrlog: so you can see why you wouldn't need to explicitly freeze them?
14:45gfrlogI tried writing an enforced-immutability library in javascript; got bogged down
14:46gfrlogScriptor: yes, if you're the only one using them and you trust yourself, you don't need to enforce immutability
14:46chouserback when I was working on contrib/clojurescript, rhickey kept telling me to just do copy-on-write for the collections, but I went ahead and did the whole thing anyway. Was good for learning, but perhaps not very useful otherwise.
14:46gfrlogI implemented a finger-tree-like data structure in erlang once
14:47Scriptorgfrlog: as long as the interface to the data structure doesn't mutate anything it should be fine
14:47gfrlogScriptor: as long as you always go through the interface
14:48gfrlogJavaScript doesn't enforce that sort of thing
14:48gfrlogI don't know why it bothers me
14:48Scriptorsure, but if you're doing a clojure->js thing, then you can have it so that at least from the point of view of writing clojure code
14:49Scriptorthere is *only* that interface
14:49gfrlogScriptor: true true
14:49gfrlogbut you lose it when calling-clojure-from-JS
14:49gfrlogand presumably you might build JS-interop into clojure, so even from clojure it's not guaranteed
14:51chousergfrlog: {:a (atom 42)} ; mutable collection in Clojure
14:51gfrlogchouser: the value is always that atom
14:51hiredmanatoms are not a value
14:51chouserbut the value of the atom can change
14:52gfrloghiredman: I meant value in the key-value-of-a-map sense
14:52hiredmanatoms are mutable references
14:52gfrlogchouser: sure, but you expect that, and you're explicit about it
14:52chousermy point is that's not a "safe" collection. It does not provide the guarantees we expect from immutable collections
14:52hiredmangfrlog: the big win of immutability is computations based on values, and you just lost it
14:52chouserand Clojure allows it, without java interop or other hackery
14:53hiredmandoesn't even provide stm type guarantees since it is an atom
14:53gfrlogchouser: it does provide the guarantees
14:53gfrlogyou can't overlook the atom's value mutating because you have to deref it
14:53gfrlogthat key will always map to that atom
14:53amalloygfrlog: wut. you're totally wrong that it provides guarantees
14:54gfrlogamalloy: how so?
14:54amalloyyou can't use that "mutable map" as a key in a map, for example, because it will hash differently depending on its current value
14:54Scriptorchouser: what did you mean by using copy-on-write for the data structures, every time you conj you just copy the array and append the new element onto it?
14:54gfrlogamalloy: an atom hashes differently when you update it?
14:54chouserScriptor: exactly. which is what Clojure's collections do now when they're mall anyway.
14:54chousersmall
14:54Scriptorah
14:55Scriptorall collections? Even lists?
14:55amalloy,(let [a (atom 1)] [(hash a) (swap! a inc) (hash a)]) ; let's try it and see
14:55clojurebot[15530730 2 15530730]
14:55chouseroh, no.
14:55gfrlogthat's what I would expect
14:55chouserjust vectors, hash-maps and array-maps I think.
14:55gfrlogsame java object
14:56Scriptorare you guaranteed that it'll use the same memory address?
14:56gfrlogif you want to put mutable objects in your immutable data structures that's your responsibility, but it doesn't change the immutability of the data structure
14:56hiredmangfrlog: but an atom or a ref or an agent is not a value, so it does not matter if it is the same object
14:56chouserok, let's back up a step. My point at the moment is that Clojure provides tools and expectations about immutability, not guarantees.
14:56gfrlogyou can't swap the atom out for a ref
14:56hiredmangfrlog: so?
14:56chouserand it could do the same on a JS runtime.
14:56dnolen_amalloy: atoms hash consistently regardless of what value they hold.
14:56amalloydnolen_: yeah, so i see
14:56gfrloghiredman: the context is that I'm saying the java immutable data structures provide stronger guarantees than naive JS implementations
14:57Scriptorgfrlog: how so?
14:57gfrlogbecause in Java/clojure I cannot change the objects in an immutable collection
14:57hiredmangfrlog: given java reflection that seems naive
14:57chousergfrlog: but you *can*
14:57gfrlogif they are ref objects, I can change their values, sure
14:57chouserreflection, mutable java objects as keys or values, etc.
14:58gfrlogreflection sure
14:58gfrlogI feel like it's valid to consider just the set of things you can do in java without reflection, but if nobody else is interested in that, then nevermind
14:58hiredman,(let [a {:a (atom 0)}] (= a (do (swap! (:a a) inc) (println a) a)))
14:58clojurebot{:a #<Atom@1a30706: 1>}
14:58clojurebottrue
14:59gfrloghiredman: that doesn't change what I was saying
14:59gfrlogyou still have a map with the key :a pointing to the atom 1a30706
14:59hiredmanbut the atom is not a value
15:00hiredmanso the map is not a value
15:00gfrlogno, but in a naive JS implementation, you could change the map itself
15:00gfrlogmutably add keys
15:01hiredman*shrug* you are obviously wrong, but I have things to do
15:01gfrlogchouser: reflection would let you mutably add values to a vector, e.g.?
15:01chousergfrlog: I believe so, yes. You'd change some private fields to public, and then mutate them. It's all Java arrays inside.
15:02gfrlogdoes nobody understand the distinction I'm making?
15:02dnolen_gfrlog: I agree with you.
15:02gfrlogdnolen: thanks :)
15:02chousergfrlog: To the extent that I understand your distinction, I don't think it matters.
15:02gfrlogchouser: I could grant you that
15:02dnolen_gfrlog: in fact I think it's a point that you can leverage in an interesting way.
15:03amalloygfrlog: can't you really-actually hide information in js, by returning a closure?
15:03gfrlogamalloy: yeah, that's how I'd do it
15:03amalloyand then it's actually immutable afaict
15:03gfrlogamalloy: https://github.com/fredericksgary/persistent_js
15:03chousereven without reflection, just with normal java interop you can make clojure's immutable collections mutable enough to for the distinction to be useless
15:03gfrlogthat's nowhere near functional, but that was my approach
15:03gfrlogchouser: how's that? does it have to be that way?
15:04chouserthe reason that's not a problem in clojure is because we have good tools to accomplish our jobs without that. clojure makes it easy to do the right thing.
15:04chouserno matter how possible doing the wrong thing still is.
15:05chouserwho gave this analogy recently -- was it Halloway? It's like how sidewalks are still useful even without guardrails to keep us on the path.
15:05amalloycemerick: had a good time reading last year's results just now. thanks for the link
15:06@rhickeychouser: I did
15:06gfrlogchouser: sometimes I get too interested in orthogonal issues :)
15:08chouserrhickey: ah yes, in Fogus' interview. Sorry.
15:10@rhickeynothing to be sorry about, you were just asking
15:10@rhickeyStu will be saying it soon enough :)
15:12hiredmanI have this theory that rhickey and halloway are the same person, they say the same things, never seen a photograph of them together, never both in #clojure at the same time, etc
15:12gfrlogdid halloway introduce rhickey @conj?
15:12devnyes.
15:13ScriptorI saw them next to each other once
15:13hiredmanit persists even though I saw both of them on the bus at the conj
15:13devni saw them both. they are two separate people.
15:13devnthere may be some vulcan mind-melding at play, though...
15:13Scriptorstunt double?
15:13gfrlogif he alternates between the two identities really fast, maybe it is enough to convince you there are two people
15:14chouserI think it's more likely that they're both 3-dimentional aspects of the same multidimentional being
15:14hiredmanperhaps a transporter accident..
15:15redinger It's just a trick with mirrors
15:44TimMchiredman: So, atoms are not values, but contain values?
15:45TimMc,(atom (atom 5)) WHERE IS YOUR GOD NOW
15:45clojurebot#<Atom@19d5fe6: #<Atom@103074e: 5>>
15:45hiredmanI never said atoms contain values
15:45hiredmanI said atoms are mutable references
15:46gfrlog:)
15:47gfrlogha -- just noticed that http://clojure-log.n01se.net/ highlights "rhickey" in red
15:48amalloygfrlog: could be because he has ops, not special-cased on name
15:48hiredmanit is special cased on his nick
15:50gfrlogif only the statements were highlighted instead of the nick
15:54Scriptorhe's not always opped though, chanserv has guard on here
15:58TimMchiredman: Seriously, though -- why do you not consider a mutable reference to be a "value"?
15:58TimMcI'm confused about how you define that term.
15:58gfrlogI think it's a more abstract concept
15:58gfrlogfor which mutability doesn't make sense
15:59hiredmanbecause values are immutable
15:59TimMcAh! Fair enough.
15:59hiredman1, 2, 3, :foo, "bar", etc
15:59hiredman[1 2 3]
15:59TimMcbut not (ArrayList.)
15:59hiredmancorrect
15:59gfrlognor (atom)
15:59hiredmanindeed
16:00bdeshamso if you're playing a game and your score goes from 80 to 90, then yes, your score changed, but the *values* 80 and 90 certainly didn't change
16:00hiredmancorrect
16:00gfrlogunless it's a drinking game
16:00bdeshamgfrlog: haha
16:00TimMcYeah, now rich's value/state/reference thing is coming back to me.
16:00hiredmanyour score is a mutable reference to a series of values over time
16:00TimMchttp://clojure.org/state
16:08Scriptorthe Clojure/core reading list page has some nice articles linked: http://clojure.com/reading.html
16:09gfrlogI like how it all starts with HDD
16:10redingergfrlog: Almost like it was planned that way. ;)
16:12Scriptorheh, I accidentally discovered hdd in an essay writing course
16:13gfrlogScriptor: it was part of the course?
16:13Scriptorgfrlog: nah, we were supposed to come up with our own topic
16:14gfrlogScriptor: and you were interested in hammocks?
16:14Scriptorand I've done some of my best thinking with pencil and paper
16:14Scriptorehh, metaphorically :)
16:14gfrlogaah; you meant the concept, not the talk
16:15Scriptoroh, sorry for the confusion, right
16:58dnolen_ooh cond w/ :let binding syntax from cgrand https://github.com/cgrand/parsley/commit/6c12b27f86de26c41bb811e2f2ecf4d2169edab1#L0R13
17:00gfrlogreusing a symbol in (let) feels like multiple assignment
17:02jcromartiegfrlog: you mean like...?
17:02jcromartie,(let [x 1 x (inc x) x (inc x)] x)
17:02clojurebot3
17:02jcromartieyeah
17:02jcromartiebut at least it's all right there
17:03gfrlogI guess it's not quite as powerful as multiple assignment because you can't do it iteratively
17:03jcromartieright
17:03jcromartieand each let is its own scope
17:03jcromartieso you avoid the problems where a re-assignment happens in some godforsaken nested if block
17:04jcromartieyou know you've been doing FP too long when you refer to if blocks as "godforsaken"
17:04gfrlogah right -- the outer one is still accessible
17:05gfrlogyou merely referred to _nested_ if blocks though; not as extreme
17:09rseniorI am getting an error when I try and run "lein compile" on windows that it can't find javac.exe
17:10rseniorI have the JAVA_HOME setup, and I can run lein deps and it will work without issue, but it can't seem to compile, is there an environment variable I would need in windows that I don't need in Linux?
17:23TimMcrsenior: What happens if you just try to run javac from the command line?
17:24TimMc(I guess that would be a PATH issue, though.)
17:24rseniorTimMc: it runs (displaying help output)
17:24TimMcinteresting
17:24gfrlogyeah I figured "lein deps" wouldn't work otherwise
17:25rseniorTimMc: I'm up and running now, I removed Java and reinstalled it in a place that doesn't have spaces in the path, reset JAVA_HOME an PATH and it seems to be working
17:25TimMchuh
17:25gfrloggood ole whitespace
17:25gfrloggets worse when you add bell characters
17:25rseniorI don't work much in windows and don't know much about Windows 7, so I was kind of stabbing in the dark anyway
17:41mreynoldsWhat's the "right" way to specify use/require/etc with ns? Is it (ns x.y.z (:use ... or (ns x.y.z (use... ?
17:42technomancyclojurebot: ns?
17:42clojurebottransients are not mutable data structures: http://technomancy.us/132 or at least as far as you're concerned.
17:42technomancyclojurebot: ns is unfortunately more complicated than it needs to be, but http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns may be helpful.
17:42clojurebotIn Ordnung
17:42dnolen_http://lambda-the-ultimate.org/node/4293, if only we had Prolog built into our typechecker, ha!
17:43technomancymreynolds: ^^
17:43hiredmanyes, well
17:44hiredmanI was reading some f# blog post where the guy used the type system to constrain code to only being run on a particular thread
17:44hiredmanwhich seems pretty crazy
17:44brehauthiredman: do you have a link for that?
17:45hiredmanmmmm, tab seems to be gone
17:47offby1Now, there's a bot that should really do URL shortening
17:47Cozeygood evening, how to run maven task 'sources-jar' in clojure source?
17:48mreynoldstechnomancy: gracias!
17:48brehauthiredman: oh well, thanks anyway
17:51gfrloghiredman: was it something you could do in Java as well? like subinterfacing runnable, and subclassing thread with the singleton pattern?
17:58brehautgfrlog: at a guess, its probably using phantom types or a similar approximation
17:58gfrlogooh, more learning
17:58brehautgfrlog: its pretty trippy stuff :)
17:58gfrlogif I'm gonna learn emacs, I may as well learn haskell...
17:59brehautyou definately should learn some haskell
17:59gfrlogwhatabout just a haskell?
17:59brehautis that an option pun?
17:59gfrlogno
18:00gfrlog$google learn you a haskell
18:00brehautpity
18:00gfrlogdangit where's sexpbot?
18:00gfrlogsexpbot: whatup?
18:00gfrlogclojurebot: go find your friend
18:00clojurebotNo entiendo
18:15TimMcouch
18:15TimMcrejected
18:18hiredman~google learn you a haskell
18:18clojurebotFirst, out of 174000 results is:
18:18clojurebotLearn You a Haskell for Great Good!
18:18clojurebothttp://learnyouahaskell.com/
18:21gfrlogclojurebot is more useful than I thought.
18:29CozeyHi, has anybody managed to get swank-cdt to evals under cake ?
18:29amalloyCozey: last i heard swank-cdt wasn't compatible with cake
18:29Cozeymhm so this is still the case
18:29Cozeygoddamnit!
18:30amalloyCozey: yeah, lance hasn't heard from george for quite a while, so i'd guess he's not really working on it
18:31Cozeyspring came
18:31gfrlogsexpbot came back and personally apologized to me for his absence
18:32hiredman~search for useful
18:32clojurebot<#clojure:gfrlog> clojurebot is more useful than I thought.
18:32clojurebot<#clojure:chouser> who gave this analogy recently -- was it Halloway? It's like how sidewalks are still useful even without guardrails to keep us on the path.
18:32clojurebot<#clojure:chouser> back when I was working on contrib/clojurescript, rhickey kept telling me to just do copy-on-write for the collections, but I went ahead and did the whole thing anyway. Was good for learning, but perhaps not very useful otherwise.
18:32clojurebot<#clojure:gfrlog> I think it'd be useful. You could finally write client-side code you were proud of
18:33gfrlogclojurebot is even more useful than I thought
18:33amalloyinteresting that only gfrlog and chouser ever say the word "useful"
18:33hiredmanyou can page through results with a "page" number in square brackets
18:33hiredmanamalloy: limit 4 per "page"
18:34hiredman~search for useful [1]
18:34clojurebot<#clojure:chouser> back when I was working on contrib/clojurescript, rhickey kept telling me to just do copy-on-write for the collections, but I went ahead and did the whole thing anyway. Was good for learning, but perhaps not very useful otherwise.
18:34clojurebot<#clojure:gfrlog> I think it'd be useful. You could finally write client-side code you were proud of
18:34clojurebot<#clojure:dnolen_> cemerick: of course it's not clear how much of Clojure is useful in JS ... Featherweight Clojure ?
18:34clojurebot<#clojure:cemerick> Scriptor: Things like scriptjure and clojurejs perform a naive source-to-source translation. Useful as far as it goes, but there's no runtime, no compiler, namespaces, proper data structures, reference types, protocols…
18:34amalloyhiredman: yes, i know that isn't the whole result set
18:34hiredmananyway, also works in private message
18:35gfrloghiredman: sweet
18:35hiredmansomeday I'll get around to a web ui for it
18:36gfrlog~sexpbot
18:36clojurebotsexpbot is there is another
20:13carllercheI'm trying to use :gen-class to generate a log4j Layout, but when I refer to the layout in the log4j.properties file, it doesn't seem to find the class. Am I doing something wrong? https://gist.github.com/7874cd65ed655f2ce59a
20:26amalloycarllerche: you probably have to specify the class in the :aot list of your project.clj?
20:26amalloyand then lein/cake compile it
21:12gfrlogis AOT only relevant for gen-class?
21:48halfprogrammerhow do i get a sorted vector datastructure?
21:51halfprogrammeri would like to to be able to conj to the datastructure (maintaining order) in less than o(n)
21:52scgilardiwill a sorted-set do the trick?
21:52halfprogrammeractually it would. but I would'n it take a lot more memory?
21:52halfprogrammers/would'n/wouldn't
21:52sexpbot<halfprogrammer> actually it would. but I wouldn't it take a lot more memory?
21:53scgilardiI think the memory used would be ballpark similar. do you have a huge dataset or very limited memory available?
21:55halfprogrammeri am writing some utilities. I don't know how i will be using it later. i thought i could use as little memory as possible
21:59scgilardisorted-set seems like the right tool. Here's some more info about how Clojure's persistent vector is implemented: http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/ . Most of Clojure's persistent data structures are trees under the hood.
22:01halfprogrammerthanks for the share. will look at it now.
22:02scgilardiyou're welcome
22:10hiredmantechnomancy: I wonder if clojure mode could interact with clojure over slime to do things like highlight locals different from globals, etc
22:43duck1123I have a question that I'm unable to find a good answer. I have a ring app that I'm building with maven. I'm using mongodb for the db, but that shouldn't matter as much. I simply want a different set of config options to be used when testing
22:43duck1123I'm currently using lazytest, but I might be willing to switch at this point
22:44seancorfieldi just ran into java.lang.Exception: Cyclic load dependency when compiling... i added a new :import of a java class in one of the namespaces that my code being compiled depends on... any suggestions on approaches to fix that?
22:46seancorfieldwithout the :import it compiles, with it... boom... the code being compiled is a log4j appender, the imported class is the c3p0 ComboPooledDataSource
22:47seancorfieldit looks like c3p0 depends on log4j so i guess that's what is causing the problem :(
22:48seancorfieldhmm, adding that import to the code being compiled causes a fairly immediate compilation failure on that namespace alone...
22:51seancorfieldfrom the stacktrace, it looks like compiling the namespace actually runs code in that namespace?
22:52seancorfieldi see at worldsingles.logging.dbappender$loading__4532__auto__.invoke(dbappender.clj:5) in the stack trace - which points at the (ns) call... guess that makes sense... executing that tells it what / how to compile...
23:07seancorfieldthe solution was to break the chain of dependencies by removing the :require in the compiled code and using (resolve) to load the necessary symbol at run time