2010-08-10
| 00:05 | mebaran151 | igms, if you haven't check it out MessagePack has awesome rpc over tcp and udp built on netty |
| 00:06 | mebaran151 | really easy to use from clojure too |
| 00:06 | mebaran151 | with all the new deftype and defprotocol magic |
| 00:11 | vIkSiT | hi all |
| 00:11 | vIkSiT | can you run lein swank on a different IP address than 127.0.0.1? |
| 00:11 | vIkSiT | on the website, I see a "lein swank [PORT=4005] [HOST=localhost]" |
| 00:11 | vIkSiT | but in practice, i see : Exception in thread "main" java.lang.NumberFormatException: For input string: "PORT=4005" (NO_SOURCE_FILE:1) |
| 00:14 | lancepantz | vIkSiT: you don't specify a key |
| 00:14 | vIkSiT | lancepantz, sorry? |
| 00:14 | vIkSiT | a key? |
| 00:15 | lancepantz | just lein swank 4006 localhost |
| 00:15 | vIkSiT | aah |
| 00:15 | mebaran151 | hey lancepantz, you get a chance to abuse my egregious hack |
| 00:15 | vIkSiT | ah ok looks like this works :) |
| 00:16 | vIkSiT | lancepantz, hmm for some reason, i can't connect remotely to a lein swank on say, 192.168.1.111 |
| 00:17 | vIkSiT | I'm guessing there's a port vs localport issue. |
| 00:18 | lancepantz | vIkSiT: dunno |
| 00:19 | lancepantz | mebaran151: i have not, i had to restart this morning, can you send me the link again? |
| 00:19 | mebaran151 | np |
| 00:20 | mebaran151 | http://gist.github.com/516658 |
| 00:21 | Voting | what are the cooliest things that you folks have done with it? |
| 00:21 | Voting | why is it getting more popular? |
| 00:21 | mebaran151 | vIkSiT, are you forwarding 4005? |
| 00:21 | mebaran151 | sounds like a port forwarding problem |
| 00:24 | vIkSiT | mebaran151, hmm no i'm not actually |
| 00:25 | vIkSiT | i'm trying ot figure out whether using lein swank is possible remotely.. |
| 00:25 | vIkSiT | i thought the port was firewalled - and now i can connect to the swank server, but for some reason, i get an error |
| 00:25 | vIkSiT | (a java stacktrace) |
| 00:27 | mebaran151 | what's it say |
| 00:28 | mebaran151 | I've connected lein swank remotely actually |
| 00:28 | mebaran151 | it's pretty sweet deal |
| 00:28 | Voting | is it easy for java to call clojure? |
| 00:30 | mebaran151 | what's your java stack say? |
| 00:30 | mebaran151 | that sounds like a deployment issue |
| 00:31 | Raynes | vIkSiT: It's definitely possible. I used to run sexpbot over a swank server remotely on Licenser's server (only reason I stopped is because of some weird error that we're too lazy to figure out). |
| 00:32 | vIkSiT | ah |
| 00:32 | vIkSiT | mebaran151, raynes - i've gotten most stuff to work now. except, how did you guys handle compilations remotely though? |
| 00:33 | vIkSiT | i don't know what the java issue was. i just restarted swank and it worked fine |
| 00:33 | mebaran151 | what do you mean by compilations? |
| 00:33 | mebaran151 | C-c C-k will do what you expect |
| 00:33 | vIkSiT | mebaran151, the C-c C-k shortcut |
| 00:33 | vIkSiT | hmm no it doesnt |
| 00:33 | mebaran151 | how do you mean? |
| 00:33 | vIkSiT | ah wait. I'm using tramp to connect to that file |
| 00:33 | vIkSiT | i'm guessing thats whats causing that issue |
| 00:34 | vIkSiT | how do you access the remote files using emacs/slime? |
| 00:34 | vIkSiT | (without using tramp) |
| 00:34 | vIkSiT | I can see that Cc Ck gets stymied by this : error: java.io.FileNotFoundException: /scp:servername:/path/to/file |
| 00:35 | vIkSiT | mebaran151, ^ |
| 00:36 | mebaran151 | oh it looks like scp isn't work quite right |
| 00:36 | vIkSiT | yes.. |
| 00:36 | vIkSiT | not sure if swank-clojure supports that |
| 00:36 | mebaran151 | do you have ssh installed on the server |
| 00:37 | vIkSiT | yeap |
| 00:37 | mebaran151 | with scp enabled et al |
| 00:37 | vIkSiT | oh yes, i'm able to acess the files and all |
| 00:37 | vIkSiT | its just Cc Ck that fails |
| 00:44 | mebaran151 | hmmm, it's been a while since I got it running |
| 00:45 | mebaran151 | I might have just been using C-c C-e |
| 00:45 | mebaran151 | that's guaranteeed to work |
| 00:45 | mebaran151 | you can evaluate the forms you want to redefine |
| 00:47 | mebaran151 | apparently you have to tunnel it over ssh |
| 00:47 | mebaran151 | and the file has to be edited with tramp |
| 00:48 | vIkSiT | mebaran151, you mean Cx Ce |
| 00:48 | vIkSiT | yes that works |
| 00:48 | vIkSiT | but a long program - i'll have to go to each expression and Cx Ce! |
| 00:48 | mebaran151 | yeah C-x C-e |
| 00:48 | mebaran151 | haha |
| 00:48 | mebaran151 | you could wrap them all in a giant do |
| 00:49 | mebaran151 | I mean that's so hack I regret telling you it |
| 00:49 | vIkSiT | hehehehe |
| 00:49 | vIkSiT | ok thats EXACTLY what i was tyring |
| 00:49 | vIkSiT | but this is interesting |
| 00:49 | mebaran151 | where is the file you're editing |
| 00:49 | mebaran151 | is it remotely located or local |
| 00:49 | vIkSiT | (do (map prn [1 2 3]) (map prn [5 6 7]) (map prn [0 1 0])) |
| 00:50 | vIkSiT | why does this only evaluate the last expression? |
| 00:50 | mebaran151 | You never used the results of the others |
| 00:50 | mebaran151 | laziness caught you |
| 00:50 | mebaran151 | doall the others |
| 00:50 | vIkSiT | aah |
| 00:50 | vIkSiT | so how should this be wirtten? |
| 00:50 | mebaran151 | (do (doall (map prn [] ....) |
| 00:51 | vIkSiT | hmm |
| 00:51 | mebaran151 | http://lisp-book.org/contents/ch18.html#id2565666 |
| 00:52 | mebaran151 | there's also a slime-tramp module |
| 00:53 | mebaran151 | http://common-lisp.net/projects/slime/doc/html/Setting-up-pathname-translations.html |
| 00:54 | vIkSiT | aha |
| 00:54 | vIkSiT | interesting |
| 01:10 | vIkSiT | hmm has anyone here actually used slime-tramp? |
| 01:11 | vIkSiT | I'm not even sure how to install it |
| 01:12 | vIkSiT | mebaran151, have you used it btw? |
| 01:35 | bartj | how does one go about importing all the classes in a java package? |
| 01:35 | bartj | (:import java.util *) doesn't work |
| 01:36 | bartj | neither does (:import java.util.*) |
| 01:36 | eyeris | I'm just getting started with compojure. I've figured out binding forms for routes on GET requests. I can't find any documentation on how to get all POST params though. |
| 01:36 | eyeris | Most of the examples I find online are for 0.3.2 |
| 01:37 | eyeris | Meanwhile the compojure.org/routes-in-detail.html doesn't cover POST routes |
| 01:38 | eyeris | bartj: you are looking for (:use) |
| 01:39 | eyeris | (ns my-ns-name (:use java.util)) |
| 01:39 | eyeris | ,(ns my-ns-name (:use java.util)) |
| 01:39 | clojurebot | java.io.FileNotFoundException: Could not locate java/util__init.class or java/util.clj on classpath: |
| 01:39 | eyeris | Oh wait, nvm, it's late. |
| 01:39 | eyeris | I don't think you can do what you are trying to do |
| 01:39 | lancepantz | eyeris: they come in as an InputStream under :body |
| 01:40 | bartj | hmm, why not ? |
| 01:40 | eyeris | lancepantz: What do you mean by "under :body"? |
| 01:41 | bartj | it seems very odd that I just can't seem to import all the java classes in a package ? |
| 01:42 | lancepantz | they are under the :body key in the request map |
| 01:42 | eyeris | bartj: if you're coming from the Java world, then it probably does seem strange. |
| 01:42 | lancepantz | so your route looks like (POST "/blah" {body :body} (do stuff)) |
| 01:42 | bartj | ok |
| 01:43 | eyeris | (POST "/test-post" {body :body} (slurp body)) ;does not work |
| 01:44 | eyeris | bartj: once you get used to clojure, most of your code will be in clojure, and your desire to import java classes will decline |
| 01:44 | lancepantz | (POST "/blah" {body :body} (println "keys:" (-> body read-lines first keys))) |
| 01:45 | bartj | eyeris, you mean I would be writing my own libraries ? :) |
| 01:47 | eyeris | bartj: or using other people's clojure wrappers for common java libs |
| 01:47 | bartj | eyeris, I am using a lot of apache http libraries |
| 01:47 | bartj | specifically org.apache.http.* |
| 01:47 | bartj | not sure if these have clojure wrappers |
| 01:49 | eyeris | lancepantz: that doesn't seem to work |
| 01:49 | eyeris | it prints nil |
| 01:49 | eyeris | despite there being 2 fields in the POST |
| 01:49 | eyeris | (verified via Firebug) |
| 01:50 | lancepantz | (POST "/blah" {body :body :as request} (println "request:" request)) |
| 01:50 | lancepantz | verify you have a body key with an inputstream as its value |
| 01:52 | eyeris | That prints nothing :( |
| 01:54 | lancepantz | afraid i dunno then :/ |
| 01:55 | eyeris | If the map destructuring fails, is the route mismatched? |
| 01:55 | lancepantz | i don't think so, but try this to check (ANY "*" {body :body :as request} ...) |
| 01:56 | lancepantz | eyeris: i have to run, i'd try the mailing list if that doesn't get to the bottom of it |
| 01:56 | lancepantz | gl |
| 01:57 | eyeris | Thanks for your help |
| 02:00 | eyeris | I got it. Since the fields are being submitted at application/x-www-form-urlencoded, it looks like they are in :form-params |
| 02:08 | notsonerdysunny | clojure and openscenegraph .. I am considering using openscenegraph via jni/jna .. it is a scenegraph library in c++ .. do you have any suggestion for an alternative? |
| 02:08 | mebaran151 | vIkSiT, I haven't used slime-tramp |
| 02:09 | bartj | I have a bunch of fields with values and I need to spew them out as XML - which Clojure (xml?) library would be the most useful ? |
| 02:24 | spariev | bartj: there is some xml-related stuff in contrib - http://nakkaya.com/2009/10/10/processing-xml-with-clojure/ |
| 02:26 | bartj | spariev, thanks! |
| 02:40 | amalloy | i'm getting a compiler error i don't understand but i suspect is related to my faulty knowledge of destructuring: |
| 02:40 | amalloy | (defn legal-moves [{{player :to-play |
| 02:40 | amalloy | trick :trick} |
| 02:40 | amalloy | hands :hands}] |
| 02:40 | amalloy | (legal-plays trick (hands player))) |
| 02:40 | amalloy | <C-c C-C yields the following> |
| 02:40 | amalloy | 3 |
| 02:40 | amalloy | [Thrown class java.lang.ArrayIndexOutOfBoundsException] |
| 02:41 | amalloy | oh wow, sorry about spamming there - not used to IRC and thought i could insert line breaks |
| 03:15 | spariev | amalloy: try (defn legal-moves [{{player :to-play trick :trick} :player-trick hands :hands}] |
| 03:15 | spariev | (println player trick hands)) |
| 03:16 | amalloy | yes, thanks - realized just a minute ago that i hadn't given a keyword to the nested map. works just as you suggest |
| 03:17 | spariev | yep, nested destructuring is tricky |
| 03:17 | amalloy | but also *awesome* |
| 03:17 | spariev | indeed :) |
| 03:18 | amalloy | it got a lot more useful earlier today, when i realized i could use :as within destructuring forms, not just the outer level of function parameters |
| 03:22 | amalloy | by the way, is there a way to use macros to pass strings without having to quote them? ideally i'd like a macro that i can call like (mymacro 7a1) and get back "7a1" |
| 03:28 | Chousuke | amalloy: you can convert the symbols to strings |
| 03:29 | amalloy | right, but 7a1 isn't a symbol |
| 03:29 | Chousuke | hm, right. |
| 03:29 | Chousuke | then, no. |
| 03:29 | amalloy | okay. well, a few "s here are there isn't a terrible burden |
| 03:54 | esj | Greeting Parenthesists |
| 04:01 | old_sound | hi, anyone that could help me with some compojure questions? |
| 04:04 | lpetit | Hello all |
| 04:05 | scottj | ,anyone |
| 04:05 | clojurebot | java.lang.Exception: Unable to resolve symbol: anyone in this context |
| 04:08 | old_sound | ? |
| 04:09 | old_sound | where's the description of the protocol for asking questions here? I may have missed that… |
| 04:11 | esj | old_sound: no protocol, its just a bit quiet here in the GMT morning, so nobody may know the answer |
| 04:11 | old_sound | esj: thanks |
| 04:11 | esj | if nobody answers, try again once the US wakes up |
| 04:11 | Chousuke | old_sound: just ask and be patient |
| 04:11 | old_sound | I'm patient, just that I don't get those java lang things… |
| 04:12 | Chousuke | also I think there's a #compojure channel? |
| 04:12 | Chousuke | I might be wrong though. |
| 04:12 | old_sound | there's people there :) |
| 04:12 | spariev__ | old_sound: what version of compojure are you using ? I can try to answer if you are on 0.3.2 |
| 04:12 | old_sound | and yes is for the web framework |
| 04:13 | old_sound | thanks |
| 05:18 | defn | gahhh! my clojure setup in emacs is badly broken |
| 05:18 | tomoj | what did you do? |
| 05:18 | defn | Debugger entered--Lisp error: (file-error "Cannot open load file" "slime-banner") |
| 05:19 | tomoj | hmm |
| 05:19 | tomoj | on `M-x slime-connect` ? |
| 05:19 | defn | no, when i start my emacs |
| 05:19 | tomoj | ouch |
| 05:19 | defn | i put contrib/ into the elpa/slime-2010... folder |
| 05:19 | defn | which has fixed errors like this in the past |
| 05:19 | defn | but no dice |
| 05:19 | defn | slime/contrib that is |
| 05:19 | tomoj | paste what's in your .emacs.d or init.el that's relevant |
| 05:19 | defn | this could take awhile lol |
| 05:20 | tomoj | heh |
| 05:20 | tomoj | well, are you doing something in there which enables the banner? |
| 05:20 | tomoj | I don't have slime-banner either but have no problems |
| 05:20 | defn | yes |
| 05:20 | tomoj | so, "give me banner or give me death" is your strategy? |
| 05:20 | defn | !! yes! |
| 05:20 | tomoj | haha |
| 05:21 | tomoj | ok, well, perhaps try adding contrib/ to your load-path? |
| 05:21 | defn | it should automatically be on the path |
| 05:21 | defn | considering it's under elpa/ |
| 05:21 | defn | it recursively loads |
| 05:21 | defn | or at least it has in the past |
| 05:21 | defn | i took out banner -- another failure |
| 05:23 | defn | :D |
| 05:23 | defn | tomoj: (add-to-list 'load-path (expand-file-name "~/src/org-mode/contrib/lisp")) |
| 05:24 | defn | bah nevermind... |
| 05:24 | tomoj | adding contrib/ didn't even work? |
| 05:24 | defn | nope |
| 05:24 | tomoj | same error? |
| 05:25 | defn | it's complaining about another thing in my org-mode |
| 05:25 | defn | a clojure related thing |
| 05:25 | tomoj | ah |
| 05:25 | defn | interestingly enough |
| 05:25 | tomoj | what, clojure org-babel? |
| 05:25 | defn | yeah |
| 05:25 | defn | :) |
| 05:25 | tomoj | dude |
| 05:25 | tomoj | *high five* |
| 05:25 | tomoj | I just toyed around with clojure org-babel the other day |
| 05:25 | defn | i take notes with org-mode and use org-babel to save snippets in a code diary |
| 05:25 | tomoj | but I gave up because it seems to suck |
| 05:25 | defn | it takes a little getting used to |
| 05:26 | tomoj | I need it to easily use my `M-x slime-connected` jvm |
| 05:26 | defn | the problem is this... |
| 05:26 | defn | in my package.el i have swank-clojure 1.1.0 |
| 05:26 | defn | it doesn't jive with the latest slime, slime-repl, clojure-mode, clojure-test-mode |
| 05:26 | defn | i think |
| 05:26 | tomoj | ah, yes |
| 05:27 | tomoj | the only solution is to patch the clojure org-babel stuff to work with M-x slime-connect, imo |
| 05:27 | defn | how the heck do i fix this it's driving me crazy |
| 05:27 | defn | what about the previous error |
| 05:27 | defn | the one about the slime-banner and stuff |
| 05:27 | tomoj | I couldn't get the org-babel stuff to work because I refused to install swank-clojure.el |
| 05:27 | defn | bah im going to do it |
| 05:28 | defn | why does elpa suck so bad? |
| 05:28 | defn | seriously man - wtf? |
| 05:28 | tomoj | no idea, slime-banner.el is at ~/.emacs.d/elpa/slime-2010.../contrib/slime-banner.el and you added ~/.emacs.d/elpa/slime-2010.../contrib to the load-path but you still got "Cannot open load file" on slime-banner? |
| 05:29 | defn | packages with 2004 release dates? wtf? |
| 05:29 | tomoj | maybe those packages are already perfect :P |
| 05:29 | defn | cant open org-babel-init?! |
| 05:29 | defn | what!? |
| 05:32 | defn | tomoj: im adding it explicitly now |
| 05:32 | defn | ive never had to in the past, but we'll see i guess |
| 05:34 | defn | tomoj: M-x slime => eval-buffer: Symbol's function definition is void: define-slime-contrib |
| 05:35 | tomoj | you're doing `M-x slime` to try to make sure org-babel can start a jvm? |
| 05:52 | defn | no |
| 05:52 | defn | i just run slime sometimes |
| 05:52 | defn | without a project |
| 05:55 | tomoj | the horror |
| 05:55 | defn | heh |
| 05:56 | tomoj | what is it about swank-clojure.el that doesn't work with latest elpa slime/slime-repl? |
| 05:56 | defn | not sure tbqh |
| 05:56 | tomoj | I would think they wouldn't screw eachother up |
| 05:56 | defn | swank-clojure is quite dated |
| 05:56 | defn | 1.1.0 is Ye Olde compared to how things are done now |
| 05:57 | defn | i think it might be a mixture of the new clojure-mode and swank-clojure |
| 05:57 | tomoj | how does swank-clojure.el make it so that `M-x slime` does a clojure slime, anyway? |
| 05:57 | defn | but this is probably a question for phil |
| 05:57 | defn | i configured it as such tomoj |
| 05:57 | tomoj | with slime-lisp-implementations or whatever? |
| 05:58 | defn | ill gist it |
| 05:59 | tomoj | my solution to the same problem with different symptoms: never use `M-x slime`, use `cljr swank` instead, patch clojure org-babel stuff to work with How Things Are Done Now |
| 05:59 | defn | http://gist.github.com/517017 |
| 05:59 | defn | ^^ |
| 06:00 | defn | tbqh ive never liked using elpa |
| 06:00 | defn | you get locked in at an old ass version of everything |
| 06:00 | tomoj | awesome, repl helper |
| 06:00 | defn | :) |
| 06:00 | tomoj | with technomancy's patched package.el I haven't been locked in |
| 06:01 | defn | i have the patched package.el |
| 06:01 | tomoj | well, yeah |
| 06:01 | defn | what is so great about it? |
| 06:01 | tomoj | locked in until an update is pushed |
| 06:01 | defn | if that's the case then why is swank-clojure at 1.1.0 |
| 06:01 | defn | i thought it was at 1.3.0-SNAPSHOT or something |
| 06:01 | tomoj | because it's deprecated |
| 06:02 | tomoj | I think it forked to a new project, too |
| 06:02 | defn | lein-swank was deprecated |
| 06:02 | defn | swank-clojure is around for good |
| 06:02 | tomoj | swank-clojure.el remains in the swank-clojure repo only so that people's stuff doesn't break, but won't be worked on anymore |
| 06:02 | tomoj | swank-clojure as a clojure dependency is around for good |
| 06:02 | tomoj | swank-clojure.el is dead |
| 06:03 | tomoj | and so no reason to push elpa updates of the swank-clojure package |
| 06:03 | defn | ahhhh |
| 06:03 | defn | how did i miss all of this happening? heh... things have been working great for ages |
| 06:03 | tomoj | my problem is that org-babel requires swank-clojure and seems to be intertwined with it |
| 06:03 | defn | and then it just all exploded |
| 06:03 | defn | tomoj: yeah :( |
| 06:03 | tomoj | me too |
| 06:04 | tomoj | I'm puzzled by the contrib problem too, though |
| 06:04 | lpetit | silly question: has the "client side" part of slime/swank been ported to clojure ? |
| 06:05 | tomoj | I don't think so |
| 06:05 | tomoj | someone was asking about that before |
| 06:05 | lpetit | maybe me :) |
| 06:05 | tomoj | and the only answer I saw was that someone else tried to do that and gave up because the swank protocol is undocumented |
| 06:05 | tomoj | oh |
| 06:06 | lpetit | 'cause then swank / slime could have been used by anybody : netbeans users, eclipse users, probably also vim users, IntelliJ IDEA users ! ! ! |
| 06:06 | lpetit | tomoj: yes, I said that once |
| 06:07 | Voting | what does swank refer to? |
| 06:09 | lpetit | I always mistake one for the other |
| 06:14 | evanrmurphy | In Emacs, is clojure-mode incompatible with slime-repl-mode? |
| 06:17 | evanrmurphy | Enabling clojure-mode while at the slime repl has been breaking it for me, but it's desirable to have clojure-mode on while writing code. (Perhaps this is why it's great to write your Clojure in a file and compile it from there?) |
| 06:17 | tomoj | lpetit: I have just made a log of all the data transferred between swank client and server in a clojure session which used a bunch of features |
| 06:17 | tomoj | will gist |
| 06:18 | lpetit | will be interesting, thanks ! |
| 06:18 | tomoj | unfortunately the in/out are not synched up |
| 06:18 | tomoj | wonder how I could do that |
| 06:18 | lpetit | oh |
| 06:18 | lpetit | shame |
| 06:19 | tomoj | https://gist.github.com/be1780178bc11e029999 |
| 06:19 | tomoj | inflow is stuff the client in emacs sent to the swank server, outflow is the stuff the server sent back, I believe |
| 06:19 | lpetit | does swank server just allow to "hook into the running env" for e.g. macro-expansion purposes, or is it also used for implementing the "client part" of the REPL ? |
| 06:19 | tomoj | see line 5 of inflow |
| 06:20 | defn | bbiab |
| 06:21 | tomoj | I'd be very interested to know what the hell the hex bits at the front are |
| 06:22 | lpetit | yes |
| 06:23 | lpetit | thanks tomoj, I'll send your gist to cemerick, who is currently porting enclojure's server backend to ccw. Maybe of interest to him |
| 06:24 | tomoj | outflow is broken |
| 06:24 | tomoj | fixing now |
| 06:25 | raek | evanrmurphy: there shouldn't be any problem using clojure-mode and slime at the same time |
| 06:27 | raek | clojure-mode automatically starts for me when I visit a .clj file |
| 06:28 | raek | evanrmurphy: or did you mean *in* the slime repl? |
| 06:28 | evanrmurphy | raek: Thanks for responding. If I "M-x clojure-mode" at the repl, the "REPL" indicator is replaced by one for clojure-mode and evals stop working. I thought this might mean they were mutually exclusive major modes. |
| 06:28 | raek | ah |
| 06:28 | raek | I dont't know I you're supposed to do that |
| 06:28 | evanrmurphy | raek: Yes, exactly. Only while *in* the repl. I can use clojure-mode just fine in files. |
| 06:29 | tomoj | lpetit: ok, fixed outflow in the gist |
| 06:29 | raek | I usually write the code in a file and send it for evaluation with C-M-x or C-x C-e |
| 06:29 | evanrmurphy | raek: I'm relatively new to Emacs, this is the first time my major modes have started clashing. (Viper is having to go sometimes! :) |
| 06:30 | raek | evanrmurphy: did you want syntax highlighting in the repl, or why did you want to use clojure-mode there? |
| 06:30 | evanrmurphy | raek: I'm going to do it that way too. Just wanted to make sure I wasn't missing out. |
| 06:30 | evanrmurphy | raek: I might have something mixed up here, but it seemed like clojure-mode was tweaking my paredit-mode w/r/t { } braces. |
| 06:30 | raek | the repl already is "clojure-enabled" |
| 06:31 | evanrmurphy | I just wanted that functionality. |
| 06:31 | tomoj | paredit in the repl? |
| 06:31 | raek | I added this to my .emacs |
| 06:31 | raek | http://gist.github.com/443590 |
| 06:31 | raek | there is a fix for paredit { } at the middle |
| 06:31 | tomoj | you're missing M-{ for paredit-wrap-curly |
| 06:32 | raek | oh |
| 06:32 | tomoj | I mean, assuming you want paredit-wrap-curly.. |
| 06:32 | evanrmurphy | tomoj: Do you not use paredit in the repl? |
| 06:33 | tomoj | I don't |
| 06:33 | raek | I don't use the meta plus {/[/]/} |
| 06:33 | tomoj | the ideas scares me because I think things will get strange |
| 06:33 | tomoj | raek: but they're so awesome! :( |
| 06:33 | raek | since to type a { on my keyboard layout, I have to hold down AltGr plus 7 |
| 06:33 | raek | and Meta + AltGr + 7 doesn't work |
| 06:33 | tomoj | ouch |
| 06:34 | evanrmurphy | raek: what keyboard layout do you have? |
| 06:34 | raek | I have thought about changing to US layout for coding |
| 06:34 | raek | swedish |
| 06:34 | tomoj | in my layout M-{ is qwerty's M-3 |
| 06:34 | raek | the US layout has much better positions for "coding keys"... |
| 06:35 | evanrmurphy | interesting |
| 06:36 | raek | I already know the US layout from earlier, so I might just switch to it some day |
| 06:37 | evanrmurphy | raek: Could be good, switching layouts is frustrating though. |
| 06:41 | evanrmurphy | paredit is great. Does anyone else wish it didn't completely freak out when parens are unbalanced though? |
| 06:42 | raek | I guess you could wipe out the wrongly closing parens with C-w and enter new )s |
| 06:43 | raek | I think paredit will enter the right closing paren, no matter which one you where typing |
| 06:44 | evanrmurphy | Well, sometimes if I restart a repl, for instance, and then try to enable paredit-mode, it says it detects unbalanced parens and won't start. Has that never happened to you? |
| 06:46 | raek | yes, but then it points out where it is, rigth? |
| 06:46 | evanrmurphy | raek: What does it do to point that out? |
| 06:50 | evanrmurphy | I never noticed it locating the unbalanced parens, will watch for that next time. |
| 06:54 | raek | I think it tells about it in the minibuffer |
| 06:54 | raek | or event place the point |
| 06:54 | evanrmurphy | raek: Thanks for the .emacs gist, that helped me get the paredit { } sorted out. |
| 06:56 | evanrmurphy | ah, looks like there is row-column info in the minibuffer, wow |
| 06:58 | raek | M-g g <line-no> ; goto line <line-no> |
| 07:12 | lpetit | evanrmurphy: switch to ccw, I just released a version of paredit.clj which still works with unbalanced parens ( e.g. recognizing "chimera" pairs such as "[foo}", or incomplete "[foo"), still allowing to do structural selection, wrap with, raise over, etc. |
| 07:12 | lpetit | :p |
| 07:12 | LauJensen | Good morning all |
| 07:12 | lpetit | 'morning La-ô |
| 07:13 | evanrmurphy | lpetit, is that for eclipse? |
| 07:13 | lpetit | evanrmurphy: yep |
| 07:14 | evanrmurphy | lpetit: I'll stick with emacs for now, but thanks. :) |
| 07:15 | lpetit | LauJensen: I've finally added the missing bits to clojure.zip in order to be able to do binary search of a child loc, and O(1) creation of the loc of any child of the current loc. |
| 07:15 | LauJensen | Cool - Is that going opensource somewhere? |
| 07:16 | lpetit | LauJensen: used it for paredit.clj, and it's terrific ! Now e.g. indenting the 4000's line of a clojure file feels instantaneous (before the move, a "pause" was clearly visible) |
| 07:16 | LauJensen | Fantastic |
| 07:16 | LauJensen | How did you end up doing it ? |
| 07:16 | lpetit | LauJensen: currently there's still a missing part in paredit.clj : the incremental parser. When this one is ok, I'll speak about it on the ml |
| 07:17 | LauJensen | k |
| 07:17 | tomoj | I was just wondering about incremental parsing + zippers for clojure the other day |
| 07:18 | tomoj | hope that stuff can become portable someday |
| 07:18 | lpetit | LauJensen: more easily than I thought. |
| 07:18 | lpetit | LauJensen: 1. For binary search, I need to examine any given child. This part is easy: I didn't use the xml-zipper anymore, because its provided children function returned a seq. Instead I use my own xml-vzipper which returns a vector. |
| 07:19 | lpetit | LauJensen: 1bis: maybe this was not necessary after all (I've not cleaned things up totally). I mean calling (-> loc clojure.zip/node :content) should suffice if I ensure that the make-node function creates a vector in :content |
| 07:24 | lpetit | LauJensen: 2. I need a new function to be able to jump down at index idx. I just copied over clojure.core/down into a new utility function with an arity of 2 and not 1: (defn vdown [loc idx] ...), and this vdown function takes care of leveraging the vector nature of the children. It can easily be generalized if we could add some 'split function when creating a zipper (fn split [children idx]) => must return [ children-before-idx ch |
| 07:24 | lpetit | LauJensen: easier to implement than to explain, ~ 10 lines of utility code :) |
| 07:24 | LauJensen | sounds like good work |
| 07:25 | lpetit | LauJensen: of course the "binary search" part is in the client code : that's the part that searches the index to jup down to, and it's specific to client's usage; |
| 07:27 | lpetit | LauJensen: I learned a lot in the process. Like left nodes in the loc are implemented as a vector, so that when you go to the right you can pop from the tail, and when you go the the left you can push to the tail, while right nodes in the loc are implemented as a list, so that when you go to the right you can add to the front, and when you go to the left you can remove from the front. And when you want to go up, you don't have to r |
| 07:28 | lpetit | LauJensen: but for sure, if we had finger trees, clojure zippers would certainly be even more performant under intensive navigational usage (but that's not a problem I've been aware in my code yet) |
| 07:29 | LauJensen | Amazing that you can optimize that much with so few changes. You can ask Christophe for a copy of the code fron Conj Labs if you want another 20% boost without any changes to your code |
| 07:34 | lpetit | LauJensen: I will. Though I doubt it'll be a 20% boost of a total paredit command. |
| 07:34 | LauJensen | It wont. Its simply all the core zipper functionality |
| 07:35 | LauJensen | But since is basically care free to install, you should do it :) |
| 07:35 | lpetit | LauJensen: is it meant as a drop-in replacement of clojure.zip ? |
| 07:36 | LauJensen | Yea. I think once Christophe gets the time he'll pretty-it-up and submit it for inclusion in core |
| 07:36 | LauJensen | (though it doesnt need much/any work tbh) |
| 07:38 | lpetit | LauJensen: what's the core "virtue" of this new impl ? |
| 07:38 | LauJensen | The virtue is the speed. Its just a protocolbased reimplementation of the original code. |
| 07:38 | lpetit | LauJensen: will it still work with lazy datastructures (I think the current implementation does, though I'm not 100 certain) |
| 07:38 | LauJensen | lpetit: yea, all interface remain the same |
| 07:38 | LauJensen | s |
| 07:39 | lpetit | LauJensen: does it still enable the creation of new kinds of zippers ? How to do this ? (the last time we talked about it Christophe and I, he was facing a problem for generalizing the approach) |
| 07:39 | lpetit | LauJensen: good ! |
| 07:40 | lpetit | LauJensen: ok, I'll see the detail with Christophe, then |
| 07:40 | LauJensen | Yea - I think he'd be happy to share the code, if not, entice him with a baguette, I know he's a sucker for those |
| 07:43 | lpetit | LauJensen: :) |
| 09:06 | lenw | hi all - i am missing something in compojure - trying to serve files statically, eg css so have the line (files "/css") but still bet a 404 - anyone can help me ? |
| 09:07 | spariev__ | lenw: did you put them into public/ subdir ? |
| 09:07 | lenw | spariev__: public under src ? |
| 09:08 | spariev__ | no, on the same level with src/ |
| 09:11 | lenw | spariev__: ok moved them there - then in the url must i also use public ? |
| 09:12 | spariev__ | no, afaik, public/ is a web root, like in rails |
| 09:13 | lenw | spariev__: ok so css is in public/css and in clojure source i say (files "/css") then http://localhost:8888/css/main.css still gets 404 |
| 09:14 | spariev__ | also, I have something like (GET "/*" (or (serve-file (params :*)) :next)) in defroutes |
| 09:14 | spariev__ | that's all for compojure 0.3.2 btw |
| 09:15 | raek | hrm, I think 0.3.x has a different default static directory |
| 09:15 | lenw | yeah i am on 0.4.1 |
| 09:15 | raek | spariev__: can you do a (doc serve-file) ? |
| 09:16 | raek | iirc, the directory was named .static or .public or something |
| 09:17 | spariev__ | raek: it says "Attempts to serve up a static file from a directory, which defaults to |
| 09:17 | spariev__ | './public'" |
| 09:18 | lenw | in the compojure source it has this : (let [options (merge {:root "public"} options)] |
| 09:19 | lenw | i tried setting my own root option as well ... |
| 09:19 | LauJensen | lenw: Compojure needs a middle called (wrap-file "root-dir") which automatically serves statics from that dir |
| 09:19 | LauJensen | s/middle/middleware/ |
| 09:19 | sexpbot | lenw: Compojure needs a middleware called (wrap-file "root-dir") which automatically serves statics from that dir |
| 09:19 | LauJensen | For Moustache you would do (app (wrap-file "dir") ["login"] render-login) for instance |
| 09:19 | raek | how is ring related to compojure? which one came first? is one of them an offshoot from the other? |
| 09:20 | lenw | compojure uses ring |
| 09:20 | lenw | AFAIK |
| 09:20 | LauJensen | true. Ring is the underlying lib which Compojure is based on |
| 09:20 | raek | that wrap-file middleware exists in ring, btw |
| 09:20 | LauJensen | raek: yea thats the one Im talking about. Usually when saying 'middleware' we're refering to Rings |
| 09:20 | LauJensen | (since all of Compojures middleware got moved into Ring) |
| 09:20 | LauJensen | (which was why I switched to Moustache) |
| 09:21 | raek | ah, now I understand |
| 09:21 | lenw | cool that makes more sense LauJensen |
| 09:21 | raek | that was that big 0.3 -> 0.4 change, right? |
| 09:21 | raek | so, what is left in compojure then? |
| 09:21 | raek | routing? |
| 09:22 | lenw | and the html composing support |
| 09:22 | raek | html was split off into hiccup, right? |
| 09:22 | spariev__ | yep |
| 09:22 | LauJensen | raek: very big. Yea a little routing |
| 09:22 | LauJensen | And it was a good thing, so Im not complaining. Compojure is still a very good choice for web-dev |
| 09:22 | LauJensen | But since Moustache got all of the middle ware functionality for free, I just went with that, because of its simplicity |
| 09:22 | raek | so if one is not interested in compojure's approach to routing, one could just use ring? |
| 09:23 | LauJensen | raek: sure |
| 09:23 | raek | ...or moustache :) |
| 09:23 | lenw | and moustache seems simpler from my newbie pov |
| 09:23 | LauJensen | yea, which is also based on ring :) |
| 09:23 | raek | ok, so I can use ring middleware in it too? |
| 09:23 | LauJensen | lenw: If you want Moustache, you can check out the source for bestinclass.dk, that entire site is run using enlive and moustache |
| 09:23 | LauJensen | raek: yea |
| 09:23 | raek | neat |
| 09:24 | LauJensen | exactly |
| 09:24 | LauJensen | So what they did was great, because now we can have more libs, since the functionality is so modular |
| 09:24 | lenw | LauJensen: thanks have the source and it is great |
| 09:25 | raek | what I have liked about moustache so far is the ability to do the routing hierarchy level by level |
| 09:25 | raek | the nestability thingy |
| 09:25 | raek | one handler strips off one portion of the path and invokes another handler |
| 09:26 | LauJensen | yea, christophe is crazy smart when it comes to designing libs |
| 09:26 | LauJensen | Ive never used Enlive for a professional project, and not a some point have to lean back and go 'wow'. Its just so well designed |
| 09:28 | raek | I like the quality of a library being "micro" |
| 09:30 | spariev__ | lenw: so, did the wrap-file middleware help your case ? btw, sorry for misguided advices :) , I should have asked about version you're using |
| 09:31 | lenw | spariev__ think it will - just restructuring things here - np re advices its great to have ppl to help !! |
| 10:24 | LauJensen | Jquery has an odd inconsistency. $(':input').serialize() will serialize all checkboxs that are checked as name=on, but all unchecked checkboxes are left out of the data |
| 10:26 | AWizzArd | LauJensen: urks, yes, this is how checkboxes work per default in html+js |
| 10:26 | LauJensen | oh ok. |
| 10:28 | jfields | what's the easiest way to convert from a java.util.Properties to a clojure map? |
| 10:28 | AWizzArd | jfields: try (into {} your-properties) |
| 10:28 | jfields | thanks man |
| 10:32 | pdk | (doc into) |
| 10:32 | clojurebot | "([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined." |
| 10:55 | limux1972 | why hiccup can not display chinese character correctly? |
| 10:57 | limux1972 | I am doing the demo "Developing and Deploying a Simple Clojure Web Application" by mmcgrana |
| 10:58 | limux1972 | and add more stuff to do include display some chinese character in the browser |
| 10:59 | limux1972 | but it's not work as my expectance |
| 10:59 | limux1972 | Those chinese characters are displayed as ???? |
| 11:00 | dnolen_ | limux1972: how are you starting the JVM? |
| 11:00 | AWizzArd | Can you do a (map int your-string)? |
| 11:01 | AWizzArd | There you can see the if the string contains the correct data, and only the program can't display those. |
| 11:01 | limux1972 | exactly do it as the his blog |
| 11:01 | limux1972 | the prn to console is ok |
| 11:02 | limux1972 | only browser is wrong |
| 11:02 | limux1972 | i start the JVM by lein run script/run.clj |
| 11:02 | raek | limux1972: this can be caused by a lot of things |
| 11:02 | limux1972 | maybe |
| 11:03 | raek | first, do the (map int "string containing chinese characters") as AWizzArd suggested |
| 11:03 | limux1972 | I am a newbie in Clojure and not very familar with Java |
| 11:03 | raek | that will determine if it is an issue with source file encoding (witch should always be UTF-8) |
| 11:05 | pdk | (doc cond) |
| 11:05 | clojurebot | "([& clauses]); Takes a set of test/expr pairs. It evaluates each test one at a time. If a test returns logical true, cond evaluates and returns the value of the corresponding expr and doesn't evaluate any of the other tests or exprs. (cond) returns nil." |
| 11:05 | pdk | (doc case) |
| 11:05 | clojurebot | "([e & clauses]); Takes an expression, and a set of clauses. Each clause can take the form of either: test-constant result-expr (test-constant1 ... test-constantN) result-expr The test-constants are not evaluated. They must be compile-time literals, and need not be quoted. If the expression is equal to a test-constant, the corresponding result-expr is returned. A single default expression can follow the clauses, and its va |
| 11:06 | limux1972 | I replaced the "content" with a wide char string such as my name "刘孟江", It also not work well |
| 11:06 | raek | limux1972: what happens if you do (map int "刘孟江")? |
| 11:07 | raek | ...in your repl |
| 11:07 | raek | that is, start a repl with "clj" and then type the line above |
| 11:08 | AWizzArd | ,(map int "AB C") |
| 11:08 | clojurebot | (65 66 32 67) |
| 11:08 | raek | ,(map int "刘孟江") |
| 11:08 | clojurebot | (21016 23391 27743) |
| 11:08 | limux1972 | 210162339127743 |
| 11:08 | raek | if you don't get these three numbers, your source file is in the wrong encoding |
| 11:08 | raek | ok, looks right |
| 11:09 | raek | then that part works. |
| 11:09 | limux1972 | next step? |
| 11:09 | raek | add a encoding meta tag to the generated html, if you don't have one |
| 11:09 | limux1972 | i have already add "utf-8" |
| 11:10 | dnolen_ | ,(java.nio.charset.Charset/defaultCharset) |
| 11:10 | clojurebot | #<UTF_8 UTF-8> |
| 11:10 | raek | inside head: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >/ |
| 11:10 | raek | great |
| 11:10 | limux1972 | I just do it |
| 11:10 | limux1972 | as the blog |
| 11:10 | limux1972 | no one word changed |
| 11:11 | raek | can you post the link to the blog? |
| 11:11 | raek | it might be due to operating system default encoding |
| 11:11 | dnolen_ | limux1972: what happens when you run the ^ for getting the JVM encoding ? |
| 11:12 | limux1972 | http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html |
| 11:12 | raek | limux1972: what does (.name (java.nio.charset.Charset/defaultCharset)) give for you? |
| 11:12 | limux1972 | dnlon_, the prn to console is ok |
| 11:13 | limux1972 | sorry typo, donlen_ |
| 11:14 | limux1972 | GBK |
| 11:16 | raek | ah |
| 11:16 | limux1972 | donlen_, how to do sa you say |
| 11:16 | limux1972 | ah |
| 11:16 | raek | looks like the tutorial relies on the default encoding being UTF-8 |
| 11:17 | raek | maybe you could add :content-encoding to the response map |
| 11:18 | raek | http://github.com/mmcgrana/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L113 |
| 11:18 | limux1972 | where to add? |
| 11:18 | AWizzArd | Also you can check (System/getProperty "file.encoding") and (System/getProperty "sun.jnu.encoding") |
| 11:18 | raek | here it sets the output encoding to UTF-8 |
| 11:19 | raek | limux1972: what do you get in the browser? can you manually select a different encoding in the browser that gives correct characters? and if so, which? |
| 11:20 | raek | *sigh* do you guys see why the concept of "OS default encoding" is broken? |
| 11:21 | raek | limux1972: do you have a running server that we can access? so that we can look at the generated html our selves? |
| 11:21 | limux1972 | i tried it and no effects |
| 11:22 | limux1972 | no |
| 11:23 | limux1972 | I can try to have a public domain that you can access torrow. now it's too late |
| 11:23 | dnolen_ | limux1972: have you tried changing the default encoding of the JVM? |
| 11:23 | raek | we only need your ip |
| 11:24 | raek | http://whatismyip.com/ + port number |
| 11:24 | limux1972 | greatly thanks to raek and all of your guy |
| 11:25 | raek | (java.io.ByteArrayInputStream. (.getBytes "刘孟江" "UTF-8")) |
| 11:25 | limux1972 | sorry, I have to run a software to do a dynamic dns resolve or you cannot see me |
| 11:25 | raek | try that as an response |
| 11:25 | raek | limux1972: if you give us your ip, we don't need any DNS |
| 11:26 | raek | all DNS does is to give a name to an IP |
| 11:27 | raek | (java.io.ByteArrayInputStream. (.getBytes "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head><body>刘孟江</body></html>" "UTF-8")) |
| 11:27 | limux1972 | I havn't a IP |
| 11:27 | defn | raek: except it's plural |
| 11:28 | raek | 17:28 [freenode] -!- limux1972 [~chatzilla@119.190.127.4] |
| 11:28 | raek | limux1972: you seem to have 119.190.127.4 currently |
| 11:28 | limux1972 | can you try it on you machine? raek |
| 11:29 | raek | limux1972: try to use the line above as your response |
| 11:29 | raek | (defroutes app (GET "/" [] <what i wrote earlier>) |
| 11:30 | raek | ) |
| 11:30 | limux1972 | ok |
| 11:32 | limux1972 | ah |
| 11:32 | limux1972 | my name is here |
| 11:32 | raek | also, does (defroutes app (GET "/" [] "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head><body>刘孟江</body></html>")) work? |
| 11:32 | limux1972 | exact |
| 11:33 | raek | ok, the ByteArrayInputStream version worked? |
| 11:34 | limux1972 | yeah |
| 11:35 | raek | how about my last line? |
| 11:36 | limux1972 | 刘孟江 |
| 11:37 | limux1972 | I think the issue is in hiccup |
| 11:37 | raek | the last one worked? |
| 11:38 | limux1972 | all works |
| 11:38 | raek | if so, the issue is most certainly in hiccup |
| 11:38 | limux1972 | i think so |
| 11:38 | raek | ring: OK, source-file encoding: OK, html charset meta: OK, hiccup NOT OK |
| 11:39 | limux1972 | you are right |
| 11:39 | raek | I'm very glad that most of these things handled encoding pretty well |
| 11:40 | raek | I might take a look at hiccup later this evening |
| 11:40 | limux1972 | thank you, that's all for today |
| 11:40 | raek | I don't promise anything, but this should be fixed |
| 11:40 | raek | since it's a pretty big isssue |
| 11:40 | raek | glad to help |
| 11:40 | raek | bbl |
| 11:41 | limux1972 | you are hiccup author? |
| 11:41 | limux1972 | see you tomorrow |
| 11:42 | limux1972 | perhaps i will have more stuff study to you |
| 11:44 | limux1972 | heartly thanks for your help to my clojure and english, I am a young chinese! |
| 11:44 | limux1972 | bye |
| 12:17 | ecyrb | Is it possible to refer to a record in another namespace without fully qualifying it? |
| 12:18 | ecyrb | sorry - I mean a record-type, defined with defrecord - not an individual record. |
| 12:19 | ecyrb | it seems that for defrecords, there is no __init.class generated, so you can't "use" them |
| 12:22 | chouser | ecyrb: use import |
| 12:23 | ecyrb | aw man, I never even thought of that |
| 12:24 | ecyrb | I find the whole use / require / refer / import confusing. I can never remember which one to use. |
| 12:25 | ecyrb | At least in Java there was only "import". |
| 12:25 | chouser | yeah. it should be improved |
| 12:25 | chouser | there have been proposals |
| 12:26 | ecyrb | cool. That's good to hear |
| 12:26 | chouser | but before defrecord, at least import was clearly separate from use/require. Now it's not so clear anymore. |
| 12:26 | technomancy | clojurebot: ns overhaul is http://www.assembla.com/spaces/clojure/tickets/272-load-ns-require-use-overhaul |
| 12:26 | clojurebot | Ack. Ack. |
| 12:27 | chouser | technomancy: I'm reading The Man Who Would Be Thursday and thoroughly enjoying it. |
| 12:28 | smokecfh | i'm amazed at http://ideone.com/ - it even supports clojure |
| 12:28 | technomancy | chouser: yeah! it's great. how far are you? |
| 12:29 | chouser | 80% |
| 12:29 | chouser | :-) |
| 12:30 | technomancy | ah, the part where it starts getting _really_ crazy. |
| 12:30 | chouser | so says my book reader. let's see, they just discovered the entire town was on the side of law not anarchy. |
| 12:30 | chouser | heh. I can somehow believe that. |
| 12:30 | chouser | oh wait, no they're chasing Sunday. |
| 12:31 | chouser | I can't wait to finish so I can start trolling the web for explanations. |
| 12:34 | mabes | could someone take a look at my use of lazy-seqs + futures and tell me how I'm doing it wrong? The lazy-seq is being kept in memory and I'm getting OOM errors.. : http://gist.github.com/513376 |
| 12:36 | mabes | (I asked on the ML but got no relies - http://bit.ly/d0V8jV) |
| 13:07 | thunk | sexpbot: (+ 1 2) |
| 13:07 | sexpbot | This command is old. Use -> now. It's a hook, so it can evaluate anything, even stuff that doesn't start with parentheses. |
| 13:08 | thunk | -> (+ 1 2) |
| 13:08 | sexpbot | => 3 |
| 13:08 | thunk | -> 'rudybot: |
| 13:08 | sexpbot | java.lang.Exception: Invalid token: rudybot: |
| 13:08 | thunk | Oh, whoops. wrong room |
| 13:09 | thunk | I thought there was a new bot in #emacs |
| 13:25 | cgrand | raek: do you like Moustache or the "syntax" file? |
| 13:34 | raek | both, I guess |
| 13:34 | raek | all DSLs should have a syntax reference page |
| 13:35 | raek | and moustache is very neat |
| 13:36 | raek | cgrand: thanks for an awesome lib! |
| 13:37 | raek | I have decided to use it in a rewrite of a web service I have made |
| 13:38 | raek | btw, is a validator a fn that returns a parsed/normalized value if the input was valid and nil if it was invalid? |
| 13:40 | defn | ditto to cgrang |
| 13:40 | defn | cgrand* |
| 13:40 | defn | really great lib |
| 13:43 | cgrand | raek: yes, validator fns return nil/false on failure |
| 13:44 | cgrand | defn, raek: you're welcome |
| 13:46 | raek | Kaali (who recently got into clojure) made a validation library, which uses the same interface for validators |
| 13:46 | raek | http://github.com/Kaali/pour |
| 14:16 | duncanm | hola |
| 14:17 | duncanm | is there a way to tell lein about my own maven server? |
| 14:19 | lancepantz | duncanm: yes |
| 14:19 | lancepantz | :repositories { "java.net" "http://download.java.net/maven/2" |
| 14:19 | lancepantz | "jboss" "http://repository.jboss.com/maven2/"} |
| 14:19 | duncanm | cool |
| 14:19 | lancepantz | from http://github.com/technomancy/leiningen/blob/master/sample.project.clj |
| 14:21 | raek | duncanm: if you want to have a dependency on another project you are working on, you can add a link to that project directory with lein's "checkouts" fieature |
| 14:21 | clojurebot | your link is dead |
| 14:22 | joegg | Can anybody comment on the mailing list discussion of try/catch/finally? Is this a real bug, or just a needs-better-documentation? That is, is the behavior desired or accidental? |
| 14:27 | raek | I think that is a bug |
| 14:27 | raek | from what joegg's example shows |
| 14:28 | raek | ( http://groups.google.com/group/clojure/msg/367791544e67aa27 ) |
| 14:29 | raek | the finally-code should obviously not be in the try-part too |
| 14:30 | raek | anyway, Meikel Brandmeyer has forwarded this to the clojure-dev list, so it will get attention |
| 14:31 | joegg | raek: Ooh, thanks for pointing that out. I didn't think to look over there. |
| 14:31 | raek | joegg: oh, sorry. didn't see it was you... :) |
| 14:31 | joegg | That's okay. :) |
| 14:31 | raek | man. |
| 14:32 | raek | I should pay more attention... |
| 14:32 | joegg | I kept hitting refresh and hoping for some kind of response, so I came over here to see what's up. :) |
| 14:32 | raek | so the compiler emits duplicated code? |
| 14:32 | joegg | It's complicated. :) |
| 14:34 | joegg | My bytecode knowlege is a bit limited; so feel free to correct me if I'm wrong, but: Basically, it looks like it emits the try and finally sections together, and then, separately, the finally section again. |
| 14:35 | joegg | But, with regard to exceptions, I think the first time through is correct -- if nothing goes wrong, run both the try and the finally. |
| 14:35 | joegg | I think the issue is that the second finally section is being linked to the entirety of the first emitted try/finally exprs. |
| 14:36 | joegg | So, if something goes wrong in the finally clause, then we re-run the finally clause. |
| 14:36 | chouser | amazingly easy to reproduce |
| 14:37 | joegg | I can post my tests somewhere, if that will help. |
| 14:37 | chouser | I would guess the ones in the ggroup thread are sufficient |
| 14:37 | joegg | I was excited to find special.clj, and then sad to see that it was empty. :) |
| 14:45 | lancepantz | what is a shell wrapper? |
| 14:47 | chouser | joegg: commit 5e9f2b29 is interesting |
| 14:51 | joegg | Oh ho! A good point. I'll add a test for that, and see if we can figure out a way through it. |
| 14:53 | technomancy | lancepantz: if you install swank-clojure using the latest lein, it writes a cljr-like ~/.lein/bin/swank-clojure shell script that sets up the classpath and lets it get run from the CLI; see the "1.3 features" thread on the lein list |
| 14:54 | lancepantz | oh, cool |
| 14:59 | duncanm | it's always bugged me that in slime-repl-mode, paredits's M-s doesn't work because the keybinding is used by slime |
| 15:00 | joegg | chouser: I'm trying to provoke the problem that that commit says it solved (now that I've pretty much uncommitted it), and I can't. |
| 15:05 | chouser | hmph. |
| 15:07 | joegg | Wait, I'm wrong. |
| 15:07 | joegg | My test wasn't testing what I thought it was. |
| 15:07 | joegg | I need to change something things. |
| 15:07 | chouser | (try (prn 1) (throw (Exception. "one")) (catch Exception e (throw (Exception. "two"))) (finally (prn 2) (prn 3))) |
| 15:07 | chouser | ,(try (prn 1) (throw (Exception. "one")) (catch Exception e (throw (Exception. "two"))) (finally (prn 2) (prn 3))) |
| 15:07 | clojurebot | chouser: It's greek to me. |
| 15:08 | chouser | so the goal is to get both that and this to print just 1\n2\n3\n and an exception: |
| 15:08 | chouser | (try (prn 1) (finally (prn 2) (prn 3) (throw (Exception.)))) |
| 15:09 | joegg | Okay, I am provoking the behavior that that was supposed to fix. My test was broken. |
| 15:10 | chouser | oh.... |
| 15:11 | chouser | Java doesn't allow you to do both cathc and finally on the same "try", does it. |
| 15:12 | joegg | Ummm... in a .java file? Yes, try/catch*/finally?. You must have a least one catch or finally. try/finally, try/catch, try/catch*/finally, etc. All okay. |
| 15:12 | chouser | oh, ok. |
| 15:12 | clojurebot | namespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it |
| 15:12 | joegg | As far as what that turns into in the bytecode, well, I don't really know. |
| 15:12 | chouser | in which case there must be a "right way" to emit this stuff. |
| 15:12 | joegg | You'd really think! :) |
| 15:21 | chouser | javac emits the finally code multiple times too |
| 15:21 | joegg | Very interesting. |
| 15:22 | joegg | I wonder if the difference is the exception table. |
| 15:24 | chouser | is there only one exception table per method? |
| 15:25 | joegg | Dunno. |
| 15:28 | chouser | "At run time, when an exception is thrown, the Java virtual machine searches the exception handlers of the current method in the order that they appear in the corresponding exception handler table in the class file" ...I *think* that means one table per method |
| 15:29 | BrianForester | "Each method that catches exceptions is associated with an exception table that is delivered in the class file along with the bytecode sequence of the method. The exception table has one entry for each exception that is caught by each try block. Each entry has four pieces of information: the start and end points, the pc offset within the bytecode sequence to jump to, and a constant pool index of the exception class t |
| 15:29 | BrianForester | hat is being caught." -- http://www.artima.com/underthehood/exceptions.html -- seems to confirm that. |
| 15:29 | joegg | (try (prn :a) (throw (Exception.)) (catch Exception e (prn :b) (throw (Exception.) (finally (prn :c))))) |
| 15:30 | joegg | ,(try (prn :a) (throw (Exception.)) (catch Exception e (prn :b) (throw (Exception.) (finally (prn :c))))) |
| 15:30 | clojurebot | joegg: Pardon? |
| 15:31 | chouser | ok, when I do try { A } catch { B } finally { C } in java, AC are emitted together, but the finally handler only covers A |
| 15:31 | joegg | I'm expecting :a, :b, :c from that, and getting :a :b only. Stock clojure 1.1. |
| 15:32 | chouser | joegg: your finally is at the wrong level |
| 15:32 | joegg | Thanks. |
| 15:34 | pdelgallego | any good tutorial on testing in clojure ? |
| 15:36 | chouser | ok, I think I see it |
| 15:37 | chouser | javac generates an exception table entry for the finally clause for the try block and *each* exception handler |
| 15:37 | raek | I started to work on a java class disassembler, and iirc there was only one exception table per method |
| 15:38 | chouser | Clojure compiler generates a single exception table entry for the finally clause, that covers all the try and catch blocks at once (and therefore the finally blocks emitted for each of them) |
| 15:39 | Plouj | what's the state of clojure debugging (in Eclipse)? |
| 15:39 | raek | (in case someone wants to look at the byte code in a more "readable" format: http://github.com/raek/impojure ) |
| 15:40 | raek | is there any good software for inspecting jvm bytecode? |
| 15:41 | chouser | I was just using javap :-P |
| 15:41 | chouser | pretty painful |
| 15:41 | raek | yeah, but that doesn't show all the details |
| 15:41 | joegg | javap -v |
| 15:42 | joegg | raek: What do you want to see? |
| 15:43 | chouser | joegg: what were you doing when you found this bug? |
| 15:44 | arkh | raek: there's a commercial one that Rich Hickey used in making Clojure but I forget the name :( |
| 15:45 | chouser | joegg: I think this fixes it: http://gist.github.com/517865 |
| 15:45 | arkh | is there any way to return from a seque that's blocking on the consumer side? (i.e. when using (.take q)) |
| 15:47 | raek | (here is an example output from impojure, if someone was interested: http://gist.github.com/517866 . it is for clojure.core/comp) |
| 15:47 | joegg | chouser: Compiling, will test in a moment. |
| 15:47 | arkh | or, more generally, can an InterruptedException be generated from outside an agent thread (and safely)? |
| 15:47 | joegg | Great success! |
| 15:48 | chouser | raek: that's pretty cool! |
| 15:48 | raek | thanks |
| 15:48 | raek | the goal is to make a s-exp based jvm assembly format |
| 15:49 | raek | anyway, that example did not contain any exception handlers... |
| 15:49 | chouser | heh |
| 15:49 | joegg | http://gist.github.com/517871 |
| 15:49 | raek | hey! I came up with it before that lein patch! ;) |
| 15:49 | raek | the name is not set in stone, btw... |
| 15:49 | danlarkin | raek: I was gonna ask if you deliberately circumvented it :) |
| 15:50 | chouser | joegg: oh, you caught this while writing actual clojure unit tests? |
| 15:50 | joegg | My tests, that broke with original behavior, and my patch, but work with chouser's code. |
| 15:50 | joegg | Negatory, I wrote some tests because I saw this on the mailing list. |
| 15:50 | chouser | ah. still, very helpful. |
| 15:50 | joegg | And wanted to test my "fix"... |
| 15:50 | joegg | Ummm... they're really gross. |
| 15:51 | joegg | It's pretty much just Laurent's demo, expanded to try a few more edges. |
| 15:51 | arkh | I can't wait until I release my math library called 'intejure' /s |
| 15:54 | raek | http://gist.github.com/517879 <-- LazySeq.java (with exception tables( |
| 15:55 | raek | row 567 |
| 15:56 | raek | the point was, a method can have an exception table that is a set of (catch-type, start-pc, end-pc, handler-pc) tuples |
| 16:01 | lpetit | hello |
| 16:03 | arkh | bonjour |
| 16:03 | lpetit | ah, one civilized person ;) |
| 16:04 | lpetit | hey I'm not japanese, bowing is from ancient times in France :) |
| 16:05 | lpetit | arkh: hmm, maybe you're japanese or chinese ? |
| 16:05 | defn | would you call clojure aspect-oriented? |
| 16:05 | arkh | lpetit: I am not but it was a good thought :) |
| 16:05 | lpetit | defn: mm |
| 16:06 | defn | lpetit: was that an "mm" in the affirmative? |
| 16:06 | lpetit | defn: it was dubitative |
| 16:06 | raek | isn't aspect orientation an extension of object orientation? |
| 16:06 | raek | i'm sure clojure addresses some of the things AOP addresses, but maybe not in the same way |
| 16:06 | lpetit | defn: aspect oriented because one can redef and encapsulate existing vars ? |
| 16:07 | chouser | joegg: is it ok if I post the the dev thread, pointing to your tests? |
| 16:07 | lpetit | defn: and also by using binding ? |
| 16:07 | defn | i was thinking about "modularity" |
| 16:07 | defn | separation from business logic |
| 16:07 | defn | i guess it's not "enforced" |
| 16:07 | defn | but it seems to happen naturally much of the time |
| 16:08 | lpetit | defn: you're loosing me. "aspect orientation" has a strong meaning these days, and I can't manage to make your definition fit mine :) |
| 16:08 | defn | lpetit: i wasn't aware of that |
| 16:08 | chouser | defn: Doesn't aspect-oriented suggest you can "hook" before or after any methods you want to? |
| 16:08 | chouser | in which case I don't think clojure qualifies |
| 16:08 | joegg | chouser: That's fine by me. |
| 16:09 | lpetit | chouser, defn: my guess is that defn is not using the popular meaning of aspect oriented. And even if so, I won't say so, 'cause while possible, it's not done in practice |
| 16:09 | defn | I was imagining a single .clj as being sort of the whole of the business logic |
| 16:09 | joegg | I would also be happy to modify them first if you have any criticisms. |
| 16:09 | defn | wherein secondary functions achieve the primary goal |
| 16:10 | lpetit | defn: that's not what people are calling "aspect oriented". see chouser's definition and mine ^^^ |
| 16:10 | defn | to be honest I've never heard anything about AOP until today so I'm taking you both on your word |
| 16:10 | lpetit | defn: what you're talking is more about separation of concerns, layering out of the application, etc. |
| 16:10 | defn | just a curiosity, really-- |
| 16:10 | defn | lpetit: yeah, that's accurate |
| 16:10 | neotyk | Hi * |
| 16:11 | defn | hi neotyk |
| 16:11 | neotyk | just wanted to share my happiness of having test running from emacs |
| 16:11 | neotyk | no jvm startup |
| 16:11 | chouser | joegg: they look pretty good to me. you could make them a bit stronger by conjing on a vector or something instead of just counting |
| 16:11 | defn | neotyk: cake? |
| 16:12 | chouser | (swap! a conj :catch) ... (swap! a conj :finally) ... (is (= [:finally] @a)) or whatever. |
| 16:12 | chouser | but what you've got is good. |
| 16:12 | neotyk | defn: lein swank and slime-connect |
| 16:13 | neotyk | defn: what is cake? |
| 16:14 | defn | neotyk: oh -- it's a build tool that lancepantz has been working on |
| 16:14 | defn | it has a persistent JVM so you can have a JVM up and running all the time that you can run tasks in |
| 16:14 | defn | you can have project-local and global tasks |
| 16:15 | neotyk | problem I had was [leiningen/lein-swank "1.1.0"] in dev-deps next to [swank-clojure "1.2.1"], while lein-swank is deprecated |
| 16:15 | anars | has anyone successfully run clojure-clr using mono? either with MS's DLR distribution or the DLR included in the .NET 4 profile of the latest mono |
| 16:15 | neotyk | sounds cool, but you have to have "clean" tasks |
| 16:15 | neotyk | might be hard in java |
| 16:16 | timcharper | I noticed that back in december of last year, Rich asked if anyone had written any test cases for lazy-sequence head retention |
| 16:16 | joegg | chouser: endTryCatch doesn't appear to be used for anything anymore, so I think it's safe to delete, too. |
| 16:16 | timcharper | I have isolated an issue where the head a lazy sequence is retained when a lazy sequence is consumed in a different thread from whence it originated |
| 16:16 | timcharper | the code could easily be made into a test case |
| 16:16 | timcharper | (I believe) |
| 16:16 | chouser | joegg: yeah, I updated my gist |
| 16:17 | lpetit | timcharper: gist ? |
| 16:17 | joegg | Okay, cool, didn't see that. |
| 16:17 | timcharper | http://gist.github.com/510601 |
| 16:18 | timcharper | currently it output if the lazy sequence head gets GC'd |
| 16:18 | timcharper | thousands of date objects are allocated as a result of the realization of the lazy sequence |
| 16:19 | timcharper | and the garbage collecter is queued to run every 100ms |
| 16:19 | timcharper | in my tests, if the head is going to get freed, it gets freed at least by first 100ms |
| 16:20 | timcharper | otherwise, it is retained until after the entire lazy sequence is processed, and then freed |
| 16:21 | lpetit | sorry, in call |
| 16:21 | timcharper | ok :) thank you for engaging |
| 16:22 | timcharper | I will refactor further into a test case |
| 16:22 | timcharper | but running that snippet of code will demonstrate the issue |
| 16:31 | technomancy | neotyk: yeah, I guess the docs need to be clearer re: lein test being a sanity-check and not a real TDD tool |
| 16:33 | neotyk | technomancy: it turned out to be very simple |
| 16:33 | jonnyb` | hi, i need to pass a java enumeration value to a function. But it just doesn't work :) and google woun't spit it out. Anyone has a short explanation or a link? |
| 16:33 | neotyk | thanks to your "in which are found tricks of the trade concerning clojure authorship" |
| 16:33 | neotyk | but I think I found a bug in clojure-test |
| 16:34 | defn | have you tested it? |
| 16:34 | defn | *world explodes* |
| 16:34 | arkh | are there any naming conventions in clojure other than the usual that are used to designate "constants" or "magic numbers"? |
| 16:34 | neotyk | defn: like typing google into google |
| 16:34 | technomancy | neotyk: no surprise there; it's kind of cobbled together |
| 16:34 | defn | or recursion :) |
| 16:34 | technomancy | revisiting it is high on my list for after the next lein release |
| 16:34 | defn | /Did you mean recursion?/ |
| 16:35 | technomancy | but please file an issue re: any bugs you find |
| 16:35 | neotyk | technomancy: if I do clojure-test-run-test fixture is not applied |
| 16:35 | technomancy | arkh: everything's a constant by default |
| 16:35 | technomancy | neotyk: yeah... that is kind of tricky to do with clojure.test |
| 16:35 | technomancy | I may be able to work around it, but clojure.test isn't designed with that in mind |
| 16:36 | chouser | jonnyb`: Java enumerations should act like static fields of the class |
| 16:36 | perkinsc | anyone know how much of The Joy of Clojure is written? The website says: "gives you access to the first four chapters now, plus more as we write them", but the Manning site says "Available" beside all 12 chapters. Which is right? |
| 16:36 | neotyk | but it is not that annoying as I can run test on warmed up jvm now :) |
| 16:36 | technomancy | neotyk: please do open an issue though |
| 16:36 | neotyk | will do |
| 16:36 | chouser | perkinsc: oh dear. the web site is out of date. All chapters are written. |
| 16:37 | arkh | technomancy: I understand but is there any special designation for 'magic number', e.g. an mtu of 1500? |
| 16:37 | rhudson | jonnyb`: try something like MyClass$MyEnum/ENUMVAL |
| 16:37 | raek | arkh: clojure does not use the +plus-earmuffs+ convention present in some lisps |
| 16:38 | arkh | raek: ok ... so nothing special? Just (def mtu = 1500) ? |
| 16:38 | arkh | er... omg |
| 16:38 | raek | yes |
| 16:38 | arkh | raek: yes, thank you. brain lapse |
| 16:38 | raek | unless it is meant to be dynamically reboundable |
| 16:39 | raek | in that case *earmuffs* are used |
| 16:39 | raek | as in *in*, *out*, |
| 16:39 | raek | and *agent* etc |
| 16:39 | arkh | raek: oh - cool. That helps it stand out. |
| 16:40 | raek | but those don't count as constants, I suppose... (could be good to know anyway) |
| 16:41 | arkh | raek: sometimes it's the small things. If I knew anyone learning clojure who was local, I could ask them my silly questions and save the meaty ones for IRC and the permanent memory of the Internet ;) |
| 16:43 | neotyk | technomancy: http://github.com/technomancy/clojure-mode/issues/issue/10 |
| 16:43 | neotyk | who runs on GAE with new Compojure? |
| 16:44 | neotyk | side note: nice timing for Compjure guys, you would be banned by lein now |
| 16:45 | neotyk | s/Compjure/Compojure/ |
| 16:45 | sexpbot | side note: nice timing for Compojure guys, you would be banned by lein now |
| 16:46 | joegg | chouser: http://gist.github.com/517871 Updated to use conjing symbols onto a vector. |
| 16:49 | neotyk | anyone running on GAE? |
| 16:53 | evanrmurphy_ | neotyk: I'm just getting set up there myself, but haven't done it yet. |
| 16:53 | neotyk | evanrmurphy_: any hints for starters? |
| 16:53 | evanrmurphy_ | neotyk: been following http://compojureongae.posterous.com/, which is good |
| 16:54 | evanrmurphy_ | I'm fresh into Clojure but have used similar Lisps and fiddled with GAE a bit |
| 16:54 | evanrmurphy_ | neotyk: had you seen that blog before? |
| 16:55 | neotyk | evanrmurphy_: yes, have seen it |
| 16:56 | evanrmurphy_ | neotyk: Well maybe you're once step ahead of me ;) Did the instructions not work for you? |
| 16:56 | neotyk | evanrmurphy_: haven't done single thing from it yet |
| 16:56 | neotyk | also was looking at hackers with attitude |
| 16:57 | bozhidar | I looked at the blog, but it seemed pretty shallow |
| 16:57 | bozhidar | the lack of documentation is a general problem for compojure... |
| 16:58 | neotyk | bozhidar: but you gen-class the servlets right? |
| 16:58 | evanrmurphy_ | Do other Clojure web frameworks have more documentation? |
| 16:58 | lancepantz | compojure isn't really that much guys |
| 16:59 | lancepantz | most stuff has been moved into ring, which is pretty well documented |
| 16:59 | bozhidar | maybe it's not, but it could really use some documentation |
| 16:59 | bozhidar | the project site is hard to describe because there is next to nothing there :-) |
| 17:02 | evanrmurphy_ | I have to agree with lancepantz, so far things have been pretty self-explanatory |
| 17:06 | lpetit | timcharper: examined your gist. I think I understood what you did. And I think there's no bug. Or rather, that the bug is in the user code, not in clojure's. |
| 17:06 | timcharper | ok |
| 17:07 | lpetit | timcharper: in the "leaky tests", you hold onto the head in the let, while waiting for the future to fully realize. |
| 17:07 | timcharper | lpetit: I hold onto the head with a weak reference in both tests |
| 17:08 | timcharper | (both the leaky tests and the non-leaky tests) |
| 17:08 | timcharper | it is how I detect if the head is retained or freed |
| 17:08 | lpetit | timcharper: not what I'm seeing/understanding. (test-lazy-sequence) returns a lazy seq, whose head is retained in dates. |
| 17:09 | timcharper | so, the head is retained if I have a reference to the lazy seqyence ? |
| 17:09 | timcharper | s/seqyence/sequence/ |
| 17:09 | sexpbot | so, the head is retained if I have a reference to the lazy sequence ? |
| 17:09 | lpetit | timcharper: sure |
| 17:09 | timcharper | I hold on to that in all of the cases though |
| 17:10 | wwmorgan | I'm using the repl in vimclojure and trying to recall expressions using C-Up, but it's just moving the cursor. Do I have to tell vim not to use the arrow keys, or something like that? |
| 17:10 | timcharper | if I consume the lazy sequence in the same thread that contains the reference to the lazy sequence, the head is not retained |
| 17:11 | timcharper | however, if I consume the lazy seqence in a different thread, the head is not retained |
| 17:11 | lpetit | no, in the first case, you hold inside the future, and clojure 1.2's smart compiler takes care of clearing the variable when it sees that after the call to reduce it will not be of use anymore. So the variable is cleared at the right time, right before the whole seq is consumed by reduce. That's how I understan things. |
| 17:11 | timcharper | how else would you consume a lazy sequence in a streaming manner ? |
| 17:11 | timcharper | ah |
| 17:12 | timcharper | and it's not smart enough if you pass the sequence to a future ? |
| 17:12 | lpetit | timcharper: would you have returned the future to another function, and called deref on the future on this other function, I guess the head would not have been held |
| 17:12 | timcharper | (FYI: anything using fill-queue will suffer from this) |
| 17:12 | lpetit | timcharper: that's an interesting question |
| 17:13 | timcharper | in order to use fill-queue, you must pass a lazy-sequence which ultimately is passed to a future that "fills" the LinkedBlockingQueue |
| 17:15 | lpetit | timcharper: can you change your test so that in the "leaky ones", you go out of the (let) without calling deref on future, and rather call deref on the let ? |
| 17:15 | timcharper | so... I'm a little saddened to find that this is classified as a user error, when a similar approach is already embraced by a method in clojure core |
| 17:15 | lpetit | timcharper: would be interesting to know the result of this test before anything else |
| 17:16 | timcharper | sure... one second |
| 17:16 | timcharper | I think if I move the @ sign on lign 45 to the beginning of line 44, that would do it, right ? |
| 17:17 | lpetit | timcharper: yes |
| 17:17 | timcharper | it's still retained... screencast coming... |
| 17:17 | mabes | lpetit: this gist shows the same error (without the leting of the head into a weak ref).. http://gist.github.com/513376 |
| 17:18 | mabes | well, it "shows" the same error by producing an OOM |
| 17:19 | lpetit | timcharper: interesting |
| 17:20 | lpetit | chouser: is it theoretically feasible to have the equivalent of "local clearings" for lexically scoped stuff ? |
| 17:21 | lpetit | chouser: it seems that timcharper demonstrated something like that |
| 17:21 | lpetit | timcharper: mabes's example more straight to the point, IMO |
| 17:22 | mabes | timcharper, lpetit: I added the deref to the let with the future and I still got an OOM |
| 17:22 | mabes | I'll update the gist... |
| 17:23 | timcharper | http://screencast.com/t/MWYxZjg4YzI |
| 17:23 | mabes | http://gist.github.com/513376 |
| 17:23 | timcharper | (excuse my speech, I had 7 stiches put into my chin last night and mouth movement is restricted) |
| 17:25 | mabes | Yeah, I don't understand how fill-queue would not be effected by this... |
| 17:26 | lpetit | mabes, timcharper: seems like a clearing problem in the contextual exical binding |
| 17:27 | emh | is there an any/all function? (apply or/and [true false]) doesn't work since it's a macro |
| 17:28 | mabes | lpetit: should we file a ticket for a bug then? |
| 17:28 | lpetit | ,(doc every?) |
| 17:28 | clojurebot | "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false." |
| 17:28 | timcharper | lpetit: I will further distill my example. The benefit of not being informed of head retention by an OOM exception is obviously that it's more feasible to put in a unit test |
| 17:28 | lpetit | mabes: no, first report this on the clojure-dev ml |
| 17:28 | mabes | timcharper: agreed, for a unit test your approach is much better |
| 17:28 | lpetit | indeed |
| 17:28 | emh | lpetit: thx |
| 17:29 | timcharper | lpetit: thank you for your time |
| 17:29 | mabes | lpetit: ok.. I posted this on the regular ML and got no response.. Hopefully the dev mailing list will be more attentive. |
| 17:29 | mabes | lpetit: yes, thanks for your help |
| 17:29 | lpetit | timcharper: but the tweak with the garbage collector makes me feel bad. I mean AFAIK calling gc does not guarantee that the real gc will happen soon |
| 17:29 | lpetit | np |
| 17:29 | timcharper | lpetit: aware of that drawback |
| 17:29 | timcharper | my research has led me to believe that that is as much as you can do |
| 17:30 | timcharper | which is why I allocate so many date objects.... in my experience it has been reliable... but mileage may vary |
| 17:31 | lpetit | timcharper: yes, I can't think about another way of proving this yet |
| 17:36 | lpetit | timcharper, mabes: which version of clojure are you using ? |
| 17:36 | timcharper | 1.2 |
| 17:36 | mabes | lpetit: various versions of 1.2, including the most recent RC |
| 17:37 | lpetit | maybe I must help the OOM happen in my machine, maybe cljr added some -Xmx1024M to the java thread ... hmmm ('cause it does not happen "as is") |
| 17:42 | mabes | lpetit: try this project: http://github.com/bmabey/doseq-future |
| 17:44 | mabes | lpetit: you can specify how long you want the function to run for.. which should eventually cause an OOM.. but another way to verify is to compare what the heap looks like (via visualVM) |
| 17:47 | lpetit | mabes: too tired to continue tonight. Will let others on the ml take care of that while I'm sleeping. cu ! |
| 17:48 | mabes | lpetit: cool, thanks again |
| 18:00 | mebaran151 | what's the best way to cast nil to zero |
| 18:02 | raek | mebaran151: that depends. how are you using the result? |
| 18:02 | mebaran151 | trying to max a bunch of values |
| 18:02 | mebaran151 | getting null pointer exceptions |
| 18:02 | raek | where do you get the value from? a map? |
| 18:03 | mebaran151 | I guess I could map #(or % 0) over everything |
| 18:03 | mebaran151 | yep, a map |
| 18:03 | tomoj | uhh |
| 18:03 | raek | ok, then use the three-arg get |
| 18:03 | mebaran151 | yeah |
| 18:03 | tomoj | just remove nil? instead of mapping #(or % 0) |
| 18:03 | mabes | when you get a value from the map you can pass in a default 0 |
| 18:03 | raek | ,(get {:foo 1} :bar 0) |
| 18:03 | clojurebot | 0 |
| 18:03 | mebaran151 | I just thought of three arg get |
| 18:03 | mebaran151 | hmmm I wonder which will be more efficient |
| 18:03 | mebaran151 | these lists might get pretty long |
| 18:04 | mabes | ,(:bar {:foo 1} 0) |
| 18:04 | clojurebot | 0 |
| 18:04 | mebaran151 | is it more efficient to max a bunch of possible 0's or to filter 0's |
| 18:04 | mebaran151 | *filter nils |
| 18:04 | mabes | dunno, it might depend on how sparse your values are. you could try profiling the common case |
| 18:05 | mebaran151 | they probably won't be too sparse |
| 18:05 | raek | both ways should have the same complexity |
| 18:06 | raek | but to filter you still have to get the value for that key |
| 18:06 | raek | so then you might as well pass it the default value to use |
| 18:06 | mabes | seems like it would be n vs 2n, since the filter does an extra loop around the data.. so depending on how big n is that might matter.. |
| 18:07 | mabes | yeah, I would pass the default value |
| 18:07 | raek | filter is lazy, so everyting os done in one pass |
| 18:07 | mabes | duh... |
| 18:07 | raek | oh, misread |
| 18:07 | mabes | I was "duh.."ing me :) |
| 18:08 | mebaran151 | I think the filter would actually be less efficient because it has to test all the values anyway |
| 18:08 | mebaran151 | max automatically excludes 0's anyway |
| 18:12 | tomoj | in what way does it exclude 0's? |
| 18:12 | mebaran151 | I mean they don't matter |
| 18:12 | tomoj | ah, right |
| 18:13 | mebaran151 | adding a bunch of 0's to max shouldn't change it's behavior |
| 18:13 | tomoj | it's a (> x y) instead of a (nil? y) for each 0, I think |
| 18:14 | tomoj | plus an extra (nil? y) for every non-0 |
| 18:15 | mebaran151 | yeah |
| 18:15 | mebaran151 | the extra nil? checks are useless |
| 18:15 | mebaran151 | also, what's the difference between using the delay macro and simply passing an anonymous function |
| 18:16 | mebaran151 | seems like delay and @ are the same as creating an anonymous function no arguments and invoking it if wanted |
| 18:18 | raek | @ is deref |
| 18:18 | mebaran151 | yeah I know that |
| 18:18 | mebaran151 | but how is delay different than using a closure as a thunk |
| 18:18 | raek | ah, not very different |
| 18:19 | mebaran151 | does delay do anything funny with threads or something? |
| 18:19 | raek | I think tou can only force a delay once |
| 18:19 | raek | then the result is cached, or something |
| 18:19 | mebaran151 | deref is force right |
| 18:20 | mebaran151 | for delays that is |
| 18:20 | raek | yeah, either force or deref can be used |
| 18:21 | raek | ,(let [a (atom 0), d (delay (swap! a inc))] [@d @d @d]) |
| 18:21 | clojurebot | [1 1 1] |
| 18:23 | mebaran151 | that behavior of delay is actually useful here |
| 18:24 | mebaran151 | I want to possibly pass the results of a query to two functions, that may never actually need the result at all |
| 18:25 | mebaran151 | either one may or may not need it, so the delay macro will automatically let them share the cached result |
| 18:26 | raek | lazy sequences is a similar idea |
| 18:52 | raek | moustache's 'app' really maximizes the usage of () [] {} |
| 18:53 | tomoj | effectively, you think? |
| 18:53 | tomoj | I got lost in it for a while, but I'm not sure whether I just didn't give it enough time to sink in |
| 18:53 | raek | I'm still reading up on it... |
| 18:54 | raek | almost every clojure data structure or scalar has a mening at every point |
| 18:54 | raek | it's compact |
| 18:55 | raek | but if that's a good thing, I don't know yet |
| 18:55 | tomoj | I found it made it difficult to do things I felt like I wanted to do often |
| 18:55 | raek | I'm just impressed that he managed to make a syntax that semantically compact |
| 18:55 | tomoj | but those things could have been stupid things that I wouldn't want to do often in a real project |
| 18:55 | tomoj | yeah |
| 18:55 | raek | what kind of things? |
| 18:56 | tomoj | pretty dense |
| 18:56 | tomoj | like, for example, returning an explicit response map |
| 18:57 | raek | hrm, I guess so... :) |
| 18:57 | raek | #(fn [request] {...}) maybe |
| 18:58 | raek | but yeah, no literal syntax for that |
| 18:58 | tomoj | even though the syntax guide seems to suggest it should work |
| 18:59 | tomoj | generally it was feeling like I had to make too many trivial wrapping fns, yeah |
| 18:59 | tomoj | but again I think I probably just don't grok it yet |
| 18:59 | raek | {a-literal ring-response-map} <-- that? |
| 18:59 | raek | I haven't figured out that one yet, too |
| 19:01 | tomoj | I think it's just clobbered by the other meaning for maps |
| 19:02 | raek | just putting a symbol in the "a-literal" position doesn't work for me |
| 19:03 | tomoj | I just assumed it meant the whole map was supposed to be a literal ring response map |
| 19:03 | tomoj | like {:body ... :code ...} |
| 19:04 | raek | oh, right... that worked |
| 19:04 | wolfjb | how do you concatenate strings? (concat "a" "b") gives back a seq not a string |
| 19:04 | raek | wolfjb: (str "a" "b") |
| 19:04 | wolfjb | raek: thanks! |
| 19:05 | raek | I think I saw a strcat in contrib somewhere |
| 19:05 | raek | it probably did (fn [coll] (apply str coll)) |
| 19:07 | wolfjb | it's probably just an experience thing, but the only difficulty I'm having with clojure is finding these kinds of answers. of course, once I ask here the answer is nearly obvious (like why didn't I think of that? kind of obvious) |
| 19:08 | wolfjb | another question is how do I "overload" a function with different arity? I've been reading defmulti/defmethod, but the syntax for how to have a method with 2 parms and the same named method with 3 is escaping me |
| 19:09 | Scriptor | wolfjb: I think the regular fn can take multiple arity definitions |
| 19:09 | wolfjb | it's probably right there in front of me somewhere, but I just haven't found it |
| 19:09 | Scriptor | lemme find the docs |
| 19:09 | lancepantz | wolfjb: (defn foo ([a b] (do blah)) ([a b c] (do blah))) |
| 19:09 | Scriptor | yep, that |
| 19:10 | wolfjb | nice |
| 19:10 | wolfjb | I missed seeing that |
| 19:10 | evanrmurphy_ | wolfjb: are you talking about: (defn foo ([] (foo 1)) ([x] (+ x 1))) ? |
| 19:10 | raek | http://faustus.webatu.com/clj-quick-ref.html <-- that one can be handy |
| 19:10 | wolfjb | thanks! |
| 19:12 | Scriptor | huh, didn't know about this before: http://clojuredocs.org/ |
| 19:12 | raek | that one has a lot of examples too |
| 19:13 | Scriptor | very well laid out as well, I like how it shows the source for functions |
| 19:14 | evanrmurphy_ | Scriptor: Thanks for the clojuredocs link |
| 19:15 | wolfjb | thanks for all the help and tips! |
| 19:24 | polypus | ~ping |
| 19:24 | clojurebot | PONG! |
| 19:25 | polypus | i have an ant task java class that i'd like to use from clojure. is the best way to do this with lancet? if so, is this documented anyplace? |
| 19:30 | polypus | basically what i'm trying to do is use an ant task class, which if i were writing a build.xml file, i'd have to write a taskdef to use, inside a leiningen plugin. i'm an ant noob, so any tips, obvious or not could help |
| 19:31 | lancepantz | polypus: there is a really cool macro we use inside of http://github.com/ninjudd/cake/blob/master/src/cake/ant.clj |
| 19:32 | polypus | lancepantz: great. thanks i'll have a look |
| 19:32 | lancepantz | your able to call stuff with (ant SSHExec {:host "foo"}) |
| 19:32 | lancepantz | where the map basically becomes your setters to the ant tasks |
| 19:32 | polypus | any dependencies other than ant? |
| 19:34 | lancepantz | http://github.com/ninjudd/cake/blob/master/src/cake/tasks/compile.clj#L8 is a good example of the usage |
| 19:34 | lancepantz | i don't think so, if you just pull that fn out |
| 19:34 | lancepantz | you'll have to import the ant task classes that you want to use |
| 19:34 | lancepantz | or fully qualify them with the package i suppose |
| 19:35 | lancepantz | which task are you trying to use actually? |
| 19:35 | polypus | lancepantz: com.sun.tools.javafx.ant.JavaFxAntTask |
| 19:36 | polypus | not sure if having to import it will be a problem though |
| 19:36 | clojurebot | not a problem, the average bid for it on getacoder is $821.00 |
| 19:36 | lancepantz | ah, i dont have any examples of that one |
| 19:37 | lancepantz | you don't *have* to, its just cleaner |
| 19:37 | polypus | problem is on different systems it sits in different places, and i was hoping to use a leiningen project key to define that place |
| 19:38 | polypus | lancepantz: cool, i'll have to read through your code a bit. thanks for the tip |
| 19:38 | lancepantz | np |
| 19:42 | polypus | actually, that brings up another question. is it possible to add paths to the classpath which lein builds up from within a lein plugin |
| 20:09 | mikejs | is there a friendlier web interface to the clojure core docs than the ones at clojure.github.com? |
| 20:10 | lancepantz | mikejs: use swank? |
| 20:11 | mikejs | I sometimes like having docs outside my immediate dev environment, particularly when I'm just sort of browsing/not 100% sure what I'm looking for |
| 20:12 | lancepantz | you may be interested in http://clojuredocs.org/ |
| 20:12 | mikejs | oh, nice |
| 20:12 | mikejs | I was actually thinking of making a little more featured doc browsing tool as a way of learning more clojure/compojure/ring etc. |
| 20:13 | mikejs | though that right there might be what I'm looking for |
| 20:13 | mikejs | thanks |
| 20:20 | tomoj | mikejs: please make a better one in clojure/compojure/ring :) |
| 20:21 | Scriptor | mikejs: cojuredocs with some tutorial sections built in would be pretty neat |
| 20:21 | mikejs | well, I think I'll still tackle it as a learning exercise, but I'm not sure I want to push it publicly and split the community |
| 20:21 | mikejs | would be nice if clojuredocs were open source |
| 20:23 | tomoj | damn the community |
| 20:23 | tomoj | :P |
| 20:26 | mikejs | tomoj: well what would you like to see? |
| 20:26 | tomoj | it would just make me very happy to see it done beautifully in clojure |
| 20:27 | mikejs | gotcha |
| 20:28 | tomoj | I wonder who owns the examples on clojuredocs |
| 20:32 | mikejs | good question; site doesn't make it clear |
| 20:32 | gstamp | examples are licensed under the creative commons |
| 20:33 | gstamp | I know when they first started out they populated with some examples from http://clojure-examples.appspot.com/ |
| 20:44 | tomoj | oh, where did I agree to make my example CC? |
| 21:00 | mikejs | it would be cool if the examples and source listings on clojuredocs were annotated with embedded docs |
| 21:00 | mikejs | like links/popups with docstrings for functions they call |
| 21:01 | mikejs | I'm picturing loading the example code in a sandbox and introspectively linking everything up |
| 21:02 | Scriptor | hmm, could the syntax highlighter be extended for that? |
| 21:03 | Scriptor | they apparently already show core functions the code listings use |
| 21:04 | replaca | mikejs: if you want to start from the autodoc source, you can feel free. If it doesn't have a license on it, I'll happily put one there |
| 21:05 | mikejs | replaca: sounds great, I'd appreciate that |
| 21:08 | mikejs | Scriptor: looks like their syntax highlighting is done in javascript; I think something more extensive like I'm imagining would require actually loading the code and introspecting |
| 21:14 | gstamp | tomoj: when you click add example it's right below the text box. |
| 21:17 | tomoj | gstamp: ah :) |
| 21:33 | replaca | mikejs: autodoc lives @ github.com/tomfaulhaber/autodoc. It's always in some interesting state of flux, but the html gen has been pretty stable for a while now |
| 21:36 | mikejs | replaca: thanks |
| 22:58 | micrypt | Would it be a decent idea to work through SICP in Clojure? Or should I be looking at Scheme? |
| 22:58 | lancepantz | micrypt: http://sicpinclojure.com/ |
| 22:59 | lancepantz | some guy also had a github repo full of the examples, which was more complete last i looked |
| 23:01 | micrypt | lancepantz: This looks excellent. Thank you. |
| 23:04 | lancepantz | ,(let [foo "1.2.3"] (into [] (.split foo "."))) |
| 23:04 | clojurebot | [] |
| 23:04 | lancepantz | ,(let [foo "1.2.3"] (into [] (.split foo "2"))) |
| 23:04 | clojurebot | ["1." ".3"] |
| 23:04 | lancepantz | ??? |
| 23:04 | technomancy | ok, everyone on the latest version of lein can now do: lein install swank-clojure 1.3.0-SNAPSHOT && swank-clojure 4004 # bam! server started. |
| 23:05 | technomancy | granted I am the only person on the latest version of lein right now. |
| 23:06 | talios | 'lo technomancy |
| 23:06 | lancepantz | anyone know why that first form doesn't split ^ ? |
| 23:06 | talios | technomancy: did swank-clojure ever get into central or still somewhere in clojars? |
| 23:07 | technomancy | talios: I don't know if it made it to central |
| 23:07 | technomancy | stuart S talked about it, but I don't remember if he went through the paperwork |
| 23:08 | talios | must get back into some clojure hacking. been way too long since I've delved in. |
| 23:09 | technomancy | oh, will they not take it unless it has my domain name as its group-id? |
| 23:09 | technomancy | sheesh |
| 23:09 | technomancy | I don't want it to be tied around my neck like an albatross. =\ |
| 23:10 | talios | no - I was just meaning I'd not seen it in the usual place in central. |
| 23:10 | technomancy | oh, I see |
| 23:11 | talios | oss.sonatype.org's nexus setup is a bit more restrictive tho - you need to proove ownership/control of the groupId - which is just more for tracability |
| 23:12 | talios | altho "proove" is quite flexible, i.e. I just said "I own the domain, its mine mmmkay?" and was all sweet and away laughing |
| 23:12 | slyrus | technomancy: it is an ancient lisp programmer and he stoppeth one of three... |
| 23:12 | lancepantz | ,(let [foo "1.2.3"] (into [] (.split foo "\\."))) |
| 23:12 | clojurebot | ["1" "2" "3"] |
| 23:13 | technomancy | the bureaucracy around the process has always left me disinterested |
| 23:13 | lancepantz | so i guess .split coerces strings into regexes |
| 23:14 | talios | technomancy: back when you had to rsync everything it was horrible, but now with nexus and the staging stuff, it took me less than 6 hours from emailing @sonatype to having an account/repo setup and synced to central |
| 23:14 | igms | I got cljr and it works great, but I find that it takes quite some time to start even simple hello world clojure apps. What is the "right" way to run stuff while developing an app w/o waiting every single time for the whole thing to load |
| 23:14 | igms | I am not using emacs or slime... rather textmate with clojure bundle |
| 23:14 | slyrus | use emacs and slime |
| 23:15 | technomancy | talios: is it that common to have clojure projects that don't already have clojars as a repo though? |
| 23:15 | slyrus | at least that's what the ancient lisp programmers use |
| 23:15 | igms | could I somehow avoid emacs? :-) |
| 23:15 | igms | not really a fan of it |
| 23:15 | slyrus | sure, just wait every single time for the whole thing to load |
| 23:16 | slyrus | as you say |
| 23:16 | talios | technomancy: probably not, but it's really annoying having a dependency in central that fails because its deps arn't also in central. Even if its a loose dependency for optional functionality |
| 23:16 | technomancy | textmate doesn't really have good subprocess support from what I understand |
| 23:17 | technomancy | talios: oh, because clojure-maven-plugin depends on swank-clojure? |
| 23:17 | lancepantz | igms: i'd keep an eye on this, it's incomplete right now though http://github.com/swannodette/textmate-clojure/tree/cake |
| 23:18 | talios | technomancy: yeh, it's a loose dependency as its a forked process, and only when using clojure:swank so not a major blocker, just being a "nice citazen". |
| 23:19 | technomancy | talios: can you submit it, or does it have to be me? |
| 23:19 | slyrus | igms: you might consider trying emacs/slime/paredit for a day. paredit is essential to the way I write code. |
| 23:19 | technomancy | I can add you as a maintainer if that would help. =) |
| 23:20 | talios | technomancy: for a non-auto-syncing thing I think we can still submit a "deploy" jira ticket and it'll happen when an admin gets time, i'll see what needs to be done there. |
| 23:20 | lancepantz | igms: http://github.com/ninjudd/cake will do what you want now, it's still immature though |
| 23:21 | technomancy | talios: 1.2.1 has all the "good stuff" in it; I actually don't even really have any plans for it beyond that. |
| 23:21 | technomancy | talios: that would be great; thanks |
| 23:21 | igms | lancepantz: thanks |
| 23:21 | technomancy | for a single version it's just a jar and a pom; figure it can't be too tricky. |
| 23:24 | technomancy | so... who's interested in publishing Clojure projects that are easy to launch from the CLI? |
| 23:27 | Scriptor | technomancy: what do you mean, exactly? |
| 23:29 | hiredman | does anyone know of a ring middleware that doe http auth? |
| 23:30 | technomancy | Scriptor: well for instance now if you install swank-clojure you get a shell script installed that lets you run a standalone server |
| 23:30 | technomancy | kind of like cljr |
| 23:31 | technomancy | but any project can bundle a script; it's not limited to the ones that come with cljr |
| 23:33 | Scriptor | technomancy: hmm, so would this come with a script to manage everything needed to launch the project? |
| 23:34 | technomancy | Scriptor: right |
| 23:37 | technomancy | hiredman: I saw something called sandbar that might fit the bill |
| 23:38 | technomancy | tomoj: hey, you were asking about read-project? |
| 23:39 | hugod | technomancy: I'll take a look at the scripting for pallet |
| 23:39 | technomancy | the answer is basically yes, the mutability is there because we can't depend on defproject being the last form in project.clj, so we can't use the return value of load-file. |
| 23:40 | technomancy | hugod: yeah, I figured you'd be interested. =) |
| 23:40 | technomancy | hugod: right now it only supports one shell wrapper per project. will probably lift that restriction in the future, but not for 1.3 |
| 23:41 | hugod | technomancy: is the argument parsing flexible? |
| 23:41 | technomancy | but it's super-easy to use; just include :shell-wrapper true in project.clj and it will look for bin/pallet in resources to use as a wrapper, otherwise it will use the default templated script |
| 23:42 | technomancy | hugod: it does clojure.main -e "(use 'foo.core)(apply -main *command-line-args*)" basically |
| 23:42 | technomancy | oh, with a $@ on the end |
| 23:42 | cais2002 | how do I test whether a given form is a regular expression? |
| 23:42 | technomancy | hugod: so you can handle it all in clojure. but if the default templated one doesn't cut it, you can include a script in resources/. |
| 23:42 | cais2002 | (re? #"test") ==> true |
| 23:44 | hugod | technomancy: does the generated script downloads all the dependencies? |
| 23:48 | technomancy | hugod: no, the script gets written out after lein has downloaded the dependencies already |
| 23:48 | cais2002 | ,(defn isre? [p] (= java.util.regex.Pattern (type p))) |
| 23:48 | clojurebot | DENIED |
| 23:48 | cais2002 | -> (defn isre? [p] (= java.util.regex.Pattern (type p))) |
| 23:48 | sexpbot | java.lang.SecurityException: Code did not pass sandbox guidelines: () |
| 23:49 | technomancy | hugod: interesting idea though; it wouldn't be too hard to do if you just templated it at script generation time. |
| 23:51 | technomancy | aw hell; just realized the templated script doesn't include transitive deps yet. |
| 23:51 | technomancy | facepalm |
| 23:53 | ataggart | can some kind soul please tell me what steps are necessary for one to get changes made in a local text file into github from whence the file was originally cloned? |
| 23:54 | slyrus | git push |
| 23:55 | ataggart | ~/clojure-contrib/ git push |
| 23:55 | ataggart | Everything up-to-date |
| 23:55 | clojurebot | I don't understand. |
| 23:55 | Scriptor | ataggart: did you git add it? |
| 23:55 | slyrus | and commit |
| 23:56 | Scriptor | http://git-scm.com/ |
| 23:56 | ataggart | I edited a file |
| 23:56 | ataggart | that's the extent of the operations I have performed |
| 23:56 | Scriptor | look at the instructions at the bottom |
| 23:56 | Scriptor | don't worry about the patch part |
| 23:56 | slyrus | try making sure you've got the local commit showing up properly in the log before considering pushing |
| 23:56 | Scriptor | instead of format-patch, you want to do git push |
| 23:57 | technomancy | ataggart: so you haven't committed yet? |
| 23:57 | ataggart | I'm not clear on what I'm adding |
| 23:57 | ataggart | I checked out the project from github, edited a file. |
| 23:57 | Scriptor | ataggart: have you used git before? |
| 23:57 | ataggart | erm, "cloned" whatever the git jargon is |
| 23:58 | ataggart | used insofar as I try to do something, it pisses me off, and I go do something else for a few months |
| 23:58 | ataggart | :) |
| 23:58 | technomancy | ataggart: do you use emacs? |
| 23:58 | ataggart | no I have a mouse |
| 23:58 | Scriptor | ataggart: ok, then look at http://git-scm.com/, and do as I said above, instead of format-patch use git push |
| 23:58 | ataggart | git add (files) |
| 23:58 | technomancy | ataggart: I was going to say, if not then I agree; I hate using git outside of Emacs too. =) |
| 23:58 | ataggart | I assume that means I'm supposed to specify which files I changed? |
| 23:58 | Scriptor | right |
| 23:58 | Raynes | I actually use the mouse more than I should in Emacs. |
| 23:59 | ataggart | and I have to do that for every file? |
| 23:59 | ataggart | manually? |
| 23:59 | Raynes | Only thing I hate about magit is that I always have to make the first push from a terminal, otherwise magit screws stuff up. |
| 23:59 | Scriptor | ataggart: you can also do git add . |
| 23:59 | ataggart | ok I did that |
| 23:59 | ataggart | no output |