#clojure logs

2010-08-11

00:00Scriptorthat's good
00:00Raynesgit add RE<tab> LI<tab> test/ src/
00:00Raynes;)
00:00Scriptornow, continue to follow the directions, so commit
00:00ScriptorGive it a message explaining what you changed
00:03ataggartfinally
00:05ataggartthe benefit of 4 steps vs 1 is lost on me, but oh well.
00:05ataggartat least it's uploaded
00:05Scriptorataggart: the benefits become clearer when you're dealing with a ton of code and numerous changes :)
00:06ataggartgiven that I'd then be constrained to the output from a console, I have a hard time imagining that.
00:07ataggartI'll care more about git once someone makes a fully functional ui
00:07Scriptorthere are UI's, but consoles aren't constraining
00:07Scriptormost people use them anyway
00:08technomancyeh; I hate using git without magit.
00:09Scriptornub :p
00:10ataggart^ another reason I'm loath to deal with git
00:10Scriptorhave you used other version control systems?
00:10ataggartyes
00:10rlbataggart: the index is an extra level of complexity, but it can be handy -- think of it as a staging area.
00:11rlb"git add FILE" merges whatever's in a file into the index (so the index contains the current state of that file at that point).
00:11rlbIf you edit the file further, the index will still contain the old version, and a "git commit" without "-a" will just commit whatever's in the index.
00:12rlbYou can run "git add" as many times as you like to refresh the index.
00:12ataggartso the index is an equivalent to the local repo?
00:13ataggartwell no that wou;dn't make sense considering the comment goes with commit
00:13rlbThough in one really common case, you can ignore the index entirely and just use "git commit -a" which will commit the working tree state of every file (that git already knows about).
00:13rlbIt won't handle new files.
00:13rlbYou need to "git add" those.
00:13technomancy-a is the "turn my lightsaber into a shotgun" flag
00:13rlbataggart: the index is basically a list of file names along with a secret copy of their contents at the point they were added to the index.
00:14Scriptorit's really not that complicated, you make a bunch of separate changes, you add certain files to the staging area, commit, and repeat
00:14rlbThose files are "staged" -- i.e. they're in the staging area, and git commit (without -a) just commits whatever's in the staging area.
00:14rlb"git commit -a" behaves more like svn, etc.
00:15ataggart"simple" is clearly a relative word
00:15rlbataggart: I suspect that if you continue to use git, you'll find the index handy eventually.
00:15ataggartgood thing it's in my face right at the get go then, eh?
00:15rlbataggart: but you can ignore it much of the time if you use "-a".
00:16rlbataggart: and of course "git status" is useful (to help see what's going to happen).
00:16ataggartso to get a change from my editor to the repo on git hub, I need to add it to the index (which does?) and then commit it (which does?) and then push it, which gets it to where I want the changes to go.
00:16Scriptorataggart: if all you're doing is changing a text file, sure
00:16Scriptoror
00:17Scriptoryou commit as much as you want, until you've got everything ready
00:17Scriptorand then you push
00:17rlbI'd also recommend setting color.ui to auto in your ~/.gitconfig. "git config --add color.ui auto"
00:17rlbataggart: and I bet the first time you make use of some of something like "git commit --amend" you might start becoming more fond of git, but who knows?
00:19rlbNo doubt it can be complicated, but I've been particularly impressed by the fact that I have yet to back myself in a corner, or want to do something that it can't do (after some occasional help from #git).
00:19ataggartI'm loath to go there.
00:19Scriptorwhy?
00:19clojurebotwhy not?
00:19rlbataggart: hmm -- they've always been friendly to me...
00:19ataggartMy experience with git-vocates is much like my experiecen with rubyists
00:19Scriptorhave you been there before?
00:20ataggartno, because I don't really care enough
00:20ataggarta few beers in me and I just want to get the bytes onto the damn server
00:20ataggartstroking linus' "workflow" just annoys me at this point
00:21rlbataggart: also, fwiw, some of the commands that look arcane are explained pretty well in the manpage EXAMPLES.
00:21rlb(or in the output of "git status", etc.)
00:22Scriptorataggart: well, it sounds like we probably won't suddenly convince, just be sure to keep an open mind
00:22ataggartperhaps I'm not in the right mindset, but the 99% case of simply moving changes (along with a comment) to the repo should be a fairly basic operation
00:22clojurebotuse comp for a point free, pointless style
00:22ataggartclojurebot confuses me
00:22slyrusand it is...
00:23Scriptorataggart: well, repos are just what's on your computer, github just happens to be a repo that's integrated with their site
00:23ataggartanyway, my next hurdle will be trying to get thoser changes from my fork of contrib over to official contrib
00:23rlbOh, and I suppose I should mention that you shouldn't use some of those commands (like "commit --amend" or "reset --hard .." if you've already pushed the relevant commits. If you do, you'll make other people grouchy. You're basically editing public history in that case.
00:24Raynesataggart: What VCS do you use right now?
00:24rlb(But at least git makes that *possible* for the cases where you only have local changes.)
00:25Scriptorataggart: oh, that's easy, go to the original repo's github page and click pull request
00:25Scriptorgive them a brief gist of what you've done, and they can then pull your code themselves
00:25ataggartRaynes: svn, though I haven't needed to use the commandline for about 4 years.
00:25ataggartwell, I have commit rights to contrib
00:26ataggartbut it wasn't clear to me what the process should be
00:26ataggartso I forked it
00:26scottjIs there's a simpler fn for merge-with to ensure vals are colls and concat them than this: http://paste.lisp.org/display/113394
00:26RaynesI don't think of the command-line as something I need to use as much as it is something I'd rather use. Except with magit, of course.
00:27ataggartRaynes: I like being able to see every file that has either an incoming or outgoing change, be able to instantly see a visual diff between local and remote sitting side-by-side, etc.
00:27ataggartthe console sucks for that
00:28RaynesFair enough.
00:29ataggartplus console is ugly :)
00:29ataggartused almost exclusively for runnign commands on remote machines or tailing logs
00:30wwmorganataggart: gitx has a pretty good diff viewer
00:30wwmorgangitx / gitk
00:32ataggartwwmorgan: where?
00:32ataggartah, I see. ugh, that over/under style
00:33ataggarthow do you see the diff between a local and remote file?
00:34wwmorganwell, you have the whole repo history, so you just view the local commit on your machine
00:35scottjataggart: what diff viewer's format do you like?
00:37ataggartscottj: side-by-side. subclipse has a very nice one that keeps the two sides in sync relative to non-changed lines, etc.
00:38ataggartthough you need some screen realestate, so it doesn't show well in cramped screenshots
00:42scottjmaybe EGit does that
00:58slyrushmm... I think the two arg repeatedly should go away and the one arg repeatedly should become the (now non-existent) one arg iterate, meaning that repeatedly could just go away.
00:58slyrusbut what do I know
01:00ataggartrepeatedly (even the old one-arg version) doesn't do the same thing as iterate
01:02ataggartnamely the elements of repeat are all just (f)
01:02ataggart*repeatedly
01:15technomancyslyrus: Clojure has gone for years with only two backwards-incompatible changes, so a change like that is extremely unlikely.
01:16slyrustechnomancy: yeah, and I see ataggart's point about iterate passing it's result to the next iteration.
01:16slyrusnvm...
01:18technomancya total of two (intentional) breaking changes is pretty amazing if you ask me.
01:19bozhidartechnomancy: what were those two changes?
01:19raekwhich were those, btw?
01:19ataggartand I go ahead and make a dozen in c.c.logging
01:21wwmorganbozhidar: the regular expression macro syntax was changed around two years ago
01:21wwmorgan*reader macro
01:21bozhidarthere is some similar change in 1.2 as well I think
01:22bozhidarthe metadata reader macro was changed or something like that
01:22bozhidarI read something of the sort in "Practical Clojure"
01:23ataggart^ is the new #^
01:23ataggartbut I think the old style will still work in 1.2
02:05kumarshantanuhi
02:05Scriptorhey kumarshantanu
02:06kumarshantanu@Scriptor registered just now, so trying out if it works
02:12scottjIs it correct that macros can't do anything with the values of symbols they're passed, only output code that does something with them? They can make decisions about what code to output based on the symbols that were passed, but not the value of those symbols?
02:13Scriptorscottj: not quite, macros, in a sense, are just passed unevaluated code
02:13Scriptorfor example, if you pass a macro a number, it can read that number, if you pass it (< 3 3), it will be passed a list of 3 elements
02:14scottjand if a is 3 and I pass it a can the macro figure out that a is 3 or does it have to output code that that does that?
02:14Scriptorit can figure it out
02:15Scriptorso if the definition is (defmacro m (a))
02:16Scriptorand you call it: (m 3) or (m some-var) where some-var is 3
02:16Scriptora should just be 3
02:17wwmorganscottj: you have the right idea. I'm not sure what Scriptor is getting at
02:18scottjScriptor: if you do some-var it will be some-var
02:18Scriptoroh, right
02:18Scriptorsorry, like I said, it won't evaluate some-var
02:20raekthe macro doesn't really know about the value, since the expansion is done in compile time, not in run-time
02:20raekbut if the variable a i bound in compile time, it is possible
02:21raekhowever, you would need to call resolve or eval or something like that
02:22raekmacros are usually unevaluated code in, code to compile out
02:23raekbut as they have access to everything in clojure, they can perform computations (like evaluating an expression)
02:25scottjahh eval the feature that does just what I want but will get my head bitten off if anyone ever sees my code
02:27kumarshantanuhi, can somebody share c.c.sql experience with me?
02:27scottjkumarshantanu: haven't used it for awhile but I found it pretty simple and didn't notice any bugs.
02:28kumarshantanui want to able to find out the ID auto-generated by the DB after an INSERT
02:28kumarshantanuscottj: any encounter with auto-generated IDs?
02:29scottjkumarshantanu: yeah, I think that's not sql generic and you have to issue a command for your specific db that will return the last one
02:29kumarshantanuscottj: i see
02:30raekscottj: there is probably a more safe (and simple) way than using eval in a macro (e.g. generate code that does what you want instead)
02:31raekmay I ask what you want the macro to do? (input, desired effect)
02:34raekyou can always do something like this if you want to make a decision based on a value:
02:34kumarshantanuscottj: there is this -- http://download-llnw.oracle.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys()
02:35raek(defmacro m [x] `(let [y# x] (if (odd? y#) :odd :even)))
02:35kumarshantanuscottj: seems it's a standard way to get IDs, so i was wondering if it's possible to use that
02:37wwmorganraek: the x needs to be unescaped. This would also work: (defmacro m [x] `(if (odd? ~x) :odd :even))
02:38raekwwmorgan: yes, that's true :)
02:39raekas for the let, I just wanted to demonstrate how the gensym# symbols look
02:39scottjraek: but what if x is a symbol that has sexps that aren't valid clojure, and I want to look at them before deciding what macro to feed them to?
02:40raekah, maybe I misunderstood you before
02:40raekyou most certainly can do that
02:40raekjust do that outside any syntax-quote
02:41scottjbut that only tells me the symbol, not its value
02:42raek(defmacro simple-infix-to-prefix [exp] (asset (= (count exp) 3)) (let [[arg1 op arg2] exp] `(~op ~arg1 ~arg2)))
02:42raekit is better to transform the non-clojure code into clojure code
02:43raekthat is what a macro usually does
02:43raekyou probably want the symbol to be evaluated in the environment the macro "call" is made
02:44raekand not in the compiler's environment
02:45raekI got to go now, but I will get back to this channel later
02:45scottjok that makes sense, thanks
02:49limux1972hi, raek
02:51limux1972I do a little test use hiccup in command
02:51limux1972no use of jline
02:51limux1972it's ok
02:52limux1972it seems to hiccup is ok
03:08raeklimux1972: ok. great then!
03:08raeklimux1972: did you find the thing that caused the trouble?
03:25limux1972i just do the test to find whether hiccup cause the issue
03:26limux1972It seems hiccup is ok
03:30raekdo you still get ???s instead of the characters?
03:30limux1972(html (doctype :xhtml-tag "en" [:body "你好"])) will generate the string ""
03:31limux1972"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/
03:31limux1972TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html lang=\"en\" xml:lang=\"en\" xmlns=\"ht
03:31limux1972tp://www.w3.org/1999/xhtml\"><body>你好</body></html>"
03:32limux1972no ??? appeared
03:33raekif you wrap that in seq so you get (seq (html ...))), do you get ... \b \o \d \y \> \你 \好 \< \/ ... at the end?
03:34raeklimux1972: try http://gist.github.com/ if you want to paste many lines of code
03:34limux1972ok
03:37limux1972yes, i can get "... \b \o \d \y \> \你 \好 \< \/ ..."
03:38raekalright, then there is nothing wrong with tour terminal or hiccup, as far as I can tell
03:40limux1972thanks for your so much and nice help
03:42limux1972too confused
03:48xkbhi
03:48xkbIs there any way to improve this piece of code: http://paste.lisp.org/+2FHX ?
03:48xkbI think the ugly check on type might not be needed
03:50bozhidarwhy don't you operate on seqs be default?
03:50bozhidarI don't like the type checks either
03:51limux1972would you like to take a moment to do someting to reproduce the error
03:51bozhidarand I doubt you care about the underlying implementation that much...
03:51limux1972ie, download that code from githun to do a test with render the html by replace the content in body with some chinese characters
03:51xkbI could maybe use take and drop to get somethign more general on seq's
03:52limux1972just only a simpler test
03:52xkbbozhidar: correct, I don't mind at all. Actually it is a function operation on generated code, so seq is better anyway
03:54limux1972perhaps you will find the reasons of issue occured on me
03:55limux1972it too hard for me to find that because of my poor clojure experences
03:56xkblimux1972: so your problem is the chinese characters are not displayed?
04:04limux1972yes, xkb
04:06raeklimux1972: did you get it working correctly on you computer in the end?
04:07limux1972raek, is it possible lein which cause those errors?
04:07limux1972on
04:07limux1972the browser displays ??? yet
04:08limux1972my last test is in a relatively pure clojure REPL, not lein
04:08raekbut the things we tried yesterday worked?
04:08raeklein repl?
04:09limux1972i used lein-run
04:09limux1972to start the jetty-adapter
04:10limux1972the command is lein run script/run.clj
04:10limux1972just before, i use clojure REPL
04:11limux1972with all the necessary jars execpt jline
04:12limux1972no lein, no lein-run
04:12raekyou could test that example you wrote before both from the repl and from your run script
04:13raekthings you enter *through* the lein repl gets through JLine, which breakes UTF-8
04:13limux1972all things i tried yesterday worked if no hiccup used
04:14limux1972or it will display the annoying ???
04:15raeklimux1972: you could try this http://groups.google.com/group/compojure/browse_thread/thread/44a25e10c37f3b1b/d4a17cb99f84814f?lnk=gst&amp;q=utf8#d4a17cb99f84814f
04:16raekI guess you will have to try different combinations of lein repl / lein run, hiccup / no hiccup to pinpoint where the fault is
04:16raekbut note that the code you type throught the lein repl might get messed up, due to JLine
04:17raek(since it lein repl uses JLine)
04:19limux1972_i am willing to try what you say until it's ok
04:23raekI'm sorry, but I'm a bit busy now
04:23limux1972no matter
04:24raekI'll probably be around later, around 16:00 GMT maybe
04:27scottjNew way of writing web apps that I'm experimenting with: http://gist.github.com/518689 Thoughts?
04:29xkbslice em and dice em
04:29xkb;-)
04:29RaynesTasty website pie.
05:00limux1972raek, is there a middleware in ring used to echo the html text stream to console?
05:01raekyou could always run the (html ...) in the repl
05:04raek(defn debug-println [x] (do (println x) x))
05:05raekor, you could wrap the (html ...) form in debug-println: (debug-println (html ...))
05:06xkbhmm this is odd, I do lein uberjar on a project, and he starts to run it
05:07xkbinstead of building the jar
05:10defnscottj: that is exactly my idea
05:10defnscottj: but sort of a messy implementation IMO
05:10defnno offense
05:11defnthe slices ought to be a product of some higher template-level stuff you're doing
05:11defnyou need to combine your slices into a template
05:12scottjI had that but why? can't the slices themselves be the templates?
05:12defnthey should be less templates
05:12defnlesser
05:12defnIMO
05:13defnscottj: i really like what you're doing -- it is close to what i imagined
05:13defnbut this seems gorier than it should be
05:14scottjscottj: well the example is ugly in part because I parameterized a bunch of stuff that normally wouldn't be, like all those div ids etc
05:14defnscottj: /me nods
05:14scottjmaybe that's not what you meant
05:14defnscottj: im not going to tell you you're doing it wrong because i haven't worked on it
05:14defnscottj: http://github.com/defn/double-bubble
05:14defn^my project
05:14defn;)
05:14raekxkb: to you have code that starts the server at the top level?
05:15raekif so, move that to a main method
05:15raekotherwise the compiler will end up starting the server (since it evaluates all top-level expressions)
05:15defnscottj: i think my main problem with your code is that it seems rather jumbled -- i think the result of what you're trying to do should be incredibly modular code snippets
05:16defnlike you should be applying :css at one level
05:16defnand :clj at another
05:16defnas opposed to the same level
05:16defnscottj: do you follow?
05:17defnlike (defn foo [title, body] [:html [:head [:title content]] [:body body]])
05:18defn(with-css foo [:background-color #333])
05:19scottjoh I see decorate the html with css, js, etc
05:19defn(deftemplate home (with-css #(foo "Hello world) [:background-color #333])
05:19defnsomething along those lines
05:19defnthat last thing i wrote is gibberish
05:19defnbut it's sort of what i imagined
05:20defn(deftemplate home [foo (with-css [:background-color #333])])
05:20defnthat's closer I think
05:21defnit's like enlive, but add CSS transformations into the mix
05:21defnCSS selector mutation
05:23scottjwhat selector is your with-css using?
05:29scottjdefn: your repo leaves something to be desired :)
05:30scottjso yeah, with slice some of the ideas are a slice wouldn't necessarily have any html. It could be any combination of 0 or more snippets of js, clj, css, html, etc
05:30scottjand slices compile to functions
05:31scottjand when they're composed they act like templates, and the top level one gives you a valid html page with either inlined or linked css/js
05:33scottjI really like the idea of having a uniform unit of code regardless of what language it's going to end up. so even small concepts that span multiple languages can be in one spot that comes up when you M-. on it
05:38xkbhow come 1.2 is so much slower sometimes?
05:40scottjdefn: I had a version working without the :var and argument lists features, but I suspect that the difficulty implementing or afterward understanding how to use those features correctly might lead me to understand the value of your approach.
07:35zmila, (sort-by (comp < last) {:a 1, :c 3, :b 2})
07:35clojurebot([:a 1] [:c 3] [:b 2])
08:11LauJensenGood morning all
08:26esjLauJensen: heavy night ?
08:27LauJensenhehe, no, Im just trying to go with the whole UGT thing to avoid all the repetivetive chatter about timezones, so its all good morning when I come in, and good night when I check out
08:27dnolenpretty good article on Clojure strengths (and weaknesses) - http://programming-puzzler.blogspot.com/2010/08/racket-vs-clojure.html
08:27LauJensenthanks dnolen
08:38LauJensendnolen: excellent read - I think except for his dislike of Java/Java-land and ignorance of Emacs, he brought up some very good points
08:40dnolenLauJensen: heh, "ignorance of Emacs". Aren't we *all* ignorant of Emacs, even those of us that use it? But yeah, the dislike of Java-land is a bit irrational.
08:41LauJensenHehe - I just expected that he simply hasn't tried it yet. But I like how that article is so focused on data-structures, usually that doesn't get the attention it deserves in the x vs y things
08:50chouserthat puzzler article is quite good. the list of "unproven features" is insightful and fair.
09:10rhickeychouser: the STM ding is a bit naive. Not that STM isn't unproven, but people have unrealistic expectations when given short vs long transactions. That scenario has inherent problems no automated solution (short of serialization) could solve, and there are plenty of practical workarounds given a concrete case
09:11rhickeyalso the transients comment dings the lack of compliant interfaces, but interfaces can't be compliant
09:12chouserrhickey: yes, I'd buy that. And I haven't seen those "early reports" on multimethod "prefer"
09:12rhickeyeither conj returns a persistent thing or it doesn't
09:12chouserer
09:12chouserprefer-method
09:12LauJensenrhickey: true on both counts, though I think to most people the STM inner workings are still cryptic and hard to go in-depth with. I mean its still a research problem in some regards right?
09:13chouserbut it's fair to have doubts about these things. Personally, I'm a whole-hearted believer in protocols already, despite their youth.
09:13rhickeychouser: mikel evins and I had some long discussions early on on prefer-method vs CLOS
09:14rhickeychouser: one of the challenges of Clojure is that the first 2 years of me changing my mind (and hopefully improving my ideas) happened in private, now it's all public :)
09:15chouser:-)
09:15chousersome of us prefer it this way
09:16bozhidarmaybe rhickey doesn't ;-)
09:16bozhidarI find it amusing and enlightening to be able to follow the development of new features in the public space
09:16rhickeyI'm fine with it, just as long as people are mature and realize it is a process, things don't drop from the sky all perfect
09:17bozhidaryou see the debates, the alternatives and in the end you know that all this lead to something good by no accident
09:17bozhidarindeed
09:19bozhidarrhickey: I'm sometimes wondering do you plan at some point to author a book on Clojure yourself. Often language architects have created masterpieces, after all you have an unique perspective on your creations
09:19LauJensenbozhidar: I asked that a year ago, he said "Do you want me to work on a book or Clojure?", .. so I stopped asking about books :)
09:20rhickeybozhidar: Right now it is a choice between work on a book on Clojure or work on Clojure
09:21chouserrhickey has put significant time in helping us improve Joy of Clojure, which is a pretty awesome compromise from my perspective.
09:22bozhidarrhickey: I think it'll always be this choice, but I've enjoyed your short essays on the clojure web site immensely and I'd love to get more of them. This probably goes to all the clojure users
09:24rhickeybozhidar: the pods work has helped me refine my ideas around process and that might warrant another essay. Otherwise most of my more complete thoughts are out there.
09:25bozhidarchouser: I'm quite impatient about this one. I read that the book was almost completed. Any chance it'll be shipping before the November estimate?
09:26LauJensenrhickey: An essay relating to pods would be fantastic - Would probably boost uptake in the community quite a bit
09:26rhickeyso much todo for Clojure, short list here: cinc, better method inference, letmacro, JSR 292, modularity, android, pods, parallelism, primitives, scopes...
09:27chouserbozhidar: I believe all the content except for foreward and appendices are available electronically now if you buy the meap via http://joyofclojure.com/
09:27LauJensenrhickey: That list sounds daunting, but isnt this Clojure/core crew speeding up development quite a bit?
09:27rhickeyLauJensen: but people aren't well served by descriptions of things that are speculative or changing a lot. I don't need to drum up adoption of new things, I need to temper it :)
09:28jcromartie^ wisdom
09:28chouserI heard a rumor Clojure/core (or just some members of it?) are spending most of their time using Rails.
09:28LauJensenrhickey: of course not - I was thinking post-release, it they come into being
09:29bozhidarrhickey: I know you have some ideas for improvements in the JVM. Are you by some chance involved to some extent in the development process of Java 7?
09:29jcromartiechouser: like Ruby on Rails?
09:29LauJensenchouser: I guess that would make them Clubyists ? :)
09:29chouserjcromartie: I haven't verified that at all (hoping rhickey will confirm or deny), but yes that's what I heard.
09:29rhickeyLauJensen: yes, Clojure/core is helping a lot, especially freeing me to think about these things rather than e.g. maven builds
09:29rhickeybozhidar: not at all
09:30LauJensenhehe, great, thats a big win :)
09:31bozhidarchouser: I've been thinking about the MEAP lately, I just wasn't sure about it's shape - because from my experience a lot of changes get made at the last moment. I guess you're better organized than I am :-)
09:31chouserbozhidar: oh, I'm sure there will be last-minute changes.
09:42LauJensenchouser: How does it feel to be wrapping up a project as big a JOC ?
09:42chouserLauJensen: daunting. Fogus is my salvation.
09:44LauJensenIm sure you're a great team, supporting each other in different ways
09:44LauJensens/You're/you make/
09:44sexpbotIm sure you make a great team, supporting each other in different ways
10:01perkinscThe clojure.org site has llots of really great documentation about the rationale behind clojure's design. Will similar essays be posted about protocols, deftype, etc. when 1.2 is released?
10:02MayDanielhttp://clojure.org/datatypes http://clojure.org/protocols
10:04perkinscOK, cool. I assume they will be linked from the some page once 1.2 is out. Thanks for the links.
10:04perkinsca/some page/home page
10:04MayDanielYeah. They're pretty well hidden.
10:20edbondwhats the best coupon for 'joy of clojure' now? I see clojure35 for 35%
10:22LauJensenchouser: what was joyofclojure.com/buy the url you suggested to purchase from ?
10:22chouserthat's it
10:23chousersometimes there's coupon codes on joyofclojure.com itself
10:41scottjIs there a function that will replace all instances of symbol a in a sexp with symbol b? (replace 'a 'b '(c (d a))) => (c (d b))
10:44chouser,(clojure.walk/prewalk-replace '{a b} '(c (d a)))
10:44clojurebotjava.lang.ClassNotFoundException: clojure.walk
10:45chouser,(use 'clojure.walk)
10:45clojurebotnil
10:45chouser,(clojure.walk/prewalk-replace '{a b} '(c (d a)))
10:45clojurebot(c (d b))
10:45chouserscottj: how's that?
10:45scottjchouser: perfect, thanks
10:47zmilawhy quote before map {a b}?
10:48scottjzmila: prewalk-replace is a function so args get evaluated and we want symbols a b not what they're bound to
10:49zmilai need to think this about :)
10:50scottjzmila: it's the same reason the list (c ...) is quoted
10:50spewnscottj: It's slightly different because ('c ...) won't work, but {'a ...} would.
10:51scottjspewn: yeah I realized right after I said that that I was confusing myself because lists are special since they represent function calls
10:51chouser,(let [a 1, b 2] {a b})
10:51clojurebot{1 2}
10:51chouser,(let [a 1, b 2] '{a b})
10:51clojurebot{a b}
10:52zmila,(clojure.walk/prewalk-replace '{Math/sin Math/sqrt} '(println (Math/sin 4)))
10:52clojurebot(println (Math/sqrt 4))
10:52chouserI think that's the first time I've used clojure.walk
10:52danlei:)
10:52zmila,(clojure.walk/prewalk-replace {Math/sin Math/sqrt} '(println (Math/sin 4)))
10:52clojurebotjava.lang.Exception: Unable to find static field: sin in class java.lang.Math
10:52spewnIs there ever any reason to do (into [] foo) over (vec foo)?
10:53chouserspewn: I don't think so
10:56spewnchouser: Good, thanks :)
10:56zmilainto is different when applied not to empty literal [] but to other vector, yes?
10:57LauJensenzmila: how?
10:58spewn,(into [1 2 3] [4 5 6])
10:58clojurebot[1 2 3 4 5 6]
10:58zmilacorrect, spewn
10:58LauJensenah ok, really didn't get that from the question
10:59scottj,(let [ensure-coll #(if (coll? %) % (vector %))] (merge-with #(mapcat ensure-coll %&) {:a 1} {:a [2]} {:a [3] :b 1}))
10:59clojurebot{:b 1, :a (1 2 3)}
10:59scottjIs there a shorter way to write that?
11:00zmila(frequencies (flatten (vals your-data)))
11:01pdk(doc condp)
11:01clojurebot"([pred expr & clauses]); Takes a binary predicate, an expression, and a set of clauses. Each clause can take the form of either: test-expr result-expr test-expr :>> result-fn Note :>> is an ordinary keyword. For each clause, (pred test-expr expr) is evaluated. If it returns logical true, the clause is a match. If a binary clause matches, the result-expr is returned, if a ternary clause matches, its result-fn, which must b
11:02zmilanot, (map #(flatten (vals %)) (frenqencies your-data))
11:05scottjzmila: I don't see it :)
11:05pdk(condp = 1 2 :2 0 :0 :1)
11:05pdk,(condp = 1 2 :2 0 :0 :1)
11:05clojurebot:1
11:05pdk,(condp < 1 2 :2 0 :0 :1)
11:05clojurebot:0
11:09dprohi
11:10dprothx to this channel my emacs/swank setup works as expected now, but java eats ~40% cpu for an idle "lein -swank" REPL, is that normal ?
11:10LauJensendpro: Should idle around 0 - 1%
11:11dproLauJensen: hmm my top output begs to differ ;)
11:12LauJensenIf you've filled up the memory of the system, then swapping might explain it, but not a fresh repl
11:12dproI'll restart and reconnect ... maybe some previously closed windows
11:12dpro processes weren't garbage collected
11:13LauJensendpro: And make sure your -Xmx isnt set sky high
11:13neotykhow do you get form parameters in defroutes in compojure?
11:14neotykhow to destructure it?
11:14dprolooks better now ...
11:14LauJensenneotyk: form parameters in defroutes?
11:15neotyk(POST "/sample/" {{a :a} :params} (fn [a] a))
11:15pdk(doc defroute)
11:15clojurebotGabh mo leithscéal?
11:15LauJensendpro: good, I think the only caveat is memory consumption, and you can control that at command-line
11:15neotykLauJensen: how do i get fomr param named a from this route?
11:16neotyks/fomr/form/
11:16sexpbotLauJensen: how do i get form param named a from this route?
11:16dproLauJensen: cheers, but I don't think swapping was the problem
11:16LauJensenneotyk: this might help http://bestinclass.dk/index.clj/2010/02/reddit-clone-in-10-minutes-and-91-lines-of-clojure.html
11:16LauJensenDISCLAIMER: Compojure has changed a bit since that 0.3.2 post
11:16dproapparently just closing a window isn't enough to clean it all up after a (load "something")
11:16neotykLauJensen: checked this already
11:16LauJensenIf you need specific 4.0 tips Im blank - Im deeply invested in Moustache now
11:17neotyktrying to build reddit clone running on GAE with new compojure
11:17LauJensenneotyk: But, if you forget about wrappers, then in 'params' there's a key called 'body. In there, you'll find the params
11:18LauJensensomething like (->> (:body request) (repeatedly #(.read %)) (take-while pos?) (map char) (apply str)). That will give you something like "a=1&b=2" depending on whats posted. Run java.net.URLDecoder/decode on the values to get pure text
11:19LauJensenThough.. Im sure they wrapped that somehow, its a common thing with Ring
11:28neotyk (POST "/new/" {{title "title" url "url"} :params} (add-link title url))
11:28neotykthat made it\
11:40LauJensenInteresting approach
11:51dnolenso is any excited enough about good TextMate support to be willing to contribute some code? :D, so far Eval, Eval pprint, Show Source, Load File, Macroexpand, and Macroexpand are all working. Everything is implemented in Clojure so need to use a less powerful language to extend the bundle.
11:51dnolenMacroexpand All
11:52dnolens/any/anyone
11:54esjwe're all afraid of Lau raining fire on us :P
11:56dnolenesj: heh, well I'll keep hacking on it, tho I'm won't be surprised if there aren't many TextMaters since Clojure TextMate support has been pretty dismal until now. Just thought I'd throw it out there.
11:57esjdnolen: i'm just joking of course, and improving tools is a huge plus for us all
11:57LauJensenesj: what?! :)
11:58LauJensenYea Im all for all IDEs - But I must admit I've never tried this thing called 'text mate'
11:59LauJensenhehe
11:59LauJensenIts a valid question though
12:00danlarkinI used textmate for a couple years. Thinking back on it I can't justify why
12:00esjdnolen: warned you, I did :P
12:01LauJensenesj: cool it Yoda :)
12:02dnolenwell everyone I work with uses TextMate (a couple VIMers), they're all scared of Emacs.
12:02technomancydanlarkin: the people I used to know who liked textmate mostly used it because they were allergic to lisp.
12:02LauJensenMaybe its time for a more rigorious comparison of the different IDEs. There must be some strong incentives to choose Emacs > Eclipse > Netbeans > ... and so on. But I have too limited knowledge of most of them
12:02technomancyor they thought they were at least
12:03dnolenI'd like to think of my TextMate bundle as yet another gateway drug ... to Emacs
12:03Chousukeheh
12:03danlarkinLauJensen: problem is, no one can make an objective comparison :)
12:03LauJensendanlarkin: I guess thats true
12:04ChousukeI think emacs' extensibility is what primarily draws people to it
12:04Chousukeand the fact that everything integrates with it :P
12:04esjfull disclosure - I use emacs exclusively. But others don't.
12:05chouserthe last time I stopped using emacs it was because its integration with cscope was broken compared to vim
12:06LauJensenchouser: But you never got the keycombos into your fingers did you?
12:06alexykanybody uses La Clojure?
12:06chouserLauJensen: yeah, I was pretty comfortable with it. Used it for all my email and code editing
12:07alexykdnolen: there were some ingenious clojure bundles for textmate, most abandoned though; invoking repl with some ruby tricks, does your do that?
12:07ChousukeI like the vim interface to editing, I just don't like the editor itself as much as I like emacs :P
12:07LauJensenchouser: cool
12:08technomancyis cscope like a tags generator?
12:08Chousukeit's a shame that viper/vimpulse doesn't work very well together with most emacs add-ons
12:08chouserChousuke: yeah, it really is.
12:08chouserand that's mainly a culteral thing, I assume, which is harder to fix than code. :-/
12:08LauJensenChousuke: But are vi-bindings really superior to Emacs'? Because if they're not, or at least if its debateable, why not just use the combos which are natural to emacs?
12:09chouserLauJensen: they really are superior.
12:09chouser:-)
12:09danlarkinLauJensen: muscle memory?
12:09ChousukeLauJensen: it's not just about bindings, it's about the whole paradigm of having modes and actions and "targets"
12:09LauJensenChousuke: I know, but now I was thinking about the bindings
12:09LauJensen(ive never been able to pick up vims)
12:09dnolenalexyk: it relies on Cake. Cake launches persistent VMs. I convinced them to add a bunch of features to make integrating with TextMate simpler.
12:09LauJensens/able/willing/
12:09sexpbot(ive never been willing to pick up vims)
12:10ChousukeLauJensen: vim's bindings could probably be improved while keeping the core paradigm intact, too
12:10dnolenalexyk: for example I can write a executable script with !#/usr/bin/evn cake run at the top of a .clj file and it runs blazingly quickly since the JVM has already been started up.
12:10dakroneChousuke: how would you improve vim's bindings?
12:10dnolenit's also get the entire shell environment passed to in a bound var *env*
12:10Chousukedakrone: I haven't thought much about it but if I were to write a new editor from scratch I'm sure I would find something :)
12:11alexykdnolen: I convinced them of features first! :) Is your bundle new, or cake functionality is new?
12:11dnolenso you get figure out what the damn current directory is as well as other envrionment vars
12:11alexykdnolen: do you know that in the horror world called Windows, there's an editor called e-texteditor which runs TextMate bundle as is?
12:11chouserChousuke: I agree. vim kept more compatibility with vi than it now really needs.
12:12dakroneChousuke: seems like key-bindings are an easy thing to fix in both Vim or Emacs
12:12dakronesince you can bind your own
12:12dnolenalexyk: I'm punting Windows compatibility to Cake, they seem concerned with that. I'm assuming my work can be adapted to the Window's TextMate editor
12:13ChousukeIf I were to write a new editor I'd do it with GNU Guile or something and make it like vim, but then again I would also attempt to design it so it can handle more than just text editing (like emacs does)
12:13alexykdnolen: that conceivably may bring a cute clojure IDE to Windows
12:13Chousukebut then again, I'm not going to write a new editor so hmm :P
12:13chouserdakrone: you'd think, but then when you do anything a little unusual (hyperlinking, directory-tree browsing, org-mode, etc.) each of those plugins want to take over a set of bindings.
12:14dakronechouser: that sounds like more a criticism of model editing than regular keybindings, is that correct?
12:14chouserthey're usually careful to provide bindings that are compatible with what "most people use", which of course is different in each editor.
12:15chouserdakrone: I'm not sure what you mean
12:16dakronechouser: are you saying you prefer Emacs' bindings because they can be standardized over a wider range of buffers since they are all non-text characters (ie, C-a, C-e, etc)?
12:17Chousukedakrone: I'm sure a number of commands could be "standardised" over different modes even in a vi-like editor
12:17chouseroh, not at all. I consider emac's bindings to be modal as well, you just have to hold down your mode keys all the time.
12:17dakroneChousuke: yea, and they are, I'm just trying to understand the argument
12:17dakroneI still don't understand the basic argument against it then
12:18chousermy point is just that when a plugin adds new bindings in either editor, it tries to avoid clobbering default bindings, so it's much easier to use plugins when you use that editor's default bindings.
12:18chouserand so you run into problems trying to use viper in emacs or cream in vim
12:19dakroneahh yea, okay, as a hardcore Vim person who attempted to use Emacs via Viper for about a week, I certainly agree
12:20dakronethen I found myself actually sinking into depression trying to use Emacs, so I stopped ;)
12:21chouserit would require so much work for me to bend emacs to my will, and all that work would be in a lousy ancient lisp ... it's just daunting.
12:21Chousukeheh
12:21Chousukeand writing new editors really is not feasible nowadays :(
12:22LauJensenchouser: really? because you would redesign the ways keybindings work and such ?
12:22dakronechouser: so what do you normally use anyway?
12:22chouserthere's plenty I don't like and/or don't know well enough in vim, but it mostly works how I want already, so I stay.
12:22Chousuke"It doesn't even do autocompletion for source code, what a lousy editor!"
12:22chouserChousuke: yeah. :-(
12:23chouserI need to look at waterfront.
12:23chouserstill
12:23dakroneChousuke: Vim does autocompletion for code...
12:23chouserdakrone: he's talking about a theoretical new editor written from scratch
12:23chouserlike textjure. :-P
12:23dakroneoh okay, I apologize, sorry Chousuke
12:29ChousukeIt's a problem with software in general I suppose
12:30ChousukeNowadays we'd know how to do most things "right" but it's not feasible to start from scratch ;/
12:31Chousuke(and even if you did it, the same thing would repeat a couple decades later)
13:03slyrusI don't suppose java has built-in support for 2-bit array elements... can anyone recommend a good java library that does this? (and 4-bits, while we're at it).
13:10dprohas anyone done some YASnippets for clojure so far ?
13:10polypuscan lein compile java sources? if so where to place them, how to do it?
13:13dakronepolypus: check out lein-javac http://github.com/antoniogarrote/lein-javac
13:13polypusdakrone: ty
13:13LauJensendpro: they're not very helpful. perhaps for function definitions
14:09apgwozpolypus: i just started using lein-javac today, and it works perfectly fine
14:11LauJensenI think 'select-keys' might be poorly named, seeing how its not selecting keys but key/val pairs
14:21AWizzArd,(doc select-keys)
14:21clojurebot"([map keyseq]); Returns a map containing only those entries in map whose key is in keys"
14:21AWizzArdmaybe select-entries
14:22LauJensenexactly
14:22AWizzArdThough, a function returning keys that were its input sounds more like identity :)
14:24chousercould be filter-map
14:24chouserthough it isn't, quite.
14:35apgwoz`select-keys` seems like the right name to me. `select-in` would also be acceptable to me.
14:36apgwoz(i.e. (select-in {...} [k1 k2])))
14:39AWizzArdOn the other hand it’s no tragedy.
14:40alexykhow do you switch back to "global" namespace in repl after going to some other with (in-ns smth)?
14:42chouserthere's no global namespace
14:43chouserbut you're in 'user by default, so (in-ns 'user) may do what you want
14:45alexykchouser: ah ok. say I have a file with: (ns hey) (member:defn hey [x] (print (str "hey, " x))). I load it into a repl. If I do (in-ns 'hey), should I be able to say just (hey "man") ?
14:45alexykmember: is extraneous
14:45alexykcolloquy loves him rotten
14:46AWizzArdyes, when you in-ns into hey, then you can call all fns in it directly
14:46AWizzArdwithout the ns specifier
14:50LauJensenapgwoz: select-in is also good
14:50rhickeychouser: where are those nice tests mentioned here: http://groups.google.com/group/clojure/msg/04302f0aa80bc52b ?
15:01alexykafter a while I forget how to show two things from repl: (1) clojure version, (2) classpath. So -- how, and are they in a FAQ somewhere?
15:02tomoj*clojure-version*, *classpath*, dunno
15:02AWizzArd(System/getProperty "java.class.path")
15:03NikelandjeloIs there built-in function, analogous defn- ,but more general, for def?
15:03alexykAWizzArd: see, yours I knew and could never remember; tomoj's, OTOH, I can
15:03tomojI think we do need a #clojure FAQ
15:03Nikelandjelo*macro
15:03alexyktomoj: it wills say "ask tomoj" :)
15:04alexykchouser: is the gentleman in the top hat on the cover of TJoC supposed to remeble rhickey ?
15:04alexykresemble
15:04LauJensenalexyk: no thats Chouser in his sunday suit :)
15:04alexykLauJensen: chouser on github pic looks slimmer :)
15:04LauJensenits only a headshot
15:05alexykLauJensen: but kind of extrapolates to a slimmer build, if you will
15:05kencauseyno infobot here?
15:05LauJensenIm only kidding ofc, its just something MEAP does to all their books in order to scare away customers I think
15:06alexykLauJensen: AFAIU authors do get to pick a person? Seeing the cover reminded me of clojure videos for some reason :)
15:06LauJensenoh... I didn't know that
15:06hiredmanclojurebot: infobots |are| inferior
15:06clojurebotYou don't have to tell me twice.
15:08kencauseyclojurebot: help
15:08clojurebothttp://www.khanacademy.org/
15:08hiredmanit's help in the most abstract sense
15:09kencauseyclojurebot: clojure version
15:09alexykhiredman: better make it an NSFW site
15:09clojurebotsee swank
15:09cemerick,*clojure-version*
15:09clojurebot{:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"}
15:09alexyk,*classpath*
15:09clojurebotjava.lang.Exception: Unable to resolve symbol: *classpath* in this context
15:09alexyktomoj: ^^?
15:09cemerick,(System/getProperty "java.class.path")
15:09clojurebotjava.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read)
15:09cemerickheh, oh well
15:10alexykcemerick: yeah, but tomoj mentioned *classpath* and I was elated. Why don't we define that?
15:11hiredmanbecause any classloader can add it's own classpath, so what would *classpath* be except a listing of the system classloader's classpath
15:11hiredmanwhich is what you set with with -cp
15:12hiredmanso, uh, whats the point?
15:12cemerickalexyk: I can imagine people rebinding *classpath*, and then being very confused as to why it doesn't do what you'd hope for.
15:12alexykhiredman: rememberability
15:13tomojalexyk: weird, I have it
15:13alexyktomoj: did you define it yourself?
15:15tomojnope
15:15tomojmust be swank-clojure
15:15tomojI have it when I connect to a swank server, not in a plain repl
15:28alexykaha
15:29alexykwhoever wrote swank-clojure, he was a smart man
15:29alexykor she
15:29alexyka smart woman then
15:29alexykdnolen: is your TextMate bundle operational?
15:29RaynesWasn't it jochu?
15:34dnolenalexyk: the basics are there yes, http://github.com/swannodette/textmate-clojure/tree/cake
15:34dnolenalexyk: I have quite a bit of finessing to do before I want to do any kind of announcement tho.
15:35alexykdnolen: did you build on the existing extensive bundles with syntax/repls etc?
15:35dnolenalexyk: I want to be able to intelligent determine the sexpr enclosing/preceding the cursor using Clojure. also wrap all commands in try/catch to produce nice formatting stack traces with urls to source files
15:36alexykdnolen: beautiful
15:36dnolenalexyk: i used mcgrana's it just does syntax highlighting. all the other bundles are too hacky for my tastes. my bundle pretty much puts all the logic in Clojure
15:36alexykdnolen: that's great. It means it should be portable to Windows then, hopefully
15:37alexykdnolen: so cake repl is TextMate's response to swank, right?
15:38dnolenalexy: cake has swank. what cake does is create persistent VMs. so instead of booting each time, it just hooks into a running VM
15:38dnolenalexyk: originally I was using cake eval, which can take an sexpr and evaluate it in a peristent VM, but that became unweildy.
15:39dnolenalexyk: so I requested "cake run". Which will take a .clj file and execute it with bake/*env* bound to all the shell environment vars when "cake run" was executed
15:39alexykdnolen: right, right. I'm just wondering what the workflow w.r.t. repl can look like from TM. I never saw anything like an efficient repl in textmate. Used to send lines to an existing repl in iTerm via an applescript snippet in TM.
15:39alexykdnolen: you still want to execute selections
15:39dnolenalexky: that already works
15:40dnolenalexyk: as well as loading a file to compile it. It even guesses the name space and ensures that new eval'ed expression happen in the namespace for that file.
15:41dnolenbasically I want this to be the core of the SLIME experience, without SLIME
15:42alexykdnolen: README still refers to a github path from mmcgrana
15:42alexykdnolen: "slime experience without slime" is a good company motto :)
15:43dnolenalexyk: yeah, lemme fix
15:45dnolenalexyk: fixed, and cake is now the master of my repo
15:45alexykdnolen: awesome
15:46alexyksaved me a git checkout cake :)
15:46dnolenalexyk: there's certainly going to be a lot rough edges, this is only a couple days of work :)
15:47alexykdnolen: as a friend replied to a scared newbie driver pulling out of a driveway onto a main street, saying "I can't see", -- "don't worry, you'll hear" :)
15:47LauJensenhehe
15:48alexykdnolen: btw, why does everybody show osascript command to reload bundles if you can do it from a menu?
15:49dnolenalexyk: no idea
15:49alexyknot like you're avoiding TM menus anyway
15:51alexykdnolen: do you have to start cake repl from a Terminal? I did iTerm and get a refusing to quit eval error on shift-cmd-x
15:53dnolenalexyk: I haven't tried iTerm, in general you should issue cake repl FIRST before trying to run any commands.
15:53alexykdnolen: did that. Hmm: Load File: unknown task: run
15:54alexyk(shift-cmd-K)
15:54dnolenalexyk: you need an up to date version of cake, do you have 3.8 installed?
15:54dnolenalexyk: known issue, load file doesn't work on unsaved files, files that don't belong to project. it's on the TODO list, which is in the repo
15:55alexykok, updated cake. up to date means pull again next day :)
15:57alexykdnolen: I get an NPE now on eval or run, in eval.clj:1
15:58dnolenalexyk: huh, can you gist the stacktrace please.
15:59alexykdnolen: if I could scrape it out of that pop-up :)
15:59alexykah I can
15:59dnolenalexyk: yup, sooo lame. I need to fix that.
16:00dnolenclj-stacktrace to the rescue I think for that.
16:00alexykdnolen: http://paste.pocoo.org/show/249031/
16:00alexykthat's the error
16:00alexykin the popup upon shift-cmd-x in (4+5)
16:00alexykcake repl started before
16:01alexykdnolen: is it sending to the Terminal, or only internally?
16:01dnolenalexy: (4 + 5) ? you mean (+ 4 5)
16:01alexykREADME said (4+5)! :)
16:01dnolenalexky: haha
16:01alexyklike any good FORTRAN!
16:02alexykwait, it's not #Fortran66?
16:03alexykstill same thing on (+ 4 5), or load file, something's fishy with the setup
16:03dnolenalexyk: and you verify that the cake repl is working just fine?
16:03alexykin the Terminal, yes
16:04alexykshould I restart TextMate just in case?
16:04dnolenalexyk: sometimes things get into a weird state, especially if you've used cake before. I recommend "cake kill --all", then "cake repl"
16:04dnolenalexyk: no need to restart TM
16:04alexykdnolen: I have to cake jvm's now. I'll just start cake repl again.
16:05alexykdnolen: replace 2 seconds by 7 in the README for coldstart expectations :)
16:06alexyk"and, in 7-11 seconds, you'll have a repl"
16:06alexykdnolen: still the same
16:07alexykdnolen: after I git pull in cake, do I have to rebuild it?
16:07lancepantzalexyk: no
16:08alexyklancepantz: what I thought
16:09alexykdnolen: shift-cmd-K works!
16:09alexyk-X fails as before
16:10dnolenalexyk: incredible.
16:10alexykbut for -K, you deserve hugs and kisses! :)
16:10alexykand cake people get chocolates
16:10alexykmagically, stuff is injected into your repl from TM.
16:11dnolenalexyk: yup. that's weird about X, it's working here. I need to try this on a clean setup and see what's going on .
16:11alexykso I can have my repl in a normal console, not some gnuish emacs you have to switch to :)
16:11alexykdnolen: sorry, my bad, I didn't select sh*t.
16:12alexykI placed a cursor within it
16:12alexykexpecting you to fund the sexp
16:12dnolenalexyk: on the todo list
16:12dnolenalexyk: http://github.com/swannodette/textmate-clojure/blob/cake/TODO.txt
16:13alexykmight as well start opening tickets :)
16:13dnolenalexyk: sure
16:14alexyklancepantz: so is run doing cake compile? i.e. cake compile injects into project's JVM?
16:16lancepantzalexyk: compile creates class files, completely different process than reloading the classes in the jvm
16:16clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
16:16dnolenalexyk: I think compile generates class files right? run just sends the contents of the file to the running JVM I believe.
16:17alexyklancepantz: so why does run task say "Compilation finished"?
16:17dnolenalexky: I added that
16:17dnolenremember the the part about "rough edges"
16:17lancepantzah, had us confused for a second :)
16:17alexykdnolen: I didn't know if you capture the status or pass it along :)
16:18alexyklancepantz: you'll now hear shouts from above via dnolen :)
16:18alexykok it all works, whew
16:18alexykclojure productivity award of 2010
16:19alexyk2009 went to lein
16:19alexyk2010 is cake + TM
16:20dnolenalexyk: haha we'll see, there's a lot work to do for the TM experience to match Emacs
16:20alexykdnolen: I used to get by with a simple send to terminal. BTW, also would be good to have eval current line.
16:20alexyk(so you don't care where the cursor is)
16:22lancepantzdnolen: ninjudd just showed me how you figured out how to make clojure files executable
16:22lancepantzthat is really freaking cool
16:22lancepantzthey also don't have to end in .clj
16:23alexyklancepantz: I guess this is where the global jvm will be handy
16:23alexykcan start cake on Mac boot and have it clojure-scriptable
16:23lancepantzyeah
16:23Blue-Foxhi
16:23alexykthen can also add Dcake.project to it so scripts don't pollute projects if happen to be launched from them
16:24LauJensenDo you guys see such a great use for a persistent jvm, that you keep one running constantly ?
16:24Blue-Foxclojure supports sockets, doesn't it?
16:24LauJensenBlue-Fox: Clojure supports everything which Java supports, so yes
16:24lancepantzalexyk: that's a good idea too
16:24alexykLauJensen: cake launches a global jvm if it's outside o f a project
16:24Blue-FoxLauJensen: wow
16:24lancepantzLauJensen: yeah, i do, mainly because i'm connected to it with swank usually
16:25lancepantzso its just there
16:25ChousukeBlue-Fox: Clojure runs on the JVM; you have full access to all java libraries.
16:25LauJensenalexyk: Yea I know - Im just saying, when I look at the stuff I use Clojure for, that seems wasteful, to keep it running
16:25alexykLauJensen: I want to be able to open the lid of my MacBook, type someting, and eval right away.
16:25ChousukeBlue-Fox: Most of the time they're not very well fitting with clojure idioms though.
16:25LauJensenLets say I launch cake+jvm for project X, and later I want to work with project Y, does cake update the classpath and everything for that?
16:26ninjuddLauJensen: 'cake kill --all' will stop all persistent JVMs. you can run it occasionally if you are short on resources
16:26ChousukeBlue-Fox: but they're usable, which is what matters :)
16:26alexykLauJensen: cake runs a jvm per project.
16:26LauJensenalexyk: ah
16:26Blue-Foxclojure isn't OOP, is it?
16:26alexykLauJensen: you have to discipline your consumption of jvms :)
16:26LauJensenBlue-Fox: http://clojure.org/rationale
16:26ChousukeBlue-Fox: Not the classes-and-inheritance kind of OOP anyway
16:26ninjuddi regularly have 10 running and don't even notice
16:26ChousukeBlue-Fox: I'd say it's mostly functional and interface-oriented :P
16:27ninjuddwe played around with having them stop automatically when idle
16:27LauJensenalexyk: I would see the point if it had a very intelligent way to handle classpath, so that one instance could be used throughout the day
16:27ninjuddi could pick that back up if it is a widespread concern
16:27Blue-FoxLauJensen and Chousuke: thanks
16:27alexykninjudd: wait until you do data mining with 30 GB per JVM. I guess using -Dcake,project will be handy in case you don't care about resuing JVMs
16:27alexykreusing
16:27Blue-Foxgood night
16:27LauJensennight
16:27alexykninjudd: simply an option to reuse a jvm will be fine
16:28alexyklike, in project.clj, :cake-jvm-from "path"
16:28ninjuddprojects can't really share JVMs safely
16:29alexyk:cake-insafe-jvm-from :)
16:29alexykunsafe
16:29alexykor just reuse global
16:30LauJensenninjudd: well... not easily
16:30alexyki.e. then you "merge" you project dir to that of a parent project, virtually; same effect as if you merge their src/ dirs
16:30alexyklast proj wins
16:30ninjuddi really don't think multiple JVMs will be a problem
16:31ninjuddi could add an option in ~/.cake/config: max_jvms = 10
16:31ninjuddand it could stop inactive JVMs if you exceed that
16:37cryptic_starhi all, I have a question about lein-clojars...it looks like it should be able to push to a specified remote repository using similar syntax to scp, so "lein push <username>@<server>:<path>", but I continuously get auth failures, despite having generated keys with lein keygen and placed them on both the host and remote server - any idea what's up?
16:38ninjuddalexyk: or .cake/config: inactive.shutdown = 30 # minutes
16:39alexykninjudd: what I care about is not max number of JVMs, but having a ver beefy one with lots of RAM. But probably I shouldn't have more than one anyways.
16:39alexykI'd probably like reusing the fat one for some unrelated namespaces
16:39alexykninjudd: how about that, reuse for nonoverlapping namespaces?
16:39LauJensenninjudd: I understand cake works with gems, whats their story on linux/osx/windows?
16:40alexykLauJensen: gems work everywhere
16:40alexykbetter portability than bash
16:41LauJensencool
16:41dakronecryptic_star: does pushing with scp instead of lein work?
16:41ninjuddcake *mostly* works on windows
16:41LauJensenargh there it came
16:41LauJensenI was just about to say 'thats the first piece of software Ive heard works on windows'
16:41alexykninjudd: do you mean Windows as in cmd or PowerShell, or under cygwin?
16:41ninjuddcryptic_star: is your key in .ssh/id_rsa, .ssh/id_dsa, or .ssh/identity?
16:41alexykLauJensen: it will work on Windows, or we invade Denmark.
16:42LauJensenNo problem, I could do with a vacation on Hawaii :)
16:42cryptic_star@ninjudd my key is in ./ssh/id_rsa
16:42LauJensenWe've been invaded before, we know the drill
16:42alexykLauJensen: there's a Microsoft presence there, that's why we'll invade it :)
16:42cryptic_star@dakrone I have not tried using scp - was hoping to get it to work with lein first, but that might be a good indication
16:42ninjuddLauJensen: there are two open issues that i'm working on, but it wasn't very hard at all to get it running on windows
16:43alexykHawaii, of course, is where Microsoft folks vacation, too
16:43dakronecryptic_star: jssh doesn't pick up settings in ~/.ssh/config, so if you have any there it may not work
16:43LauJensenninjudd: One of my major objections to lein, is that it has no Windows story yet
16:43alexykninjudd: so, cygwin or plain cmd shell? should it need any changes under cygwin?
16:43lancepantzalexyk: cmd
16:43ninjuddLauJensen: Windows was one of the primary reasons we chose Ruby instead of bash
16:44alexyklancepantz: so cygwin should be ok?
16:44lancepantzalexyk: yeah, i don't think anyone has tried it yet though
16:44cryptic_starso scp did work
16:44LauJensenninjudd: Good pick
16:44ninjuddalexyk: plain shell. cygwin should work too though
16:44alexyklancepantz: I will next time I reboot my MBP into Windows 7. I share Maven repo across the Mac and Windows partition.
16:44alexykI share the cake git repo too :)
16:45ninjuddcryptic_star: if you're feeling adventurous, cake has a built in release task that pushes to clojars
16:45alexykwith Java-based stuff, you can reuse most of it. I can run IDEA on both.
16:45alexykninjudd: lancepantz are you guys aware of PowerShell? very cute
16:45lancepantzalexyk: heh, did you have to buy two licenses? :)
16:45cryptic_star@ninjudd Ahh, I see you're pushing your project? :)
16:46alexyklancepantz: IDEA is now open-source in Community Edition, which has Maven and Git and Clojure plugins
16:46cryptic_star@ninjudd I'll take a look at it actually, looks cool
16:47alexyklancepantz: you can git clone idea and enjoy the power of git on 70 MB checkout
16:47lancepantzalexyk: ah, had no *idea* :)
16:47alexyklancepantz: well, you get the *idea* now :)
16:47lancepantzalexyk: when did this happen?
16:48alexyklancepantz: a while back, six months or so
16:48ninjuddcryptic_star: cool. still prerelease, so let me know if you have problems (either here or in #cake.clj)
16:48alexykjetbrains.org
16:48LauJensenninjudd: how incompatible are you guys with lein ?
16:48cryptic_star@ninjudd definitely, I'll let you know
16:48cryptic_starthanks all
16:52lancepantzLauJensen: the main thing is we do not allow you to change the directory structure
16:52lancepantzyou have to use /src /test /lib
16:52LauJensenso lein plugins etc work with cake as well ?
16:52lancepantzand tasks are incompatible as well
16:52lancepantzthey do not
16:52LauJensenok
16:53LauJensenDo you export pom files?
16:53lancepantzyes
16:55LauJensenSounds like you've guys have put a lot of work into this, I look forward to taking it out for a spin
16:57herdrickhi - is there a function for writing objects? i.e. making a representation of them that the reader can read?
16:57ninjuddLauJensen: awesome! we'd love to hear your input once you take a look
16:58LauJensenninjudd: If I can get your stuff to run on all 3 OS's I expect to blog about it - if I have critique I'll come to you guys directly :)
17:09alexykdnolen: so in case there's no selection, something better should be pringted by eval than a giant error roll :)
17:09alexykprinted
17:10raekherdrick: I've heard some discussions about a reader syntax for records
17:11herdrickraek: ok
17:11raekit's probably somewhere in the google group archives
17:11raekthat is all I know
17:11herdrickbut how about a function for writing the objects that already have a readable syntax?
17:12raekfor most simple cases (especially when you don't need type polymorphism) maps are sufficient
17:12raekwhat do you mean by "object"?
17:12herdrickhow to write this: ["foo" ["bar" "bazz" 3]] for example (using a function that works on other things, too)
17:12raekthere is the pr* family
17:12LauJensen,(prn {:one 2 :three 4})
17:13raekpr prn
17:13clojurebot{:one 2, :three 4}
17:13raeketc
17:13raekit is similar to the __repr__ of python
17:13herdrickright, those write to System.out
17:13raekyes, you can use pr-str to get it in a string
17:13LauJensenherdrick: they write to *out* which can be rebound
17:13LauJensen,(with-out-str (prn {:one 2 :three 4}))
17:13clojurebot"{:one 2, :three 4}\n"
17:13raekor wrap it in (binding [*out* some-other-print-writer] ...)
17:14LauJensen~source with-out-str
17:14LauJensenWhich is what goes on there
17:14raekpr* works for all clojure data structures and scalars
17:14herdrickok, that's what I'm looking for, thanks folks. shouldn't that be a core function?
17:14raekit is
17:15herdricknot prn
17:15herdrickprn surrounded with "with-out-str"
17:15raek,#'prn
17:15clojurebot#'clojure.core/prn
17:15herdrickthat's what i suggest
17:16chouser,(pr-str ["foo" ["bar" "bazz" 3]])
17:16clojurebot"[\"foo\" [\"bar\" \"bazz\" 3]]"
17:16raek,(prn-str ["foo" ["bar" "bazz" 3]])
17:16clojurebot"[\"foo\" [\"bar\" \"bazz\" 3]]\n"
17:16raekthe -n is for new line
17:30Lajla->(let [[I worship his shadow] '(+ 1 2 3)] (I worship his shadow))
17:30sexpbotjava.lang.IllegalArgumentException: Wrong number of args (3) passed to: Symbol
17:33chousertry (list + instead of '(+
17:36bmaddyHi all. Does anyone have any good tutorial recommendations for getting clojure running on app engine?
17:37bmaddyThere seems to be a few out there--just curious if there's one that's better than the others.
17:51dnolenalexyk: noted
17:56apgwozbmaddy: http://compojureongae.posterous.com/
17:57bmaddyHey, thanks! I'll check that one out! (gotta run right now though)
18:04bortrebwhats the right way to use duck-streams -- I have (ns rlm.twitter (:use [clojure.contrib duck-streams def])) but I can't use the namespace at all wth clojure 1.2. it says spit already refers to: #'clojure.contrib.duck-streams/spit in namespace: rlm.twitter
18:05apgwozbortreb: i've seen that warning too.
18:05chouserI always recommend against naked :use like that
18:05bortrebthen what's the right way to use it
18:06chouserI generally prefer (:use [clojure.contrib.duck-streams :as ds :only []] [clojure.contrib.def :as def :only []])
18:07chouserthe :only [] parts mean no names are brought into your namespace automatically (though you can add specific ones in those :only vectors if you want to)
18:07chouserthe :as ds means you can say (ds/reader ...) or whatever.
18:07chouserthough on 1.2 you might prefer clojure.io
18:08apgwozchouser: is the issue that 1.2 has it's own `spit`?
18:08bortrebyes
18:09apgwozcool. i figured as much, but didn't worry about it since it still worked.
18:09chouser(ns foo (:use [clojure.java.io :as io :only []])) .... (io/reader ...)
18:10bortrebI've recently found that it's extremely inconvienent to use clojure to show my friends anything, because I have to use all these namespaces everywhere. It also is a barrier to making short scripts when more than half the file us a bunch of header junk.
18:11bortrebI have my own custom namespace with everything loaded which helps a little
18:11bortrebbut it's stiill hard to do scripting
18:11bortrebanyone else have this problem?
18:13raekbortreb: does this occur in clojure for you more often than in other languages?
18:14bortreboh yeah -- a specific example is my friend and I working on an ardunio -- we needed to go through a file and do a semi complicated regex replace
18:14technomancyit happens more in clojure than ruby since in ruby if you're in a nested module you can reach into the outer modules relatively
18:15bortrebin perl I'd just put a nice short shebang line, OPEN the file, regex replace, and be done with it
18:15technomancyit would be like being in clojure.contrib.condition.foo and being able to refer to stuff in c.c.condition without qualification
18:16bortrebclojure is more elegant and would be nicer, but it's ~7-8 seconds of starting a repl, making sure the jars are in the right place, using duckstreams and str urils and repl utils
18:18raekcorrect me if i'm wrong, but I think that scripting was not a primary design goal for clojure
18:18chouserbortreb: yeah, clojure is not (currently) well suited for the kind of dash-one-off command-line scripts that perl always excelled at.
18:18aria42Anyone remember these neat reduce macros which people were posting a week or so back, which removed some of the boiler from a standard reduce?
18:18aria42Anyone have a link to a gist?
18:18chouserbortreb: but it doesn't have to remain that way...
18:19polypusrecommended way of loading a clojure file from java?
18:19raekhowever, cljr should make it simpler to do one-off repl sessions that need libraries
18:19danlarkinaria42: the channel is logged, check le goog
18:19technomancyaria42: http://github.com/Seajure/reducate
18:19bortrebI don't see why not -- the actual, usefull content of the core of the program is actually shorter than perl
18:19bortrebbut that stupid java-like verbose setup at the start just kills it
18:19aria42technomancy: thanks! exactly what I was thinking of
18:20raekcljr sort of has the same package model as perl, python and ruby -- a central repository of installed packages
18:20bortrebI always feel like I'm fumbling around whenever I'm "on the spot" and want to show someone something
18:21raekI heard that cake could be used to make short commands in a persistent jvm
18:21raekso there isn't the jvm startup delay between invokations
18:22raek(hrm, invoKe - invoCation)
18:22polypusbest way to execute a clojure file from within java?
18:23polypusis there a best practice way of doing it that's unlikely to change out from under me?
18:23bortrebhmmmm I'll look into cake. it sounds like nailgun, but you run into problems when for example you're showing someone your cool clojure graphics dsl, something screws up, and you have to do killall -KILL java
18:24bortrebbut maybe that's more a problem with the jvm itself
18:24raekbortreb: http://github.com/ninjudd/cake
18:24raekit hangs?
18:25bortrebbut how bad would it be to have some ns option that is just "use EVERYTHING clojure can do right now" and be done with it
18:25bortrebthe shebang line can be made short enough already
18:26raekI guess the problem lies in "EVERYTHING clojure can do"... which libraries does this include?
18:26raek...and which version?
18:26raek-s
18:26bortrebeasy -- everything in contrib that's not duplicated in core
18:26bortrebif you want something else then you use it like normal
18:27bortreb(ns fast-script (:use :all))
18:27raekcontib is not an official part of clojure, merely a collection of neat things
18:27raekI guess it would possible to do such a macro
18:29raekmy experince with what I need from contrib seems to be quite different from yours
18:29bortrebI think such an extention could extend clojure in a whole direction, because
18:30bortrebthen it would be shorter than the equivalent perl script
18:30raekthe only contrib lib I use often is c.c.def
18:30raekfor scripting, this makes sense...
18:31raekbut I have a hunch that the majority of the clojure projects are not scripts, so this might be the reason the default is the way it is
18:32raekmaybe one could do a (cljscript) macro that one puts at the top of the file, when one wants to quickly make scripts
18:33bortrebhowever, the impedance against "getting up and running" could be a lot lower and would make it more flexible
18:35bortrebhow hard would it be to get something like this added to (ns)
18:35raekpolypus: it can be done with some method of the clojure.lang.RT class, but maybe there is a more straightforward alternative nowadays
18:35bortrebsomething like (ns whatever :script)
18:36bortrebno I mean into the language itself
18:36bortrebit'd help a lot when explaining to people too; I could just say "put :script" at the top and now let's focus on the algorithms
18:37raekare there many algorithms that depend on contrib?
18:37bortrebone of the hardest things when starting out really is actually getting things to *do* something: opening files, writing to files, using urls, etc
18:38bortrebwhen you already don't know what you're doing, it's really hard to discover this stuff *and* figure out how to use it.
18:39bortrebat least, in my experience trying to teach people clojure
18:39raekI guess that the current philosophy is that only the least common denominator should be in clojure.core
18:40raekif one does not want to use io, it should not be loaded
18:40raekmaybe this is a topic for the google group
18:40bortrebI'd love to bring it up! how do I do that?
18:41raekjust post an email to the clojure gooogle group
18:41polypusraek: ty. just looking through the source, it looks like Compiler.loadFile does it
18:41raekjoin here: http://groups.google.com/group/clojure
18:41raekpolypus: don't know how stable that is, though
18:42polypusyeah. that was my concern. oh well. if it changes, i'll just have to change it
18:43raekI guess the gen-class thingy could be used too
18:44polypusactually, looks like RT.load might be a better bet
18:45lancepantzpolypus: you will have to use genclass and compile it using core/compile before hand
18:45lancepantzafaik, you can't load a clj file in java as they require a different classloader
18:46polypuslancepantz: what will i have to compile?
18:46lancepantzthe ns you wish to access from within java
18:47polypuslancepantz: really. that would suck
18:48lancepantzpretty sure
18:48polypusi'll mess around a bit and see what i can pull off
18:50dpritchetti saw a sticky note on a coworker's wall this morning that said "startrepl.sh"... I excitedly asked him what it meant and he told me it was a batch job to replicate his SQL Server database :(
19:36polypusanyone know with some certainty, how to load a clojure file from java, in such a way as to then have access to the vars and namespaces in that file and files required by that file through RT.var(ns, name)?
19:37polypuslancepantz suggested that i need to AOT the clojure, but wasn't 100% sure
19:37aretepolypus: check out http://github.com/clojure/clojure/blob/master/src/jvm/clojure/main.java, that's basically waht it does
19:39polypusthanks arete
19:40aretenp, wrote a little application loader using those APIs, works great =)
20:01bortreb,(time (doall (pmap (fn [_] (Thread/sleep 500)) (range 10))))
20:01clojurebotjava.lang.Exception: No such namespace: Thread
20:02bortrebwell, anyway , if you replace (range 10) with (doall (take 10 (iterate inc 0))) it takes twice as long, how could it possibly do that, given that pmap is a function?
20:24drsnyderi'm looking for help on a simple function to read in lines from a file and return a sequence
20:26drsnyderhere is the function: (defn f-to-seq[file] (with-open [rdr (java.io.BufferedReader. (java.io.FileReader. file))] (let [seq (line-seq rdr)] seq)))
20:26Raynes(doc line-seq)
20:26clojurebot"([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."
20:26drsnyderwhen I run this in the repl, i get java.lang.RuntimeException: java.io.IOException: Stream closed (NO_SOURCE_FILE:0)
20:27dnolendrsnyder: because you're using with-open, that's closing the file when it leaves scope.
20:27Raynesdrsnyder: What version of Clojure are you using?
20:28drsnyder1.1.0
20:28dnolenbindings and lazy-sequences are not designed to interact together
20:28drsnyderoh, interesting. if i understand correctly, you need to read it into a sequence and return that
20:30drsnyderany hints on how to do that?
20:32tomoj(doall (line-seq rdr)) would work
20:32dnolentomoj: that still won't close the file.
20:32dnolenthat's why line-seq takes a reader and not a file
20:33dnolenyou need to hold onto to close it yourself when you've exhausted the sequence
20:34tomojcouldn't you do (with-open [file (FileReader.) rdr (BufferedReader.)] (doall (line-seq rdr))) ?
20:34tomojer
20:34tomojexcept pass the file param, obviously
20:34dnolentomoj: oh sorry I misunderstoood, yes yes, if you want to just read the whole file at once.
20:35tomojbut that's already implemented in contrib anyway
20:36tomoj(doall (clojure.contrib.io/read-lines "filename")) ?
20:36dnolendrsnyder: one clever trick would be to put the file handle on the lazy sequence as metadata I think. then when the sequence is exhausted you can get the metadata and close the file.
20:36dnolenthis way you get all the benefits of lazy file processing
20:37drsnydergiving doall a try
20:38tomojdnolen: so someone calling f-to-seq opens up the metadata of the return value to find the file handle to close?
20:39dnolentomoj: I think that would work.
20:39tomojagreed
20:39tomojbut isn't it a bit strange?
20:39dnolenI never tried this myself but it just occured to me.
20:39tomojit sounds like using metadata to simulate multiple return values
20:39dnolentomoj: why, if you want to process the sequence efficiently?
20:39drsnyderthis worked: (defn f-to-seq[file] (with-open [rdr (java.io.BufferedReader. (java.io.FileReader. file))] (doall (line-seq rdr))))
20:40dnolenmemory efficiently. doall puts the whole file in memory.
20:40tomojbut why not return [the-seq the-file-handle]
20:41tomojthen people will have to deliberately ignore part of the return value instead of being able to just let file handles rot away in metaspace
20:43dnolentomoj: ah, true. auto closing line-seq would be nice, eh?
20:44tomojisn't that clojure.contrib.io/read-lines?
20:45tomojdrsnyder: but that will still leave the FileReader open, won't it?
20:45tomojmaybe I misunderstood dnolen
20:45drsnydertomoj: i don't think so
20:45drsnydertomoj: i think with-open will close it when you leave scope
20:46tomojwith-open closes the BufferedReader
20:46tomojdoes the BufferedReader then close the FileReader itself?
20:47tomojfairly easy to test, will do
20:48dnolentomoj: oh yeah, yr right read-lines. my ignorance of contrib is sometimes profound.
20:48tomojit looks like it does close the FileReader
20:49tomojso that will work if you are OK with having the whole file in memory at once
20:52dnolentomoj: read-lines is lazy
20:53tomojso is line-seq?
20:54dnolentomoj: but it doesn't close once exhausted
20:54tomojexactly
20:55tomojyou wanted a non-lazy autoclosing line-seq?
20:56dnolendrsnyder: clojure.contrib.io/read-lines might be what you want, it'll close the file for you once you've read all the lines from the file. you can avoid the doall
21:03tomojas long as you actually are sure to read the whole file
21:12dsantiagodnolen, I was checking out your textmate/cake integration earlier. I don't know much about how Textmate bundles work, but do you think it will be possible to have a persistent repl you can type into, instead of a window that pops up?
21:13dnolendsantiago: hmm ... not sure how that would work, also pretty un-TextMate-ish, right? I usually startup a REPL in Terminal.app and keep it open.
21:13dnolendsantiago: thx for trying it out.
21:14dsantiagoOh, well, sending stuff to a repl in a terminal would be even better, but I didn't think that was possible from the way it worked.
21:16dnolendsantiago: I'm open to ideas. Just don't know how to get the output to actually appear in a REPL in Terminal.app. I've never used a TextMate bundle that worked liked that.
21:16dnolendsantiago: to be fair, Emacs isn't much better, you get the output of eval last sexpr in the mode line
21:17dsantiagoOh, OK. I'd love to use TextMate, but I've gotta have that repl integration from Slime, so I can send it a function I'm working on, and then run some test code by hand at the repl that uses it.
21:18dnolendsantiago: then why not keep the Terminal.app REPL open? That's what I've been doing. Eval in TextMate, test code REPL in Terminal.app
21:19dsantiagoHm, I'm not sure I understand. What I want is something like C-c C-c and C-c C-k in Slime.
21:19dnolendsantiago: C-c C-k loads the whole file. You get that in TextMate with Shift-Command-K
21:20dsantiagoRight, but it just gives you the output in the popup window, it doesn't send it to the repl in the Terminal.
21:20dnolendsantiago: it does get sent
21:20dnolendsantiago: just cake repl, and all your code will be there
21:20dsantiagoOh, hm. I did, it wasn't working.
21:20dsantiagoI must have something wrong.
21:20dsantiagoThat was what I thought was supposed to happen, but it wasn't.
21:21dnolendsantiago: you have to make sure you're in the right namespace for one. if you have a name filed in a project, you need to switch into that namespace in the REPL
21:21dnolens/name filed/named file
21:22dnolendsangtiago: at some point I'll look into making this magically work with AppleScript or something, but that's not a high priority. it's early days for this project :D
21:28dnolendsantiagio: cause it check if there's isn't a filename yet
21:28dnoleneval in user ns if no path to file
21:28dnolendsantiago: http://github.com/swannodette/textmate-clojure/blob/cake/TODO.txt
21:28dnolenthose are my immediate plans
21:28dsantiagoOh, hm. Maybe I should file that then.
21:30dnolendsantiago: please do. I'd like to fulfill a reasonable amount of the slime expectations.
21:32tomojdnolen: are you planning to write the sexp stuff inside textmate or using an external library somehow?
21:33dnolentomoj: the bundle is basically pure Clojure. the bundle just executes clojure scripts by submitting them to cake
21:33dnolentomoj: means people don't have an excuse for not contributing :D
21:33dsantiagoHow much control is there over the windows TextMate pops up?
21:33tomojnifty
21:33dnolendsantiago: unknown, this is my first remotely serious bundle.
21:34dsantiagoOK, I know even less about it. :)
21:34dnolendsantiago: I believe it's a webkit window, so some JS might do the trick. will investiage.
21:34tomojtextmate 2 didn't come out while I was away, did it?
21:35dnolentomoj: nope. I'm not holding my breath either. but that doesn't seem to phase the gigantic userbase.
21:36dsantiagoOh, I just meant preventing it from appearing.
21:36dnolenbasically why I left for Emacs. Emacs caught up.
21:38dnolendsantiago: it's something for me to look into. that some people just don't want that window and they should be able to suppress it. of course it easy for you just to tweak the bundle. Just discard the output of the commands you don't care about in the Bundle Editor for the Clojure mode. Of course this will break for you until things settle down as new versions roll out, unless you setup a fork.
21:43dsantiagoOK, thanks dnolen. I'll see what I can do.
21:50dnolendsantiago: thx for the feedback and trying it out.
21:56tomojdnolen: you left for emacs, but you're building a TM bundle?
21:57dnolentomoj: yup. because Emacs and Java IDEs are just too much of a hurdle for most people. I think good TM integration would get a lot more people to try it out. And from what response I've gotten seems like people unwillingly left TM for Emacs because of Clojure.
22:04tomojadmirable cause
22:05RaynesToo bad TM isn't cross-platform. I can't even try it.
22:05dnolenRaynes: eh, if you're already on Emacs I don't see the point ;) I'm just trying to widen the potential audience.
22:06RaynesStill.
22:30vIkSiThi all
22:30vIkSiTif i've got a list like ("a" "b") - is there a way to combine all the elements (which are strings), separated with spaces?
22:31vIkSiTfor instance, (apply str ("a" "b")) results in "ab"
22:31vIkSiT(and i'm looking to get "a b")
22:34spewn,(apply str (interpose \space ["a" "b"]))
22:34clojurebot"a b"
22:35lancepantzthere is also a join function in contrib.string, but i always use interpose as well
22:35vIkSiTah
22:35vIkSiTthanks, let me check it out!
23:53bmaddyHas anyone else gotten compojure to work?
23:57arbschtbmaddy: yes. and you'll find some more at #compojure :)
23:58bmaddyOooh, good call--I'll head over there for those questions. :)