2010-04-30
| 00:40 | Tordek | hi |
| 00:40 | Tordek | I'm trying to use fact, but I think I'm doing it wrong |
| 00:41 | Tordek | I got the source and built the jar, but then "java -jar fact.jar" says it can't find the library |
| 00:48 | Blackfoot | i haven't used fact, but what is the specific error? |
| 00:49 | Tordek | sorry, er |
| 00:50 | Tordek | $ java -jar fact.jar |
| 00:50 | Tordek | Failed to load Main-Class manifest attribute from |
| 00:50 | Tordek | fact.jar |
| 00:50 | sexpbot | Command not found. No entiendo lo que estás diciendo. |
| 00:53 | Blackfoot | Tordek: so it looks like the -main function is in fact.main in main.clj. you may need to do something more along the lines of java -cp fact.jar fact.main |
| 00:54 | Tordek | $ java -cp fact.jar fact.main |
| 00:54 | Tordek | Exception in thread "main" java.lang.NoClassDefFoundError: fact/main |
| 00:54 | sexpbot | Command not found. No entiendo lo que estás diciendo. |
| 00:54 | Tordek | same with just "main" |
| 00:54 | Tordek | oh, wait, it goes deeper than that |
| 00:55 | Tordek | there are no .class files in the jar |
| 00:55 | Tordek | hmm, the ant task just skips the compile phase |
| 00:57 | Blackfoot | yea, that's what i'm seeing. i think it needs to know where clojure.jar is in order to build it |
| 00:58 | Tordek | odd... I'm almost certain it compiled once.. |
| 00:59 | Tordek | ok, so, how do I inform it of the location of clojure? |
| 00:59 | Blackfoot | ant -Dclojure.jar=clojure-1.1.0.jar |
| 00:59 | Blackfoot | (assuming you have that file in the current dir) |
| 01:01 | Tordek | ok, at least it errors on compile now... |
| 01:01 | Tordek | [java] java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes |
| 01:02 | Blackfoot | hrm i did not see that when mine build. what clojure version did you use? |
| 01:03 | Tordek | 1.1.0 |
| 01:03 | leifw | any clojure-hadoop users arrived? |
| 01:05 | Blackfoot | so here's what i did: git clone git:...fact.git, cd fact, cp ../clojure-1.1.0.jar . , ant -Dclojure.jar=clojure-1.1.0.jar |
| 01:06 | Blackfoot | that clojure.jar came from another project that was using lein |
| 01:08 | Tordek | odd... I deleted the folder and recloned it and now it compiled (with a little bitchin' about not finding clojure-conrib, but then I added it and it shut up) |
| 01:09 | Blackfoot | hrm, maybe a leftover class or something |
| 01:09 | Blackfoot | so then i can run it with java -cp fact.jar:clojure-1.1.0.jar fact.main |
| 01:10 | Blackfoot | but i think it is supposed to take a directory with tests in it |
| 01:12 | Tordek | ok, I managed to get it running |
| 01:12 | Tordek | now, I gotta learn how to write the tests, apparently >_> |
| 01:50 | LauJensen | Good morning all |
| 01:51 | hoeck | good morning Lau |
| 01:53 | LauJensen | Ubuntu 10.04 is released |
| 02:03 | Raynes | LauJensen: I preordered a disc a few days ago. |
| 02:04 | LauJensen | Cool - But why ? |
| 02:04 | LauJensen | @ Raynes |
| 02:05 | Raynes | Because I'm running on a dial-up connection. |
| 02:05 | LauJensen | ah.. then running isn't the word |
| 02:05 | Raynes | Crawling. |
| 02:05 | LauJensen | How much do you have to pay to get a disk sent your way ? |
| 02:05 | Raynes | Nada. |
| 02:05 | Raynes | It's free. |
| 02:05 | Raynes | Because I'm a poor young padawan. |
| 02:06 | Raynes | It just takes forever. |
| 02:06 | Raynes | Up to 10 weeks. |
| 02:06 | Raynes | I'm still running on Hardy. |
| 02:06 | Raynes | Crawling* |
| 02:06 | Raynes | ;) |
| 02:07 | LauJensen | Ah ok - Its a shame we dont live a little closer, and you not in the US, because then I could have sent you a CD today :| |
| 02:07 | Raynes | I'd rather wait a month or so until bugfixes are out anyway. |
| 02:08 | Raynes | I'm going to be doing a fresh install on a dedicated partition this time, so I need time to figure out how I'm going to back all my stuff up. |
| 02:10 | LauJensen | Oh |
| 02:11 | LauJensen | I always have something like sda1=root, sda2=home, sda3=root2 sda4=swap |
| 02:11 | LauJensen | So I can reinstall any linux on sda1 and boot up to the exact same desktop every time, and run experimental OS's on sda3, also with the same desktop |
| 02:12 | LauJensen | And the trick is, I wrapped apt-get install to always pipe the name of the app into a file in my home, so when I reinstall I just run a script on that file which installs all the programs that I manually installed on the old version |
| 02:14 | scottj | and you haven't had any problems with experimental gnome etc messing up your settings for the stable version? |
| 02:15 | LauJensen | scottj: One time a KDE desktop did add some garbage, which I flushed with the OS but nothing major |
| 02:17 | replaca | Raynes: I'm with you dude, still on Hardy |
| 02:18 | Raynes | replaca: Hardy is awesome, isn't it? It works. |
| 02:18 | Raynes | That's the most important thing: it works. |
| 02:18 | vu3rdd | LauJensen: you can use dpkg-scanpackages |
| 02:18 | replaca | I was excited to upgrade today, but life got a little crazy and I need to keep the machine going |
| 02:18 | mmarczyk | good morning :-) |
| 02:19 | LauJensen | Raynes: If thats your attitude you should be on Debian, enjoying all the benefits of Git 0.8 or so :) |
| 02:19 | mmarczyk | Ubuntu 10.04, well what do you know |
| 02:19 | vu3rdd | problem with ubuntu is that upgrades are never smooth. You have to do fresh install to get all the advantages of the new release. |
| 02:19 | replaca | yeah, but slowly I've begun to want to be on something newer. about a month ago I decided to upgrade, but I realized that lynx was right around the corner |
| 02:19 | LauJensen | Ubuntu 10.04 is miles ahead of Hardy |
| 02:19 | mmarczyk | more interestingly, a new version of Sun JDK |
| 02:20 | mmarczyk | vu3rdd: I might be especially lucky, but I haven't had any problems with upgrades thus far |
| 02:20 | LauJensen | mmarczyk: I've never had anything but problems with the dist-upgrades |
| 02:20 | LauJensen | (and I dont know of anybody who has except you) |
| 02:20 | mmarczyk | in fact, I don't recall having to reinstall Linux for any reason other than wanting to switch distros :-) |
| 02:20 | mmarczyk | alright then, guess I might be especially lucky |
| 02:20 | vu3rdd | mmarczyk: Oh. ok. I had a lot of issues in the past on a work laptop and finally I converted that machine (also) to debian. |
| 02:21 | replaca | my probs have all been cause of my nvidia card, but lynx is supposed to fix that |
| 02:21 | mmarczyk | though that's also with a machine at the uni :-) |
| 02:21 | mmarczyk | and a friend is doing the same with annoying, but fixable issues |
| 02:21 | vu3rdd | But yes, fresh installs are really nice. |
| 02:21 | Raynes | They are when you don't have a ton of stuff to backup and nowhere to put it. |
| 02:22 | scottj | you have bigger problems than upgrading your distro if you don't have a backup of valuable stuff :) |
| 02:23 | mmarczyk | scottj: spot on :-) |
| 02:23 | Raynes | I'm running on a Wubi installation and I have been for about a year and a half. I backup stuff by moving the root disk file to the Windows side. |
| 02:23 | mmarczyk | also, where's the foss spirit, if we don't break our systems with dist-upgrade and report the bugs then who's gonna do it? ;-) |
| 02:24 | Raynes | So my valuable stuff is indeed backed up, but that wont count when I install on a dedicated partition. |
| 02:24 | Raynes | Because that could screw up Windoze as well. |
| 02:25 | LauJensen | mmarczyk: Dont get me started on that spirit. You know this tradition where someone says "I tried to installed X and it broke my system", and instead of helping the support goes "Why are you trying to install X anyway, you should be using Y instead of being a moron..." |
| 02:26 | LauJensen | Then I really found a keeper recently, this guy had his battery in his Macbook Pro roasted by poor power management in Ubuntu and the capacity degraded 20 - 40% over a few weeks only. The supporter goes "Why are you trying to run Linux on overpriced hardware like Apple anyway?" :) |
| 02:26 | Raynes | Priceless. |
| 02:29 | mmarczyk | LauJensen: aye, that's rather off-putting |
| 02:29 | LauJensen | happens all the time if you follow irc/forum discussions :) |
| 02:29 | LauJensen | And you have seen me do the same, if something have complained about a problem with VimClojure :) |
| 02:30 | LauJensen | s/something/someone |
| 02:30 | mmarczyk | :-) |
| 02:30 | LauJensen | Raynes: You should plug that into Botjure, if someone says s/x/y it replaces the text and reprints |
| 02:30 | Raynes | $sed #clojure i s/plug/secks/ |
| 02:30 | sexpbot | Raynes: You should secks that into Botjure, if someone says s/x/y it replaces the text and reprints |
| 02:30 | Raynes | It just isn't automagic. |
| 02:31 | Raynes | I didn't write that though, and the person who did is on the verge of a bit of a rewrite right now. Once he's finished, I'll incorporate your idea, because it's awesome. |
| 02:31 | LauJensen | ERC does it though, you guys just cant see |
| 02:32 | mmarczyk | LauJensen: still, I'd say sending in the occasional bug report is a nice thing to do, and if its re: dist-upgrade breakage, it's likely to be received in a more reasonable way |
| 02:33 | mmarczyk | ERC :-) |
| 02:33 | mmarczyk | incidentally, your blog post made me give ERC a try |
| 02:33 | Raynes | I'm not man enough for ERC. |
| 02:33 | LauJensen | I found a kernel regression in 10.04 and it actually popped up itself asking a series of questions, collecting information, checking if I wanted to report only to Ubuntus staff or also Kerneloop, and at the final dialog it borks "Cannot report problem: This is not an Ubuntu package" |
| 02:33 | mmarczyk | when I finally decided to come to #clojure |
| 02:33 | mmarczyk | thanks for that! |
| 02:33 | LauJensen | mmarczyk: Are you liking it? :) |
| 02:34 | LauJensen | Sweeeet :) |
| 02:34 | mmarczyk | I can't believe the sort of things I'm doing in Emacs these days |
| 02:34 | LauJensen | I set mine up so I open Emacs and start working, then when I miss Raynes too much, I hit f1, enter my password and off it goes |
| 02:34 | clojurebot | emacs is an out-moded belief system |
| 02:34 | mmarczyk | and I'm only getting started |
| 02:34 | Raynes | I'm not man enough for erc. |
| 02:34 | mmarczyk | I mean, started on using Emacs for stuff other than Lisp coding |
| 02:35 | LauJensen | mmarczyk: tell me about it. Couple of weeks ago I was sitting at a clients office developing a financial app in Emacs, feels good though |
| 02:41 | mmarczyk | if I find a way to stop ansi-term from flickering, I'll actually switch to doing all my terminal stuff inside Emacs |
| 02:41 | mmarczyk | I already use it a lot, along with eshell for stuff which doesn't require proper terminal emulation |
| 02:42 | mmarczyk | I'm doing it, yet I'm having a hard time believing it :-) |
| 02:43 | wooby | i've found it easier to run screen inside emacs than vice versa, with ansi-term |
| 02:43 | wooby | my buffer of no shame, filled with screen and vim :) |
| 02:47 | mmarczyk | yeah, I actually tried running Vim inside Emacs too :-D |
| 02:48 | mmarczyk | then I told myself I was being ridiculous and fired up a separate gvim :-) |
| 02:48 | mmarczyk | I guess one day I might not stop myself! |
| 02:49 | wooby | lol |
| 02:56 | LauJensen | mmarczyk: you can view files in Emacs as well, you dont need Vim for that |
| 02:56 | mmarczyk | LauJensen: you don't say :-) |
| 02:57 | mmarczyk | (got my morning tea, good... :-)) |
| 02:58 | LauJensen | Im actually on tea this morning as well.... weird |
| 02:58 | mmarczyk | I need to figure out the VC magic in Emacs, then I can stop mixing in Vim for writing commit messages |
| 02:59 | mmarczyk | I actually find that Vim's rendering works better for me, though |
| 03:00 | mmarczyk | do you guys have the problem where sometimes little arrows like those indicating word wrap appear in Emacs when no word wrapping is actually needed |
| 03:00 | mmarczyk | and then never go away until M-x redraw-display ? |
| 03:00 | LauJensen | Not me |
| 03:00 | mmarczyk | and don't get me started on C-n jumping to mid-page without moving the visible part of the buffer when I attempt to scroll |
| 03:01 | mmarczyk | when a line is being wrapped |
| 03:01 | LauJensen | But for VC you have either Magit if you're advanced, or Egg if you just want a simple pretty interface for branching committing, stashing etc |
| 03:01 | mmarczyk | though that's not much of a problem, since I tend to either truncate-lines or use longlines-mode |
| 03:01 | LauJensen | mmarczyk: you can complain all you want, but you know its configurable right? E |
| 03:01 | mmarczyk | LauJensen: my particular complaints have to do with bugs |
| 03:02 | mmarczyk | a way to configure those a way could be considered a 'bug fix' -- and I'd love to know of one :-) |
| 03:02 | mmarczyk | re: Magit -- is it worth the time investment in your opinion? |
| 03:02 | Chousuke | yes |
| 03:03 | LauJensen | Depends entirely on your use. I personally dont use the advanced features more than 2 times a year, so I'm sticking with Egg. |
| 03:03 | mmarczyk | hm :-) |
| 03:03 | mmarczyk | with these two opinions, I'm about where I was before ;-) |
| 03:03 | mmarczyk | guess I'll give both a go |
| 03:03 | LauJensen | mmarczyk: hang on |
| 03:04 | Chousuke | I use magit since it's still being developed, albeit somewhat slowly |
| 03:04 | LauJensen | http://alexvollmer.com/posts/2009/01/18/meet-magit/ |
| 03:04 | sexpbot | " Alex Vollmer — Meet Magit!" |
| 03:04 | mmarczyk | (note that I occasionally complain about both Vim and Emacs and I love them both :-)) |
| 03:04 | LauJensen | Everything that guy does with Magit in terms of reflogs, pushing pulling cannot be done in Egg, but Egg looks muuch nicer, as you can see on its Github page |
| 03:04 | mmarczyk | LauJensen: cool, thanks! |
| 03:04 | Chousuke | in any case, magit is much preferable to git add -p |
| 03:04 | Chousuke | in my opinion, that's enough reason to use it. |
| 03:04 | LauJensen | Chousuke: thats certainly true |
| 03:05 | mmarczyk | -p ? I didn't even know that switch :-( |
| 03:05 | Chousuke | mmarczyk: it allows you to stage chunks of code instead of whole files |
| 03:05 | Chousuke | mmarczyk: useful if you make unrelated changes in a single file, or just don't want to commit everything |
| 03:06 | mmarczyk | oh? in that case, *why didn't I know of that switch!?* |
| 03:06 | mmarczyk | thanks :-) |
| 03:06 | LauJensen | mmarczyk: But you can do the same in Egg |
| 03:06 | Chousuke | mmarczyk: with magit you just press tab on a staged/unstaged files and it expands to a chunk view and you can again stage/unstage those |
| 03:07 | hiredman | magit lets you stage lines |
| 03:07 | Chousuke | LauJensen: egg doesn't let you split the chunks though as far as I know :/ |
| 03:07 | Raynes | Magit is awesome. |
| 03:08 | Chousuke | LauJensen: that was the primary reason I moved to magit. And the unmaintainedness of egg :P |
| 03:08 | mmarczyk | wow, guys, thanks a bunch |
| 03:08 | LauJensen | Chousuke: No you dont split line-wise like hiredman mentions, but you do get to see your editions to a file as patches, which you can individually stage/unstage |
| 03:08 | Chousuke | LauJensen: yes, but can you split those patches? |
| 03:08 | LauJensen | no |
| 03:09 | mmarczyk | I get the feeling that I won't be able to understand what my work flow might have looked like before after I start using one of these :-) |
| 03:09 | Chousuke | git add -p and magit let you do that if the chunk is too large |
| 03:09 | Raynes | If you load an ns with a bunch of method definitions for a multimethods, and use remove-ns on it, are those methods still seen by the multimethod? |
| 03:09 | Raynes | s/multimethods/multimethod/ |
| 03:09 | Chousuke | yes. |
| 03:10 | Raynes | Is there anyway to make them disappear? |
| 03:10 | Raynes | I'd like to murder them with an axe. |
| 03:10 | Chousuke | I think multimethods have a java method fro that. |
| 03:10 | mmarczyk | ,(doc remove-method) |
| 03:10 | clojurebot | "([multifn dispatch-val]); Removes the method of multimethod associated with dispatch-value." |
| 03:10 | Raynes | I'll check that out. |
| 03:10 | Chousuke | oh, right. |
| 03:11 | Raynes | Well, that would work. |
| 03:11 | mmarczyk | don't know of a way to remove them by ns, though |
| 03:11 | Raynes | A bit more tedious than I hoped, but it fit's in with my current plugin system. |
| 03:11 | mmarczyk | or actually |
| 03:12 | mmarczyk | you could use |
| 03:12 | Raynes | Because each plugin's set of commands are categorized in a command-map by the name of the plugin, so I can just iterate through the keys. |
| 03:12 | mmarczyk | ,(doc methods) |
| 03:12 | clojurebot | "([multifn]); Given a multimethod, returns a map of dispatch values -> dispatch fns" |
| 03:12 | Chousuke | I suppose namespaces don't support watchers |
| 03:12 | mmarczyk | than check metadata on the fns |
| 03:12 | mmarczyk | then |
| 03:12 | Raynes | I thought the ns the methods are defined in wasn't put in metadata? |
| 03:12 | Raynes | I believe I asked about something similar a while back. |
| 03:12 | mmarczyk | right :-( |
| 03:12 | mmarczyk | oh bother |
| 03:13 | mmarczyk | you could try extracting their class names |
| 03:13 | Chousuke | meh |
| 03:13 | mmarczyk | they contain a mangled ns name |
| 03:13 | Chousuke | just have an explicit unload function for each plugin ;P |
| 03:13 | mmarczyk | at this point I'm beginning to wonder if it's worth the trouble, though |
| 03:13 | Chousuke | that way you can also allow the plugin to do any teardown it might need. |
| 03:13 | Raynes | Chousuke: I do, but right now, it isn't "true" unloading. Right now, all I do is remove the commands from the command list. And that actually works just fine. |
| 03:14 | Raynes | I'm just curious. |
| 03:14 | Raynes | Each plugin attaches an unload and load fn that does the right thing to the modules ref. |
| 03:16 | Raynes | It unloads the commands (and the hooks when I'm finished with it tonight), but the ns and multimethods are still there. It's probably better that way anyway, but it's nice to know that there is a way to do what I was talking about with multimethods. |
| 03:18 | LauJensen | Ok, 10.04 is burned and ready to be installed, later :) |
| 03:20 | mmarczyk | good luck :-) |
| 03:21 | Raynes | mmarczyk: I give him 3 hours before he is in here whining about bugs. |
| 03:22 | Raynes | Of course, I don't really have a choice, seeing as Canonical is obviously not in a hurry to get me my fix. |
| 03:22 | mmarczyk | :-) |
| 03:23 | mmarczyk | no chance of some magazine bundling a cd? |
| 03:25 | Raynes | mmarczyk: Well, probably. |
| 03:26 | Raynes | I could just buy one and have it in like 3 days. |
| 03:26 | Raynes | But then I'd still be waiting a month before I install it. |
| 03:26 | Raynes | Because I'm a scared lolkitten, and I really do need to figure out how I'm going to backup my stuff OFF of the harddrive. |
| 03:27 | mmarczyk | oh, ok |
| 03:27 | Raynes | Oh wow. Irclj has more watchers than sexpbot. |
| 03:27 | Raynes | :o |
| 03:27 | Raynes | And you're one of them!!! |
| 03:28 | Raynes | http://github.com/Raynes/irclj/graphs/traffic You can see the spike in views from when you guys were playing with sexpbot once the new plugin system was introduced the other day. |
| 03:28 | mmarczyk | yup, I'll brush up on irc-fu while reading Clojure, which is always nice :-) |
| 03:29 | Raynes | I don't promise standards compliance in Irclj. I just hacked it together in such a way that I could replace Pircbot in sexpbot very cleanly, and try to make it prettier to use. |
| 03:29 | Raynes | I need to look at the reference and make sure I'm doin' it rite. |
| 03:29 | mmarczyk | there's no way I'm interested enough to read any irc-related standards |
| 03:29 | mmarczyk | but reading your lib should be fun enough :-) |
| 03:30 | mmarczyk | then I might become interested in the standards just to see if it works as it should ;-) |
| 03:30 | Raynes | My lib /works/ which is the most important thing. But, if people are actually ever going to use it, I need to make sure it's standard compliant (mostly). |
| 03:30 | Raynes | In case, you know, hiredman uses it for clojurebot. ;) |
| 03:30 | mmarczyk | :-) |
| 03:30 | Raynes | When I started it, I really knew nil about IRC. I asked many questions in #botters and such. |
| 03:31 | mmarczyk | that's where I'm at now |
| 03:31 | Raynes | Irclj is good enough to power sexpbot on two different servers, so I'm content. |
| 03:44 | LauJensen | Hmm |
| 03:44 | LauJensen | The install took 20 minutes or so, but the first boot was like..5 - 6 seconds. I dont want to be untruthful in any way, but I think it was that fast or faster |
| 03:44 | wooby | wb LauJensen, looks like at least networking is working! |
| 03:45 | LauJensen | thanks |
| 03:45 | LauJensen | I mean that was _really_ fast |
| 03:46 | mmarczyk | LauJensen: now let's see if you can be equally fast to break it :-) |
| 03:46 | LauJensen | Like a type-hinted version of Ubunjure |
| 03:46 | LauJensen | mmarczyk: yea gimme a sec :) |
| 03:47 | LauJensen | Does anybody have an oppinion on Chrome vs Chromium ? |
| 03:48 | Raynes | Firefox. |
| 03:48 | LauJensen | hehe |
| 03:48 | LauJensen | Firefox feels so 1980s now |
| 03:48 | Raynes | FFJure. |
| 03:48 | Raynes | So does Hardy. |
| 03:48 | LauJensen | True |
| 03:48 | Raynes | You, with your new fangled Lynx. |
| 03:48 | mmarczyk | LauJensen: I'm more interested in Chrome vs. Opera :-) |
| 03:48 | LauJensen | I tried forcefully to go back to Firefox, using plugins to fill the backs - I just couldnt |
| 03:49 | Raynes | Me sitting here on dial-up with Hardy running on Wubi in a Vista installation. |
| 03:49 | Raynes | Might as well just stop programming completely and sink into the 30s. |
| 03:49 | mmarczyk | well, actually I'll be interested in that again when 10.5 appears on Linux |
| 03:49 | LauJensen | Raynes: Yea with your dad running the treadmill so you can get power |
| 03:49 | Raynes | It's my cat running the treadmill. |
| 03:49 | LauJensen | I never found Opera remotely appealing, because of the lack of plugins |
| 03:49 | vu3rdd | when you do (use '[] :only ()) isn't it strange that the vector does need quote but the list does not need it? |
| 03:50 | LauJensen | (:use [something]) or (use '[something]) |
| 03:50 | vu3rdd | yes, the former inside the ns |
| 03:50 | LauJensen | yes |
| 03:50 | LauJensen | the latter on the ladder |
| 03:50 | vu3rdd | ok. |
| 03:51 | LauJensen | vu3rdd: But yea, the whole import,require,use,:use,refer stuff is still a bit confusing to me |
| 03:51 | vu3rdd | yes, to me too. I keep looking at the docs or code every time I use it |
| 03:52 | mmarczyk | LauJensen: well, there's user js for things like click-to-flash |
| 03:52 | mmarczyk | but there's no equivalent to rikaichan / rikaikun |
| 03:52 | LauJensen | mmarczyk: yes, and you can also modify the core in a hex-editor, but whats your point? |
| 03:53 | mmarczyk | my point is that all the things I used to use plugins for in FF (a ways back) or Chrome are done better in Opera out-of-the-box |
| 03:54 | LauJensen | ok |
| 03:54 | mmarczyk | but of course I didn't intend that as an argument |
| 03:54 | mmarczyk | as mentioned, I use rikaikun in Chrome -- no equivalent in Opera to that :-( |
| 03:55 | LauJensen | will have to look that up |
| 03:55 | mmarczyk | there's no equivalent to the way in which Opera allows you to configure all keybindings etc. |
| 03:55 | mmarczyk | then carry that config around |
| 03:56 | mmarczyk | plus I think its session manager is just about the best of those I've used |
| 03:56 | LauJensen | I would like to write a plugin for Chrome, so that it read my .emacs |
| 03:56 | mmarczyk | rikaichan (FF) / rikaikun (Chrome) -- hover your cursor over a kanji to have a cartoon bubble with translations come up :-) |
| 03:57 | mmarczyk | also does clusters of consecutive kanji/kana |
| 03:57 | mmarczyk | LauJensen: oh, please do :-D |
| 03:58 | LauJensen | Looking at your plugin, I must admit I have zero need of understanding Japanese and infact I would like suggest that we outlaw it |
| 03:58 | AWizzArd | Morning. |
| 03:58 | mmarczyk | LauJensen: in that case I think you can't possibly have a valid reason not to use Opera, since that's the only worthwhile thing it doesn't have ;-) |
| 03:58 | mmarczyk | AWizzArd: morning |
| 03:58 | LauJensen | ok :) |
| 03:59 | LauJensen | Japanese is back in the game! |
| 03:59 | LauJensen | Morning Andre |
| 03:59 | mmarczyk | :-) |
| 04:05 | LauJensen | Ok, ~18 seconds with all my packages installed |
| 04:05 | LauJensen | (I'll give Ubuntu a rest now) |
| 04:08 | esj | LauJensen: it is extremely nice |
| 04:10 | mmarczyk | btw, how would one go about setting up a small separate window for erc to send various notices to? |
| 04:11 | mmarczyk | I've got them turned off so as not to have them clutter up the chat window, but if I could use a separate pane for them, that'd be cool |
| 04:11 | LauJensen | mmarczyk: depends a little on which level you're asking, but you need to hook ERC's events and then you can handle them like you want |
| 04:11 | mmarczyk | I was hoping for an event received hook, yeah |
| 04:12 | mmarczyk | also, is there a standard hook for after joining a channel? |
| 04:12 | LauJensen | If you search site:emacswiki.org you'll get demos for many hooks, though I cant claim to known them all, or even a fraction |
| 04:12 | mmarczyk | yeah, tried doing that; maybe not dilligently enough |
| 04:12 | LauJensen | #emacs is always helpful |
| 04:12 | mmarczyk | will try again tonight |
| 04:13 | mmarczyk | oh, good idea |
| 04:13 | mmarczyk | thanks, I'll try that |
| 04:13 | LauJensen | np |
| 04:22 | stilkov | ,(format "%" "please ignore") |
| 04:22 | clojurebot | java.util.UnknownFormatConversionException: Conversion = '%' |
| 04:22 | stilkov | ,(format "%s" "please ignore") |
| 04:22 | clojurebot | "please ignore" |
| 04:24 | LauJensen | stilkov: for non-general-interest stuff, I think you can actually query the bot |
| 04:25 | stilkov | LauJensen: sorry about that, you are right |
| 04:25 | LauJensen | its not a problem, just wanted to make sure you knew :) |
| 04:46 | hircus | is there a known problem with the latest leiningen? It just stops after "Copied :dev-dependencies" |
| 05:36 | Licenser | hmm I found something very odd: |
| 05:37 | Licenser | (. GridBagConstraints LINE_END) ; => 22 |
| 05:37 | Licenser | (let [c GridBagConstraints] (. c LINE_END)) ; => No matching field found: LINE_END for class java.lang.Class |
| 05:37 | Licenser | is there some evil magic going on here? |
| 05:41 | sids | Licenser: I believe . expects the literal class name. This should work: (let [c GridBagContraints] (eval `(. ~c LINE_END)) |
| 05:42 | Raynes | Yike.s |
| 05:42 | Licenser | *cries* |
| 05:42 | Raynes | Yikes.* |
| 05:42 | Licenser | thakns you sids |
| 05:43 | Licenser | this is more then horrible but it works |
| 05:46 | Licenser | this is ugliish ugly so to say |
| 05:47 | Licenser | good greif |
| 05:48 | mmarczyk | ,(require '[clojure.contrib.java :as java]) |
| 05:48 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/java__init.class or clojure/contrib/java.clj on classpath: |
| 05:48 | mmarczyk | ,(require '[clojure.contrib.reflect :as reflect]) |
| 05:48 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/reflect__init.class or clojure/contrib/reflect.clj on classpath: |
| 05:48 | mmarczyk | wutsitcalled |
| 05:48 | mmarczyk | ,(require '[clojure.contrib.java-utils :as java]) |
| 05:48 | clojurebot | nil |
| 05:49 | mmarczyk | ,(let [c Integer] (java/wall-hack-method c 'MAX_VALUE c)) |
| 05:49 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args passed to: java-utils$wall-hack-method |
| 05:49 | mmarczyk | hm, worked for me at a 1.2 repl |
| 05:49 | mmarczyk | aaaah |
| 05:49 | mmarczyk | ,(let [c Integer] (java/wall-hack-field c 'MAX_VALUE c)) |
| 05:49 | clojurebot | java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks) |
| 05:50 | mmarczyk | well, that's likely clojurebot's sandboxing in action |
| 05:51 | sids | mmarczyk: works on the 1.1 repl too |
| 05:52 | mmarczyk | sids: right; sandboxing it is with the bot |
| 05:52 | sids | but it is (almost) as ugly as the eval solution |
| 05:53 | mmarczyk | I'm considering taking issue with the notion that my reflective solution might not be the ugliest ;-) |
| 05:53 | sids | :) |
| 05:55 | Licenser | sids: but it ets way less ugly when you concider that I do this in a mcaro and the conbination of `in ~ in ~ in ' and ~@ makes it a major PITA |
| 05:56 | sids | Licenser: yeah, it'll start looking like perl! |
| 05:56 | Licenser | I don't even get it working since it's too silly :P |
| 05:57 | Licenser | or I am too stupid |
| 05:57 | mmarczyk | got a gist? |
| 06:00 | Licenser | http://gist.github.com/385022 L 32 |
| 06:00 | Raynes | Licenser: You know, you can anchor to lines right? |
| 06:01 | Licenser | Raynes: not in gits |
| 06:01 | Licenser | at least not in this one, don't ask me why |
| 06:01 | Licenser | I tried it |
| 06:01 | Raynes | Huh. |
| 06:01 | mmarczyk | Chrome vs. line numbers on GitHub, the hopeless battle |
| 06:01 | Raynes | That's odd. |
| 06:01 | Raynes | I thought you could. |
| 06:01 | mmarczyk | oh, but fortunately they look fine this time |
| 06:01 | Licenser | mmarczyk: nope safari |
| 06:01 | AWizzArd | How can I open a repl in VimClojure? |
| 06:01 | Licenser | worked great iup to now |
| 06:01 | mmarczyk | Licenser: I mean Chrome misplaces them and I'm using Chrome now |
| 06:02 | mmarczyk | Licenser: nothing to do with anchoring |
| 06:02 | Licenser | heh |
| 06:02 | Licenser | ah |
| 06:02 | mmarczyk | so that's set-constraint!, right? |
| 06:02 | Licenser | it's wooooookring |
| 06:02 | Licenser | mmarczyk: yea |
| 06:02 | mmarczyk | oh :-) |
| 06:02 | mmarczyk | ok then |
| 06:02 | Licenser | http://gist.github.com/385022 is too |
| 06:03 | mmarczyk | cool :-) |
| 06:04 | mmarczyk | clj-swing ? |
| 06:04 | Licenser | mmarczyk: yea working on that |
| 06:05 | mmarczyk | a greatly promising name! :-) |
| 06:05 | Licenser | mmarczyk: assuming I get it ever to work - yes :P |
| 06:05 | Raynes | I think you mean swingjure |
| 06:05 | Raynes | :p |
| 06:05 | mmarczyk | :-) |
| 06:06 | Licenser | tried that, lein complained |
| 06:06 | Licenser | j/k |
| 06:06 | LauJensen | Licenser: use leinjure instead :) |
| 06:06 | mmarczyk | :-) |
| 06:08 | Licenser | I should rename the project to macro-madness |
| 06:09 | _exterm | Hey everybody, I just read through a bit of the swank-clojure repl startup code and don't quite understand it. It's this piece http://gist.github.com/385027 |
| 06:09 | _exterm | Why is stop set to return true? |
| 06:10 | _exterm | is the start-server bit executed for every call to the :read callback of the repl? |
| 06:13 | mmarczyk | _exterm: it would probably be user to try & answer if you posted a link to the relevant bit of swank-clojure's source in its natural context :-) |
| 06:13 | mmarczyk | http://github.com/technomancy/swank-clojure/ |
| 06:13 | LauJensen | wow that code looks old... (swap! stop (fn [_] true)) => (swap! stop (fn [] true)) => (reset! stop true) |
| 06:14 | mmarczyk | http://github.com/technomancy/swank-clojure/blob/master/src/swank/swank.clj#L60 |
| 06:19 | spariev | swank-clojure is probably the oldest third-party clojure code in the entire universe |
| 06:20 | mmarczyk | well it seems to me that this simply sends the server-starting expression back to the repl |
| 06:20 | mmarczyk | and as soon as that's executed, it sends the exit form |
| 06:21 | _exterm | ah, that makes sense :-) |
| 06:22 | mmarczyk | does it? oh good. I don't know how start-server is defined, so wouldn't know :-) |
| 06:22 | mmarczyk | now I'd be curious to find out why is a sensible thing to do |
| 06:26 | LauJensen | All Emacers simple hit 'M-. start-server' in the REPL to find out how its defined |
| 06:27 | mmarczyk | yeah, I could do that too |
| 06:27 | mmarczyk | but I'm too lazy to look it up on GH to post a link *and* open it in Emacs |
| 06:29 | _exterm | http://github.com/technomancy/swank-clojure/blob/master/src/swank/swank.clj#L48 |
| 06:30 | mmarczyk | I think I'm going to write a function to come up with the GitHub link for a file in a repo cloned from GH :-) |
| 06:30 | _exterm | ;-) |
| 06:31 | mmarczyk | together with your suggestions re: Magit / Egg from earlier, that'll make for the ultimate source control bliss :-) |
| 06:32 | mmarczyk | _exterm: yup, noticed that ;-) but only followed to setup-server now |
| 06:33 | mmarczyk | I can't believe this code :-) |
| 06:35 | mmarczyk | LauJensen: does Emacs have something like C-o (in normal mode) for "jump back"? |
| 06:40 | mmarczyk | M-* ! lovely :-) |
| 06:40 | Raynes | If I have several maps with the same keys and each value is a different sequence, what would be the best way to turn {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}} into {:this [1 2 3 4 5 6]}? |
| 06:42 | mmarczyk | ,{:this (reduce into (map #(:this (% 1)) {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}}))} |
| 06:42 | clojurebot | {:this [1 2 3 4 5 6]} |
| 06:43 | Raynes | Cool. |
| 06:43 | mmarczyk | ,(apply merge-with into (vals {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}})) |
| 06:43 | clojurebot | {:this [1 2 3 4 5 6]} |
| 06:43 | mmarczyk | better :-) |
| 06:43 | Raynes | Cooler. |
| 06:43 | Raynes | Thanks. |
| 06:43 | mmarczyk | np |
| 06:43 | Raynes | Didn't know about merge-with. |
| 06:43 | Raynes | Exactly what I was looking for. |
| 06:44 | mmarczyk | perhaps concat would be more appropriate though |
| 06:44 | _ato | mmarczyk: with slime you can use M-. and M-, |
| 06:44 | mmarczyk | if the seqs might not be all vectors |
| 06:44 | mmarczyk | _ato: lovely! thank you |
| 06:48 | mmarczyk | http://code.google.com/p/wave-client-for-emacs/ |
| 06:48 | sexpbot | " wave-client-for-emacs - Project Hosting on Google Code" |
| 06:48 | mmarczyk | oh come on now!? |
| 07:08 | rsynnott | Hey, does anyone know in what version protocols were added/will be added? |
| 07:09 | hoeck | rsynnott: 1.2 |
| 07:09 | rsynnott | ah, thanks |
| 07:09 | hoeck | will be added in 1.2 |
| 07:11 | hoeck | rsynnott: they are, it's big fun programming with them! |
| 07:14 | bozhidar | hoeck: good one :-) |
| 07:16 | hoeck | bozhidar: thats not from me, found it there: http://www.zazzle.com/clojure+programmers+have+more+fn+gifts |
| 07:16 | sexpbot | " Clojure Programmers Have More Fn T-Shirts, Clojure Programmers Have More Fn Gifts, Art, Posters, and more" |
| 07:22 | bozhidar | nice |
| 07:33 | ivenkys | Stella......................... |
| 07:33 | ivenkys | oh i mean afternoon gents |
| 07:37 | Raynes | mmarczyk: Stop getting all the easy questions! :p |
| 07:42 | Licenser | so has anyone used clojure with swing a lot? I am looking for some code examples here |
| 07:42 | Licenser | and I don't mean the few blog posts out there that show some tutorial programs but seriouse code :P |
| 07:43 | rsynnott | Licenser: the blog posts with tutorial code should give you the general idea |
| 07:43 | rsynnott | after that it should be rather like using swing with java, I would have thought |
| 07:44 | Licenser | rsynnott: I know, but my goal is not to use swing but to make a nice clojury wraper/lib for it |
| 07:45 | Licenser | so I can either do it on a theoretical base of 'what I think might be needed' or look at actual code and see how people use it - which I think is much more helpful |
| 07:45 | rsynnott | hmm |
| 07:46 | rhudson | Licenser: I would imagine that Incanter does a lot of Swing |
| 07:46 | Licenser | I went through the blog posts already and harvested everything I could as usage cases there |
| 07:46 | Licenser | *peaks at incanter then* |
| 07:48 | hoeck | Licenser: whats the goal of your lib? |
| 07:48 | Licenser | hoeck: making it easy (I like that word a lot :P) to make clojure programs with a gui |
| 07:48 | hoeck | Licenser: do you aim at having a clojure-friendly way to do guis? |
| 07:48 | Licenser | yap |
| 07:49 | hoeck | what about apache pivot then? |
| 07:49 | Licenser | hoeck: I know you've this apache pivot lib but it requires an extra dependency and I am not entirely sure if pivot is good for desctop apps |
| 07:49 | hoeck | got a nice clojure wrapper for it :) |
| 07:50 | Licenser | I know I know hoeck ^^ |
| 07:50 | hoeck | okay, its currently limited to only one single host frame |
| 07:50 | hoeck | and its lacks good examples |
| 07:52 | Licenser | I've no idea what single host frames are o.O and examples are true :P I didn't find any |
| 07:53 | rhudson | A few years back I did a fair bit of Swing using Jython. My recollection is that dynamic typing and first-class functions eases a lot of the pain of Swing. |
| 07:54 | rhudson | A crucial aspect of keeping things sane with Swing is to somehow arrange that the tree structure of widgets be reflected in tree structure of code. |
| 07:55 | rhudson | That's my two bits -- not that USD0.25 gets you far these days. |
| 07:57 | Licenser | rhudson: this is what I got so far: https://gist.github.com/9e9fb363b502733a0e31 |
| 07:58 | Licenser | (look at the very botton the two functions there are examples) |
| 07:59 | rhudson | Looks good |
| 08:00 | Licenser | :) |
| 08:03 | rhudson | I think it might be a bit clearer, though, if you had a list of components under frame -- e.g. lines 92--95 would be a separate form. |
| 08:03 | rhudson | That way it's easier to have separate functions to generate subassemblies. |
| 08:04 | rhudson | But maybe just judicious use of commas would do the trick. |
| 08:08 | Licenser | *looks at the lines* |
| 08:09 | hamza | ,(drop (int 1/2) [1 2 3]) |
| 08:09 | clojurebot | (1 2 3) |
| 08:09 | hamza | ,(drop 1/2 [1 2 3]) |
| 08:09 | clojurebot | (2 3) |
| 08:09 | rhudson | That button is at [1 1] ? It's probably better to be explicit about thata |
| 08:09 | hamza | ^ is this expected or a bug? |
| 08:10 | Licenser | rhudson: my first attempt was to make that a single form but it turned out to be non functional since sadly the constrains are not related to the object but they have to be passed to the container when you add the child |
| 08:10 | Licenser | the idae of this slowly changing of constraint is from stuart sierras blog |
| 08:11 | rhudson | Not sure I like that idea... |
| 08:12 | Licenser | rhudson: neither am I :P hence my trying to find some input |
| 08:13 | _ato | hamza: if it were a bug what would you expect to get instead? |
| 08:13 | Licenser | https://gist.github.com/e0c50ac49c001361cb84 was another attempt |
| 08:13 | hamza | [1 2 3] in both cases? |
| 08:13 | rhudson | Right, the constraints are container args, so somethng like (add-to container :x 1 :y 1 (button ...)) |
| 08:14 | rhudson | & then do you have something like (doto container ....) to add children |
| 08:14 | _ato | ,(drop 3/2 [1 2 3]) |
| 08:14 | clojurebot | (3) |
| 08:14 | _ato | ,(drop 0.9 [1 2 3]) |
| 08:14 | clojurebot | (2 3) |
| 08:15 | Licenser | rhudson: *nods* I thought about that too but that usually let you with a huge let around the whole code where you define your buttons/lables/boxes/fields etc then glue them together and I found that ugly |
| 08:15 | hamza | ,(drop 0.4 [1 2 3]) |
| 08:15 | clojurebot | (2 3) |
| 08:15 | _ato | ,(drop (int 1/2) [1 2 3]) |
| 08:15 | clojurebot | (1 2 3) |
| 08:15 | _ato | yeah, I guess it's a bug |
| 08:16 | _ato | although a lot of people might say that it's just invalid input |
| 08:16 | Licenser | ,(drop (int 1) [1 2 3]) |
| 08:16 | clojurebot | (2 3) |
| 08:17 | _ato | ,(take 1/2 [1 2 3]) |
| 08:17 | clojurebot | (1) |
| 08:17 | _ato | guess it's consistent with take at least |
| 08:18 | jweiss | i didn't even know you could write a number as "1/2" |
| 08:19 | _ato | 1/2 is the syntax for ratios |
| 08:19 | _ato | ,(class 1/2) |
| 08:19 | clojurebot | clojure.lang.Ratio |
| 08:19 | _ato | ,1/2 |
| 08:19 | clojurebot | 1/2 |
| 08:19 | ivenkys | how do you invoke the bot gents ..? |
| 08:19 | _ato | just write some code prepended with a comma |
| 08:20 | hamza | _ato: even if rounds i would expect 0.4 to work but that would still drop the first element. |
| 08:20 | hamza | ,(drop 0.4 [1 2 3]) |
| 08:20 | clojurebot | (2 3) |
| 08:20 | _ato | ~def drop |
| 08:21 | _ato | it just checks pos? and decrements and recurses |
| 08:21 | _ato | so anything >= 1.0 will drop an element |
| 08:25 | _ato | I mean > 0.0 |
| 08:25 | ivenkys | ,( + 2 3) |
| 08:25 | clojurebot | 5 |
| 08:25 | rhudson | Licenser: parting thought (breakfast time!): try looking at some of the XML-based layout DSLs (Pivot, JavaFX, Flex) as a model for defining some reasonable widget-tree macros. |
| 08:26 | Licenser | thanks for the advice rhudson and good breakfast |
| 08:26 | rhudson | have a great day |
| 08:27 | Licenser | mm can I add a protocol to a java class? I guess not right? |
| 08:29 | chouser | you can extend a protocol to a java class |
| 08:40 | rhickey | so, in an effort to ease migration pains, I am thinking about different policies for conflicts when trying to refer to something in a ns. Right now it just throws and exception saying, already refers to XXX, but it could instead: |
| 08:40 | rhickey | generate a warning but take the latter |
| 08:40 | rhickey | or |
| 08:41 | rhickey | having conflict resolution like, 'core wins', also with a warning |
| 08:42 | LauJensen | One thing I like about the current exception throwing, is that things gets fixed. I remember in CL I had a tendency to resolve it temporarily and then hack away, forgetting about it - Might just me be though :) |
| 08:43 | Licenser | hmm I think conflicts should throw exceptions, otherwise LauJensen is right, it will be forgotten |
| 08:44 | cgrand | rhickey: conlict resolution between several refered libs or between the namespace-being-defined and refered libs/core? |
| 08:44 | Licenser | but perhaps make the exception a bite more expressive so |
| 08:44 | rhickey | cgrand: however the conflict occurs, not sensitive to context |
| 08:45 | Licenser | like saying 'can't refer #clojure.controb.funky/do since #clojure.core/do already claims this' just in propper english :P |
| 08:46 | chouser | a general "first one in wins" plus a warning should allow core fns to win (which seems right) and be a stable simple behavior people can rely on. |
| 08:46 | rhickey | Licenser: something like that, although core-wins probably isn't going to work out |
| 08:46 | rhickey | chouser: the problem is, you have your own code wich uses 'foo' then core comes around with a new 'foo', can't be what you want |
| 08:46 | Licenser | what about something like (use '(clojure.contrib.funky :overwrite do) |
| 08:47 | chouser | rhickey: right, in which case you have to follow the same steps you would today |
| 08:47 | rhickey | chouser: then this isn't solving the upgrade-without-breaking problem |
| 08:47 | chouser | roll back to an old clojure, rename your 'foo' to something else, refer-clojure to exclude or rename core/foo ... |
| 08:48 | chouser | not completely, but it would help some. |
| 08:48 | Licenser | I thinkit is good to be very annoying about overwriting core stuff |
| 08:48 | rhickey | chouser: the goal is upgrade without breaking, one release, 'replaced' things stay there, deprecated |
| 08:49 | Licenser | I'm not sure if you can upgrade w/o breaking |
| 08:50 | rhickey | so your build says 'overwriting core/foo', or 'overwriting core/shuffle' followed by 'deprecated contrib.seq/shuffle' |
| 08:50 | cgrand | rhickey: I guess that :added + :as-of doesn't satisfy you |
| 08:50 | rhickey | cgrand: still breaking in that you have to add that |
| 08:51 | rhickey | cgrand: I like :as-of, but it doesn't exist yet |
| 08:51 | Licenser | hmm how about this rule: |
| 08:52 | Licenser | clojure.core overwrite clojure.contrib, provate namespace overwrites clojure.core and of cause clojure.contrib |
| 08:52 | Licenser | so if I have a foo method I declare myself, I likely want to keep it the same, even if core gives me one too |
| 08:52 | Licenser | we can live old functions in clojure.contrib since core overwrites them |
| 08:52 | LauJensen | rhickey: It seems you want to try and prevent breakage of something which should rightfully break, ie. I dont want my program to run if functions are being added in an uncontrolled manner |
| 08:52 | Licenser | :as-of 1.1.0 would give me the function of the 1.1.0 clojure? |
| 08:52 | rhickey | Licenser: sometimes, in moving to core, semantics or return types might change slightly |
| 08:53 | Licenser | hmmm |
| 08:53 | Licenser | hmm hmmm |
| 08:53 | cgrand | rhickey: so you'd like existing 1.1 libs to work with 1.2 even in case of nameclashes? Then I guess it's "last wins" + warning |
| 08:54 | Licenser | I generally don't think breaking is bad so, since a lot of what changes really needs user attention but I'm uncertain about version stuff then, is clojure using that semver system because then it should not be 1.2 but 2.0 |
| 08:54 | rhickey | cgrand: existing client code. Maybe forcing :as-of now is the last we'll have to break as we move forward. But :as-of still requires changes as things move or are renamed |
| 08:55 | rhickey | Licenser: with semver Clojure will be up to version 20 in no time |
| 08:55 | Licenser | rhickey: you can call it done with version 42 then :P |
| 08:56 | Licenser | but yes I undestand the issue, could have left it 0.* to be server free untll the API is stable but that won't have looked good |
| 08:57 | Licenser | but when we don't have to follow semver with clojure break for good that at least forces people to update their stuff :P |
| 08:57 | Licenser | but the :as-of stuff might be good |
| 08:58 | Licenser | could I do (require [some.other.lib :as-of 1.1.0 :as sol]) to by that forcing the whole require tree of some.other.lib into 1.1.0? |
| 08:58 | Licenser | if that works :as-of will solve a lot of problems |
| 08:58 | Licenser | the worst problem I see are in non accessable 3rd party libs. If it is your code, you can go around and change it once it breaks if it is not your code, you can't |
| 09:00 | rhickey | code that breaks c.c.seq :as seq ... seq/shuffle, if it's not there. use c.c.seq :only (shuffle), but that might become 'harmless if missing' |
| 09:01 | rhudson | Licenser: one more thought: take a look at Groovy's SwingBuilder: http://groovy.codehaus.org/Swing+Builder |
| 09:02 | sexpbot | "Groovy - Swing Builder" |
| 09:02 | Licenser | rhudson: thank you I will |
| 09:22 | cgrand | maybe leaving stubs for moved/renamed vars or having per ns an history of renames/moves :-/ |
| 09:24 | chouser | revision control systems are good at this kind of thing |
| 09:25 | chouser | perhaps "upgrade without breaking" is a false goal? There could be branch with bug fixes and non-breaking new features. |
| 09:25 | rhickey | chouser: yeah, and when people were pulling Clojure from svn we never had these problem - not ready, don't pull. Now we have maven shapshot hell |
| 09:26 | powr-toc | Does anyone know how to get swank to use a ~/.user.clj file? |
| 09:30 | Chousuke | rhickey: the git project has a policy that master is always stable and "breaking" development happens in a branch that actually gets rebased every once in a while. It might not work for Clojure but I think it's worth taking a look at how they do things. |
| 09:30 | rhickey | chouser: yes, could be unobtainable goal |
| 09:31 | Chousuke | git's commit log is always a pleasure to read too. It requires a lot of discipline to achieve such consistency though. |
| 09:31 | rhickey | Chousuke: that doesn't really solve the problem of breaking when moving to new version. People do want the new version, new features, not just bugfixes |
| 09:32 | Chousuke | rhickey: right. I think git's pretty strict about maintaining backwards compatibility, but obviously in that regard it's not very comparable with Clojure. |
| 09:32 | rhickey | In this case, the breaking is largeley on the side of users of contrib. But the foo-added-to-core problem is core breaking you, not itself |
| 09:34 | rhickey | e.g. from the perspective of a user of core, it got shuffle added. Non-breaking. cgrand's :as-of idea would protect you if you had a shuffle of your own, as would last-one-wins-with-warning |
| 09:34 | Licenser | crazy idea |
| 09:34 | Licenser | since clojure code is just data, why not make a updateer :P |
| 09:34 | Licenser | when the reader notices that your code is for 1.1.0 it asks you if it should update it for 1.2.0 |
| 09:35 | Licenser | might now work for every single peace of code (think eval and stuff) but for a lot |
| 09:35 | chouser | unfortunately, we still don't edit the code that is data |
| 09:35 | _ato | I guess last-one-wins it's how it's handled in python and ruby, you can redefine a core function, it won't even warn |
| 09:36 | chouser | we edit text files that become data after relatively trivial rules are applied. Rules the lose important information like comments and spacing. |
| 09:36 | Licenser | _ato: well I like the warnings since it's bad charma to redefien core functions |
| 09:36 | Chousuke | rhickey: so you could in a ns declaration specify which version of clojure core you're targeting and the :as-of metadata is checked and newer stuff in core is not imported/you get a warning? :/ |
| 09:36 | chouser | that lose |
| 09:36 | rhickey | _ato: this is not that, you aren't replacing the core thing in core, just in your view of the world |
| 09:36 | Licenser | chouser: noone will stop the reader to read comments and spacings too :P |
| 09:37 | _exterm | clojure.core question: how does eval work? http://gist.github.com/385198 looks like an infinite recursion to me. |
| 09:37 | Chousuke | _exterm: that's not a call to the eval function |
| 09:37 | _ato | rhickey: that too. put a "def dir(x): x" in a foo.py and do "from foo import *" from the repl, no warning, the one you get is the last you imported |
| 09:38 | Chousuke | _exterm: note the . form |
| 09:38 | chouser | Licenser: I'd be very pleased to see a sane solution for that, but I haven't thought of any. If you read a file that has 10 lines, all blank except a middle one that was the word "true" indented by 6 spaces, how is that read? |
| 09:38 | Chousuke | _exterm: it's calling the clojure.lang.Compiler/eval static method |
| 09:38 | Licenser | chouser: we've meta data here :) |
| 09:38 | chouser | Licenser: not on booleans |
| 09:38 | chouser | nor on Booleans |
| 09:38 | Licenser | then we add that :P |
| 09:38 | Chousuke | :P |
| 09:39 | Chousuke | not possible. sorry. |
| 09:39 | _exterm | Chousuke: really? I always thought that would be (. clojure.lang.Compiler eval form)) |
| 09:39 | chouser | and even if we did, you want ^{:text-before "\n\n\n\n " :text-after "\n\n\n\n\n"} true !? |
| 09:40 | _exterm | Isn't that evaluated with the innermost expression first? |
| 09:40 | Chousuke | _exterm: no. |
| 09:40 | Chousuke | _exterm: . is a special form |
| 09:40 | chouser | _exterm: that's old-style interop syntax. |
| 09:40 | Licenser | Chousuke: of case make true a clojure.core.Boolean instead of a java.lang.Boolean |
| 09:40 | Chousuke | Licenser: that's not very neat. |
| 09:40 | chouser | _exterm: today we're write (Compiler/eval form) |
| 09:40 | Chousuke | Licenser: Clojure's interop is supposed to be wrapper-free :) |
| 09:40 | chouser | Licenser: I did say "sane" :-) |
| 09:41 | powr-toc | Hmmm I'm using slime-connect to connect to a mvn clojure:swank, and I'd like it to automatically include my ~/.clojure/user.clj file on the classpath... does anyone know how to do this? |
| 09:41 | Chousuke | you could of course write a special reader that returns whitespace elements as well. |
| 09:41 | Licenser | :P |
| 09:41 | Licenser | annotations? *dodges* |
| 09:42 | _exterm | Chousuke: thanks :-) |
| 09:42 | chouser | Chousuke: hmm... said that way, it sounds interesting. |
| 09:43 | Chousuke | chouser: it would be useful for many tools at least |
| 09:43 | _ato | so for python, introducing new core functions has been non-breaking, since if someone had defined their own (or pulled one in from an older lib), there's no problem, they just get that one. The changes they really worry about are new reserved words. On the other hand that does mean they could import two libraries and one would clobber the other |
| 09:43 | _ato | without error |
| 09:43 | Licenser | *nods* smart idea |
| 09:43 | chouser | the whitespace elements don't have to be strings. Could be objects that have the text, line number, file name, etc. |
| 09:44 | chouser | Chousuke: then the "real" reader could actually take that output and strip out those extra objects. |
| 09:44 | Chousuke | or a reader that can be restarted. could eg. "parse" incomplete clojure code in an editor and instead of getting weird exceptions the thing could efficiently mark the code as faulty, and then remove the marking once it's completed. |
| 09:45 | Chousuke | chouser: or you could just have two modes for the reader if you designed the thing well enough I suppose. |
| 09:45 | chouser | what about the whitespace and comments between metadata and its target. :-/ |
| 09:46 | Chousuke | you could return a metadata-element, whitespace-element, and the target-element |
| 09:46 | LauJensen | Chousuke: You made it restartable ? |
| 09:47 | Chousuke | LauJensen: no. I did toy with the idea once but it's not very easy ;P |
| 09:52 | cemerick | stuarthalloway: how is your 1.2.0-SNAPSHOT version spec ever touching the 1.2.0-master-SNAPSHOT stuff at all? |
| 09:52 | stuarthalloway | damn good question |
| 09:53 | stuarthalloway | if I specify the "and greater" form it finds master instead |
| 09:53 | cemerick | that's odd |
| 09:53 | stuarthalloway | but to spec |
| 09:53 | cemerick | oh really? |
| 09:53 | stuarthalloway | maven does a string compare on the "qualifier" section of the version number |
| 09:53 | _ato | yeah, that's just the way maven compares version numbers |
| 09:53 | stuarthalloway | and the word "master" is > any number |
| 09:54 | cemerick | oh, right, I see |
| 09:54 | stuarthalloway | but we shouldn't have two sets of artifacts anyway |
| 09:54 | cemerick | another nail in the coffin of artifacts corresponding to git branches |
| 09:54 | cemerick | I'd strongly suggest blowing away the 1.2.0-master-SNAPSHOT dir |
| 09:55 | stuarthalloway | but that is the one consistent with the name in clojure :-( |
| 09:55 | _ato | ugh |
| 09:55 | stuarthalloway | no matter what I do I bet I break someone |
| 09:55 | _ato | please don't break all the dependencies again |
| 09:55 | chouser | cemerick: what should we do next time there's a branch with experimental changes that some people want? |
| 09:55 | _ato | bad enough when contrib got renamed |
| 09:55 | cemerick | except no one, but no one should be using it |
| 09:55 | _ato | wait until 1.3 |
| 09:56 | cemerick | chouser: in that case, people should pull and build on their own |
| 09:56 | cemerick | The activity of people on the bleeding edge should not leak out for everyone to see. |
| 09:56 | cemerick | And the maven artifacts are the touchpoint for the entire userbase. |
| 09:56 | stuarthalloway | it would be great if somebody wrote a 1-2 page "all the maven you need to know to be on the edge of project" |
| 09:56 | chouser | really!? You're saying there should be no artifact id at all for such things? |
| 09:57 | _ato | change the artifactId instead of the version? clojure-with-awesome-feature-1.2-SNAPSHOT |
| 09:57 | cemerick | If there is to be one, it should have a different project name, or live in a different repo. |
| 09:57 | stuarthalloway | I am perfectly happy with the *clojure* artifact names. They all have version and branch in them, and are consistent |
| 09:58 | cemerick | stuarthalloway: well, when it was 1.2-new-SNAPSHOT vs. 1.2-master-SNAPSHOT, that wasn't as nice. |
| 09:58 | stuarthalloway | at least you knew what you were getting |
| 09:58 | _ato | but I wasn't using version ranges |
| 09:58 | cemerick | _ato: but for people who didn't even know what new vs. master was, it was a big problem. |
| 09:59 | Licenser | why not clojure-SNAPSHOT? |
| 09:59 | Licenser | erm 1.2-SNAPSOT |
| 09:59 | Licenser | sorry |
| 09:59 | cemerick | Licenser: yeah, that's really what it should be IMO. |
| 09:59 | stuarthalloway | clojure isn't hurting anybody, and that would be a breaking change if we did it now |
| 09:59 | Licenser | that is what I think since maven runs nuts with the -master thing I think |
| 09:59 | cemerick | stuarthalloway: right, for the future, I mean |
| 10:00 | stuarthalloway | so the real question (in terms of breakage right now) is which name people use when referring to contrib |
| 10:00 | _ato | "new" vs "master" was partly because "new" was an extremely misleading name ;-) |
| 10:01 | cemerick | stuarthalloway: surely there are logs where one can see if anyone is actually asking for 1.2-master-SNAPSHOT updates? |
| 10:01 | Licenser | oi (instance nil ...) is a NPE |
| 10:01 | AWizzArd | Will the "parallel branch" of the repository work under JDK 7? |
| 10:02 | cemerick | And if the ratio of them to those asking for 1.2-SNAPSHOT updates is acceptably small, just rm the dir, and people will field questions here and on the list. |
| 10:02 | stuarthalloway | dysinger (or someone else behind his company firewall) could |
| 10:02 | stuarthalloway | I was doing the research in the other direction: grabbing clojure projects and reading their pom.xml or project.clj files |
| 10:03 | rhickey | to the extent these deps systems are unaware of the VCS systems they are just wrong |
| 10:04 | rhickey | VCS is system of record, has concrete names for everything, knows what is derived from what else |
| 10:04 | rhickey | no manual naming 'schemes', interpretation issues etc |
| 10:04 | cemerick | rhickey: except the entire notion of version numbers has a lot of friction with DVCSs, or git anyway. |
| 10:04 | cemerick | sequential* version numbers, that is |
| 10:05 | _ato | clojars.org log shows 1676 hits for clojure-contrib/1.2.0-master-SNAPSHOT and 3315 for clojure-contrib/1.2.0-SNAPSHOT |
| 10:05 | _ato | in the last 5 days |
| 10:05 | rhickey | cemerick: still, git has names (hashes) and knows what is derived from what else, the problem is in requiring version numbers, not git |
| 10:05 | Licenser | so away with -master! :P |
| 10:05 | cemerick | rhickey: except the whole world uses sequential version number to identify concrete builds and relationships between them. |
| 10:06 | rhickey | cemerick: not anymore they don't |
| 10:06 | cemerick | oh? |
| 10:06 | rhickey | not once using git |
| 10:06 | Licenser | if we write a own dependecy management system for clojure count me in! |
| 10:06 | Licenser | hence I'll even start writing it :P |
| 10:06 | cemerick | rhickey: as a user, I want clojure 1.2, not clojure 453feb12 |
| 10:06 | Licenser | stuarthalloway: good man! |
| 10:07 | LauJensen | rhickey: you're not entirely dismissing the notion of stable realeases named by 1.1 or 1.2 etc right? Just for the snapshot states you're saying its irelevant ? |
| 10:07 | rhickey | cemerick: you can always tag 453feb42 as version 1.2, that would also be known to git |
| 10:07 | Licenser | I don't think those things are mutally exclusive |
| 10:08 | rhickey | cemerick: but saying, no one can use anything not such tagged is onerous |
| 10:08 | rhickey | as we have knowledge about these things, just mvn doesn't |
| 10:08 | rhickey | mvn should ask git/VCS |
| 10:08 | AWizzArd | hmm, interesting point |
| 10:09 | cemerick | rhickey: well, mvn has knowledge about whatever you tell it. You could absolutely publish bleeding edge experimental stuff to mvn, but I think it's a bad idea to conflate it with mainline version numbers for the general public. |
| 10:09 | cemerick | e.g. the 1.1-new vs. 1.1-master |
| 10:09 | rhickey | cemerick: but retelling things is like a game of telephone, totally lossy |
| 10:10 | cemerick | rhickey: what's the retelling, the specifying of a version number outside of a git hash or tag? |
| 10:10 | rhickey | cemerick: yeah |
| 10:10 | cemerick | hrm |
| 10:10 | Licenser | hmmm to make maven happy use clojure-new 1.2.0-SNAPSHOT? |
| 10:11 | Licenser | or even new/clojure which would be the best way I geuss |
| 10:11 | cemerick | rhickey: I think the alignment of the two (version number and git rev) only occurs in specific cases. |
| 10:11 | rhickey | also, we didn't have these problems pre-maven. People only pulled what and when they wanted, and the build easily worked with the version they had |
| 10:11 | cemerick | rhickey: heh; sorta like "I didn't have this oil change problem when I used a horse!" ;-) |
| 10:12 | rhickey | cemerick: not at all like that |
| 10:12 | Licenser | hmm perhaps rhickey was happyer with his horse? |
| 10:12 | rhickey | we waste much more time on this stuff now than before maven solved our dependency problem |
| 10:13 | LauJensen | rhickey: Do you see an alternative to Maven which would rid us of these problems? |
| 10:13 | Licenser | hmm the only reason we have maven is the java world uses it right? |
| 10:13 | cemerick | rhickey: I assure you that having a stable mvn repo makes my life easier compared to maintaining a local build of things. Nevermind the "typical" java dev. |
| 10:15 | Licenser | well if there is a way out of maven, and we specify what we really want I'll gladly invest the time to start of a project to realize it |
| 10:15 | _ato | we could just do away with snapshots. This will probably have two effects: less talk of breakage but git doesn't get anywhere near as thouroughly tested before stable release |
| 10:15 | cemerick | oy |
| 10:15 | rhickey | cemerick: not mine, as it makes it harder for people to follow Clojure development, and the admonitions to not ever use snapshots doesn't help at all |
| 10:15 | Borkdude | Ah, a German book on Clojure? http://bit.ly/dqWoBp |
| 10:16 | sexpbot | "Clojure: Einführung und Praxis: Amazon.de: Stefan Kamphausen, Tim Oliver Kaiser: Bücher" |
| 10:16 | cemerick | rhickey: who's having a harder time following clojure dev? |
| 10:17 | rhickey | cemerick: everyone with snapshot in their deps, who get things they aren't ready for? |
| 10:17 | AWizzArd | Since the switch to maven I am using build.clojure.org |
| 10:18 | cemerick | rhickey: There's mechanisms for controlling how and when you get new snapshot builds. *shrug* |
| 10:18 | rhickey | cemerick: documented where? |
| 10:18 | Licenser | rhickey: but does not people who have snapshots in their deps help the dev team find real world issues? |
| 10:19 | wlangstroth | Licenser: I don't know if using a snapshot with "real world" stuff would be advisable |
| 10:19 | _ato | you know we could actually force people to pick a snapshot version, rather than the "latest". Just deleting the maven-metadata.xml from the repo would probably have that effect. |
| 10:19 | cemerick | rhickey: http://mojo.codehaus.org/versions-maven-plugin/lock-snapshots-mojo.html |
| 10:19 | sexpbot | "Versions Maven Plugin - versions:lock-snapshots" |
| 10:19 | Licenser | wlangstroth: don't mistake real world with production |
| 10:19 | cemerick | Doesn't help people using lein, but I don't have suggestions there. |
| 10:19 | wlangstroth | Licenser: ah, okay |
| 10:20 | cemerick | I locked my clojure and contrib snapshots to a build from Tuesday when I saw the big changes coming down the pike. |
| 10:20 | rhickey | cemerick: that page is completely meaningless to me |
| 10:20 | cemerick | rhickey: I doubt you're its intended target. |
| 10:20 | _ato | and to me |
| 10:20 | AWizzArd | wlangstroth: snapshots are very similar to the stable stuff. Typically rhickey checks in only things that work. No real issues to use Clojure snapshots in production environments. |
| 10:21 | Licenser | but wlangstroth while I trust the dev team a lot, 100 coders see more then 10, it's a fact. |
| 10:21 | cemerick | rhickey: But the notion that "maven is a problem" totally ignores that the vast majority of the java world hears "clojure artifacts are in maven" and says "oh, OK", and happily goes about using them without missing a beat. |
| 10:22 | rhickey | cemerick: but if the answers to these problems are pages like that, they remain problems |
| 10:22 | wlangstroth | AWizzArd: just bad policy is what I mean. If I'm going to use something in production, it won't be based on my inherent trust of Rich (talented as he might be) |
| 10:23 | _ato | cemerick: I don't get it. What does this plugin do over just specifying specific snapshot version numbers? eg <version>1.0-20090128.202731-1</version> |
| 10:23 | rhickey | cemerick: learn maven to use clojure is just as bad as learn emacs to use clojure, a hurdle |
| 10:23 | Licenser | wlangstroth: but using stable isn't much different when the crowd does not use the snapshot builds |
| 10:23 | cemerick | rhickey: I humbly submit that that page is well understood outside of this channel. |
| 10:23 | _ato | oh.. does it use the one from your local repo? |
| 10:23 | mefesto | seems to me that when people depend on SNAPSHOT (bleeding edge) they should expect things to break from time to time. If they need stability, they shouldn't be depending on something that is unstable :) |
| 10:23 | Licenser | I mean that Rich releases it as stable is also 'just' him releasing something |
| 10:23 | rhickey | cemerick: as are emacs-isms amongst its fans |
| 10:24 | cemerick | rhickey: People absolutely don't need to learn maven to use clojure, but if clojure isn't available via mvn repos, then you will simply get far less uptake than you would otherwise. |
| 10:24 | cemerick | Those who don't like mvn can download a jar or build from source as they like. |
| 10:24 | cemerick | Inventing or proposing to invent yet another system for this problem is the worst possible reaction. |
| 10:25 | _ato | heh |
| 10:25 | cemerick | _ato: no, it takes the current concrete SNAPSHOT you're depending upon, and writes that into the POM |
| 10:25 | rhickey | cemerick: I'm not arguing against providing Clojure in maven repos, I just want a simple story for people who don't want to waste their lives on maven. |
| 10:25 | Licenser | cemerick: you don't need to learn is true but if you dont 't lean it you'll experience lots of lots of pain |
| 10:25 | wlangstroth | to be honest, as a Clojure newbie, I'm only using maven because it's there, and lein uses it. I find maven ridiculously over-complicated. |
| 10:25 | rhickey | cemerick: build clojure from source and use with a lib that has a clojure dep, easy and obvious? |
| 10:25 | cemerick | rhickey: pull from github and build or download a jar? |
| 10:25 | LauJensen | What is this pain that new-comers feel when digging into Clojure? |
| 10:25 | Licenser | wlangstroth: you'll like lein-add then :P |
| 10:26 | LauJensen | (re: maven that is) |
| 10:26 | mefesto | imo, maven is overkill for many things |
| 10:26 | rhickey | cemerick: it wasn't obvious to me how to use even contrib with clojure from source |
| 10:26 | Licenser | LauJensen: yes it is |
| 10:26 | LauJensen | Licenser: not a yes/no question, WHAT is the pain? |
| 10:26 | Licenser | the yes was meant to your response suggestion |
| 10:26 | LauJensen | Because just getting started, building contrib (a pretty complex build) and declaring dependencies is not complicated at all, and compared to ant is actually easy |
| 10:27 | Licenser | but if we stick to maven we should follow it's rules so no 1.2-master-SNAPSHOT :P |
| 10:27 | cemerick | rhickey: SS can speak better about the advantages to using mvn for the contrib build. As for understanding how to use the tool, I'm not sure how to respond there. Just like learning how to use ant, I guess. |
| 10:28 | LauJensen | When we first configured clojureql with ant, that was a really painful experience that I wont soon forget |
| 10:28 | wlangstroth | cemerick: ant is pretty comfortable for people who are used to configure/make/make install |
| 10:28 | cemerick | Are there really people wandering in here and saying "boy, I wish I could use clojure, but this maven business makes it difficult for me"? |
| 10:28 | wlangstroth | but are there that many of us? |
| 10:29 | cemerick | wlangstroth: right, I think that's the key question |
| 10:29 | Licenser | cemerick: you haven't heared my rants about maven yet do you? :P |
| 10:29 | cemerick | Licenser: believe me, I hear plenty of rants :-) |
| 10:29 | Licenser | good good |
| 10:29 | Borkdude | I like lein, but it needs easier Windows support and maybe some more intelligence for deleting old jars |
| 10:29 | Borkdude | And Maven, I didn't have to learn it to use clojure, since I have lein |
| 10:29 | chouser | for our "production" env we build our own clojure and contrib from specific git sha's. |
| 10:30 | pjstadig | there is always a period of adjustment when learning a new language |
| 10:30 | pjstadig | whether build tools, or idioms, or syntax |
| 10:30 | Licenser | pjstadig: of cause but that periode should focus around the language not about some third party tool |
| 10:30 | LauJensen | chouser: which system controls that ? |
| 10:30 | cemerick | chouser: we did that until very recently. I got tired of it. |
| 10:30 | Licenser | and I've needed more time to get used to maven then to get used to clojure to be frank |
| 10:30 | chouser | no unexpected breakage, no need to predict "big changes coming down the pike", no particular need to use a release version of anything. |
| 10:30 | wlangstroth | cemerick: haha - certainly maven isn't a barrier to entry |
| 10:31 | pjstadig | Licenser: that's the question, which potential new users are a target for clojure, and how can the transition be made simplest for them |
| 10:31 | Licenser | wlangstroth: no not to enter, since while you enter you don't see much of it but while passing along there are a few maven pitfals |
| 10:31 | chouser | LauJensen: no system controls it. I control it. When I want new features or bug fixes I find sha's for clojure and contrib that work together, check those numbers into our git repo, and rebuild. |
| 10:31 | pjstadig | you can't be everything to everyone |
| 10:31 | wlangstroth | cemerick: ... but I can understand if people find it a pain in the ass |
| 10:32 | LauJensen | chouser: so 'rebuild' means manually running ant/maven ? |
| 10:32 | cemerick | wlangstroth: I can too, absolutely. |
| 10:32 | chouser | no |
| 10:32 | wlangstroth | Licenser: we're just going to get you going, here, aren't we? |
| 10:32 | chouser | make :-) |
| 10:32 | pjstadig | you can do things different if you want, but you just have to ignore the noise of people complaining that it's different than what they're used to |
| 10:32 | Licenser | wlangstroth: yea maven is my new arch nenemis since clojure took java away from me |
| 10:33 | fogus | chouser: Sounds like you've adopted my build system. :p |
| 10:33 | wlangstroth | Licenser: it's true that it would be nice to have a build/dependency tool that is to maven what Clojure is to Java |
| 10:33 | Licenser | *nods* yes it would |
| 10:33 | chouser | my point is *not* that we have a pleasant and convenient build system. We don't. But as messy as it is, we do have the benefits I listed, and release version numbers don't matter much to us. |
| 10:33 | Licenser | and I think lein is a start in that direction, it shields you from a lot maven of maven I think |
| 10:34 | pjstadig | i have a theory that there's a philosophical underpinning (or worldview) to each language |
| 10:34 | cemerick | wlangstroth: wouldn't that roughly be the lowest-value project in the world? Yet another build system? |
| 10:34 | pjstadig | either you have to learn to accept that worldview |
| 10:34 | pjstadig | or realize that it's different than yours, irreconcilable, and move on to something else |
| 10:34 | Licenser | pjstadig: and you might e right |
| 10:34 | pjstadig | i'll write a book |
| 10:34 | cemerick | This is a social problem way, way, way more than it is a technical one. |
| 10:34 | Licenser | but I din't think maven matches clojures philosophy |
| 10:34 | fogus | pjstadig: What's the Ruby worldview? |
| 10:34 | wlangstroth | cemerick: you beat me to it (with the addendum that "since I'm not doing it right now, it's not my place to say") |
| 10:35 | pjstadig | fogus: still needs more research, but i'd like to do a presentation on it to capclug |
| 10:35 | Licenser | fogus: one of them is |
| 10:35 | rhickey | cemerick: when someone wants to tie maven to a particular sha/commit from git, how do they find the right maven timestamp to pin it to? |
| 10:35 | Licenser | 'it does what you expect' |
| 10:35 | pjstadig | perl of course is "there's more than one way to do it" |
| 10:35 | Licenser | one I like a lot :P and clojure has a lot of that too |
| 10:35 | cemerick | rhickey: what do you mean by "tie maven to..."? |
| 10:35 | fogus | pjstadig: Would love to see it |
| 10:35 | pjstadig | ruby is probably "programming should be a joy" or something like that |
| 10:35 | rhickey | cemerick: make maven use |
| 10:35 | pjstadig | i think Matz has said something to that effect |
| 10:35 | cemerick | oh, I see |
| 10:35 | Borkdude | pjstadig: you mean that builds should be immutable in clojure? ;-) |
| 10:36 | pjstadig | hehe |
| 10:36 | pjstadig | a build is a value |
| 10:36 | pjstadig | you need an identity to refer to that value |
| 10:36 | pjstadig | git tag "1.2" is identity referring to git hash "3df65" as value |
| 10:36 | chouser | nooo |
| 10:36 | stuartsierra | rhickey: I've tied maven builds to particular commits by looking at the reports on build.clojure.org |
| 10:37 | chouser | that would mean "1.2" could mean something else later. |
| 10:37 | _ato | heh there's actually some jars in clojars which have done away with version numbers entirely and just used git hashes, of course that totally breaks maven's version ranges, but still |
| 10:37 | cemerick | rhickey: a proper maven deployment process ensures that the SCM tag/sha/rev/ref gets added to the deployed POM. e.g. http://clojars.org/repo/org/clojars/arohner/compojure/0.3.3-SNAPSHOT/compojure-0.3.3-20100308.145053-1.pom |
| 10:37 | rhickey | stuartsierra: sounds tedious |
| 10:37 | pjstadig | chouser: good point |
| 10:37 | stuartsierra | rhickey: mostly I just let it track the current snapshot |
| 10:37 | cemerick | Unfortunately, it looks like the clojure and contrib maven deployments don't do that. |
| 10:38 | Licenser | hmm but depending on git hashes means also that we depend on git, is that good or bad? |
| 10:38 | chouser | is there not a maven plugin to allow fetching and building specific sha's from a git repo? |
| 10:38 | rhickey | cemerick: and how do you leverage that? manual search? |
| 10:38 | cemerick | chouser: yes, the release plugin. Generally not a userland sort of tool. |
| 10:38 | _ato | lein inserts the git hash into poms when it generates them. The new version of the clojars UI I'm working on exposes this |
| 10:38 | chouser | cemerick: why's that? |
| 10:38 | pjstadig | anyway i do think that using maven as a build tool is somewhat counter to clojure's philosophy, but that's just MHO |
| 10:38 | wlangstroth | _ato: sweet! |
| 10:39 | cemerick | rhickey: repositories like nexus allow you to search POMs in a variety of ways, including by tag/ref/sha |
| 10:39 | Licenser | (inc pjstadig) |
| 10:39 | rhickey | cemerick: do we have nexus? |
| 10:39 | pjstadig | for one thing, because the vision for clojure is multi platform language, and maven seems to be a very java solution |
| 10:39 | cemerick | rhickey: no, the clojure repos are using hudson, which is essentially just apache sitting on top of its local repo, I believe. |
| 10:40 | rhickey | sigh |
| 10:40 | cemerick | technomancy and I talked about future paths for clojure repos last week. FWIW, sonatype offers free nexus hosting for any open source project |
| 10:41 | cemerick | ...with a red carpet into central, which is nice |
| 10:41 | cemerick | I don't know what he thought of any of that. :-) |
| 10:42 | pjstadig | anyway compatibility with maven *repos* is brilliant |
| 10:42 | _ato | this is what nexus looks like, btw, for those unfamiliar with it: http://repository.sonatype.org/ |
| 10:42 | sexpbot | "Sonatype Nexus Maven Repository Manager" |
| 10:42 | pjstadig | but that's something like hosting on the jvm, but not being java |
| 10:42 | Leafw | cemerick: after a few months of maven for contrib, can one evaluate the situation? Did it get better than with ant or a simple shell script? |
| 10:43 | cemerick | Leafw: the build configuration is absolutely simpler. stuartsierra can talk more about the details. |
| 10:43 | _ato | I couldn't find a search by git sha1 option, there is sha1 but I think it refers to just a sha1sum of the jar itself, nothing to do with SCM |
| 10:43 | cemerick | Leafw: No such thing as a "simple shell script", BTW, since they're all different. |
| 10:43 | LauJensen | _ato: Nexus looks really nice, but searching out Clojure and clicking it returns a 404 :\ |
| 10:44 | stuartsierra | Leafw, cemerick: Switching the contrib build from Ant to Maven made it dramatically simpler. |
| 10:44 | stuartsierra | It also exposed some subtle bugs resulting from implicit assumptions about order of compilation, which were fixed. |
| 10:44 | cemerick | it's true, the contrib build has a certain flair now |
| 10:45 | Licenser | Leafw: I think with lein things got quite a bit better. |
| 10:45 | cemerick | ;-) |
| 10:45 | chouser | contrib moving to maven did nothing for me. very slightly complicated dev builds and patch testing, added a dep on maven in our production builds. |
| 10:45 | stuartsierra | Maven only helps Maven users, it's true. |
| 10:45 | LauJensen | chouser: Can you elaborate on how exactly in complicated things? |
| 10:45 | rhickey | chouser: ditto |
| 10:45 | pjstadig | not meaning to open up closed discussions about maven, and personally i've never really had a horrible time with maven |
| 10:46 | rhickey | also it's one ugly build now, lots of nonsense spewed |
| 10:46 | _ato | I think the only people it helped were SS and cemerick ;-) |
| 10:46 | liebke | I signed up for a sonatype repository for Incanter a while back, after several weeks they still hadn't create it, so I gave up and set up my own. The next day they finally created one for me, but I never ended up using it. I'm not impressed with their responsiveness |
| 10:46 | rhickey | no sources to compile..., no test to run |
| 10:46 | Leafw | I know very little about mvn, and hence I hesitate to comment beyond a qualitative statement: it doesnt' look simpler. I've seen beginners struggle with mvn. "too much magic" (downloading of jars instead of using local jars), stated a colleague. |
| 10:47 | chouser | LauJensen: I had to read the readme, wait for the build to support local clojure, and now have to use mvn and an absolute path instead of a relative one. Not much to complain about, but not any better. |
| 10:47 | rhickey | Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 |
| 10:47 | rhickey | Ran 354 tests containing 1242 assertions. |
| 10:47 | rhickey | 0 failures, 0 errors. |
| 10:47 | Licenser | Well, maven is better then nothing at all. But I am sure it could still get a lot better |
| 10:47 | stuartsierra | rhickey: Ugliness of debugging output should not be a consideration. |
| 10:47 | cemerick | rhickey: surely that's not a material issue. |
| 10:47 | _ato | ha |
| 10:48 | _ato | it sure is |
| 10:48 | Licenser | stuartsierra: I think it should, just not the first one. |
| 10:48 | pjstadig | there's a lot of silliness in our maven build at sonian, but it think it is mostly related to living on snapshots |
| 10:48 | _ato | that sort of thing puts off new users |
| 10:48 | _ato | there's a reason ruby has had such a high take up |
| 10:48 | _ato | because they put energy into usability |
| 10:48 | stuartsierra | Ruby is also bug-ridden and dead slow. |
| 10:48 | _ato | yes |
| 10:48 | _ato | but still popular |
| 10:48 | stuartsierra | Speaking as a fan. |
| 10:48 | _ato | because of the usability |
| 10:48 | Licenser | but tons if people use it |
| 10:49 | Licenser | stuartsierra: also thanks for the great posts of swing and clojure :) |
| 10:50 | stuartsierra | Licenser: you're welcome |
| 10:51 | wlangstroth | Ruby is popular because of rails - easy, generic intranet sites (which are my money-maker, so I can understand the appeal) |
| 10:53 | wthidden | Q: How can i test that a symbol references an atom? |
| 10:54 | chouser | (instance? clojure.lang.Atom x) |
| 10:54 | wthidden | thank you.. I must be brain dead today. |
| 10:55 | chouser | hasn't always worked. atom early on didn't have it's own classname, iirc. |
| 10:56 | wthidden | good to know.. I do like moving from defstruct -> defrecord there are nice class names |
| 10:57 | _ato | rhickey: on one hand you're saying we should not be an island -- we should use existing tools, on the other you're saying these tools are too complex and bring more problems then they solve so lets just do things manually and on the third you're saying things should be "easy" with IDE integration, automation etc. There is a conflict here. Maybe we should work on making maven better. But some of it's usability problems are fundamental |
| 10:57 | _ato | to it and we as the very small minority in the inertia of the java ecosystem are not going to be able to change maven. Perhaps that's defeatist thinking, I don't know. Frankly the maven codebase, design and such is the antithesis to simplicity. |
| 10:58 | stuartsierra | Dependency and build management are not a simple problems. |
| 10:58 | _ato | I agree |
| 10:58 | LauJensen | Well, Im not convinced that they need to be complex problems either |
| 10:58 | stuartsierra | I aim. |
| 10:59 | stuartsierra | am |
| 10:59 | chouser | maybe we can use maven in a better way |
| 10:59 | cemerick | LauJensen: the history of build systems seems to indicate that they are. |
| 10:59 | LauJensen | 10 years from now, we'll look back and ponder why we made it so hard |
| 10:59 | stuartsierra | chouser: how so? |
| 10:59 | LauJensen | cemerick: ditto the history of many other things which are now simple |
| 10:59 | stuartsierra | LauJensen: 10 years ago, we were writing Makefiles |
| 11:00 | pjstadig | code reuse is not a simple problem |
| 11:00 | _ato | I dislike the island argument. You could say the same thing about Java. Instead of using/developing Clojrue shouldn't we all focus our efforts on using or improving Java in better ways? |
| 11:00 | chouser | well, I'm not really sufficiently informed to say. What about including git sha's in the builds available on build.clojure.org? |
| 11:00 | _ato | Interoperability is important |
| 11:00 | pjstadig | my software engineering professor did his PhD on the subject |
| 11:00 | wlangstroth | were makefiles so bad? Oh, wait ... |
| 11:00 | cemerick | chouser: oh, please no, no. |
| 11:00 | _ato | But I dislike decisions to stick with a system that sucks, just because it's popular |
| 11:00 | cemerick | version numbers *are* sequential. SHAs are not. |
| 11:01 | _ato | You can still interoperate with it, without being it |
| 11:01 | pjstadig | changing interfaces and implementations, and the couplings between modules get sticky pretty quick |
| 11:01 | chouser | the version number sequence is a lie |
| 11:01 | stuartsierra | cemerick, chouser: yes |
| 11:01 | drewr | cemerick: YYYYMMDD-HHMMSS-<SHORTENED SHA> works very well |
| 11:01 | chouser | version number builds could be made available as well |
| 11:02 | cemerick | _ato: I think it's a matter of what you want to focus on. I've zero interest in making a better build system. |
| 11:02 | chouser | but wouldn't this do away with the unlocked snapshot situation that causes undesirable breakage for maven and lein consumers of clojure+contrib? |
| 11:03 | stuartsierra | chouser: you can already peg maven builds to particular snapshots |
| 11:03 | pjstadig | i think rhickey wanted to stick with the date based snapshot releases, but was forced into the psychological effect of a 1.0 release IIRC |
| 11:03 | stuartsierra | you can even automate the process of locking & unlocking snapshots |
| 11:03 | LauJensen | stuartsierra: So what exactly are the conditions for breakage ? |
| 11:03 | stuartsierra | breaking what? |
| 11:04 | cemerick | stuartsierra: I suspect 90% of the folks here would object to the tooling around doing that. I already pointed rhickey @ the appropriate versions plugin page, with bad results. |
| 11:04 | stuartsierra | cemerick: Yeah, I know. Ooh, more XML, run away... |
| 11:04 | LauJensen | stuartsierra: From what I gather, we have problems when and only when we don't point to specific snapshots, causing incompatabilities, so adding the SHA and exposing those that go well together timewise should solve the issue right? |
| 11:05 | chouser | stuartsierra: so why are people complaining about changes in clojure breaking things? |
| 11:05 | chouser | oops, lunch. gotta go, sorry. |
| 11:05 | cemerick | chouser: because people (ab)use snapshots as actual releases. |
| 11:06 | stuartsierra | chouser: what cemerick said |
| 11:06 | LauJensen | cemerick: beacuse they cant easily point to shas ? |
| 11:06 | chouser | so they're misusing maven? |
| 11:06 | cemerick | LauJensen: no one pointing at 1.2-SNAPSHOT cares or knows a whit about SHAs |
| 11:06 | cemerick | chouser: yes, or not using maven, or not familiar with the semantics of SNAPSHOT |
| 11:07 | LauJensen | I expect mostly the latter |
| 11:07 | stuartsierra | yes |
| 11:07 | chouser | but you can't lock maven to a git version, right? just a snapshot date? |
| 11:07 | stuartsierra | chouser: correct |
| 11:07 | cemerick | chouser: insofar as you're using version numbers, yes |
| 11:07 | wlangstroth | well yeah, people tagging SNAPSHOT on the end just want the latest to test, don't they? |
| 11:07 | chouser | or "don't" rather than "can't" anyway. |
| 11:07 | chouser | see, so that's a failure of maven to provide the right way. |
| 11:08 | cemerick | if you're absuing SHAs as version numbers, then you've gone astray in a variety of ways anyway |
| 11:08 | cemerick | chouser: totally disagree |
| 11:08 | chouser | and then an education issue of people using maven in ways other than the nearly-right way. |
| 11:08 | chouser | ok, really going now. :-) |
| 11:08 | stuartsierra | chouser: Maven predates Git by years. |
| 11:08 | stuartsierra | And who says using SHAs as snapshot ID's is correct? |
| 11:08 | cemerick | SHAs are not version numbers. Maybe to those few who are building the libs in question, but not to the thousands that use the lib. |
| 11:09 | cemerick | stuartsierra: no one, but that's viewed as convenient and obvious. |
| 11:09 | LauJensen | stuartsierra: I think it sounds like a good idea, and a solution to the problem |
| 11:09 | _ato | snaphot dates aren't version numbers in that sense either |
| 11:09 | pjstadig | sha's as snapshot id's seem more correct to me because it's about the content, not when the build happened to have been done |
| 11:09 | cemerick | _ato: they are sequential, and the relationship between two concrete snapshot versions is obvious. |
| 11:09 | LauJensen | It just gives me a way to get a 'stable' feel out of a current snapshot |
| 11:10 | LauJensen | cemerick: yea thats the one problem with hashs, then dont sync well |
| 11:10 | _ato | code isn't sequential though when you have branches |
| 11:10 | wlangstroth | didn't someone above post YYYYMMDD-HHMMSS-sha for a low-trouble solution? |
| 11:10 | _ato | so there's a semantic mismatch there |
| 11:11 | _ato | which might have been Rich's point about subversion |
| 11:11 | LauJensen | wlangstroth: yea, but how do you look at clojure's hash, and contribs, and then figure out which 2 go together? |
| 11:11 | _ato | I'm not sure I entirely understoof that |
| 11:11 | cemerick | _ato: Very true. But again, mvn is all about artifacts for distribution, whereas these experimental branches are decidedly not meant to be widely distributed. |
| 11:11 | wlangstroth | LauJensen: fair enough. |
| 11:11 | LauJensen | cemerick: They need to be distributed though |
| 11:11 | drewr | LauJensen: each pom specifies the dependency's version it expects |
| 11:12 | cemerick | LauJensen: Perhaps, but when there's a major divergence semantically (1.1-new vs. 1.1-master), those both shouldn't be referred to as 1.1-* |
| 11:12 | _ato | I think it *would* be really nice to have no snapshots and instead have more frequent releases, but we can't have more frequent releases because we want releases to be backwards compatible and it takes time to stabilize features |
| 11:13 | stuartsierra | _ato: yes |
| 11:13 | dnolen | so there's no such thing as 1.2.0-master-STABLE ? would it be possible to create this automatically based on whether the current build passes all tests, and all the tests for a couple of popular Clojure libraries as well? then everyone would stop using SNAPSHOT. and noone has to maintain it by hand. |
| 11:13 | stuartsierra | dnolen: but the APIs are not stabel |
| 11:13 | cemerick | dnolen: that's called a release :-) |
| 11:13 | LauJensen | cemerick: Agreed, but 'new' doesnt tell me anything, then it should be '1.1-dev-0.1' |
| 11:13 | stuartsierra | 'new' was a bad branch name |
| 11:13 | _ato | the reason everyone's using snapshots is because there are features they really desire that haven't been released |
| 11:14 | cemerick | LauJensen: I think that would still get caught up in the versioning range that stuarthalloway got tripped up with. |
| 11:14 | wlangstroth | LauJensen: that was the original issue, wasn't it? 1.1-dev-0.1.1, etc |
| 11:14 | pjstadig | i don't think one needs to apologize for breaking a build that lives on snapshots |
| 11:15 | cemerick | pjstadig: uh-huh |
| 11:15 | pjstadig | however the fact that so many people seem to be living on snapshots might indicate a more fundamental problem |
| 11:15 | pjstadig | release early, release often |
| 11:15 | pjstadig | :-/ |
| 11:15 | cemerick | pjstadig: nah, you can't pin that behaviour on the authors of a lib. |
| 11:15 | pjstadig | but then again you don't want to release features that have a high probability of changing |
| 11:15 | _ato | perhaps we should throw away snapshots and instead have frequent, properly numbered development releases which aren't guranteeed backwards-compatible |
| 11:15 | _ato | eg an odd / even numbering scheme |
| 11:16 | stuartsierra | _ato: I've wondered about that too |
| 11:16 | cemerick | _ato: you think people will understand that better than an all-caps SNAPSHOT qualifier? ;-) |
| 11:16 | wlangstroth | _ato: what, like the linux kernel? |
| 11:16 | cemerick | The funny/sad thing is that there isn't actually a problem to be solved here. |
| 11:17 | wlangstroth | cemerick: hehe - we've come full circle |
| 11:17 | _ato | a social problem is still a problem |
| 11:17 | _ato | a problem of education is still a problem |
| 11:17 | stuartsierra | Programmers can't solve social problems. |
| 11:17 | cemerick | Right. RTFM is a meta issue. |
| 11:17 | stuartsierra | And should be banned from trying. |
| 11:18 | wlangstroth | haha - may I quote you? |
| 11:18 | LauJensen | stuartsierra: cemerick: How do I target a specific contrib/clojure pair using maven ? |
| 11:18 | wlangstroth | (both) |
| 11:18 | _ato | wlangstroth: yes. Interesting the linux kernel earlier had an odd/even model and has now moved to just regular releases |
| 11:18 | _ato | but part of the reason they can now do regular releases is they're a mature project |
| 11:18 | cemerick | LauJensen: Use concrete snapshot version numbers, like 1.2.0-20100427.160337-80 |
| 11:18 | cemerick | (which is what I'm using for contrib right now) |
| 11:18 | stuartsierra | which you can find on build.clojure.org |
| 11:19 | LauJensen | ok, and both repos carry the exact same suffix? |
| 11:19 | stuartsierra | no |
| 11:19 | stuartsierra | but the pages detailing the builds are cross-linked |
| 11:19 | _ato | LauJensen: the same applies to lein and all the other tools. Just don't use "-SNAPSHOT" and you'll be happy |
| 11:19 | cemerick | or, you find the version of cloure you want, note the timestamp, and the take the version of contrib that immediately follows that timestamp |
| 11:20 | cemerick | stuartsierra's way is surely easier tho |
| 11:20 | LauJensen | stuartsierra: looking at build.clojure.org its not clear which version goes with which |
| 11:20 | stuartsierra | e.g. http://build.clojure.org/job/clojure-contrib/101/ (build #101) contains link to clojure build #111 |
| 11:20 | sexpbot | "clojure-contrib #101 [Hudson]" |
| 11:21 | LauJensen | Ah like that |
| 11:21 | LauJensen | Okay - That doesn't seem very tricky actually |
| 11:21 | LauJensen | Thanks guys :) |
| 11:21 | stuartsierra | you're welcome |
| 11:22 | LauJensen | Now if only we could figure out a way to prevent Halloway from breaking it, we'd be all set for primetime :) |
| 11:22 | stuartsierra | heh |
| 11:22 | cemerick | ut-oh, that sounded remarkably like a maven success story ;-) |
| 11:22 | LauJensen | (j/k stuarthalloway) |
| 11:22 | stuarthalloway | I am breaking all sorts of stuff today |
| 11:22 | stuarthalloway | https://www.assembla.com/spaces/clojure/tickets/328-don-t-assume-chunked-seq-will-alway-stay-chunked |
| 11:22 | sexpbot | "#328 - don't assume chunked seq will alway stay chunked (Test) | Clojure | Assembla" |
| 11:22 | stuartsierra | cemerick: It would be nice if we could get Hudson to report the actual SNAPSHOT version number on the build page. |
| 11:23 | wlangstroth | cemerick: that was a paper-and-pencil success story |
| 11:23 | cemerick | wlangstroth: that was a joke, there, son! :-) |
| 11:24 | cemerick | stuartsierra: Maybe there's a plugin. I'm not up on my hudson/maven integration fu. |
| 11:24 | stuartsierra | me neither |
| 11:25 | wlangstroth | cemerick: yes. yes it was. |
| 11:25 | LauJensen | But I wonder why this turns into a maven discussion on every turn - This isnt a build system out there which can solve this for us |
| 11:25 | cemerick | LauJensen: bingo |
| 11:26 | cemerick | That's why it's a social problem. |
| 11:26 | LauJensen | Of course I could make an emacs-plugin which solves it quite easily..... :P |
| 11:26 | wlangstroth | friggin' emacs |
| 11:27 | LauJensen | Gotta jet, good weekend to all |
| 11:27 | wlangstroth | poverty? emacs has a plug-in for that. World peace? yup. |
| 11:27 | stuartsierra | CTAN, CPAN, Rubygems, Eggs, PEAR, Maven, apt: I have never seen a software distribution system that doesn't cause aggravation. |
| 11:28 | avar | Usually it's not the fault of the distribution system |
| 11:28 | stuartsierra | misuse, then? |
| 11:28 | avar | unfamiliarity, blaming the inevitable broken *package* on the distribution system |
| 11:29 | avar | confusing a sucky distribution system with one sucky client, etc :) |
| 11:29 | wlangstroth | stuartsierra: this is starting to feel like "you remind me of a man. What man? The man with the power ..." |
| 11:29 | stuartsierra | true enough |
| 11:29 | stuartsierra | anyway, I'm tired of rehashing this argument. later |
| 11:32 | rhickey | I'm not arguing against maven, I'm arguing for fans of maven to please solve the Clojure snapshot problem for non-maven experts, in a way consumable without maven expertise |
| 11:34 | stuarthalloway | rhickey: please approve 328 |
| 11:34 | rhickey | stuarthalloway: done |
| 11:38 | stuarthalloway | ...and pushed |
| 11:40 | Licenser | do destract you people from your worries: http://xkcd.com/734/ |
| 11:40 | sexpbot | "xkcd: Outbreak" |
| 11:40 | patrickdlogan | clojure's reflection seems to be selecting the more general overloaded method with an Object argument rather than the more specific one with a subclass of Object. Can I force it to use the more specific one, e.g. with metadata? |
| 11:43 | rhickey | patrickdlogan: you should be able to, yes |
| 11:48 | arkahn | a beginner question about idiomatic clojure - why do this: (map (fn [_] (ref (struct cell 0 0))) (range 80)) to create a bunch of structs instead of some other looping mechanism? (taken from Rich's ant prog written a couple or so years ago) |
| 11:49 | arkahn | sorry - this instead: (apply vector (map (fn [_] (ref (struct cell 0 0))) (range dim)) )) |
| 11:50 | arkahn | with a (def dim 80) |
| 11:51 | arkahn | ... or maybe I just need to go off and learn more functional programming style ; ) |
| 11:52 | patrickdlogan | rhickey: great - thx, worked like a charm. |
| 11:53 | hiredman | arkahn: what other looping mechanism? |
| 11:54 | Chousuke | arkahn: why do you need a vector of refs instead of a ref containing a vector? |
| 11:54 | hiredman | to be fair I think I would prefer (take dim (repeatedly #(ref (struct cell 0 0)))) |
| 11:54 | Chousuke | arkahn: generally speaking, the more refs you have, the more trouble there will be managing all of them :) |
| 11:55 | arkahn | Chousuke: the refs were needed as part of a larger example on concurrency - the rest of the program (and programming) goal call for refs |
| 11:56 | arkahn | hiredman: that's the thing. I don't know what else it would be, it just didn't seem as "natural" as perhaps something else, but I'm still at the beginning stages of thinking in clojure to know what that something else might be (hope that makes sense) |
| 11:56 | Chousuke | anyway, I'd go with (vec (for [n (range 80)] (ref (struct cell 0 0)))) |
| 11:57 | Chousuke | but there are many options |
| 11:57 | hiredman | arkahn: "loops" in clojure are almost always expressed as opertaions over a sequence of values |
| 11:57 | arkahn | I guess those two examples look better to me - thank you |
| 11:57 | hiredman | not loops |
| 11:57 | hiredman | clojure has a while, but it is not a loop |
| 11:57 | arkahn | right - I agree there |
| 11:57 | Chousuke | yeah. explicit looping is nonidiomatic |
| 11:57 | hiredman | for is not a loop |
| 11:58 | Chousuke | while is a loop but it's not very useful unless you have side-effects :P |
| 11:59 | hiredman | clojure has a 'loop' which is strictly speaking a loop |
| 11:59 | DeusExPikachu | the character ! is used to denote functions that change state and the character ? for predicates, anyone use characters to denote I/O? |
| 11:59 | hiredman | but if the jvm had tail calls it wouldn't need to be |
| 12:00 | Chousuke | DeusExPikachu: ! works for IO too |
| 12:00 | Chousuke | DeusExPikachu: though it might be redundant if the IOness is obvious |
| 12:01 | hiredman | ,(doc io!) |
| 12:01 | clojurebot | "([& body]); If an io! block occurs in a transaction, throws an IllegalStateException, else runs body in an implicit do. If the first expression in body is a literal string, will use that as the exception message." |
| 12:02 | arkahn | it seems like clojure is more "nuanced" and varied as far as how a person can accomplish a given thing (e.g. looping). It's probably the most difficult language I've ever tried to learn, out of c, perl, python, javascript, java, etc. |
| 12:02 | Chousuke | arkahn: it's probably just the most different |
| 12:02 | Chousuke | of those languages, javascript is probably closest |
| 12:03 | arkahn | Chousuke: yeah ; ) I do like the way it forces me to think differently. And in no way do I want to try to make the circular clojure fit in a imperative square hole (?) (I think that makes sense) |
| 12:03 | Chousuke | heh |
| 12:03 | DeusExPikachu | in symbol names, what's + used for? |
| 12:04 | Chousuke | like +foo+? |
| 12:04 | DeusExPikachu | Chousuke, yeah |
| 12:04 | Chousuke | it's a CL convention for constants |
| 12:04 | DeusExPikachu | k |
| 12:04 | Chousuke | largely redundant in Clojure |
| 12:04 | Chousuke | just use "foo" |
| 12:05 | replaca | stuarthalloway: should we have :added at the namespace level as well? (Autodoc will support it) |
| 12:06 | hiredman | the var stuff in the json contrib api index is still blank |
| 12:07 | replaca | hiredman: yeah, it's on the list - I've gotten sidetracked with some other stuff |
| 12:07 | replaca | sorry about the delay |
| 12:07 | hiredman | oh no, if you are busy you are busy |
| 12:09 | replaca | hiredman: just a short push to get pprint into 1.2 and a couple of other 1.2 things |
| 12:10 | replaca | hiredman: but autodoc is still in a bit of disarray from the switch to multi-branch (in particular, it's not completely auto at the moment) |
| 12:10 | hiredman | ok |
| 12:12 | wlangstroth | arohner: it's a slippery slope |
| 12:12 | arohner | my project.clj has a :dev-dependency of [swank-clojure "1.2-SNAPSHOT"] and [lein-swank "1.1.0"]. lein downloads two versions of swank-clojure.jar |
| 12:12 | replaca | arohner: try using ant, then you'll be in two hells at once |
| 12:12 | wlangstroth | haha |
| 12:13 | arohner | if I manually delete the older swank-clojure, everything works |
| 12:13 | arohner | if not, slime is broken |
| 12:13 | arohner | but lein-swank doesn't need to be updated at all for swank-clojure 1.2, except to specify its dependency |
| 12:14 | hiredman | arohner: you can remove the explicit dependency, or you can tell lein to ignore swank from lein-swank |
| 12:14 | arohner | hiredman: how do I do the second? |
| 12:14 | arohner | oh, :exclusions |
| 12:15 | _ato | [leiningen/lein-swank "1.1.0" :exclusions [swank-clojure]] |
| 12:15 | _ato | yep |
| 12:16 | arohner | hiredman, _ato: thanks |
| 12:17 | arohner | is it ever a good idea to have two versions of the same library in your classpath? |
| 12:18 | cemerick | nope |
| 12:19 | wlangstroth | arohner: that's like hitting yourself |
| 12:19 | arohner | I'm wondering if lein should detect that, and warn / throw |
| 12:20 | replaca | wlangstroth: got your message on github (re: cheatsheets). I like it. We'll discuss it in more depth in a week or two. Ping me again if I forget. |
| 12:21 | wlangstroth | replace: cool, thanks |
| 12:21 | wlangstroth | replaca: ^ |
| 12:25 | replaca | wlangstroth: np |
| 12:26 | Licenser | hmm can I use macros in a doto? |
| 12:27 | hiredman | depends on what macros expand to |
| 12:27 | hiredman | ,(doto 1 (-> .toString println)) |
| 12:27 | clojurebot | 1 |
| 12:27 | Licenser | ah okay so they get expanded before the stuff gets inserted |
| 12:27 | clojurebot | 1 |
| 12:27 | hiredman | nope |
| 12:28 | Licenser | ah okay then I should be able to put the macros in as long as they take the object as the first argument :) |
| 12:28 | hiredman | just like any other use of doto |
| 12:28 | Licenser | okay coolish :D |
| 12:38 | stuarthalloway | replaca: added at namespace level sounds good to me |
| 12:38 | abedra | technomancy: I ended up just sending a pull request over yesterday on -stable for the lein test exit code fixes |
| 12:42 | replaca | cool - I just implemented the autodoc side code |
| 12:42 | replaca | (or most of it) |
| 13:03 | cemerick | yuck, (str record-instance) returns classname@id |
| 13:04 | cemerick | is the pr behaviour going to get roped into defrecord's .toString()? |
| 13:10 | cemerick | ouch; is this expected? https://gist.github.com/31c64ee18cb631e3b54e |
| 13:11 | cemerick | I presume that result is coming from the map impl in the generated record class, but... |
| 13:12 | cemerick | rhickey: ^^ |
| 13:16 | headius | cemerick: what's defrecord btw? |
| 13:16 | cemerick | headius: http://clojure.org/datatypes |
| 13:17 | headius | interesting |
| 13:18 | headius | is that something you could feed to e.g. Hibernate as a model's data object? |
| 13:18 | cemerick | hrm, perhaps |
| 13:18 | cemerick | might need a few annotations, though you can do that now too |
| 13:19 | cemerick | heh, it gets even sillier: https://gist.github.com/31c64ee18cb631e3b54e :-P |
| 13:20 | Chousuke | ... what? |
| 13:22 | krumholt | ,(doc defrecord) |
| 13:22 | clojurebot | Gabh mo leithscéal? |
| 13:22 | krumholt | ,(clojure-version) |
| 13:22 | clojurebot | "1.1.0-master-SNAPSHOT" |
| 13:23 | headius | defrecord seems to fit the niche of Struct in ruby |
| 13:23 | headius | I wonder if we should be making Struct construct a real Java class |
| 13:29 | chouser | ha! I lied. Or rather, I was only talking about work when I said "production" |
| 13:29 | chouser | the clojure-log is out of date. Caused by: java.lang.IllegalAccessError: reductions is not public |
| 13:30 | leifw | argh clj-processing keeps crashing X |
| 13:30 | leifw | this is infuriating |
| 13:30 | chouser | there, delete one line, all fixed. |
| 13:30 | rhudson | chouser: you fixed clojure-log? |
| 13:31 | chouser | rhudson: yes |
| 13:31 | rhudson | ... or the defrecord issue? |
| 13:31 | rhudson | thanks! |
| 13:31 | chouser | http://clojure-log.n01se.net/ is running agin |
| 13:31 | chouser | again |
| 13:31 | sexpbot | "#clojure log - Apr 30 2010" |
| 13:35 | stuarthalloway | headius: if you make a real java class, look to the classloader madness you will need to do |
| 13:36 | headius | we generate java classes all the time at runtime right now |
| 13:36 | headius | most ruby programs don't ever get compiled, but they eventually end jit to bytecode in jruby |
| 13:37 | stuarthalloway | p.s. it is evil to combine Hibernate and Clojure |
| 13:38 | stuarthalloway | it is like trying to get somewhere by driving ten miles north then ten miles south |
| 13:42 | rhudson | stuarthalloway: Agree on Hibernate -- why use ORM when you can use relations directly? -- but it is nice to abstract the dialect differences between SQLs. What fits Clojure better? |
| 13:43 | stuarthalloway | clj-record? |
| 13:43 | stuarthalloway | nosql? |
| 13:44 | cemerick | hibernate and such is just The Way It Is in a lot of shops, and using clojure in those environments is just as much of a win (in relative terms) as it is elsewhere. |
| 13:44 | rhudson | "Requirement: persistence must use MySQL, SQLServer, and Oracle" |
| 13:44 | cemerick | Of course, for greenfield stuff, you're a little crazy to choose it. |
| 13:51 | cemerick | Hrm, no takers/opinions on this? https://gist.github.com/31c64ee18cb631e3b54e |
| 13:52 | rhudson | cemerick: it's those specific field names, right? |
| 13:52 | cemerick | rhudson: no, I'll bet any no-arg method name will do it |
| 13:52 | rhudson | Looks like implementation methods are being exposed |
| 13:53 | somnium | its a feature! name your field :seq for free functionality |
| 13:53 | rhudson | cemerick: 2 is the number of fields (size of record) |
| 13:53 | cemerick | yeah, I know |
| 13:53 | cemerick | I have to assume it's a bug. |
| 13:53 | rhudson | I betcha the impl has a getSize() method |
| 13:53 | rhudson | yea |
| 13:53 | remleduff | What happens if you try to make field named "equals" ? |
| 13:54 | cemerick | remleduff: works as expected. This only affects fields with the same name as no-arg methods. |
| 13:54 | cemerick | (:blah record) probably gets expanded into (.blah ^RecordType record) or somesuch |
| 13:55 | rhudson | There must be only a few hundred of those in core... |
| 14:07 | cemerick | I'd say the issue is here: http://github.com/richhickey/clojure/blob/master/src/clj/clojure/core_deftype.clj#L181 |
| 14:10 | cemerick | I'm not clear on the semantics of the lookup thunks, but It looks like getLookupThunk should return nil for any field with the same name as any no-arg methods defined by the defrecord's implemented interfaces. |
| 14:27 | stuarthalloway | cemerick: do file a ticket on this! |
| 14:27 | cemerick | stuarthalloway: already got a patch; would you like to take a look before I post it? |
| 14:28 | stuarthalloway | ok |
| 14:28 | chouser | I think getLookupThunk returning nil will cause the call-site caching to fail |
| 14:28 | chouser | (and fall back to slower lookup) |
| 14:28 | cemerick | stuarthalloway: https://gist.github.com/9d1769237b312eb49723 |
| 14:28 | cemerick | chouser: doesn't it have to in this case? |
| 14:29 | cemerick | (. object field) will always invoke the field method, if it exists |
| 14:30 | cemerick | there's the mapcat going on over the base-fields, in which case what I just pasted would go into the body of the mapcat fn, but I'm unclear as to how returning a seq from getLookupThunk can work... |
| 14:30 | chouser | well, slow is certainly better than the behavior you're seeing. :-) |
| 14:31 | stuarthalloway | the speed impact is only on map lookup, right? |
| 14:31 | cemerick | Yeah, I'm pretty well confused by that mapcat in general. |
| 14:33 | chouser | grr. I shouldn't look at this right now. |
| 14:33 | cemerick | stuarthalloway: There won't be a speed issue at all one way or the other (as far as one can eliminate a speed issue given a no-arg method and a field of the same name). |
| 14:34 | chouser | cemerick: does your patch set ~'k to nil when there are any no-arg methods in the class? |
| 14:34 | stuarthalloway | cemerick: go ahead and submit it, I will discuss with Rich |
| 14:34 | stuarthalloway | it will need (and get) some tests but I don't have time to wrap my head around this right now |
| 14:34 | slyphon | is the general use-case for pre/post conditions be that you'll run with assertions enabled during test/dev and off in production? |
| 14:35 | cemerick | OK, so my patch seems to do good -- (.getLookupThunk (Foo. 42 :b 'c) :blah) for (defrecord Foo [size seq blah]) returns a reified thunk, but (.getLookupThunk :seq) doesn't. |
| 14:35 | cemerick | chouser: no, ~'k is nil only when ~'k is of the same name as the no-arg methods implemented in the class. |
| 14:36 | chouser | cemerick: ok. |
| 14:36 | cemerick | I'm still confused by how the mapcat yields a single reify, though. |
| 14:36 | chouser | the mapcat generates the body of the case |
| 14:36 | cemerick | oh, shite, didn't see the ~@ there |
| 14:37 | cemerick | in that case, I should just filter the base-fields seq |
| 14:37 | _nj | Hi all!, I am new to clojure/compojure, I have a question. I noticed that the run-server function is missing in the new refactored compojure, has it been deprecated? Is run-jetty the only option now? Thanks! |
| 14:38 | chouser | cemerick: ok, yeah, that would make sense, if the goal is to simply skip this performanace feature for conflicting keys |
| 14:38 | cemerick | chouser: good, this makes sense now :-) |
| 14:40 | chouser | other solutions I can imagine include: munging some record fields and the keywords to match, adding some syntax to the . form to sepcifically get fields instead of no-arg methods.... |
| 14:41 | cemerick | the latter is a general need elsewhere, too |
| 14:41 | cemerick | rare, but I've seen it needed |
| 14:44 | slyphon | chouser: um, where can i report a bug on thejoyofclojure? |
| 14:45 | slyphon | s/on/in/ |
| 14:51 | cemerick | _nj: Sorry, I've been sticking with the v0.3.x builds |
| 14:51 | cemerick | Maybe there's something in ring that is more general than run-jetty? |
| 14:53 | kencausey | slyphon: http://www.manning-sandbox.com/forum.jspa?forumID=624 |
| 14:53 | sexpbot | "Manning Forums: Joy of Clojure" |
| 14:53 | slyphon | ah |
| 14:53 | slyphon | kencausey: thanks |
| 14:58 | _nj | cemerick: Thanks, I'll look into ring |
| 15:09 | leifw | I'm getting an IllegalArgumentException when I try to use clojure-hadoop |
| 15:09 | leifw | it says "no method in multimethod 'conf' for dispatch value: :input-format" |
| 15:10 | leifw | but this is clearly defined in the library |
| 15:10 | leifw | there is a (defmethod conf :input-format ...) |
| 15:11 | leifw | alternatively, leiningen has not been recompiling my classes unless I say they're main classes, which is really annoying, and if it's not compiling config.clj, I could see this being the problem, so does anyone know how to get leiningen to compile clojure files properly? |
| 15:13 | technomancy | leifw: should be able to use the :namespaces key in project.clj |
| 15:13 | leifw | yup, found that just now, thanks |
| 15:14 | technomancy | but that is a lousy name; it will be renamed in 1.2 |
| 15:14 | leifw | cool |
| 15:14 | technomancy | renamed in a non-breaking way (with an old alias) |
| 15:14 | cemerick | chouser: I'm leaving the patch as-is for now -- gtarget doesn't contain the default interface impls at the time that base-fields is mapcat'd, so I'm not sure how to get the full set of methods at that point. |
| 15:15 | leifw | technomancy: how much do you know about clojure-hadoop though? |
| 15:16 | leifw | I am having the most terrible time getting it to run on the cluster |
| 15:16 | technomancy | that about jives with my experience with hadoop |
| 15:16 | leifw | ugh |
| 15:16 | technomancy | it's a lot of work to get running correctly, and even then it doesn't provide a lot of value |
| 15:16 | technomancy | unless you're using HDFS, which is pretty impressive |
| 15:16 | leifw | words of true encouragement :-/ |
| 15:16 | leifw | we are |
| 15:17 | leifw | so that's useful I guess |
| 15:17 | leifw | YES IT IS DEFINED YOU BASTARD |
| 15:17 | leifw | ARGH |
| 15:17 | technomancy | sorry =( |
| 15:17 | leifw | haha that's ok |
| 15:17 | leifw | thanks for the help |
| 15:33 | slyphon | in a macro, if ~'blah is the idiom to capture a symbol, what does ~() mean? |
| 15:33 | cemerick | stuarthalloway: FYI: https://www.assembla.com/spaces/clojure/tickets/329 |
| 15:33 | sexpbot | "#329 - Fix defrecord keyword lookup on fields matching no-arg methods (Test) | Clojure | Assembla" |
| 15:33 | cemerick | I keyed it to 1.2, which I presume is appropriate. :-) |
| 15:34 | chouser | slyphon: unquote the result of the evaluating the () |
| 15:34 | stuarthalloway | cemerick: yes, thanks |
| 15:34 | chouser | , `[1 2 ~(+ 10 5) 3 4] |
| 15:34 | clojurebot | [1 2 15 3 4] |
| 15:34 | slyphon | ah |
| 15:47 | stuartsierra | leifw: clojure-hadoop was written (by me) for Hadoop 0.18.3 and has not been updated since (nor will it be) |
| 15:47 | stuartsierra | If you want to use Hadoop, make sure you know the Java APIs first. |
| 15:48 | stuartsierra | Then it's not too hard to add some Clojure. |
| 16:21 | danlarkin | scatterbrained: is there a function that does #(first (remove %1 %2))? |
| 16:22 | Chousuke | ,((comp first remove) nil? [nil nil 1 nil]) |
| 16:22 | clojurebot | 1 |
| 16:24 | Chousuke | I'm not usually a fan of pointfree style in clojure but in this case that works pretty neatly |
| 16:27 | hiredman | :let in for is pretty handy |
| 16:35 | chouser | ,(some #(when-not (nil? %) %) [nil nil 1 nil]) |
| 16:36 | clojurebot | 1 |
| 16:48 | livingston | if I have a lot of strings to concatenate together (and it's going to happen a lot, so I'd rater avoid a thing that concatenates the first two string, then reallocates to add the third etc.) is (str x y z ..) the function that I want? |
| 16:50 | rsh | if ref's can manage multiple locations (which means it can handle single location), then what is the purpose of having atoms? |
| 16:56 | stuarthalloway | livingston: str uses StringBuilder internally, you should be good |
| 16:56 | stuarthalloway | ,(source str) |
| 16:56 | clojurebot | Source not found |
| 16:56 | stuarthalloway | ,(use 'clojure.contrib.repl-utils) |
| 16:56 | clojurebot | nil |
| 16:57 | stuarthalloway | ,(source str) |
| 16:57 | Chousuke | rsh: atoms are simpler |
| 16:57 | clojurebot | Source not found |
| 16:57 | Chousuke | rsh: they're also not coordinated in any way |
| 16:57 | livingston | stuarthalloway: thanks yeah I looked at the source and saw that, and I though StringBuilder's were efficient but my knowledge of what's the most efficient way to do something in Java is sorely dated. |
| 16:58 | livingston | I appreciate it. |
| 16:58 | Chousuke | str's probably going to be the most efficient way of concatenating strings. so long as you don't use it with reduce :) |
| 17:00 | slyphon | w00t! |
| 17:01 | livingston | so if I'm not building my string at compile time, nor know how many substrings are going to be concatenated, I should then apply str to a list of substrings? |
| 17:07 | slyphon | is it common to use 'do' to chain together recursive expansions of a macro's arguments? |
| 17:12 | Borkdude | why do I need the # in (meta #'==) again? |
| 17:13 | slyphon | it's a reader macro |
| 17:13 | slyphon | #' is to access the Var |
| 17:13 | slyphon | aiui |
| 17:13 | slyphon | '== is just (symbol "==") |
| 17:14 | slyphon | #'== means "give me the value of var represented by (symbol "==")" |
| 17:14 | slyphon | i *think* |
| 17:15 | Borkdude | ah ok, so with (meta '==) i would ask for the metadata of a symbol, right |
| 17:15 | arohner | Borkdude: right. And symbols don't have metadata, but vars do. |
| 17:16 | Borkdude | and symbols are just stupid things in clojure |
| 17:16 | slyphon | they're more like "labels" |
| 17:16 | slyphon | or names-of-interesting-things |
| 17:17 | Borkdude | I was thinking of property lists in CL, it confused me a little |
| 17:17 | mmarczyk | actually the ' in #' has nothing to do with the stand-alone ' |
| 17:18 | Borkdude | So if i just remember that symbols are jjust labels with no further properties I should be fine in clojure? |
| 17:18 | mmarczyk | #'foo expands to (var foo), var is a special form and doesn't need quoting |
| 17:18 | slyphon | mmarczyk: oh? |
| 17:18 | mmarczyk | the effect is the same, though |
| 17:18 | slyphon | ah |
| 17:18 | slyphon | my mistake |
| 17:19 | mmarczyk | what about that do and chaining stuff in macros? |
| 17:19 | mmarczyk | not sure I understand that one |
| 17:19 | slyphon | ah |
| 17:19 | mmarczyk | btw, symbols can have metadata |
| 17:19 | slyphon | one sec |
| 17:19 | mmarczyk | in fact that's how type hints work |
| 17:19 | mmarczyk | {:tag foo} is attached to the symbol by the reader |
| 17:20 | mmarczyk | then the compiler uses that |
| 17:20 | Borkdude | i see |
| 17:20 | mmarczyk | if the symbol happens to occur as a name in a def* form |
| 17:20 | mmarczyk | then that metadata gets copied onto the Var |
| 17:20 | mmarczyk | so that it's accessible at runtime |
| 17:21 | mmarczyk | since the fact that some metadata is attached to a symbol at one time doesn't mean it's going to stay there when "the same" (in the sense of =) symbol is encountered later |
| 17:21 | mmarczyk | ,(meta '#^foo foo) |
| 17:21 | clojurebot | {:tag foo} |
| 17:22 | mmarczyk | ,(meta 'foo) |
| 17:22 | clojurebot | nil |
| 17:22 | mmarczyk | iirc, anything implementing clojure.lang.IObj can have metadata attached |
| 17:22 | slyphon | it needs IMeta i think |
| 17:23 | slyphon | mmarczyk: https://gist.github.com/d6a6dabb9c0a85e154c2 |
| 17:23 | slyphon | now, that *works* |
| 17:23 | mmarczyk | actually IObj seems to be needed for attaching data, while IMeta suffices for (meta ...) :-) |
| 17:23 | slyphon | i just wasn't sure if it was bad form, having those nested 'do's |
| 17:23 | slyphon | ah |
| 17:23 | mmarczyk | looing now :-) |
| 17:24 | mmarczyk | looking, I mean |
| 17:24 | slyphon | ah, yes |
| 17:25 | Borkdude | eh, what does (meta '#^foo foo) mean? |
| 17:26 | mmarczyk | slyphon: nothing wrong with that code to my eye :-) |
| 17:26 | slyphon | ah, good |
| 17:26 | slyphon | :) |
| 17:26 | mmarczyk | you could probably put the second form from the do inside the let |
| 17:26 | mmarczyk | but if it's more trouble to write it this way |
| 17:26 | slyphon | ah, that let is autogenerated by the doto |
| 17:26 | mmarczyk | there's no real reason to do that |
| 17:26 | mmarczyk | yeah |
| 17:26 | slyphon | hoorj! |
| 17:27 | mmarczyk | :-) |
| 17:27 | slyphon | can you only have one `() form in a macro? |
| 17:27 | slyphon | i mean, at the top level |
| 17:28 | mmarczyk | Borkdude: '#^foo foo means (quote #^foo foo) |
| 17:28 | mmarczyk | #^foo foo means the symbol foo with metadata of {:tag foo} attached at read time |
| 17:28 | mmarczyk | (that foo in the metadata is also a symbol) |
| 17:29 | mmarczyk | then quote returns the symbol unchanged with the metadata intact |
| 17:29 | livingston | slyphon: I can't tell exactly what that macro is doing, but why do you need the nested do? |
| 17:29 | mmarczyk | and meta returns it (meaning the metadata) |
| 17:29 | livingston | can't you get away with (do (let ... ) (let ...) nil) ? |
| 17:29 | mmarczyk | slyphon: macro needs to return a single form, yes |
| 17:29 | slyphon | ah |
| 17:30 | slyphon | that's the reason |
| 17:30 | mmarczyk | hi livingston |
| 17:30 | slyphon | livingston: it's only recursive because i'm not generating the let* there |
| 17:30 | mmarczyk | re: (apply str seq-of-strings), I think that's perfectly fine (and definately reduce would be the wrong way to do it) |
| 17:30 | slyphon | that's the result of a macroexpand-all |
| 17:30 | slyphon | so the let* is because of doto |
| 17:31 | livingston | oh ok, usually sos you know what your macro is doing exactly you just look at macroexpand-1 |
| 17:31 | alexyk | can lein work with 1.2.0-master-SNAPSHOT? |
| 17:32 | Borkdude | mmarczyk, I get it, tnx |
| 17:32 | technomancy | alexyk: it should, if not please let me know |
| 17:33 | alexyk | technomancy: I probably messed up lots of things; I edited bin/lein to refer to the clojure jar which is teh trunk, and now lein deps spits out: java.io.FileNotFoundException: Could not locate clojure/contrib/io__init.class or clojure/contrib/io.clj on classpath: |
| 17:33 | slyphon | mmarczyk: i didn't know about the one-form rule |
| 17:35 | arohner | slyphon: think about it. If you have a macro call in one branch of an 'if' statement, and the macro expands to multiple forms ... |
| 17:35 | slyphon | make sense |
| 17:35 | slyphon | er, makes |
| 17:35 | alexyk | ah, is it because clojure-contrib's jar is clojure-contrib-1.2.0-SNAPSHOT, without master? |
| 17:36 | technomancy | alexyk: probably so |
| 17:36 | alexyk | whoever devilishly differs in contrib from clojure proper by omitting -master-, has his karma diminished every time a programmer gets a file not found error |
| 17:37 | alexyk | technomancy: but, my lein deps doesn't even get to that. |
| 17:37 | alexyk | I simply edited the CLOJURE_JAR in bin/lein; why would it want contrib then? is contrib configurable? |
| 17:41 | livingston | what's the easiest way to test if a given symbol is in a given namespace? |
| 17:42 | livingston | e.g. that 'ex/a is in the namespace ex |
| 17:43 | livingston | .getNamespace returns a string it'd be nice if there was a non-string way |
| 17:44 | Borkdude | (:ns (meta #'a)) |
| 17:45 | Borkdude | Returns the namespace of var a |
| 17:45 | livingston | I don't have vars just symbols |
| 17:46 | mmarczyk | ,(contains? (ns-map 'clojure.core) '+) |
| 17:46 | clojurebot | true |
| 17:46 | mmarczyk | ,(contains? (ns-imports 'clojure.core) 'Integer) |
| 17:46 | clojurebot | true |
| 17:46 | Borkdude | then use ' instead of #' |
| 17:47 | tcepsa | livingston: I believe there's a way to see what's bound in a given namespace and then you could see whether the symbol you're curious about is in that--yeah, what mmarczyk said. |
| 17:47 | mmarczyk | :-) |
| 17:47 | mmarczyk | ,(keys (ns-publics 'clojure.core)) |
| 17:47 | clojurebot | (sorted-map read-line re-pattern keyword? val chunked-seq? *compile-path* max-key list* ns-aliases booleans the-ns == chunk-buffer longs special-form-anchor shorts instance? syntax-symbol-anchor format sequential? fn? empty dorun time remove-method gensym not= *3 unchecked-multiply doseq bit-or aset-byte if-not hash-set add-watch unchecked-dec some nil? string? boolean-array second letfn keys for *2 long-array pop-thread-b |
| 17:47 | livingston | that's also a different problem - that tells me if a namespace contains a particular symbol... |
| 17:47 | mmarczyk | ouch, sorry, didn't think how long that would be |
| 17:47 | mmarczyk | but clojurebot luckily truncates stuff |
| 17:48 | mmarczyk | well, a symbol, as such, is not bound to any namespace |
| 17:48 | livingston | ... I want to know if the symbol I happen to have my hands on is qualified in a specific namespace eg. the "anon" ns |
| 17:48 | mmarczyk | there's no "interning" as in Common Lisp |
| 17:48 | _nj | how do I find out the type of a symbol? |
| 17:49 | mmarczyk | I mean, there is presumably string interning, though I can't say I read actual code to do that in Clojure |
| 17:49 | livingston | I just want to have (= (the-namespace-of 'ex/a) (create-ns 'ex)) |
| 17:49 | mmarczyk | oh, do you mean |
| 17:49 | mmarczyk | (the-ns 'user) |
| 17:49 | mmarczyk | ,(the-ns 'user) |
| 17:49 | clojurebot | #<Namespace user> |
| 17:49 | livingston | ,(doc the-ns) |
| 17:49 | mmarczyk | ,(the-ns (.getNamespace 'foo/bar)) |
| 17:49 | clojurebot | java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol |
| 17:50 | clojurebot | "([x]); If passed a namespace, returns it. Else, when passed a symbol, returns the namespace named by it, throwing an exception if not found." |
| 17:50 | arohner | livingston: (ns-resolve 'your-ns 'symbol) |
| 17:50 | arohner | ? |
| 17:50 | livingston | yes! |
| 17:50 | livingston | thank you |
| 17:50 | mmarczyk | livingston: which was it then? |
| 17:50 | arohner | livingston: that will return the var, or nil |
| 17:50 | arohner | (ns-resolve 'clojure.core 'map) |
| 17:50 | arohner | ,(ns-resolve 'clojure.core 'map) |
| 17:50 | clojurebot | #'clojure.core/map |
| 17:51 | arohner | ,(ns-resolve 'clojure.core 'bogus) |
| 17:51 | clojurebot | nil |
| 17:51 | Borkdude | tnx for making my train journey enjoyable, gtg now |
| 17:52 | livingston_ | (can I tell you how much I don't like this web client randomly dropping me) |
| 17:52 | livingston_ | I don't know what I missed but I was looking for the-ns |
| 17:52 | mmarczyk | livingston_: oh :-) |
| 17:53 | mmarczyk | good |
| 17:53 | livingston_ | except that will barf when the ns hasn't been explictly created, even though you can quote symbols in ns that aren't explicitly in existanct |
| 17:53 | livingston_ | so that is not quite good either |
| 17:54 | mmarczyk | well, that's a problem of the design I'd say |
| 17:54 | tcepsa | livingston_: But if you know that the ns hasn't been created, then you know that no symbol is bound within that ns, right? |
| 17:54 | mmarczyk | if you're going to ask if a namespace which doesn't exist is equal to another |
| 17:54 | arohner | ,(ns-resolve 'bogus 'foo) |
| 17:54 | clojurebot | java.lang.Exception: No namespace: bogus found |
| 17:54 | livingston_ | somewhere I'm going to have specific namespace flagged, and I'm going to see a stream of symbols come in from wherever ... I need to pick out the ones that have been qualified to my flagged ns |
| 17:54 | mmarczyk | hm, right, what tcepsa said |
| 17:55 | mmarczyk | livingston_: in that case |
| 17:55 | mmarczyk | ,(name (.getName (the-ns 'user))) |
| 17:55 | clojurebot | "user" |
| 17:55 | mmarczyk | see if that matches |
| 17:55 | mmarczyk | ,(.getNamespace 'foo/bar) |
| 17:55 | clojurebot | "foo" |
| 17:56 | arohner | ,(find-ns 'bogus) |
| 17:56 | clojurebot | nil |
| 17:56 | livingston_ | tcepsa: well if I get the exception from the-ns then yes I know it's probably not my ns, but then I'm using exceptions for control flow in a very annoying way |
| 17:56 | arohner | ,(find-ns 'clojure.core) |
| 17:56 | clojurebot | #<Namespace clojure.core> |
| 17:56 | mmarczyk | ,(doc find-ns) |
| 17:56 | clojurebot | "([sym]); Returns the namespace named by the symbol or nil if it doesn't exist." |
| 17:56 | mmarczyk | oh, that's cool :-) |
| 17:56 | mmarczyk | so *that* would be the solution |
| 17:57 | tcepsa | livingston_: ~nods~ So you might not have the namespace created, but you still want to be able to detect symbols that have been qualified with it? |
| 17:57 | mmarczyk | tcepsa: he wants to be able to test symbols which have been qualified with *another* ns |
| 17:57 | mmarczyk | which might not exist |
| 17:58 | livingston_ | tcepsa: what mmarczyk said |
| 17:58 | tcepsa | mmarczyk: Yes, sorry, by "the namespace" I meant "the flagged namespace" not "the current namespace" |
| 17:58 | slyphon | hrm |
| 17:58 | slyphon | so ~@ causes evaluation? |
| 17:58 | mmarczyk | ,(= (the-ns (symbol (.getNamespace 'foo/bar))) (the-ns 'user)) |
| 17:58 | clojurebot | java.lang.Exception: No namespace: foo found |
| 17:59 | livingston_ | I might get the symbol 'foobar/a and I'm looking for symbols in 'ex ns say, if foobar doesn't exist... the-ns returns an exception |
| 17:59 | mmarczyk | so that's a no go |
| 17:59 | livingston_ | ,(the-ns 'foobar/a) |
| 17:59 | clojurebot | java.lang.Exception: No namespace: foobar/a found |
| 18:00 | mmarczyk | however arohner's suggestion will work |
| 18:00 | mmarczyk | ,(= (find-ns (symbol (.getNamespace 'foo/bar))) (the-ns 'user)) |
| 18:00 | clojurebot | false |
| 18:00 | livingston_ | slyphon: ~ cause "un quote" @ says instead of just sticking the value in to the back-quoted form splice the values of the list in |
| 18:00 | mmarczyk | ,(= (find-ns (symbol (.getNamespace 'user/bar))) (the-ns 'user)) |
| 18:00 | clojurebot | true |
| 18:00 | tcepsa | Ah, and that's why you said that you'd be using exceptions as flow control in an unfortunate way. |
| 18:00 | slyphon | hmm |
| 18:00 | slyphon | so is it possible to just-splice? |
| 18:01 | slyphon | https://gist.github.com/d6a6dabb9c0a85e154c2 |
| 18:01 | slyphon | that causes an exception, because it doesn't know how to resolve the second set of symbols |
| 18:01 | slyphon | i.e. at line 58 |
| 18:02 | livingston_ | mmarczyk: as soon as I call getNamespace, namespace, etc. then I have strings ... |
| 18:02 | mmarczyk | livingston_: look at the examples above -- they seem to work? |
| 18:02 | mmarczyk | you can turn the strings into symbols with (symbol ...) |
| 18:03 | slyphon | hrm, shit, this isn't gonna work |
| 18:03 | livingston_ | and I can do with with strings, (= name-of-my-package (namespace test-symbol)) but that kinda sucks to have to use strings since there are clearly structures that could be compared with pointers there |
| 18:04 | livingston_ | mmarczyk: yeah but there's no point to get the string, go back to symbol (which is going to cost me the same as just comparing the string), so I guess strings it is... :( |
| 18:04 | mmarczyk | well there is no way to extract the ns a symbol is qualified with except with .getNamespace |
| 18:05 | livingston_ | namespace does it too |
| 18:05 | livingston_ | ,(namespace 'foobar/a) |
| 18:05 | clojurebot | "foobar" |
| 18:05 | mmarczyk | ,(class (namespace 'foobar/a)) |
| 18:05 | clojurebot | java.lang.String |
| 18:06 | livingston_ | although I really think that should return the same type as: |
| 18:06 | mmarczyk | so that's a wrapper |
| 18:06 | alexyk | so -- does anybody run leiningen with a project depending on the clojure and contrib trunks? |
| 18:06 | livingston_ | ,(create-ns 'user) |
| 18:06 | clojurebot | #<Namespace user> |
| 18:06 | mmarczyk | actually this does seem strange to me |
| 18:06 | mmarczyk | hmm |
| 18:06 | mmarczyk | alexyk: why? |
| 18:06 | alexyk | mmarczyk: lein fails for me in that setup |
| 18:07 | mmarczyk | livingston_: actually if you've got symbols coming in from the outside world, say |
| 18:07 | mmarczyk | or wherever |
| 18:07 | mmarczyk | they're coming in as "just strings" anyway |
| 18:07 | mmarczyk | those strings are being interned at read time |
| 18:08 | mmarczyk | so then the string is stored as a pointer to the obarray (or whatever it's called) where it is interned, I'd guess |
| 18:08 | mmarczyk | so actually when you do a .getNamespace / (namespace ...), you get an interned string |
| 18:09 | mmarczyk | and equality testing against another interned string should boil down to pointer equality |
| 18:10 | mmarczyk | so, I'd say testing string equality of the symbol's namespace part and the ns's name should be as performant as symbol equality testing should be in any Lisp |
| 18:10 | livingston | last I saw was interned string... but can you guarantee that? |
| 18:10 | mmarczyk | well I've just read the source for clojure.lang.Symbol |
| 18:10 | livingston | I guess it doesn't matter if I have to test the strings anyway (for lack of something better) I may get the faster compare by nature of them being interned |
| 18:11 | livingston | mmarczyk: that'll work too |
| 18:11 | livingston | there still should be a way to get from a symbol to it's namespace if it's there |
| 18:11 | mmarczyk | livingston: I believe it will be just like comparing symbols in CL / Scheme |
| 18:11 | replaca | Q: once, someone was talking about how to access private vars in macros. Does anyone remember that idiom? |
| 18:11 | mmarczyk | in Scheme, a symbol is just an interned string, so actually it's the same in this case |
| 18:11 | alexyk | technomancy: given I'm getting java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V now, should I rebuild lein from git or not? |
| 18:12 | mmarczyk | alexyk: given this error, I'd say you might have a clojure-contrib.jar built with an older version of clojure.jar |
| 18:12 | mmarczyk | nothing to do with lein, try java -cp your-clojure.jar:your-contrib.jar clojure.main |
| 18:12 | alexyk | mmarczyk: I just checked that I build clojure-contrib with the same 1.2.0-master-SNAPSHOT |
| 18:12 | livingston | mmarczyk: in the case of my problem yes, although for other problems you may acutally want to get to the namespace itself to do things to it |
| 18:13 | alexyk | my repl works fine with those two jars, clojure and clojure-contrib |
| 18:13 | alexyk | the question is, why lein deps fails |
| 18:13 | alexyk | bin/lein does point to the same clojure jar |
| 18:13 | alexyk | the question is, why does lein deps need the contrib |
| 18:13 | mmarczyk | alexyk: the repl works, lein deps doesn't? |
| 18:13 | mmarczyk | livingston: well then use the-ns / find-ns |
| 18:13 | technomancy | alexyk: you can't use "lein deps" on its own lein checkout. you need to do "lein-stable deps" |
| 18:14 | alexyk | mmarczyk: repl works when launched manually with the CLASSPATh from lib/ |
| 18:14 | alexyk | and I placed clojure and contrib there manually |
| 18:14 | mmarczyk | technomancy: oh? I do it all the time and break things only 10% of the time :-) |
| 18:15 | alexyk | technomancy: I didn't actually update lein via lein deps, I assumed we upgrade by git pull... |
| 18:15 | technomancy | see "Hacking" in the lein readme; I think it explains pretty well. |
| 18:15 | mmarczyk | livingston: you can't find an ns other than by symbol, I believe (seems reasonable too), and constructing a symbol from an interned string should be lightning fast |
| 18:15 | mmarczyk | since the constructor hardly does anything besides interning the strings |
| 18:15 | alexyk | meaning, in some prehistorical time I did the dance with lein-stable; do I need to do it again each time after git pull? |
| 18:16 | alexyk | my lein now points to git-lein/bin/lein |
| 18:16 | alexyk | technomancy: you said a while ago git pull should suffice |
| 18:16 | mmarczyk | alexyk: well git pull only updates the sources |
| 18:16 | mmarczyk | alexyk: you'll have to take care of deps separately if they've changed |
| 18:16 | livingston | mmarczyk: right, but there's no way to get from a symbol like say 'user/foo directly to the user ns and you can't get the "user" part from 'user/foo except as a string so that seems kinda inconsistent |
| 18:17 | technomancy | alexyk: I wasn't considering changes to clojure and contrib when I said that. if you pull you should "lein clean" and redo "lein-stable deps" if clojure has changed a decent amount since then. |
| 18:18 | alexyk | technomancy: aha! |
| 18:18 | alexyk | now it starts making sense |
| 18:18 | mmarczyk | livingston: I guess I see your point, but symbol-ns is straightforward enough to write |
| 18:19 | mmarczyk | and you can pick your semantics (exception or nil on no-such-ns) |
| 18:23 | livingston | when do symbols actually pick up a namespace in clojure? |
| 18:23 | livingston | not at read time right, unless qualified? |
| 18:23 | mmarczyk | right |
| 18:23 | alexyk | yay it works again |
| 18:23 | mmarczyk | sometimes they never get namespaced |
| 18:24 | livingston | so the fact that all the symbols in my code get into the ns defined at the top of the file is a function of the compiler, not the reader, right? |
| 18:24 | alexyk | technomancy: perhaps makes sense to add "redo lein-stable build on git lein upon major clojure/contrib changes" or something |
| 18:24 | mmarczyk | like a special symbol in operator position or a symbol naming a local |
| 18:24 | mmarczyk | livingston: they don't actually |
| 18:24 | mmarczyk | if you write (let [x 1] x), the x never gets namespaced |
| 18:24 | alexyk | btw, strange thing: my lein hangs after it does its work |
| 18:25 | alexyk | did this for a bit |
| 18:25 | livingston | really, huh so it's actually the def forms that cause it? |
| 18:25 | mmarczyk | well I wouldn't put it this way |
| 18:25 | mmarczyk | def forms create Vars |
| 18:25 | mmarczyk | which are bound to symbols in a given namespace |
| 18:25 | livingston | but then how are the symbols in your code linked to the gobal def'ed positions |
| 18:25 | mmarczyk | symbols which don't name locals in a given context |
| 18:25 | mmarczyk | are resolved to Vars |
| 18:26 | livingston | mmarczyk: right, ok .. huh |
| 18:26 | mmarczyk | unless treated specially, like 'if' in operator position |
| 18:26 | mmarczyk | ,(doc special-symbol?) |
| 18:26 | clojurebot | "([s]); Returns true if s names a special form" |
| 18:26 | technomancy | alexyk: sure, good point |
| 18:26 | livingston | that kinda creeps me out but ok |
| 18:27 | mmarczyk | livingston: hm? why? :-) |
| 18:27 | mmarczyk | btw, how about this? |
| 18:27 | mmarczyk | ,(let [+ :foo] (binding [+ :bar] +)) |
| 18:27 | clojurebot | :foo |
| 18:27 | livingston | coming from CL I expect symbols to have a home, and that being done by the reader |
| 18:28 | mmarczyk | binding rebinds the Var, but the + in this context still names a local and locals trump Vars |
| 18:28 | mmarczyk | ,(let [+ :foo] (binding [+ :bar] clojure.core/+)) |
| 18:28 | clojurebot | :bar |
| 18:28 | mmarczyk | on the other hand, if you namespace by hand... |
| 18:28 | livingston | if you read in CL any unqualified symbols get put in the ns of *ns* so you bind over *ns* if you want to change the default for a read operation |
| 18:28 | mmarczyk | ,(let [+ :foo] (binding [+ :bar] @#'+)) |
| 18:28 | clojurebot | :bar |
| 18:28 | mmarczyk | livingston: yeah, I know |
| 18:28 | tcepsa | mmarczyk: You just blew my mind! |
| 18:28 | mmarczyk | just a sec, I've got a nice link |
| 18:29 | mmarczyk | tcepsa: :-) |
| 18:29 | mmarczyk | http://netzhansa.blogspot.com/2008/10/trying-clojure.html |
| 18:29 | sexpbot | "netzhansa: Trying Clojure..." |
| 18:29 | mmarczyk | it's pretty old, but still relevant and *very* cool |
| 18:30 | mmarczyk | a quote: |
| 18:30 | mmarczyk | Clojure wants to be a Lisp, but it explicitly does not try to be backwards compatible. This opened a rather large design space to Rich Hickey, and some of the choices he made really do make sense. He specifies a reader, yet his reader does not intern symbols. |
| 18:30 | mmarczyk | That is a big win, as it allows the reader to actually work with arbitary Clojure source files. In Common Lisp, one needs to re-implement a full reader which does not intern symbols if one wants to read Common Lisp source files. This is kind of ironic, as the "Code is Data" mantra that we keep repeating does not really reflect what is possible in practice. |
| 18:30 | replaca | technomancy: did you say that there's a new improved magit in the wild? |
| 18:30 | mmarczyk | (um, longish) |
| 18:30 | mmarczyk | that's by Hans Hübner |
| 18:30 | tcepsa | Hehe, awesome. And on that note, I'm off! |
| 18:31 | technomancy | replaca: newer than the elpa version, yeah. |
| 18:31 | replaca | technomancy: hmmm, I wonder which one I have... |
| 18:32 | replaca | technomancy: from your repo or elsewhwere? |
| 18:35 | replaca | oh I see gitorious. Looks pretty busy, too |
| 18:36 | livingston | are the any limitations on characters or length etc. on symbols (or namespace names, although that should be about the same)? |
| 18:38 | mmarczyk | livingston: the docs mention a set of acceptable chars for symbol names |
| 18:38 | mmarczyk | livingston: these are not enforced, though |
| 18:38 | mmarczyk | and last time I checked < and > where not on the list |
| 18:38 | mmarczyk | yet -> is doing fine in core |
| 18:38 | joshua-choi | Are you talking about characters allowed in symbols by the reader? :) |
| 18:39 | livingston | yes, is the contents of this string a valid symbol name: "-52e95171:128508913e5:-7fff" |
| 18:39 | mmarczyk | the list was always explicitly meant to be expanded at some point, so I'd say any incompleteness is a big deal |
| 18:39 | joshua-choi | I asked this question on this list about a month ago |
| 18:39 | livingston | ,(name 'user/-52e95171:128508913e5:-7fff) |
| 18:39 | clojurebot | "-52e95171:128508913e5:-7fff" |
| 18:39 | mmarczyk | I seem to recall a lengthy discussion on the ggroup |
| 18:40 | mmarczyk | ,(class 'user/-52e95171:128508913e5:-7fff) |
| 18:40 | clojurebot | clojure.lang.Symbol |
| 18:40 | mmarczyk | Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, and ? (other characters will be allowed eventually, but not all macro characters have been determined). |
| 18:40 | joshua-choi | The conclusion is that, other than < and >, which are strange but definite omissions, the list is definitive and should be followed, but it is not enforced by the compiler. |
| 18:40 | mmarczyk | that's from |
| 18:40 | mmarczyk | http://clojure.org/reader |
| 18:41 | joshua-choi | At least, that's what I recal. |
| 18:41 | joshua-choi | Yes, that web page. |
| 18:41 | mmarczyk | so apparently the above example is not properly named (because of the colons) |
| 18:42 | livingston | hmmm I wonder what happens when that stream of what I'm guessing is hex stops being negative |
| 18:42 | livingston | ,(name 'user/52e95171:128508913e5:-7fff) |
| 18:42 | clojurebot | Invalid token: user/52e95171:128508913e5:-7fff |
| 18:42 | joshua-choi | The idea, I think, is that there are no guarantees that that sort of symbol won't break or mean something weird in the future. |
| 18:42 | livingston | yeah... guess I prepend some crap to the front |
| 18:42 | joshua-choi | The compiler and the symbol and keyword functions do not enforce it for performance reasons, though |
| 18:50 | _brian2_ | noob question> I'm trying to understand how to call a method based java constructor : http://clojure.pastebin.com/0AQVpsSp |
| 18:51 | slyphon | ,(map (fn [x y] [x y]) (partition 2 (range 0 10))) |
| 18:51 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--13140$fn |
| 18:52 | slyphon | huh? |
| 18:52 | replaca | slyphon: you need an extra set of brackets to destructure |
| 18:53 | replaca | ,(map (fn [[x y]] [x y]) (partition 2 (range 0 10))) |
| 18:53 | clojurebot | ([0 1] [2 3] [4 5] [6 7] [8 9]) |
| 18:53 | slyphon | right on |
| 18:53 | alexyk | I am at a loss as to what to do with 1.2. Since all contrib is reshuffled, it's silly to stick with 1.1.0 and add more things to revamp later. But most of my deendencies are made under 1.1.0. I'd hate to redo them. What to do? |
| 18:53 | alexyk | short of going back to ocaml until the chips fall where they will... |
| 18:54 | alexyk | staying with 1.1.0 => living in the past; 1.2.0 => there's not much in the future yet... |
| 18:54 | slyphon | aren't they planning on making it backwards compatible? |
| 18:54 | alexyk | slyphon: try it |
| 18:55 | replaca | slyphon: mostly, yeah |
| 18:55 | alexyk | contrib is completely berserk |
| 18:55 | alexyk | ducl-streams is now io |
| 18:55 | alexyk | duck |
| 18:55 | replaca | alexyk: contrib should be close to bacwards compatible now |
| 18:55 | alexyk | seq-utils is seq |
| 18:55 | livingston | need to cut 4 characters off the front of "anon-52" to get "-52" |
| 18:55 | mmarczyk | agreed on berserk :-) |
| 18:55 | replaca | duck-streams is back in but deprecated |
| 18:56 | alexyk | replaca: what about seq-utils? |
| 18:56 | replaca | seq-utils, too, I think |
| 18:56 | alexyk | also, in str-utils2, which became str, the order of arguments in split devilishly switched |
| 18:56 | alexyk | things like that |
| 18:56 | replaca | alexyk: look at the autodoc for master - it's pretty up to date |
| 18:57 | alexyk | liebke: do you support 1.2.0 trunk? |
| 18:57 | technomancy | alexyk: it's a lot of work, but those libs *will* get updated |
| 18:57 | alexyk | somnium: how about you and the 1.2.0 trunk? |
| 18:57 | technomancy | if you have time to help them do so, I'm sure they'd appreciate patches |
| 18:57 | replaca | I know liebke's been doing it cause I saw his changes go in |
| 18:57 | technomancy | but if not, just lock to a slightly older snapshot |
| 18:58 | slyphon | technomancy: speaking of "locking" |
| 18:58 | slyphon | what does that look like? |
| 18:58 | technomancy | slyphon: there's a thread on the mailing list about it |
| 18:58 | slyphon | oh, ok, i'll go have a look |
| 18:59 | slyphon | is the mailing list the same as the google group? |
| 18:59 | technomancy | "seq fns promoted to clojure.core!" |
| 18:59 | technomancy | yeah |
| 18:59 | joshua-choi | slyphon: Yeah, it is. |
| 18:59 | slyphon | kk |
| 19:00 | alexyk | seq fns worked hard... they now can take a Hawaii vacation before starting the new position in core |
| 19:01 | technomancy | alexyk: how many libs are you using that break with the new clojure fns out of curiosity? |
| 19:02 | alexyk | technomancy: I use about 5 altogether, was generally weary of redoing them. Probably should just try rebuilding and see. |
| 19:02 | alexyk | I need congomongo, cupboard most of all, and incanter. |
| 19:02 | _brian2_ | can somebody help me out with calling this java constructor in clojure: http://clojure.pastebin.com/0AQVpsSp |
| 19:03 | alexyk | bbl |
| 19:03 | technomancy | wow. I guess the libs I use generally try to minimize their contrib usage. |
| 19:03 | joshua-choi | (def classifier (DynamicLMClassifier/createNGramProcess DynamicLMClassifier/CATEGORIES DynamicLMClassifier/NGRAM_SIZE)) |
| 19:03 | slyphon | joshua-choi: beat me to it |
| 19:04 | livingston | is drop the correct way to remove 4 characters from the front of a string? but then I get back a LazySeq, will that still be a string? |
| 19:04 | _brian2_ | joshua-choi: thnks! |
| 19:04 | joshua-choi | _brian2_: You can drop the prefix if you want depending on how you require/use. |
| 19:04 | _brian2_ | ok |
| 19:04 | mmarczyk | ,(require '[clojure.contrib.str-utils :as str]) |
| 19:04 | clojurebot | nil |
| 19:04 | mmarczyk | ,(str/drop 4 "asdfasdf") |
| 19:04 | clojurebot | java.lang.Exception: No such var: str/drop |
| 19:05 | mmarczyk | um, it's in c.c.string in 1.2 |
| 19:05 | mmarczyk | better yet |
| 19:05 | mmarczyk | ,(subs "asdfasdf" 4) |
| 19:05 | clojurebot | "asdf" |
| 19:05 | mmarczyk | that would be the right way |
| 19:06 | livingston | ,(subs "anon-52" 4) |
| 19:06 | clojurebot | "-52" |
| 19:06 | livingston | works for me |
| 19:06 | mmarczyk | (drop 4 "asdfasdf") would need to be stringified |
| 19:06 | mmarczyk | yup, and subs is in core |
| 19:06 | livingston | ,(doc subs) |
| 19:06 | clojurebot | "([s start] [s start end]); Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive." |
| 19:06 | mmarczyk | otherwise you could just use .substring |
| 19:06 | livingston | mmarczyk: yeah that's what I was seeing |
| 19:31 | rsh | if i want to have several worker threads that get updated when something get added to a queue and then they do work in the background, should those worker threads be agents and the queue be an atom? is there a way to notify agents on some event like adding to the queue? |
| 19:36 | livingston | rsh: i don't know if there is a better clojure-ey way, but your agents could all read and if there is nothing there call wait on the queue and when the queue gets data it can notify to wake up sleepers |
| 19:37 | livingston | that's the java-ey way, I'm going to have a similar problem too though a little bit down the line |
| 19:39 | rsh | yeah, I wonder if there is a different way to model this |
| 19:41 | rsh | are agents really the best thing to use for this? all I have are threads that do work..they don't maintain any state |
| 19:41 | livingston | there are "thread pools" in java that you can queue work into (and I think there is some abstraction of that in clojure), my problem is that my work will be queued into a priority queue, so it may not all get done and more important work should float to the top |
| 19:42 | livingston | agents seem more for doing things like, "hey you guy, do this,.. whenever you get around to it" and then hold onto the value |
| 19:42 | rsh | that is what I was thinking |
| 19:43 | livingston | it sounds like you just have a thread pool pulling/pushing to one of these things, either atom or agent |
| 19:44 | somnium | ,(doc future) |
| 19:44 | clojurebot | "([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block." |
| 19:44 | rsh | also, why is it that calling println does not show up in the repl when an agent runs some code? |
| 19:45 | _nj | (defroutes main-routes |
| 19:45 | _nj | (GET "/" |
| 19:45 | _nj | "Index page") |
| 19:45 | _nj | (ANY "*" |
| 19:45 | _nj | [404 "Page not found"])) Gives me an exception Unsupported binding form: Index page |
| 19:46 | _nj | any help is appreciated :) |
| 19:46 | rsh | how is a future different from an agent and using send-off? |
| 19:47 | somnium | rsh: futures arent mutable, and deref blocks on reads |
| 19:47 | livingston | think of futures as one-shot deals |
| 19:47 | somnium | agents are mutable and reads dont block, afaik |
| 19:48 | rsh | thanks |
| 19:48 | lancepantz | _nj: that looks like the 0.3 compojure syntax, are you trying to use it with 0.4? |
| 19:48 | livingston | agents can also partisipate in some ways in transactions |
| 19:49 | _nj | lancepantz: yes, I wasn't aware of that, any pointers to the new syntax? |
| 19:49 | mmarczyk | ,(doc seque) |
| 19:49 | clojurebot | "([s] [n-or-q s]); Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background, and can get up to n items ahead of the consumer. n-or-q can be an integer n buffer size, or an instance of java.util.concurrent BlockingQueue. Note that reading from a seque can block if the reader gets ahead of the producer." |
| 19:49 | mmarczyk | rsh: I wonder if this might help? |
| 19:51 | mmarczyk | then maybe have some kind of "foreman thread" take stuff out of seque's pipe and pass it onto some worker threads, be they agents or whatever |
| 19:52 | rsh | that sounds promising |
| 19:53 | mmarczyk | in fact a question came up on SO some time ago which may be relevant to you |
| 19:53 | mmarczyk | http://stackoverflow.com/questions/2602791/clojure-agents-consuming-from-a-queue |
| 19:53 | sexpbot | "Clojure agents consuming from a queue - Stack Overflow" |
| 19:53 | mmarczyk | I brought up the seque approach |
| 19:53 | mmarczyk | Christophe Grand had a different idea |
| 19:54 | mmarczyk | and Timothy Pratley -- a third one |
| 19:54 | mmarczyk | not sure if any of those worked for the OP, but perhaps they will for you :-) |
| 19:55 | rsh | thanks! |
| 20:07 | rsh | mmarczyk: any reason you say to use a ref instead of an atom in your solution to maintain the queue? |
| 20:15 | mmarczyk | rsh: not sure, I might have changed it from a version which would have required a Ref or not thought about using an Atom... or I'm missing sth now |
| 20:15 | mmarczyk | actually I see that there's some improvements to be made to that answer |
| 20:15 | mmarczyk | namely do-stuff shouldn't self-call; recur would be appropriate; but that's pretty obvious |
| 20:16 | rsh | also, what is reason for creating an agent in a future as opposed to just send-off'ing agents directly? |
| 20:17 | mmarczyk | more importantly, I guess that seque needs to be moved passed the element that's been read |
| 20:17 | mmarczyk | that's straightforward with a Ref, but cgrand had a nice trick to do that with an Atom: |
| 20:17 | mmarczyk | cons a nil onto the seque |
| 20:17 | mmarczyk | then use (first (swap! a rest)) to read elements |
| 20:18 | mmarczyk | ,(let [a (atom (range 5))] (str (first (swap! a rest)) " " (first swap! a rest))) |
| 20:18 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args passed to: core$first |
| 20:19 | mmarczyk | ,(let [a (atom (range 5))] (str (first (swap! a rest)) " " (first (swap! a rest)))) |
| 20:19 | clojurebot | "1 2" |
| 20:20 | mmarczyk | as for the futures, they make for a nice way to start a background thread... |
| 20:20 | mmarczyk | I guess agents might in fact be unnecessary here, though |
| 20:20 | mmarczyk | not sure what I was thinking :-) |
| 20:26 | rsh | i think this makes sense to me now, thanks for your help |
| 20:27 | rsh | (doc future-done?) |
| 20:27 | clojurebot | "([f]); Returns true if future f is done" |
| 20:46 | rsh | why does println or prn not print to the repl when an agent runs some code? |
| 20:52 | mmarczyk | rsh: np :-) |
| 20:52 | mmarczyk | re: printing from agents, would that be in the SLIME REPL? |
| 20:52 | rsh | yes |
| 20:52 | mmarczyk | I think there's a setting for that... slime-redirect-output or some such thing |
| 20:52 | mmarczyk | slime-redirect-inferior-output |
| 20:53 | mmarczyk | hm, actually it's a function |
| 20:54 | mmarczyk | right, just call that |
| 20:54 | mmarczyk | then printouts from other threads should go to the repl buffer too |
| 20:54 | mmarczyk | I have that in my slime-connected-hook |
| 21:02 | rsh | thanks |
| 22:25 | replaca | hiredman: if you're here: the squeaky wheel gets the grease (plus I just happened to stumble across that piece of code). The JSON should be all right now. Let me know! |
| 22:26 | rhickey | cemerick: I fixed #329 |
| 22:36 | chouser | ah, neat! Hadn't thought of that. |
| 22:42 | cemerick | chouser: I don't quite understand what's going on in that fix. My quick reading earlier made me think that (. obj :field) would work, but it doesn't. |
| 22:44 | chouser | works here |
| 22:44 | cemerick | hrm |
| 22:44 | chouser | (. (clojure.lang.Box. 5) :val) |
| 22:45 | cemerick | Anyway, I wish I had thought of that instead of futzing with a bandaid for 90 minutes :-( |
| 23:23 | cemerick | chouser: OK, so almost everything looks good here -- note the last one: https://gist.github.com/17125de93ab466043505 |
| 23:50 | uberjar | I want projobuffers |
| 23:51 | uberjar | and a pony. |
| 23:51 | uberjar | someone hook me up |
| 23:52 | ninjudd | http://github.com/ninjudd/clojure-protobuf |
| 23:53 | cemerick | hrm |
| 23:53 | uberjar | I don't know how I missed that.. thnx |
| 23:53 | cemerick | that java compilation part is a bummer |
| 23:54 | cemerick | ninjudd: are you eyeing deftype, etc. as a next step? |
| 23:54 | ninjudd | cemerick: do you mean reimplementing using deftype? |
| 23:55 | cemerick | right, to avoid any intermediate java step |
| 23:55 | ninjudd | without using google's code at all? |
| 23:56 | ninjudd | i'd be into it if it makes it faster |
| 23:57 | ninjudd | if not, then i don't see a reason why using java interop is bad |
| 23:57 | cemerick | it's not bad, per se, but I'd bet eliminating the compilation step would make for a much more pleasant dev process in a lot of cases. |
| 23:58 | ninjudd | my goal is to make it a pleasant dev process either way |
| 23:59 | ninjudd | i spent a lot of time on the ant scripts to make building it very easy |