#clojure logs

2010-07-30

00:12daakuis there a way to amortize the startup time for lein? java's already slow, and having to wait for two instances to load for running a couple of tests takes 12-13 seconds for me. i was wondering if there's a way to hold on to the lein process and keep poking it when i need the tests to be re-run so it can skip it's own startup time
00:14qbgdaaku: It sounds like cake would help, but it isn't lein, and it is a bit young
00:14daakuqbg: this didn't yield anything: http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=clojure+cake
00:14daakugot a link?
00:15qbghttp://github.com/ninjudd/cake
00:15daakuthanks
00:15qbgPersistent JVM
00:15lancepantzdaaku: you can actually put cake in autotest, then it watches for files to be reloaded and runs your tests
00:16lancepantzdo 'cake autotest'
00:16lancepantznot docs for it yet, but i think its really useful
00:16daakusweet
00:16daakuit supports project.clj too?
00:16qbgYes
00:16daakushould i be using this instead of lein?
00:17lancepantzdaaku: we're still ironing out the kinks
00:17daakucool
00:17lancepantzwe've been using it internally for a month or so, i really like it
00:17daakuout of curiosity, was it java startup time which led to this?
00:17qbgOne problem that I've encountered with cake is that you can't (read) from the repl
00:18lancepantzactually it wasn't
00:18lancepantzwe just wanted a task dependency model because our build was getting pretty complex
00:19lancepantzqbg: open an issue for it on github if you don't mind
00:19daakulancepantz: cool
00:19qbglancepantz: Okay, I will
00:20lancepantzdaaku: it's easy to install though, if you have ruby up to date, just do 'gem install cake' form your project root
00:21daakuhuh! cake test takes like 0.10s -- while lein test takes 12s -- which would mean it's lein's own startup that takes 12s. that's a bit odd
00:21daakulancepantz: already got it running :)
00:21lancepantznice
00:21qbgTotally needs to be the logo for cake: http://clojure.org/file/view/clojure_cake.png/42336345/clojure_cake.png
00:21lancepantzdaaku: that sounds about right
00:21daakuqbg: nice
00:21lancepantzqbg: nice! done.
00:22lancepantzwhere did you find a link to that image?
00:22qbgIt was on clojure.org when Clojure turned 2
00:22qbgI had to do google-foo to find the link...
00:22lancepantzsweet
00:27daakulancepantz: i'm trying to start a jetty server in the bg running in a cake repl -- but it doesn't seem to include the stdout/stderr from the thread, any suggestions on how to fix that?
00:29lancepantzwell, in short you can't
00:30lancepantzeverything is going over the socket, so there isn't really a difference between the two anymore
00:31lancepantzi think ninjudd made it just swallow up stderr if i remember right
00:31lancepantzi think i can fix it though, we dont really have that use case
00:32lancepantzdo you mind creating a ticket for it on github?
00:33lancepantzi'll do it actually
00:33daakuhey, sorry, just saw the msgs
00:33daakui can do it if you like
00:34daakuand thanks :)
00:34lancepantzgo for it, i'll let you know when its fixed
00:36daakudone: http://github.com/ninjudd/cake/issues/issue/11
00:36lancepantzty
00:36lancepantzit may be next week before we get to it
00:37lancepantzninjudd did the repl and he's on vacation, and i'm way backed up on shit
00:38slyrusdaaku: there was some talk on the lein mailing list today about the slow startup times and a possible fix
00:41daakuslyrus: cool, i need to subscribe i guess..
00:41daakuslyrus: is this the thread: http://groups.google.com/group/clojure/browse_thread/thread/e04ab3f6e17f85c4 ?
00:41slyrusthe problem seems to be in the way lein looks for hooks at startup.
00:41slyrusyeah
00:43daakuslyrus: totally worth dropping imho if it can cut down startup time by 12 seconds on a fairly recent mbp!
00:43slyrusyeah, I agree
00:43slyrusas long as lein swank works, everything else can go to hell, AFAIAC
00:43slyrus:)
00:43daakuhehe
00:44daakui've only gotten started, but i'm not sure i can switch from vim to emacs
00:45daakuvim + repl in screen works pretty well. i just need to figure out how to get the repl to reload code with a vim keybinding or just auto reload
00:50slyrusI don't suppose Joshua Choi ever hangs out here?
01:05tomojrarely
01:08daakulancepantz: thanks for cake :) -- it's going to make this learning process a lot more pleasurable!
01:09lancepantzdaaku: cool dude, glad you like it
01:09lancepantzmost of the credit is due to my co-worker, i just play bass :)
01:15daakulancepantz: i was dreading testing because of the startup time, and now i'm at the other spectrum with autotest -- that's awesome
01:15daakuin fact, i feel like cake repl is faster than clj
01:15daakuwhich makes no sense?
01:15daakuor is cake repl faking it
01:15lancepantzas far as start up time, or general performance?
01:15daakuand the socket's just being opened in the bg
01:16daakustartup time
01:16lancepantzit's faking it
01:16daakuok, makes sense
01:16lancepantzthe jvm persists
01:16daakuoh!
01:16daakui didn't get that part
01:16lancepantzwe just reload your source files when you run the cake command
01:17daakui should obviously read the readme
01:17lancepantzand i haven't documented autotest yet, but the "." being printed means all of your tests passed
01:17lancepantzit's pretty incomplete still
01:17daakuyep, i figured
01:17lancepantzwe haven't announced it or anything yet
01:17lancepantzi've just talked in the channel about it some
01:17daakucool
01:18daakui'm happy to be a beta tester
01:18lancepantzgreat, please file any issues you find on gh
01:20daakuwill do
01:36defnlancepantz: you around?
01:37defnlancepantz: with cake should I be including a :dev-dependencies [[swank-clojure "1.3.0-SNAPSHOT"]]?
02:14raekgood morning, #clojure
02:18defnmorning raek
02:22slyrusok, fnparse is starting to make sense...
02:26defnhehe
02:26defnis it now?
02:26defnslyrus: explain it to me! :)
02:27slyruswell, first of all, make sure you have the develop branch. fnparse3 looks much better.
02:27slyrusthen read the json.clj example.
02:38hiredmanclojurebot uses fnparse
02:54slyruscool. and hopefully chemiclj will soon... it's coming along.
03:02slyrushiredman: who wrote clojurebot?
03:05hiredmanI did
03:08slyrusah, cool. I assume you used fnparse2?
03:08hiredmanI'm not even sure, must have been
03:09hiredmanyes 2.2.4
03:09slyrusok. now I'm trying to figure out how to get contexts to work. neat stuff so far!
03:11slyrusunfortunately joshua choi hasn't gotten around to the fnparse 3 documentation yet :(
03:24lenwhi all - can anyone help a newbie ?
03:26slyrusraek: looks like i'll have to check out your clojure-mode mods
03:33raekjust clone my form and M-x customize-variable clojure-mode-use-backtracking-indent
03:33raek*fork
03:33raekwe should test the backtracking indent more to see if it's stable
03:34raek(it was done by the previous maintainer and no one knows if it really works)
03:34raekI merely added updated rules for the new forms
03:53neotyklenw: Hi, most likely, someone will be able to help
04:02lenwcool - am using the clj-mail stuff - a wrapper around javamail and acessing my mailbox all fine : (def msgs (get-msgs ...)) all fine
04:02BahmanHi all!
04:03lenwno i want to walk through the msgs and am getting confused how to do that
04:07zmila,(= (hash-set :a :b :c) #{:a :c :b})
04:07clojurebottrue
04:08zmilaevaluator at http://getclojure.org:8080/examples/hash-set says "false" here
04:13raeklenw: of what class is the message collection?
04:13raeki.e. (class (get-msgs ...))
04:14lenw(pr msgs) is (#<IMAPMessage com.sun.mail.imap.IMAPMessage@256ef705>)
04:14raekyou can do seq on java collections do get a sequence of their elements
04:14raekis that one message or many?
04:14lenwits a list of one at the moment
04:14raekah, I see the parens
04:15raekyou want to access stuff in the messages?
04:15lenwyes i want to process each message
04:15lenwfor example i have a fn to dump the hearders
04:15lenw(defn dump-header [header]
04:16lenw (println (. header getName))
04:16lenw (println (. header getValue)))
04:16raeklenw: just a tip, try doing 'bean' on one of the messages
04:16lenwwow thats cool !
04:17raekthat will make a map-like object that run getFoo when you lookup key :foo
04:17lenwthanks raek - refactoring now :)
04:18raekso, did you want help with how to do things for each element in a sequence or something else?
04:19lenwyes - so i am using (apply fn list) ?
04:19lenwfor the messages
04:20raek(apply process [1 2 3 4]) will do (process 1 2 3 4), which might not be what you had in mind
04:21raek,(map inc [1 2 3 4])
04:21clojurebot(2 3 4 5)
04:21lenwthats what i am beginning to see
04:21raek,(let [l (list 1 2 3 4)] (for [element l] (str element)))
04:21clojurebot("1" "2" "3" "4")
04:22raek,(for [x [1 2 3 4]] {:inced (inc x), :stred (str x)})
04:22clojurebot({:inced 2, :stred "1"} {:inced 3, :stred "2"} {:inced 4, :stred "3"} {:inced 5, :stred "4"})
04:22lenwaaah
04:22raek,(doseq [x [1 2 3 4]] (println x))
04:22clojurebot1 2 3 4
04:23lenwso apply just puts the list in as the params to a fn
04:23raekyes
04:23lenwfor does the fn to each element in the seq
04:23raekwell, map does that
04:23raekfor is more advanced
04:23raekit can "iterate" over multiple lists
04:24lenwyes as in
04:24raek(for [x (range 4) y (range 4) :when (< x y)] [x y])
04:24raek,(for [x (range 4) y (range 4) :when (< x y)] [x y])
04:24clojurebot([0 1] [0 2] [0 3] [1 2] [1 3] [2 3])
04:24lenw,(for [x [1 2 3 4]] {:inced (inc x), :stred (str x)})
04:24clojurebot({:inced 2, :stred "1"} {:inced 3, :stred "2"} {:inced 4, :stred "3"} {:inced 5, :stred "4"})
04:25raekmaps is more convenient when you have already the function
04:25raekyou could do (map (fn [x] {:inced (inc x), :stred (str x)}) [1 2 3 4])
04:26lenwmaking much more sense now thanks
04:26raekI hope this will get you started :)
04:26lenwyes there is a glimmer of light :)
04:26raekfeel free to ask here if you have any questions
04:26lenwmuch appreciates
04:48Lajla->(let [me "Worship" your "Shadow"])
04:48sexpbot=> nil
08:20pdkcan count be assumed to be o(1) or o(n)
08:22rhickeypdk: no universal answer, O(1) for most things other than sequences. There is also counted? predicate
08:33weissjis there a way to free memory in a swank repl session? It's the highest mem consuming process on my system right now (58mb resident)
08:36pdkweissj (. System gc) perhaps?
08:36weissjpdk, tried that, no effect
08:36pdkhm
08:36weissjdoes swank keep references to all the return values or something?
08:36weissjeven then i'm surprised it's this high. my program isn't using large data structures.
08:37weissjif it *did* keep references to return values, that'd be a nice feature which I have not seen documented :)
08:39raekthe clojure repl keeps the last three return values
08:39weissjraek: how do you access them?
08:39raekthey're bound the the vars *1, *2 and *3
08:39weissjah thanks
08:40raekso if you eval three things, they should be flushed out, I think
08:40weissjyeah that doesn't free any mem to the OS
09:02lenwusing compojure how do i specify the params on the route - trying (POST "/url" [p1] (...)) fails with p1 unresolvable in thie context ?
09:03bobo_lenw: you mean this? (GET "/primes/:num/:color" [num color] (print-primes num color)))
09:04bobo_or ah post!
09:04dnolen_lenw: http://weavejester.github.com/compojure/docs/routes-in-detail.html
09:04bobo_ (ANY "/do" {params :params} (do-login :session params))
09:04lenwbobo_: thanks let me try that
09:05dnolen_lenw: personally I prefer http://github.com/cgrand/moustache for routing. A bit more idiomatic - designed around the idea of destructuring.
09:05pdkcan defmultis have multiple arities like defns
09:06stuartsierrapdk: yes, just make your dispatch function variadic
09:06lenwdnolen_: thanks
09:06pdkhmm
09:06cypher23back
09:06pdkoh yeah you don't write the arglist in the defmulti i guess
09:08tcrayfordyou don't
09:08pdkthat was a smooth move
09:09tcrayfordstuartsierra: how's lazytest going these days?
09:09stuartsierratcrayford: slowly but surely
09:10stuartsierrahoping to do some more work today
09:10tcrayfordare you happy with it yet?
09:10stuartsierrano
09:10tcrayford:/
09:10stuartsierrastill trying to define the separation between code and assertions
09:10tcrayfordright
09:10stuartsierratrying to enforce things like "one assertion per test" is hard
09:11tcrayfordunfortunately :(
09:11stuartsierraand there has to be a workaround for when you really need multiple assertions in a test
09:11tcrayfordsomething like do?
09:11tcrayford:/
09:12stuartsierratcrayford: yes, actually
09:12stuartsierraand I considered just using "do"
09:13stuartsierrabut with "do" then I can't parse the assertion expression
09:13tcrayfordright
09:13tcrayfordlanguage for that concept seems kinda tricky as well
09:13stuartsierrayes
09:14stuartsierraI'm intrigued by the given/when/then syntax of Spock, but having trouble adapting it without assignment
09:15tcrayfordyep, looks tough
09:15tcrayfordwhat did you think of brian marick's clojure testing stuff?
09:15stuartsierraLast night, came up with http://paste.lisp.org/+2F6J as a possible syntax
09:17tcrayfordgiven would assign stuff to the scope of all the its and the whens?
09:17stuartsierratcrayford: yes
09:18stuartsierratcrayford: re Marick, I see his point, but remain skeptical
09:18stuartsierraI don't like using functions under test in the tests.
09:18stuartsierraBut then again, I find myself doing this.
09:18tcrayfordheh, aye
09:21lenwbobo_: using that (ANY "/do" {params :params} (do-login :session params)) i get "Unable to resolve params" ?
09:22fogusstuartsierra: Looks like you and Bradford are united against macros
09:23stuartsierraIn the comic-book world of Clojure, macros are the femme fatale.
09:23bobo_lenw: hm, weird? maybe you need to use wrap! on the session. im not sure. dont have al the code at work :/
09:24fogusYes, they are quite alluring
09:24stuartsierraOccasionally helpful, but never trustworthy.
09:24fogustrustworthy?
09:25lenwbobo_: is there a link to something i could read on this ?
09:26stuartsierraI'm not saying you can't use macros, just that newcomers to Lisp tend to use macros where they shouldn't.
09:26fogus"approachable syntax" is highly subjective. But I would say yes. I would use Clojure simply for the state model
09:28bobo_lenw: http://weavejester.github.com/compojure/docs/routes-in-detail.html i dont know to much except for that page. There are some examples in the tests aswell i think
09:28lenwbobo_: thanks
09:30chouserI was thinking last night that in C and even C++ foo(){} is clearly a "special form" while bar() is almost always a plain function call.
09:32fogusstuartsierra: In many ways I think it's much more difficult to create an API using functional composition than macros.
09:32chouserruby, scala, etc. violate that, but I wonder if the lack of such a visual hint in clojure is part of why people find reading it difficult at first.
09:32stuartsierrafogus: yes
09:32stuartsierrabut much better for users of that API
09:33fogusAgreed
09:33chouserstuartsierra: do you have an example of an API that is macro that should be?
09:33stuartsierrachouser: sure, all the macros in clojure.core
09:33chouserheh
09:33stuartsierraexcept "import"
09:34chouserwell, import should clearly be a function.
09:34fogusUsually the macro approach involves abstracting things away from the user while composition requires that you *really* think hard about how the pieces interplay. It's tough
09:34stuartsierraIdeally, a macro should add syntactic capabilities without taking any away. It's the second condition that most macros fail.
09:35rhickeystuartsierra: import is a macro due to the limitations of Class.forName - you simply can't call that on someone's behalf
09:35stuartsierrabut it was a function in 1.0
09:35rhickeystuartsierra: and didn't work well with modularity
09:35stuartsierraoh
09:36rhickeysince all classnames were resolved by the classloader that loaded Clojure
09:36stuartsierraright
09:36stuartsierrahmm, so dynamically creating namespaces with function calls is out, then?
09:36stuartsierraat least as far as importing Java classes is concerned?
09:38rhickeystuartsierra: insofar as a ns is just a map of vars, no problem. But you aren't really compiling code relative to a dynamic import anyway are you?
09:38stuartsierraI was when I was playing around with RDF stuff.
09:39stuarthallowayplease test the RC1 download links: http://clojure.org/downloads
09:39rhickeywell you can always write a fn that calls a macro
09:39stuartsierrayes
09:42stuartsierrastuarthalloway: testing...
09:48fogusstuarthalloway: I think it would be nice to add a default clause to the example (or a comment afterwards) for `case` in changes.txt
09:49stuartsierrastuarthalloway: downloads look fine, not available on build.clojure.org/releases though
09:49stuarthallowayfogus: makes sense, patch away
09:49stuarthallowaystuartsierra: working on it
09:49stuartsierraI figured
09:49stuarthallowaywouldn't it be cool if it were automated?
09:49stuartsierrayes
09:49stuartsierrait could be
09:50fogusstuarthalloway: k
09:52stuarthallowaystuartsierra: I have two problems, both mvn+linux related
09:52stuarthalloway(1) how do I tell mvn deploy to use a different username for copying
09:52stuarthalloway(2) how to I set the right chowner on the box
09:53stuarthallowayright now I am "stuart" locally, have "root" access to build.clojure.org, and need the files, once copied, to be owned by "hudson"
09:53stuartsierrastuarthalloway: what if you tell mvn to deploy via SCP and let it log in as "hudson"?
09:54stuarthallowayI can't log in as hudson
09:54stuartsierrahm, that's something we can't change?
09:55stuarthallowayno, that's just what I am trying to do atm
09:55stuartsierraWhat if root@build.clojure.org SCPs to hudson@build.clojure.org
09:56stuarthallowaywhat's the command line to tell maven to do that?
09:56stuarthallowayI find maven to be google-opaque. ask a question, and the first hits are never the answer
09:57stuartsierraIt'd be configured in the <distributionManagement> section of the POM
09:57stuartsierraAnd the local settings.xml
09:59stuarthallowaywhere settings.xml is a magic file that lives in .m2?
09:59stuartsierra~/.m2 yes
09:59clojurebotIt's greek to me.
09:59stuartsierrahello, clojurebot, long time no see
10:00stuartsierrastuarthalloway: you set the host and path as the deploy URL in the POM, and configure your login user and password in ~/.m2/settings.xml
10:00stuarthallowaywe don't allow passwords
10:01stuartsierrait takes keys too
10:01stuarthallowaybut it can't discover them from the environment
10:01stuartsierrano, you must specify an absolute
10:01stuartsierrapath
10:01stuarthallowaymaven is a value subtraction layer over unix tools
10:01stuartsierrayes
10:01stuartsierraThe same could be said of Java.
10:03stuarthallowayis there a way to test the deploy task without being forced to run the build and tests again?
10:03stuartsierraprobably, but I don't know
10:04stuarthallowaysuccess
10:04stuartsierraw00t!
10:05stuartsierrayep I can see it in http://build.clojure.org/releases/org/clojure/clojure-contrib/1.2.0-RC1/
10:05stuarthallowaynow, back to clojure itself
10:06stuartsierraAnt land, where even Mavens fear to tread.
10:18stuarthallowayis there a way to tell maven to copy a project from a local repos to a remote repos?
10:19stuartsierraI don't think so
10:19stuartsierraMaven central just uses rsync
10:19stuarthallowaythe local copy doesn't have all the pieces, e.g. no hash
10:20liebkethere is a plugin for installing on remote repos, I used to use it for Incanter
10:20stuarthallowayotherwise I would just rsync
10:20stuartsierrastuarthalloway: I thought you figured that out with the addMeta option or something.
10:21stuarthallowayliebke: I am trying to use this : http://maven.apache.org/ant-tasks/examples/install-deploy.html
10:21liebkeI'm looking through my old pom file
10:21stuartsierrastuarthalloway: again, can you deploy via SCP?
10:22stuarthallowayyes
10:22defnstuarthalloway: have you ever finished infinite jest by DFW?
10:22defn(sorry so OT)
10:22stuarthallowaydefn: ha, not started
10:22defnone of your tweets awhile back got me interested and i just started it
10:22defnit's /hard/
10:22stuarthallowaybut that kind of talk will likely summon rhickey
10:22defnoh is rhickey partial to DFW?
10:23rhickeyInfinite Jest is one of my all-time favorite books
10:23stuartsierraspeaking of books, rhickey, I finally mailed you a copy of mine/Luke's
10:23rhickeystuartsierra: thanks!
10:23stuartsierrarhickey: you're welcome
10:23stuarthallowaystuartsierra: our box arrived. We were hoping for bagels :-)
10:24defnrhickey: interesting. what instrument (if any) did you study in college, out of curiosity?
10:24stuartsierrabagels are too damn expensive to ship
10:24stuartsierrabut maybe next time I'll bring coffee
10:24defni was surprised to hear you were a trained musician
10:25liebkestuarthalloway: I was using Maven Wagon: http://maven.apache.org/wagon/ which let me deploy with ftp
10:25defnbut with the penchant for DFW in the mix, things are starting to come together :)
10:25rhickeydefn: I was a composition major, play guitar
10:25defnrhickey: cool, any chance you're going to strange loop?
10:25defn(anyone in here for that matter)
10:25rhickeydefn: unfortunately not, too much travel
10:25defni know chouser is counting on it
10:26defnrhickey: yeah -- this is going to be my only conf. of the summer -- id like to attend the pragprog session but too rich for my blood ATM, although i hear great things and want to sell some stuff to attend :)
10:26stuarthallowayliebke: that part seems to be working -- I am just trying to get right settings
10:26defni am having trouble parting with guitar gear :\
10:29defnrhickey: anyway, any tips on reading Infinite Jest? I've heard I should read hamlet and use the notes pretty seriously
10:29defnthe notes in the back of IJ, that is...
10:29liebkestuarthalloway: okay, you can see how I configured the distributionManagement section in my old parent-pom file here: http://github.com/liebke/incanter/blob/1.0/modules/incanter-parent/pom.xml
10:30stuartsierraliebke: I think the problem is he's in maven-ant-tasks land now
10:30liebkeah
10:30stuartsierrakind of the worst of both worlds
10:30rhickeydefn: first tip - use 2 bookmarks, one for body, one for footnotes. Do not in any circumstances skip the footnotes. Also, have a dictionary handy
10:31defnrhickey: should I be reading footnotes before the page, or in the middle of the page, or after? by your estimation?
10:32defnas in: should i read them as they appear, or would it help to cache them up front?
10:34defnmaybe a silly question but im trying to get it "right" -- the first two chapters have me a bit puzzled so far
10:36defndon't get me wrong I am in love with dope-smoking phone-it-in-and-hide-your-car 2 blocks from your condo, draw the blinds, etc. guy
10:37defnjust wondering how long I need to put up with insects on the shelf before I get the picture :)
10:37stuarthallowayok, I am to the point where I need to add wagon, but in ant not maven
10:37stuarthallowaylooking at http://maven.apache.org/ant-tasks/examples/install-deploy.html
10:38stuartsierraok
10:38stuarthallowayit seems I should be able to use the install-provider task in clojure's build.xml, using our namespace prefix "mvn" instead of "artifact"
10:38stuarthallowaythe other "mvn" tasks work, but it tells me that the install-provider task doesn't exist
10:39fogusstuarthalloway: https://www.assembla.com/spaces/clojure/tickets/417-add-more-information-to-changes-txt-for-case-and-vector-of
10:39rhickeydefn: as they appear
10:40defnty
10:40defn'gonna tackle the beast after I wake up this afternoon... thanks for the tip -- much appreciated.
10:41defnfogus: you've read it too?
10:41fogusdefn: Yes
10:41fogusboth
10:41defnive never touched house of leaves
10:42stuarthallowaysuccess!
10:43stuartsierraw00t! w00t!
10:43defnfogus: it would seem im in good company :)
10:43stuartsierraGreen Lantern wins again!
10:43defnstuarthalloway: stuartsierra: You guys need new nicks. My nick completion keeps lending preferential treatment to halloway :)
10:43fogusyou guys and your comics book nicknames. Someone should flog the guy who started that.
10:44stuartsierrablame Sonian
10:44fogusdefn: HOL is a must.
10:44defnfogus: ive tacked it onto my summer reading list
10:44defndepending on how long it takes me to finish Infinite Jest
10:45defnive been really enjoying DFW's "Consider the Lobster'
10:45liebkestuartsierra: fogus is actually to blame for that meme
10:45defnso IJ is the logical next step :)
10:46fogusliebke: Oddly enough it started as a footnote!
10:46defn:)
10:46liebkefogus: of course :)
10:47fogusManning yelled at us for all of the footnotes. :-(
10:47defnha!
10:48liebkefogus: Is that why they put a pick-pocket on your cover?
10:48mattreplit is a strange cover
10:49defndamn theheh
10:49defns/damn theheh/heh
10:50fogusIt was our attempt to grab a share of the cool programming book nicknames... you know, the Red Dragon Book, the Aluminum Book , the Camel Book, etc.
10:50liebke:)
10:51fogusOurs is the Jack the Ripper book. :-o
10:51defnhaha
10:51mattreplhah
10:51mattreplThe Aristocrat Book?
10:51defnI'd go with "The Haberdasher book"
10:52defnfor the discerning haberdasher
10:52mattreplyes, this ^
10:53defnkind of a pocket watch wielding cheap suit coat maker
10:53fogusThe Artful Dodger Book
10:53defnhaha
10:54fogusThe Otis Campbell Book
10:57defnThe Saint Louis IX Book
10:57defnSaint Louis IX, the King of France 1226–70, is the patron saint of haberdashers.[4][5]
10:58stuartsierraThe Flash is Back!
10:59stuartsierraWith caffeine, and not just in my Java.
10:59abedranice
10:59stuartsierraabedra; what are you doing here? you're supposed to be on vacation.
10:59abedrai'm at the airport
11:00abedrawaiting for my flight to KY
11:00abedraso I thought i'd get some clojure in
11:00stuartsierrawhat a trooper
11:00abedra:)
11:00defnyou just can't put it down, can you?
11:00defn"just one more time, Emacs..."
11:00abedraof course not
11:01abedrastuartsierra: running the new build through argos right now
11:02stuarthallowayClojure 1.2 RC1: http://bit.ly/aFSaq8
11:02stuarthallowayregardless of what abedra finds... :-)
11:02abedra:)
11:04defnHey stuarthalloway -- if I'm ever in Raleigh can I stop by and get a tour of ThinkRelevance? :)
11:04stuarthallowaydefn: sure
11:04defnI was just down there and wanted to stop in but had limited time
11:05defnwas down in Hillsburough
11:05defnon that note, I am going to make a note of your hospitality and go lay down
11:05defncheers also, keep the clojure coming
11:05defnciao
11:07stuarthallowayget your app on Clojure 1.2 today: http://bit.ly/bZBQPC
11:08defnGreat news. Thanks Stu and Co.
11:08defnnight
11:10Raynesstuarthalloway: Is the RC on build.clojure.org?
11:10abedraRaynes: yes it is
11:10RaynesPretty much all of my projects are already on the beta. Putting them on the rc, considering it's up, is as simple as changing a few project.cljs
11:11abedrahttp://build.clojure.org/releases/org/clojure/clojure/1.2.0-RC1/
11:11RaynesAwesome.
11:13fogusSpread the word: http://news.ycombinator.com/item?id=1561327
11:21lpetitHello, I'm migrating to 1.2.0-RC1. It seems that now all my calls to swap! on my atoms need to be wrapped in (dosyncs). Is this an expected API change ?
11:21stuartsierraNo!
11:21chouserwhoa
11:22lpetit(sorry, I was just kidding, sort of preparing you guys to the bunch of questions for today)
11:22chouserha!
11:22lpetit;)
11:23djpowellI think the newlines on Windows issue should be fixed in this release. It is a known and annoying bug; I haven't seen any evidence that fixing the bug will cause issues for anyone - we've heard from several IDE authors who have no problems with fixing it. All readLine style APIs normalise both CR and CRLF anyway.
11:23redingerI think stuartsierra might have just had a Flash heart attack
11:23lpetitwoops
11:23abedraHave a great migration to 1.2 day everybody!
11:23stuartsierramy heart system load went to 11.0
11:26lpetitdjpowell, stuarthalloway: could the *newline* global var be introduced and used in 1.2, while retaining a default value of \newline for 1.2 (and adding a more OS-flavored default value for next release) ? So that djpowell & al could already rebind it, but *nobody* would be affected ?
11:27stuartsierralpetit: Java already has a global newline properyt
11:28stuarthallowaylpetit: won't djpowell (and everyone else who hangs out here) jump on master again as soon as the num/prim/equiv comes over anyway?
11:29lpetittouché
11:29stuarthallowayand, I don't like the idea of adding bindable vars unless the use case is compelling. maybe this one is, but ...
11:30lpetitstuarthalloway: you're wise. Beware the hurry towards missing functionality, when close to a release
11:32lpetitYou know you've done too much clojure when you create a FunctionChouser class instead of a FunctionChooser class ;)
11:34tcrayfordlpetit: How's the thinking about refactoring in eclipse going?
11:35lpetittcrayford: almost same state as in our last message on github:/
11:36tcrayfordlpetit: fair enough. I've pushed some changes to the one on github. If parsely is finalised I'll start work on making refactoring mode work with it as well.
11:36lpetittcrayford: maybe you could help me motivate cgrand on parsley :)
11:37tcrayfordit really depends on what else needs doing with it
11:37chouserlpetit: heh. I had that problem long before picking up Clojure.
11:38lpetittcrayford: parsley works in "single-pass" parsing mode fairly well in my private branch of paredit. I also was able to implement an interesting "degraded mode":
11:38lpetitchouser: hey ! :)
11:39tcrayfordlpetit: if you shoot me a github mail about what else needs to be done I'll see what I can do. No promises though
11:40stuarthallowayrhickey: have you read the mailing list on defrecord and map equality? Would love your opinion.
11:40lpetittcrayford: there's an additional :chimera tag which matches all kinds of improbable syntax, thus letting the parser do its just until the end of the stream. Example: "(foo" will become the parsetree {:tag chimera :content ["(" {:tag :symbol :content ["foo"]} ""]}
11:41rhickeystuarthalloway: people need to decide if they want type as part of equality or not. *not* would be in keeping with categoric equality now in place
11:41stuarthallowaypeople are interesting and all, but what does rhickey want?
11:42djpowellre a bindable variable for newline, I agree we could possibly do without that and just hardcode to line.separator
11:42stuarthallowaydjpowell: that's my (tentative) plan for release.next
11:42stuarthalloway\
11:43lpetittcrayford: I'm afraid we should let Christophe work on the missing features. There's not much left, but each of them may be hard to come up with: a/ have the possibility to declare a "garbage non-matching char" tag ; b/ incremental ( O (log2(n) ) reparsing ; c/ "projections" support (ex.: a projection could be as simple as reporting the size of the source code, or the fact that there are :chimeras in the parse ...)
11:43chouserdoes the name "release.next" allow for the possibility of it being 3.0?
11:43stuarthallowayrhickey: I want categoric equality. If the thread is correct, the current implementation gives neither, as it is not symmetric
11:44stuarthallowaychouser: that's a dark horse for sure, how about 1.3 or 2.0? :-)
11:44clojurebotWho??
11:44chouserheh. oh, right. 2.0 :-)
11:44rhickeyI think including it is probably more useful, but has the symmetry problem. We could fix that in Clojure, but not vs Java without making records non-j.u.Maps
11:45stuarthallowayrhickey: good candidate for summarizing the issues on dev.clojure.org and letting people think on it?
11:45djpowellleaving it as is for the release just encourages people to do hacky work arounds to get (println "hello")(println "world") to work properly
11:45stuartsierrasooner or later we're going to end up with multiple ='s just like Common Lisp
11:45stuartsierraand the endless questions that leads to
11:45djpowellworkarounds, that will probably break when we fix it
11:46chouser:-(
11:46rhickeydjpowell: there is simply not enough time now to shake out changing that. Will be in next release
11:46stuartsierravalue=, type=, num=, ...
11:46slyrusstuartsierra: just make = return an integer for the level of =-ness :)
11:47chouserstuartsierra: well, that looks tons better than eq? equal? eql? = and == at least
11:47rhickeystuarthalloway: dunno, it's a bad place for self-centric decisions, and the bikeshedding is exhausting
11:47stuartsierraOr introduce "like" as in http://www.staringispolite.com/likepython/
11:51lpetitso a) what are the use cases for having strict equality (including type), and b) what are the use cases for having "fields" equality ?
11:52stuartsierraa) (= (EvilDude. "Stuart" "Sierra") (NiceDude. "Stuart" "Sierra"))
11:53stuarthalloway(b) code that still works when you start to enrich maps with type information
11:53lpetitIf I have a hashmap h1, which is '=' to a record r1, by having this "positive =" returned, could I be "fooled" by thinking that calling some protocol interface on both should work ?
11:53stuarthallowaywhich may also be an argument for (a) :-)
11:54rhickeyrecords are not collections is the first hint
11:55lpetitmap-as-object ...
11:55rhickeyadding a type to a map is as if you added another key
11:56chouserdissocing certain keys from a record will give you a collection
11:56rhickeywhich is what people are sometimes doing sans records
11:56rhickeychouser: ?
11:57rhickeyI don't see how that matters
11:58lpetitstuartsierra: EvilDude and NiceDude may indeed not behave the same way, mmm
11:58chouserif a particular piece of code doesn't already know which specific type of map its dealing with, that type can change. Such code probably needs an equality test that honors that.
11:59rhickeychouser: I'm still confused
11:59rhickeymap equality tests are pretty rare, aren't they?
12:00chousernow I'm confused. I thought map equality tests were at the center of this conversation.
12:00rhickeylpetit: yes, the different behavior is also a problem. If they test =, one could presume using either wouldn't matter
12:00djpowellhmm - i think I put maps as keys in a map
12:01rhickeychouser: I simply don't understand your point
12:01stuartsierra_Re lazytest, here's the latest: http://stuartsierra.com/2010/07/30/lazytest-churn
12:01rhickeychouser: "if a particular piece of code doesn't already know which specific type of map its dealing with, that type can change. Such code probably needs an equality test that honors that."
12:02rhickeyexample please
12:03stuartsierra_I think chouser means having the option to replace a map with a defrecord without breaking anything
12:04rhickeydjpowell: that's fine, but would you expect looking up {:a 1} to be the same as looking up (AnyRecordWithFieldA. 1) ?
12:04chouserare we only talking about maps as map keys?
12:04rhickeystuartsierra_: that promise should only extend as far as it makes sense. You are adding some information when adding the type
12:04rhickeychouser: no
12:05djpowellrhickey: not really in my case, cause i'd know i'd added to the map
12:05stuartsierra_rhickey: I agree
12:05chouserSo here's a made-up example of such a "piece of code": (defn duplicate-row? [a b] (= (dissoc a :id) (dissoc b :id)))
12:05rhickeyson, one thing that will have to change is that {:a 1} is not longer a constructor for your thing, if you want it to be a record
12:06rhickeyso,
12:06djpowellrhickey: in fact (pre defrecord), I have two types of objects with different fields, so records not being equivalent would be fine
12:06stuarthallowaythe truth revealed! chouser is rhickey's (until recently unclaimed) son! :-)
12:06chouser8-O
12:07lpetitLet's call him Luke !
12:08rhickeye.g. ((fn [my-map-to-become-record] ...) {a 1}) will have to change, e.g. you'll need a factory fn, and that applies everywhere, including when you construct lookup keys etc
12:08lpetitchouser: but but in your example, having called dissoc on both sides almost guarantees that you're comparing two real maps, no ?
12:09chouserrhickey: hm, that doesn't bother me at all. I don't think I would have considered doing it that way, if I understand your example.
12:10chouserlpetit: all it takes is for either a or b to be a record without :id as a key, or particular sort of type that behaves similarly, and the "guarantee" is broken.
12:11chouserbesides being a breaking change, right?
12:11rhickeychouser: the point is, in the few cases where you are explicitly creating maps for use in equality tests, it is constructor-like, and all such constructors must change when switching from maps to records
12:12chouserah, good point.
12:12the-kennyIs there a version of technomancy's clojure-http-client on clojars somewhere which is compatible with 1.2-RC1?
12:13lpetitchouser: I don't understand
12:13lpetitchouser: I mean, you're talking about cases that may already happen today
12:14rhickeystructural equality obliterates the type, and if it was the default, people would need an equality that included the type. OTOH, if type-inclusive equality is the default, I doubt we'll see any clamoring for this duck-type equality from people using records
12:14lpetitchouser: thrown Exceptions, that is
12:16rhickeyNow, records not being j.u.Maps (in order to fix equality symmetry) is another question
12:17chouserlpetit: (defrecord A [id foo]) (defrecord B [foo]) (duplicate-row? (A. 1 "two") (assoc (B. "two") :id 3)) ;=> true
12:17chouserlpetit: which seems "expected" to me.
12:17lpetitrhickey: Ok, so tomorrow you have advanced in cinc, and you have this nice protocols for the "Map" behavior. You have re-created different flavors of "Map" for different sizes : a RArrayMap type, extending protocol "Map", a RHashMap type, extending protocol "Map". If you include the type in =, what a breaking change : (= {:a 1} (hash-map :a 1)) would return false ?
12:18rhickeylpetit: such things will not be records
12:19lpetitrhickey: do you really want records to be such an exception ?
12:19rhickeyit's not an exception
12:20lpetitrhickey: oh, yes, you're redefining equals() and hashcode() for records, sorry
12:20rhickeylpetit: right, and all records will share the same semantics
12:21rhickeyObviously, some lines of code will have to change when moving from a map to a record, in particular all construction
12:22lpetitObviously. In the "library provider side", that's not a problem. Could it be a problem in the "library user side" ?
12:23lpetitI guess not, at least if the user of the library does not violate encapsulation beyond what is promised by the library provider
12:23rhickeyI simply don't understand why anyone would want 2 records of different types that happened to have the same field to ever be equal
12:23lpetitrhickey: chouser ^^^
12:23lpetit06:17:03
12:25qbgI think type based equality for records would be the right thing for at least a majority of cases
12:25chouserso records would never be = to any PersistentMap?
12:25rhickey(defrecord Bill [:charge]) (defrecord Particle [:charge])
12:25rhickeychouser: right
12:26rhickeychouser: imagine they had a :type key
12:26rhickeythe reasons they don't are: people don't want to see them, and, they can't be used for fast dispatch anyway
12:27chouserok, at least it's a simple rule.
12:27rhickeybut defrecord could insert a :type key and then normal semantics would apply everywhere
12:27lpetitI don't care if records can not be equal to persistentmaps. I much care there was an easy way to "dynamically" get a record with the same fields from a map
12:28rhickeylpetit: that's coming
12:29rhickeywould people mind if records had a :rec/type inserted?
12:30chouserthat couldn't be changed?
12:30rhickeychouser: that's where the dragons are
12:30chouseryeah
12:30chousergotta run
12:31rhickeyalso, {:my "fabricated" :rec/type :Foo} is not in fact of type Foo
12:31lpetitno, because then it would make it consistent with the fact that the equality would be based on record as data holder, and not on the real "technical" type. This opens the door to having specialized versions of records a-la arraymap versus hash-map, I guess
12:32lpetitargh
12:36rhickeyso, we've spent a lot of time on duck-equality. If it is type-inclusive equality, it begs the questions re: the asymmetry
12:37rhickeyI can fix the (= amap arecord) for Clojure maps, but not Java maps without dropping j.u.Map support
12:39lpetitYou mean you can fix clojure.core/=, but not java.util.Map.equals()
12:40rhickeylpetit: no, (= clojure-map record), but not (= java-map record)
12:40rhickeyI'm not putting more conditionals in =
12:40lpetitok
12:41qbgPerhaps (= record java-map) should be true?
12:42lpetitqbg: (=) should work regardless the args position
12:42rhickeyqbg: but Clojure maps are Java maps
12:42qbgI think equals is not what we actually want ;)
12:44lpetitwhat happens if we drop j.u.Map for clojure records
12:44edbondwhere can I find doc about how to specify version in leiningen project.clj? I saw "[0.2.5,)", is there more tricks?
12:44rhickeylpetit: right, that's the question
12:45lpetitin the clojure world, no problem
12:45lpetitfrom java world to clojure world: no different than from clojure maps to clojure records
12:45rhickeyIMO, most people passing maps to Java as j.u.Maps are treating them as collections. I haven't seen many j.u.Maps-as-objects interfaces in Java libs, even where I've wanted them (e.g. Drools)
12:46lpetitfrom clojure world to java world: will need to drop something. But records are not maps!
12:47rhickeylpetit: but they are associative and Java doesn't have a separate interface for that
12:47qbgIf we drop j.u.Map support, then from the Java side records would be little better than the de facto OO style of many incompatible classes to hold data
12:48rhickeyqbg: true, but who is doing Clojure-style objects in Java?
12:48rhickeyClojure programmers using Java explicitly
12:49rhickeycould use Clojure interfaces instead, but lose reach over Java maps
12:49qbgMake those interfaces protocols and extend support to maps :)
12:49rhickeyqbg: no protocols in Java
12:50qbg(Just semi-joking)
12:50qbgIt would be nice though
12:53lpetitrhickey: could you rephrase ^^^(06:48:48 PM)
12:55rhickeylpetit: who uses clojure-stype maps-as-objects in Java? Clojure programmers using Java explicitly. They could instead use the Clojure map interfaces, but lose the ability to have the same code work with j.u.Maps
12:56slyrushuh? "No project.clj found in this directory"
12:57slyrussure there is!
12:59lpetitrhickey: if we're talking about clojure-stype in java source code, is it a big problem ?
12:59qbgThey could write a associative wrapper around j.u.Map
13:01lpetitgqb: would that work well with graphs of record instances ...
13:01rhickeylpetit: dunno. I sure wish there were more maps-as-objects APIs in Java. Were that to come about, records couldn't play
13:01rhickeyqbg: wrappers = evil
13:02qbgWorking in Java = need to accept some evil, maybe
13:04stuarthallowayrecords need to be java maps
13:05djpowellis having records have a synthetic 'type' field on the cards?
13:06qbgA type key might be the best solution
13:07rhickeystuarthalloway: implies an asymmetry in equality without injected :type field
13:07stuarthallowayrhickey: java side only?
13:07rhickeyno, any Java map on LHS
13:08djpowelli guess you could try to suppress the type field from clojure places - eg (keys) and print it?
13:08stuarthallowaydjpowell: just where I was going, but I think it leads to madness
13:08djpowellasymmetric equals is obviously very bad
13:09stuarthallowayrhickey: why can't we fix that asymmetry on the clojure side?
13:09slyrusah, fnparse3 needs a project.clj :(
13:09djpowellstuarthalloway: by reimplementing java.util.HashMap?
13:09stuarthallowayno, by doing something before calling .equals
13:09rhickeystuarthalloway: for = only? Because it adds more conditional testing to = which I don't want for perf reasons
13:10stuarthallowayrhickey: right, ok
13:11rhickeyone hack would be to have record's entrySet contain the extra key, but breaks any code that uses entrySet, not just .equals
13:11slyrustechnomancy: in leiningen.core/read-project, it would be nice if it printed the name of the file it can't find. In this case it was a borked dependency in checkouts and it wasn't immediately obvious what was broken (until looking at that exception that we basically ignore ATM).
13:12djpowellrhickey: having entryset bigger than keyset sounds fragile
13:12rhickeyunfortunately there's no guarantee that .equals will call hashCode, that's the easiest
13:12rhickeydjpowell: no argument, clearly a hack
13:14djpowellperhaps just have the type field there, and suppress it from print by giving defrecords a nicer readable form
13:14rhickeydjpowell: will impact count/keys etc
13:15djpowellurgh, it is sounding a bit like javascripts' map/object muddle
13:15rhickeyThere really should be marcker interfaces for the collection equality categories
13:15rhickeymarker
13:17technomancydaaku: I have plans to create a "lein interactive" mode that would sidestep JVM boot time. (scala's sbt has this, and people seem to like it.) problem is I use swank myself, so startup time never bothers me. maybe I could find someone else more motivated to implement it; hint hint =)
13:17technomancyslyrus: yes, definitely. can you open a ticket for that?
13:17stuartsierratechnomancy: I headed in that direction with classpath-manager
13:19daakutechnomancy: cool -- i'm still very much a n00b, but that sounds like opening up a repl at some point, i'll see what i can figure out over the weekend
13:19technomancystuartsierra: there's definitely a demand for it, just happens that I'm not one of the people affected by it.
13:19technomancydaaku: be sure to mention it on the leiningen mailing list if you start experimenting with it.
13:20slyrustechnomancy: issue 85
13:20daakutechnomancy: ok, will do
13:34rhickeyhmmm, I wonder if I could fix = without any additional branches at the top level. There is already one for IPersistentCollections
13:53PuzzlerJust catching up on the defrecord/type equality thread. I remember when I first discovered '(1 2 3) and [1 2 3] were equal in Clojure, I thought, "Wow, that's really weird." But I must admit, in practice it's turned out to be *very* useful to not have to worry whether I'm using vectors or lists to represent my collections.
13:54PuzzlerSince there are several functions that work on vectors but not lists, it seems like it's really the same issue.
13:54PuzzlerDoes equality mean, "These things are interchangeable", or does it mean, "I want these things to be treated as equal for filtering, hashing, etc."
13:56DanielGlauserI'm not sure if this was posted earlier but it seems like we could use type equality, attribute equality, and occasionally absolute equality. What about having different semantics for each?
13:56PuzzlerThe math part of me expects equality to mean "interchangeable", but I've been pleasantly surprised how useful Clojure's concept of equality has been.
14:38chouserlogging was off there for a bit (power outage)
14:41PuzzlerRegarding the upgrade to 1.2, right now I have some usage of contrib's io and shell-out libraries. Is there a summary somewhere of which functions changed (any functions where the args now differ, etc.)?
14:42PuzzlerOh, and duck-streams as well.
15:08technomancyDrakeson: it's hard for me to juggle all these projects; how about I just add you to the committers list?
15:09Drakesontechnomancy: sure, (read your self interview :p a while back). I won't be able to help much though.
15:10technomancynp
15:10technomancywhat's your github name?
15:10Drakesongilaras
15:11DrakesonI even made a pull request for that type fix!
15:23technomancyDrakeson: adddded
15:24Drakesontechnomancy: thanks
15:36Drakesontechnomancy: pushed. is it built automatically (to clojars)?
15:37stuarthallowayPuzzler: you still around?
15:57wolfjb(defn plus-one (:doc "returns an incremented number) [x] (inc x)) gives an error: IllegalArgumentException: Don't know how to create ISeq from : clojure.lang.Keyword (NO_SOURCE_FILE:46)
15:58wolfjbbut remove the (:doc ) and leave the string and it works fine
15:58stuartsierrawrong syntax
15:58wolfjbah
15:58wolfjbdoes (:doc ...) not work then?
15:58stuartsierra(:doc "string") means get the key named :doc out of the object "string"
15:59stuartsierramaybe you mean (defn plus-one {:doc "..."} [x] (inc x))
15:59wolfjbdoh!
15:59wolfjbI misread my tutorial, it is the {:doc ...}
15:59wolfjboops
15:59wolfjbhate it when I do that
16:02wolfjbon a related note, why does it have to come before the parameter list if it is using a keyword? It seems (defn foo [parms] {:doc "doc"} (expressions...)) would be more readable? I used to document my lisp functions that way so I guess it's what your used to
16:02stuartsierradoesn't fit if the function has multiple arities (numbers of arguments)
16:03wolfjbic
16:03wolfjbis that common?
16:04wolfjbie, common to have multiple arities?
16:04qbgSomewhat
16:04wolfjbfascinating
16:04wolfjbthis is fun
16:07lpetitwolfjb: yes it's common. And now, the place you're describing is for placing pre/post conditions
16:07lpetit,(doc defn)
16:07clojurebot"([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the var metadata"
16:08lpetit,(doc fn)
16:08clojurebot"([& 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"
16:08lpetitargh
16:08lpetit,(clojure-version)
16:08clojurebot"1.2.0-master-SNAPSHOT"
16:11lpetitthere's no mention of pre/post conditions in fn's doc ?
16:11stuartsierrano
16:11qbgIt is online though
16:12lpetityes, on the special_forms page, not easily found
16:13lpetit,((fn [x] {:pre [(pos? x)]} (* x x)) 5)
16:13clojurebot25
16:13lpetit,((fn [x] {:pre [(pos? x)]} (* x x)) -5)
16:13clojurebotjava.lang.AssertionError: Assert failed: (pos? x)
16:13lpetit,(binding [*assert* false] ((fn [x] {:pre [(pos? x)]} (* x x)) -5))
16:13clojurebotjava.lang.AssertionError: Assert failed: (pos? x)
16:14lpetitoops, *assert* a compile-time flag
16:14lpetit(eval '(+ 1 2))
16:14lpetit,(eval '(+ 1 2))
16:14clojurebotDENIED
16:14lpetitwolfjb: ^^^ pre/post examples
16:33technomancyDrakeson: no, I will push
16:55slyrushrm.... error: java.lang.OutOfMemoryError: PermGen space (smiles2.clj:2)
16:56slyrushappens during compile. sure, it's using some memory, but not _that_ much...
16:57flognikr /msg nickserv set hidemail on
17:03arohnerslyrus: is that on a long running repl, or on a clean startup?
17:06arohneris there a mocking library anywhere that mocks across all threads, rather than using binding?
17:07arohnerI remember chouser talking about something similar a while ago
17:12slyrusarohner: both!
17:12slyrusI mean a long running repl that was originally started cleanly :)
17:12arohnerslyrus: did it work on the first startup?
17:13slyrusno, the error doesn't appear until after an hour or two of interactive development
17:13slyrusyay heisenbugs!
17:13arohnerk
17:13arohnerslyrus: try adding -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled to your JVM startup
17:13slyrusok, thanks!
17:13arohnerand -XX:MaxPermSize=256m just for good measure
17:15slyrusok, I'll try that next time I need to restart
17:15slyrusin the meantime, I think I've got all of the SMILES atom parsing stuff working, now I need to go back fill on the bonds connecting the atoms...
17:22BobFunktrying to get started with emacs/swank-clojure but am running into a problem with the repl and my keyboard - probably because it's not a US keyboard
17:22BobFunkwhen I try to insert a closing square bracket
17:22BobFunkI get an "M-+ is undefined" message
17:22BobFunksince closing square bracket on my keyboard is alt + +
17:22BobFunkany way to get around that?
17:25areteBobFunk: hmm, are you on a mac?
17:25BobFunkarete: yeah
17:26aretethen I'd probably suggest rebinding command as meta, easier to type too
17:27BobFunkok - total emacs newb, but will try to figure out how to rebind the meta key :)
17:27arete(setq ns-option-modifier nil) and (setq ns-command-modifier 'meta)
17:27areteif you're using cocoa/nextstep emacs =) what does M-x version say?
17:27BobFunkusing gnu cocoa emacs
17:28areteahh ok, then that should work... the old name was mac-option-modifier
17:28BobFunkGU emacs 23.2.1
17:28BobFunk*GNU
17:38BobFunkthat worked a charm - even if I'm enough of an emacs newb that I edited the conf file with vim :P
17:38aretehehe glad to hear it =)
17:40aretehaving to type alt-+ every time you want and end square bracket though, ugh
17:40aretereminds me of japanese keyboards where double-quote is shift-2
17:40DeranderBobFunk: I do that alllll the time.
17:40lancepantzi had to alias vim to emacs on my machine
17:41lancepantzjust a habit
17:41BobFunklife of us non-english people! :)
17:41Derandertypically because when I'm editing my emacs file it's because it's broken and emacs only half loads all of the configs and everything is horrendous looking
17:55BootvisRC1 seems to broken on Windows
17:57BootvisException in thread "main" clojure.lang.LispReader$ReaderException: java.lang.Ex
17:57Bootvisception: Invalid token: C:
17:57Bootvisif you add a bunch of paths using -cp CLASSPATH
17:57Bootviswith C: in them
18:02BobFunkhmm - so one problem with binding command to meta on mac is that the normal clipboard paste stops working - anyway to still paste from the os x clipboard?
18:04DeranderBobFunk: yank works for me
18:04DeranderBobFunk: are you using aquamacs or carbon or xemacs?
18:07BobFunkwill try if yank works - using gnu emacs cocoa
18:09BobFunkworks fine yeah - neat
18:09raekBootvis: do you have any spaces in the class paths?
18:10raekI don't know what could be wrong, but it would be great if you could mention this on the google group
18:27Bootvisnope it's the classpath generated by lein.bat and the problem disappears with 1.1.0
18:27Bootviswill be posting there
18:46pdk(doc iterate)
18:46clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
18:47pdk(doc repeatedly)
18:47clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
18:47lozhI think you still need to pull from git to get lein working on windows
18:55lozhBootvis: There are fixes in git for that problem, should be ok when Phil releases 1.2.1. http://github.com/technomancy/leiningen/commit/c461fa75dd552c1080dd293af7db782570c2f16b#diff-2 is the specific patch if you want to build your own copy.
19:01Bootvislozh: thanks
19:25polypus(swank.swank/start-repl port) is completely ignoring the port i pass it and is choosing it's own. anybody seen this?
19:27slyruswoo hoo! branched molecules support.
19:36hiredmanpolypus: worked for me yesterday
19:49polypushiredman: ty. fixed it. just had the wrong version in project.clj
19:59dnolen... TextMate is getting closer to being a passable editor for REPL-centric Clojure development
20:00polypusdnolen: what's new?
20:02qedHello all
20:06dnolenpolypus: cake use a persistent VM, so it can support evaluating little snippets of code from the command line
20:06dnolenpolypus: that makes it trivial and fast to built all the basics into TextMate, Eval, Load File, Macroexpand, Source, Jump To Definition
20:07dnolenalso means you can keep a REPL open in a Terminal and TextMate and your Terminal REPL are in sync just like they are in Emacs, or an IDE or whatever
20:07brehautdnolen thats exciting, ive left textmate for eclipse currently
20:08dnolenbrehaut: yeah I'm Emac users but I think having a good TextMate story will encourage people to try out Clojure
20:08dnolenI'm an Emacs user, I mean
20:08polypusdnolen: i tried etxtmate about a year ago, and it just wasn't ready for clojure. on emacs now, but curious anyways. what's cake?
20:09polypustextmate*
20:09brehautwhen i used textmate for clojure i had a repl open in a term and i got very quick at copy and paste :P
20:09dnolenpolypus: basically a lein clone - with two amazing features, persistent VM, so JVM startup costs are less of an issue, and very good symbol completion in the REPL
20:10dnolenbrehaut: yeah no copy and paste here. Shift-Command-L to load your file, Shift-Command-X to eval selection. It's simple really hopefully people do something cooler with what I've come up with. Hoping to blog about it and push it out the door in a couple of days.
20:11brehautdnolen: that sounds like an order of magnitude improvement as it is
20:11lancepantzdnolen: could you hold off on the blog post til we announce cake?
20:11polypusdnolen: sounds interesting. will be looking out for blog post
20:11dnolenlancepantz: of course, do you guys have something lined up. I'm ok with holding off as long as you all want.
20:12dnolens/something/date
20:12lancepantzdnolen: we've just got alot of undocumented tasks, and i got a big stack of commits to push
20:12lancepantzdnolen: appreciate it man, i think we'll probably announce it next week
20:13dnolenlancepantz: no problem.
20:13lancepantzone funny thing, the features you and others like so much were really an after thought
20:14lancepantzi think people have grown accustomed to lein and forget the importance of task dependencies in build tools
20:14dnolenlancepantz: haha, yes i know, cake is really meant as a build tool, but I'm really only interested in cake eval :D
20:15lancepantzfor example, my build on lein required manually typing 8 different commands
20:15dnolenalso probably means the Vim story could improve dramatically as well, right?
20:15lancepantzwaiting for the jvm startup each time
20:15lancepantznow it's one :P
20:17lancepantzi think it does drastically, but we didn't think of that at all when we were working on the persistent jvm
20:17lancepantzwe can probably abstract out all of the swank calls into commands passed to a cake task over the commandline
20:18lancepantzreally wouldn't be too hard
20:19lancepantzironically, we're both emacs users as well
20:19lancepantzninjudd doesn't use swank though, which is just weird
20:19defnhe uses slime?
20:19lancepantznothing, just emacs with clojure mode
20:20defnweird.
20:20lancepantzand copies and pastes to his repl
20:20defnthat's just wrong :)
20:20defnalthough i sometimes think my REPL becomes a bit cluttered, I just use M-m M-o
20:20defnerr M-c M-o?
20:21dnolenlancepantz: really, cake is big news for supporting good text editors. The requirement to use Emacs or and IDE is just too much for most people.
20:21defnim forgetting now... only know it by muscle memory
20:21brehautdnolen: some of us are subprimates, not good at tool using :P
20:22BobFunkwhat is cake?
20:22defnsome of us are just "tool guys"
20:22defnthat's how it goes
20:22defnI'm a "tool guy", I'd say -- but I can also be the anti-tool guy
20:23defnreminds me of a great article on academic programmers....
20:23brehautin the end i only care that i have colorised code and a good repl :P
20:23defnhttp://www.ee.ryerson.ca/~elf/hack/academic.html
20:23defni really think the persistent JVM thing is awesome
20:23lancepantzBobFunk: http://github.com/ninjudd/cake
20:23defnalthough Ive been watching my CPU spike here and there, and have java instances which aren't shutting down nicely
20:24lancepantzdefn: that's definitely one of the problems we need to work out
20:24defncake swank && cake swank gets things up and running
20:24BobFunkthanks
20:24defnbut cake stop && cake stop doesn't always shut it down
20:24dnolendefn: cake kill --all always works it seems
20:24lancepantzdefn: i just use cake kill
20:24defnlancepantz: time to document that!
20:24lancepantz:D
20:25polypusso what about the classpath, does cake always have the whole repository on it?
20:26brehautdefn: great link :)
20:27defnbrehaut: :) there's a lot more great stuff on that site btw
20:27defnit's worth looking around
20:27brehautdefn oh damn there goes my weekend :P
20:27defnhaha
20:27polypusthis answers my Q: "Cake tries to keep the persistent JVMs running as long as possible by reloading Clojure files that have changed. However, when .java, .class and .jar files change, Cake has to restart the project JVM"
20:27defnhm I wonder if Runa will like me enough to hire me?
20:28dnolensneak peek, http://www.flickr.com/photos/13326626@N05/4844589927/
20:28defndnolen: TM mode?
20:28dnolendefn: yeah uses cake
20:28defnor are you using cake with TM?
20:28brehautrandom moustache question: is there some trick im missing wrt composing route handlers?
20:29defnahh! good idea!
20:29defnbrehaut: post a gist
20:29dnolenbrehaut: not really, you can put a moustache app anywhere you would put a handler
20:30defni dont use moustache anymore due to inactivity on that project
20:30defnmakes me a bit nervous for a production app
20:31dnolendefn: haha really?
20:31brehautbbl, i'll return to this question later. coffee calls!
20:31dnolendefn: cgrand is pretty good at adding stuff if you request it. but moustache seems to cover the routing bases pretty well
20:31defndnolen: yeah maybe im being overly picky
20:32brehautdnolen: the route params (eg ["foo" param]) are only available via symbols right?
20:32dnolenprobably the one most well thought out 190 lines of Clojure code
20:32brehautthey dont get passed to the handler in req or anything?
20:32dnolenbrehaut: no but you can pass them yourself with (fn [req] (handler param))
20:33dnolenbrehaut: I requested that he add delegate, a macro
20:33dnolenthat let's you do (delegate handler param)
20:33dnolenwhich assumes handler's arg list looks like [request param]
20:34brehautdnolen: ah right, i had seen delegate but not understood how to use it. cheers
20:38defnso much to do, so little time
20:40dnolendefn: putting Clojure docs on CouchDB seems to me to be a wise idea. but that's my bias. I like the idea of being able to replicate a db for local use.
20:42defnyeah i was thinking hadoop actually
20:42defnbut couchdb works too
20:43defni think clojuredocs gets like 60% of the story right
20:43defnbut the other 40% is just wrong. granted it's an early version and all...
20:43defnbut i think there should be a sort of points system, or a total % of example coverage for a library to push users into contributing examples
20:44defnthe hardest part in automating clojuredocs is that you need some magical sandboxes to allow people to use side-effect laden functions in safety
20:45defnpeople need to be able to use (defn ...) in their examples and have them validated by the server IMO
20:45defni also think that there are multiple sources which should be indexed and pulled into clojuredocs
20:49defnbut ill keep my mouth shut until i start producing
22:17javeI'm trying to get a Conjure hello world app working, but I'm getting a stacktrace instead of hello. Any hints?
22:17javeI tried the lein setup method
22:17dsantiagoHey, is it possible to run multiple projects at the same time in SLIME?
22:26javeok, downgrading the clojure deps to 1.1.0 solved it
22:49BahmanHi all!
22:50lyleHello, Bahman!
22:50BahmanHi lyle!
22:50Scriptorhey Bahman
22:51BahmanYo Scriptor!
23:01Drakesontechnomancy: What would you think if I experiment with swank-clojure listening on an AF_UNIX socket, instead of the normal AF_INET?