#clojure log - Apr 30 2010

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:40 Tordek: hi

0:40 I'm trying to use fact, but I think I'm doing it wrong

0:41 I got the source and built the jar, but then "java -jar fact.jar" says it can't find the library

0:48 Blackfoot: i haven't used fact, but what is the specific error?

0:49 Tordek: sorry, er

0:50 $ java -jar fact.jar

0:50 Failed to load Main-Class manifest attribute from

0:50 fact.jar

0:50 sexpbot: Command not found. No entiendo lo que estás diciendo.

0: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

0:54 Tordek: $ java -cp fact.jar fact.main

0:54 Exception in thread "main" java.lang.NoClassDefFoundError: fact/main

0:54 sexpbot: Command not found. No entiendo lo que estás diciendo.

0:54 Tordek: same with just "main"

0:54 oh, wait, it goes deeper than that

0:55 there are no .class files in the jar

0:55 hmm, the ant task just skips the compile phase

0:57 Blackfoot: yea, that's what i'm seeing. i think it needs to know where clojure.jar is in order to build it

0:58 Tordek: odd... I'm almost certain it compiled once..

0:59 ok, so, how do I inform it of the location of clojure?

0:59 Blackfoot: ant -Dclojure.jar=clojure-1.1.0.jar

0:59 (assuming you have that file in the current dir)

1:01 Tordek: ok, at least it errors on compile now...

1:01 [java] java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes

1:02 Blackfoot: hrm i did not see that when mine build. what clojure version did you use?

1:03 Tordek: 1.1.0

1:03 leifw: any clojure-hadoop users arrived?

1: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

1:06 that clojure.jar came from another project that was using lein

1: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)

1:09 Blackfoot: hrm, maybe a leftover class or something

1:09 so then i can run it with java -cp fact.jar:clojure-1.1.0.jar fact.main

1:10 but i think it is supposed to take a directory with tests in it

1:12 Tordek: ok, I managed to get it running

1:12 now, I gotta learn how to write the tests, apparently >_>

1:50 LauJensen: Good morning all

1:51 hoeck: good morning Lau

1:53 LauJensen: Ubuntu 10.04 is released

2:03 Raynes: LauJensen: I preordered a disc a few days ago.

2:04 LauJensen: Cool - But why ?

2:04 @ Raynes

2:05 Raynes: Because I'm running on a dial-up connection.

2:05 LauJensen: ah.. then running isn't the word

2:05 Raynes: Crawling.

2:05 LauJensen: How much do you have to pay to get a disk sent your way ?

2:05 Raynes: Nada.

2:05 It's free.

2:05 Because I'm a poor young padawan.

2:06 It just takes forever.

2:06 Up to 10 weeks.

2:06 I'm still running on Hardy.

2:06 Crawling*

2:06 ;)

2: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 :|

2:07 Raynes: I'd rather wait a month or so until bugfixes are out anyway.

2:08 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.

2:10 LauJensen: Oh

2:11 I always have something like sda1=root, sda2=home, sda3=root2 sda4=swap

2:11 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

2:12 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

2:14 scottj: and you haven't had any problems with experimental gnome etc messing up your settings for the stable version?

2:15 LauJensen: scottj: One time a KDE desktop did add some garbage, which I flushed with the OS but nothing major

2:17 replaca: Raynes: I'm with you dude, still on Hardy

2:18 Raynes: replaca: Hardy is awesome, isn't it? It works.

2:18 That's the most important thing: it works.

2:18 vu3rdd: LauJensen: you can use dpkg-scanpackages

2:18 replaca: I was excited to upgrade today, but life got a little crazy and I need to keep the machine going

2:18 mmarczyk: good morning :-)

2:19 LauJensen: Raynes: If thats your attitude you should be on Debian, enjoying all the benefits of Git 0.8 or so :)

2:19 mmarczyk: Ubuntu 10.04, well what do you know

2: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.

2: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

2:19 LauJensen: Ubuntu 10.04 is miles ahead of Hardy

2:19 mmarczyk: more interestingly, a new version of Sun JDK

2:19 * vu3rdd is happily on debian since 1999 or so

2:20 mmarczyk: vu3rdd: I might be especially lucky, but I haven't had any problems with upgrades thus far

2:20 LauJensen: mmarczyk: I've never had anything but problems with the dist-upgrades

2:20 (and I dont know of anybody who has except you)

2:20 mmarczyk: in fact, I don't recall having to reinstall Linux for any reason other than wanting to switch distros :-)

2:20 alright then, guess I might be especially lucky

2: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.

2:21 replaca: my probs have all been cause of my nvidia card, but lynx is supposed to fix that

2:21 mmarczyk: though that's also with a machine at the uni :-)

2:21 and a friend is doing the same with annoying, but fixable issues

2:21 vu3rdd: But yes, fresh installs are really nice.

2:21 Raynes: They are when you don't have a ton of stuff to backup and nowhere to put it.

2:22 scottj: you have bigger problems than upgrading your distro if you don't have a backup of valuable stuff :)

2:23 mmarczyk: scottj: spot on :-)

2: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.

2: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? ;-)

2:24 Raynes: So my valuable stuff is indeed backed up, but that wont count when I install on a dedicated partition.

2:24 Because that could screw up Windoze as well.

2: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..."

2:26 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?" :)

2:26 Raynes: Priceless.

2:29 mmarczyk: LauJensen: aye, that's rather off-putting

2:29 LauJensen: happens all the time if you follow irc/forum discussions :)

2:29 And you have seen me do the same, if something have complained about a problem with VimClojure :)

2:30 s/something/someone

2:30 mmarczyk: :-)

2:30 LauJensen: Raynes: You should plug that into Botjure, if someone says s/x/y it replaces the text and reprints

2:30 Raynes: $sed #clojure i s/plug/secks/

2:30 sexpbot: Raynes: You should secks that into Botjure, if someone says s/x/y it replaces the text and reprints

2:30 Raynes: It just isn't automagic.

2:31 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.

2:31 LauJensen: ERC does it though, you guys just cant see

2: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

2:33 ERC :-)

2:33 incidentally, your blog post made me give ERC a try

2:33 Raynes: I'm not man enough for ERC.

2: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"

2:33 mmarczyk: when I finally decided to come to #clojure

2:33 thanks for that!

2:33 LauJensen: mmarczyk: Are you liking it? :)

2:34 * mmarczyk sighs deeply, then goes: "ooohhhhhh yeeeeaaaaaaah"

2:34 LauJensen: Sweeeet :)

2:34 mmarczyk: I can't believe the sort of things I'm doing in Emacs these days

2: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

2:34 clojurebot: emacs is an out-moded belief system

2:34 mmarczyk: and I'm only getting started

2:34 Raynes: I'm not man enough for erc.

2:34 mmarczyk: I mean, started on using Emacs for stuff other than Lisp coding

2: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

2: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

2:41 I already use it a lot, along with eshell for stuff which doesn't require proper terminal emulation

2:42 I'm doing it, yet I'm having a hard time believing it :-)

2:43 wooby: i've found it easier to run screen inside emacs than vice versa, with ansi-term

2:43 my buffer of no shame, filled with screen and vim :)

2:47 mmarczyk: yeah, I actually tried running Vim inside Emacs too :-D

2:48 then I told myself I was being ridiculous and fired up a separate gvim :-)

2:48 I guess one day I might not stop myself!

2:49 wooby: lol

2:56 LauJensen: mmarczyk: you can view files in Emacs as well, you dont need Vim for that

2:56 mmarczyk: LauJensen: you don't say :-)

2:57 (got my morning tea, good... :-))

2:58 LauJensen: Im actually on tea this morning as well.... weird

2:58 mmarczyk: I need to figure out the VC magic in Emacs, then I can stop mixing in Vim for writing commit messages

2:59 I actually find that Vim's rendering works better for me, though

3:00 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

3:00 and then never go away until M-x redraw-display ?

3:00 LauJensen: Not me

3: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

3:01 when a line is being wrapped

3: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

3:01 mmarczyk: though that's not much of a problem, since I tend to either truncate-lines or use longlines-mode

3:01 LauJensen: mmarczyk: you can complain all you want, but you know its configurable right? E

3:01 mmarczyk: LauJensen: my particular complaints have to do with bugs

3:02 a way to configure those a way could be considered a 'bug fix' -- and I'd love to know of one :-)

3:02 re: Magit -- is it worth the time investment in your opinion?

3:02 Chousuke: yes

3: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.

3:03 mmarczyk: hm :-)

3:03 with these two opinions, I'm about where I was before ;-)

3:03 guess I'll give both a go

3:03 LauJensen: mmarczyk: hang on

3:04 Chousuke: I use magit since it's still being developed, albeit somewhat slowly

3:04 LauJensen: http://alexvollmer.com/posts/2009/01/18/meet-magit/

3:04 sexpbot: " Alex Vollmer — Meet Magit!"

3:04 mmarczyk: (note that I occasionally complain about both Vim and Emacs and I love them both :-))

3: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

3:04 mmarczyk: LauJensen: cool, thanks!

3:04 Chousuke: in any case, magit is much preferable to git add -p

3:04 in my opinion, that's enough reason to use it.

3:04 LauJensen: Chousuke: thats certainly true

3:05 mmarczyk: -p ? I didn't even know that switch :-(

3:05 Chousuke: mmarczyk: it allows you to stage chunks of code instead of whole files

3:05 mmarczyk: useful if you make unrelated changes in a single file, or just don't want to commit everything

3:06 mmarczyk: oh? in that case, *why didn't I know of that switch!?*

3:06 thanks :-)

3:06 LauJensen: mmarczyk: But you can do the same in Egg

3: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

3:07 hiredman: magit lets you stage lines

3:07 Chousuke: LauJensen: egg doesn't let you split the chunks though as far as I know :/

3:07 Raynes: Magit is awesome.

3:08 Chousuke: LauJensen: that was the primary reason I moved to magit. And the unmaintainedness of egg :P

3:08 mmarczyk: wow, guys, thanks a bunch

3: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

3:08 Chousuke: LauJensen: yes, but can you split those patches?

3:08 LauJensen: no

3: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 :-)

3:09 Chousuke: git add -p and magit let you do that if the chunk is too large

3: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?

3:09 s/multimethods/multimethod/

3:09 Chousuke: yes.

3:10 Raynes: Is there anyway to make them disappear?

3:10 I'd like to murder them with an axe.

3:10 Chousuke: I think multimethods have a java method fro that.

3:10 mmarczyk: ,(doc remove-method)

3:10 clojurebot: "([multifn dispatch-val]); Removes the method of multimethod associated with dispatch-value."

3:10 Raynes: I'll check that out.

3:10 Chousuke: oh, right.

3:11 Raynes: Well, that would work.

3:11 mmarczyk: don't know of a way to remove them by ns, though

3:11 Raynes: A bit more tedious than I hoped, but it fit's in with my current plugin system.

3:11 mmarczyk: or actually

3:12 you could use

3: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.

3:12 mmarczyk: ,(doc methods)

3:12 clojurebot: "([multifn]); Given a multimethod, returns a map of dispatch values -> dispatch fns"

3:12 Chousuke: I suppose namespaces don't support watchers

3:12 mmarczyk: than check metadata on the fns

3:12 then

3:12 Raynes: I thought the ns the methods are defined in wasn't put in metadata?

3:12 I believe I asked about something similar a while back.

3:12 mmarczyk: right :-(

3:12 oh bother

3:13 you could try extracting their class names

3:13 Chousuke: meh

3:13 mmarczyk: they contain a mangled ns name

3:13 Chousuke: just have an explicit unload function for each plugin ;P

3:13 mmarczyk: at this point I'm beginning to wonder if it's worth the trouble, though

3:13 Chousuke: that way you can also allow the plugin to do any teardown it might need.

3: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.

3:14 I'm just curious.

3:14 Each plugin attaches an unload and load fn that does the right thing to the modules ref.

3:16 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.

3:18 LauJensen: Ok, 10.04 is burned and ready to be installed, later :)

3:20 mmarczyk: good luck :-)

3:21 Raynes: mmarczyk: I give him 3 hours before he is in here whining about bugs.

3:22 * Raynes is perfectly content with waiting for bug fixes to be put out before installing.

3: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.

3:22 mmarczyk: :-)

3:23 no chance of some magazine bundling a cd?

3:25 Raynes: mmarczyk: Well, probably.

3:26 I could just buy one and have it in like 3 days.

3:26 But then I'd still be waiting a month before I install it.

3:26 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.

3:27 mmarczyk: oh, ok

3:27 Raynes: Oh wow. Irclj has more watchers than sexpbot.

3:27 :o

3:27 And you're one of them!!!

3:28 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.

3:28 mmarczyk: yup, I'll brush up on irc-fu while reading Clojure, which is always nice :-)

3: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.

3:29 I need to look at the reference and make sure I'm doin' it rite.

3:29 mmarczyk: there's no way I'm interested enough to read any irc-related standards

3:29 but reading your lib should be fun enough :-)

3:30 then I might become interested in the standards just to see if it works as it should ;-)

3: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).

3:30 In case, you know, hiredman uses it for clojurebot. ;)

3:30 mmarczyk: :-)

3:30 Raynes: When I started it, I really knew nil about IRC. I asked many questions in #botters and such.

3:31 mmarczyk: that's where I'm at now

3:31 Raynes: Irclj is good enough to power sexpbot on two different servers, so I'm content.

3:44 LauJensen: Hmm

3:44 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

3:44 wooby: wb LauJensen, looks like at least networking is working!

3:45 LauJensen: thanks

3:45 I mean that was _really_ fast

3:46 mmarczyk: LauJensen: now let's see if you can be equally fast to break it :-)

3:46 LauJensen: Like a type-hinted version of Ubunjure

3:46 mmarczyk: yea gimme a sec :)

3:47 Does anybody have an oppinion on Chrome vs Chromium ?

3:48 Raynes: Firefox.

3:48 LauJensen: hehe

3:48 Firefox feels so 1980s now

3:48 Raynes: FFJure.

3:48 So does Hardy.

3:48 LauJensen: True

3:48 Raynes: You, with your new fangled Lynx.

3:48 mmarczyk: LauJensen: I'm more interested in Chrome vs. Opera :-)

3:48 LauJensen: I tried forcefully to go back to Firefox, using plugins to fill the backs - I just couldnt

3:49 Raynes: Me sitting here on dial-up with Hardy running on Wubi in a Vista installation.

3:49 Might as well just stop programming completely and sink into the 30s.

3:49 mmarczyk: well, actually I'll be interested in that again when 10.5 appears on Linux

3:49 LauJensen: Raynes: Yea with your dad running the treadmill so you can get power

3:49 Raynes: It's my cat running the treadmill.

3:49 LauJensen: I never found Opera remotely appealing, because of the lack of plugins

3:49 vu3rdd: when you do (use '[] :only ()) isn't it strange that the vector does need quote but the list does not need it?

3:50 LauJensen: (:use [something]) or (use '[something])

3:50 vu3rdd: yes, the former inside the ns

3:50 LauJensen: yes

3:50 the latter on the ladder

3:50 vu3rdd: ok.

3:51 LauJensen: vu3rdd: But yea, the whole import,require,use,:use,refer stuff is still a bit confusing to me

3:51 vu3rdd: yes, to me too. I keep looking at the docs or code every time I use it

3:52 mmarczyk: LauJensen: well, there's user js for things like click-to-flash

3:52 but there's no equivalent to rikaichan / rikaikun

3:52 LauJensen: mmarczyk: yes, and you can also modify the core in a hex-editor, but whats your point?

3: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

3:54 LauJensen: ok

3:54 mmarczyk: but of course I didn't intend that as an argument

3:54 as mentioned, I use rikaikun in Chrome -- no equivalent in Opera to that :-(

3:55 LauJensen: will have to look that up

3:55 mmarczyk: there's no equivalent to the way in which Opera allows you to configure all keybindings etc.

3:55 then carry that config around

3:56 plus I think its session manager is just about the best of those I've used

3:56 LauJensen: I would like to write a plugin for Chrome, so that it read my .emacs

3:56 mmarczyk: rikaichan (FF) / rikaikun (Chrome) -- hover your cursor over a kanji to have a cartoon bubble with translations come up :-)

3:57 also does clusters of consecutive kanji/kana

3:57 LauJensen: oh, please do :-D

3: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

3:58 AWizzArd: Morning.

3: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 ;-)

3:58 AWizzArd: morning

3:58 LauJensen: ok :)

3:59 Japanese is back in the game!

3:59 Morning Andre

3:59 mmarczyk: :-)

3:59 * AWizzArd waves

4:05 LauJensen: Ok, ~18 seconds with all my packages installed

4:05 (I'll give Ubuntu a rest now)

4:08 esj: LauJensen: it is extremely nice

4:10 mmarczyk: btw, how would one go about setting up a small separate window for erc to send various notices to?

4:11 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

4: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

4:11 mmarczyk: I was hoping for an event received hook, yeah

4:12 also, is there a standard hook for after joining a channel?

4: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

4:12 mmarczyk: yeah, tried doing that; maybe not dilligently enough

4:12 LauJensen: #emacs is always helpful

4:12 mmarczyk: will try again tonight

4:13 oh, good idea

4:13 thanks, I'll try that

4:13 LauJensen: np

4:22 stilkov: ,(format "%" "please ignore")

4:22 clojurebot: java.util.UnknownFormatConversionException: Conversion = '%'

4:22 stilkov: ,(format "%s" "please ignore")

4:22 clojurebot: "please ignore"

4:24 LauJensen: stilkov: for non-general-interest stuff, I think you can actually query the bot

4:25 stilkov: LauJensen: sorry about that, you are right

4:25 LauJensen: its not a problem, just wanted to make sure you knew :)

4:46 hircus: is there a known problem with the latest leiningen? It just stops after "Copied :dev-dependencies"

5:36 Licenser: hmm I found something very odd:

5:37 (. GridBagConstraints LINE_END) ; => 22

5:37 (let [c GridBagConstraints] (. c LINE_END)) ; => No matching field found: LINE_END for class java.lang.Class

5:37 is there some evil magic going on here?

5:41 sids: Licenser: I believe . expects the literal class name. This should work: (let [c GridBagContraints] (eval `(. ~c LINE_END))

5:42 Raynes: Yike.s

5:42 Licenser: *cries*

5:42 Raynes: Yikes.*

5:42 Licenser: thakns you sids

5:43 this is more then horrible but it works

5:46 this is ugliish ugly so to say

5:47 good greif

5:48 mmarczyk: ,(require '[clojure.contrib.java :as java])

5:48 clojurebot: java.io.FileNotFoundException: Could not locate clojure/contrib/java__init.class or clojure/contrib/java.clj on classpath:

5:48 mmarczyk: ,(require '[clojure.contrib.reflect :as reflect])

5:48 clojurebot: java.io.FileNotFoundException: Could not locate clojure/contrib/reflect__init.class or clojure/contrib/reflect.clj on classpath:

5:48 mmarczyk: wutsitcalled

5:48 ,(require '[clojure.contrib.java-utils :as java])

5:48 clojurebot: nil

5:49 mmarczyk: ,(let [c Integer] (java/wall-hack-method c 'MAX_VALUE c))

5:49 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: java-utils$wall-hack-method

5:49 mmarczyk: hm, worked for me at a 1.2 repl

5:49 aaaah

5:49 ,(let [c Integer] (java/wall-hack-field c 'MAX_VALUE c))

5:49 clojurebot: java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)

5:50 mmarczyk: well, that's likely clojurebot's sandboxing in action

5:51 sids: mmarczyk: works on the 1.1 repl too

5:52 mmarczyk: sids: right; sandboxing it is with the bot

5:52 sids: but it is (almost) as ugly as the eval solution

5:53 mmarczyk: I'm considering taking issue with the notion that my reflective solution might not be the ugliest ;-)

5:53 sids: :)

5: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

5:56 sids: Licenser: yeah, it'll start looking like perl!

5:56 Licenser: I don't even get it working since it's too silly :P

5:57 or I am too stupid

5:57 mmarczyk: got a gist?

6:00 Licenser: http://gist.github.com/385022 L 32

6:00 Raynes: Licenser: You know, you can anchor to lines right?

6:01 Licenser: Raynes: not in gits

6:01 at least not in this one, don't ask me why

6:01 I tried it

6:01 Raynes: Huh.

6:01 mmarczyk: Chrome vs. line numbers on GitHub, the hopeless battle

6:01 Raynes: That's odd.

6:01 I thought you could.

6:01 mmarczyk: oh, but fortunately they look fine this time

6:01 Licenser: mmarczyk: nope safari

6:01 AWizzArd: How can I open a repl in VimClojure?

6:01 Licenser: worked great iup to now

6:01 mmarczyk: Licenser: I mean Chrome misplaces them and I'm using Chrome now

6:02 Licenser: nothing to do with anchoring

6:02 Licenser: heh

6:02 ah

6:02 mmarczyk: so that's set-constraint!, right?

6:02 Licenser: it's wooooookring

6:02 mmarczyk: yea

6:02 mmarczyk: oh :-)

6:02 ok then

6:02 Licenser: http://gist.github.com/385022 is too

6:03 mmarczyk: cool :-)

6:04 clj-swing ?

6:04 Licenser: mmarczyk: yea working on that

6:05 mmarczyk: a greatly promising name! :-)

6:05 Licenser: mmarczyk: assuming I get it ever to work - yes :P

6:05 Raynes: I think you mean swingjure

6:05 :p

6:05 mmarczyk: :-)

6:06 Licenser: tried that, lein complained

6:06 j/k

6:06 LauJensen: Licenser: use leinjure instead :)

6:06 mmarczyk: :-)

6:08 Licenser: I should rename the project to macro-madness

6: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

6:09 Why is stop set to return true?

6:10 is the start-server bit executed for every call to the :read callback of the repl?

6: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 :-)

6:13 http://github.com/technomancy/swank-clojure/

6:13 LauJensen: wow that code looks old... (swap! stop (fn [_] true)) => (swap! stop (fn [] true)) => (reset! stop true)

6:14 mmarczyk: http://github.com/technomancy/swank-clojure/blob/master/src/swank/swank.clj#L60

6:19 spariev: swank-clojure is probably the oldest third-party clojure code in the entire universe

6:20 mmarczyk: well it seems to me that this simply sends the server-starting expression back to the repl

6:20 and as soon as that's executed, it sends the exit form

6:21 _exterm: ah, that makes sense :-)

6:22 mmarczyk: does it? oh good. I don't know how start-server is defined, so wouldn't know :-)

6:22 now I'd be curious to find out why is a sensible thing to do

6:26 LauJensen: All Emacers simple hit 'M-. start-server' in the REPL to find out how its defined

6:27 mmarczyk: yeah, I could do that too

6:27 but I'm too lazy to look it up on GH to post a link *and* open it in Emacs

6:29 _exterm: http://github.com/technomancy/swank-clojure/blob/master/src/swank/swank.clj#L48

6: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 :-)

6:30 _exterm: ;-)

6:31 mmarczyk: together with your suggestions re: Magit / Egg from earlier, that'll make for the ultimate source control bliss :-)

6:32 _exterm: yup, noticed that ;-) but only followed to setup-server now

6:33 I can't believe this code :-)

6:35 LauJensen: does Emacs have something like C-o (in normal mode) for "jump back"?

6:40 M-* ! lovely :-)

6: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]}?

6:42 mmarczyk: ,{:this (reduce into (map #(:this (% 1)) {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}}))}

6:42 clojurebot: {:this [1 2 3 4 5 6]}

6:43 Raynes: Cool.

6:43 mmarczyk: ,(apply merge-with into (vals {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}}))

6:43 clojurebot: {:this [1 2 3 4 5 6]}

6:43 mmarczyk: better :-)

6:43 Raynes: Cooler.

6:43 Thanks.

6:43 mmarczyk: np

6:43 Raynes: Didn't know about merge-with.

6:43 Exactly what I was looking for.

6:44 mmarczyk: perhaps concat would be more appropriate though

6:44 _ato: mmarczyk: with slime you can use M-. and M-,

6:44 mmarczyk: if the seqs might not be all vectors

6:44 _ato: lovely! thank you

6:48 http://code.google.com/p/wave-client-for-emacs/

6:48 sexpbot: " wave-client-for-emacs - Project Hosting on Google Code"

6:48 mmarczyk: oh come on now!?

7:08 rsynnott: Hey, does anyone know in what version protocols were added/will be added?

7:09 hoeck: rsynnott: 1.2

7:09 rsynnott: ah, thanks

7:09 hoeck: will be added in 1.2

7:10 * rsynnott just saw a blog post about them the other day; they look quite interesting

7:11 hoeck: rsynnott: they are, it's big fun programming with them!

7:14 * hoeck needs a "clojure programmers have more fn" shirt

7:14 bozhidar: hoeck: good one :-)

7:16 hoeck: bozhidar: thats not from me, found it there: http://www.zazzle.com/clojure+programmers+have+more+fn+gifts

7:16 sexpbot: " Clojure Programmers Have More Fn T-Shirts, Clojure Programmers Have More Fn Gifts, Art, Posters, and more"

7:22 bozhidar: nice

7:33 ivenkys: Stella.........................

7:33 oh i mean afternoon gents

7:37 Raynes: mmarczyk: Stop getting all the easy questions! :p

7:42 Licenser: so has anyone used clojure with swing a lot? I am looking for some code examples here

7:42 and I don't mean the few blog posts out there that show some tutorial programs but seriouse code :P

7:43 rsynnott: Licenser: the blog posts with tutorial code should give you the general idea

7:43 after that it should be rather like using swing with java, I would have thought

7:44 Licenser: rsynnott: I know, but my goal is not to use swing but to make a nice clojury wraper/lib for it

7:45 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

7:45 rsynnott: hmm

7:46 * rsynnott has personally never really felt the need to use swing with clojure (or anywhere else in a serious way)

7:46 * rsynnott isn't really a fan :)

7:46 rhudson: Licenser: I would imagine that Incanter does a lot of Swing

7:46 Licenser: I went through the blog posts already and harvested everything I could as usage cases there

7:46 *peaks at incanter then*

7:48 hoeck: Licenser: whats the goal of your lib?

7:48 Licenser: hoeck: making it easy (I like that word a lot :P) to make clojure programs with a gui

7:48 hoeck: Licenser: do you aim at having a clojure-friendly way to do guis?

7:48 Licenser: yap

7:49 hoeck: what about apache pivot then?

7: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

7:49 hoeck: got a nice clojure wrapper for it :)

7:50 Licenser: I know I know hoeck ^^

7:50 hoeck: okay, its currently limited to only one single host frame

7:50 and its lacks good examples

7:52 Licenser: I've no idea what single host frames are o.O and examples are true :P I didn't find any

7: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.

7:54 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.

7:55 That's my two bits -- not that USD0.25 gets you far these days.

7:57 Licenser: rhudson: this is what I got so far: https://gist.github.com/9e9fb363b502733a0e31

7:58 (look at the very botton the two functions there are examples)

7:59 rhudson: Looks good

8:00 Licenser: :)

8: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.

8:03 That way it's easier to have separate functions to generate subassemblies.

8:04 But maybe just judicious use of commas would do the trick.

8:08 Licenser: *looks at the lines*

8:09 hamza: ,(drop (int 1/2) [1 2 3])

8:09 clojurebot: (1 2 3)

8:09 hamza: ,(drop 1/2 [1 2 3])

8:09 clojurebot: (2 3)

8:09 rhudson: That button is at [1 1] ? It's probably better to be explicit about thata

8:09 hamza: ^ is this expected or a bug?

8: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

8:10 the idae of this slowly changing of constraint is from stuart sierras blog

8:11 rhudson: Not sure I like that idea...

8:12 Licenser: rhudson: neither am I :P hence my trying to find some input

8:13 _ato: hamza: if it were a bug what would you expect to get instead?

8:13 Licenser: https://gist.github.com/e0c50ac49c001361cb84 was another attempt

8:13 hamza: [1 2 3] in both cases?

8:13 rhudson: Right, the constraints are container args, so somethng like (add-to container :x 1 :y 1 (button ...))

8:14 & then do you have something like (doto container ....) to add children

8:14 _ato: ,(drop 3/2 [1 2 3])

8:14 clojurebot: (3)

8:14 _ato: ,(drop 0.9 [1 2 3])

8:14 clojurebot: (2 3)

8: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

8:15 hamza: ,(drop 0.4 [1 2 3])

8:15 clojurebot: (2 3)

8:15 _ato: ,(drop (int 1/2) [1 2 3])

8:15 clojurebot: (1 2 3)

8:15 _ato: yeah, I guess it's a bug

8:16 although a lot of people might say that it's just invalid input

8:16 Licenser: ,(drop (int 1) [1 2 3])

8:16 clojurebot: (2 3)

8:17 _ato: ,(take 1/2 [1 2 3])

8:17 clojurebot: (1)

8:17 _ato: guess it's consistent with take at least

8:18 jweiss: i didn't even know you could write a number as "1/2"

8:18 * jweiss thought you had to do (/ 1 2)

8:19 _ato: 1/2 is the syntax for ratios

8:19 ,(class 1/2)

8:19 clojurebot: clojure.lang.Ratio

8:19 _ato: ,1/2

8:19 clojurebot: 1/2

8:19 ivenkys: how do you invoke the bot gents ..?

8:19 _ato: just write some code prepended with a comma

8:20 hamza: _ato: even if rounds i would expect 0.4 to work but that would still drop the first element.

8:20 ,(drop 0.4 [1 2 3])

8:20 clojurebot: (2 3)

8:20 _ato: ~def drop

8:21 it just checks pos? and decrements and recurses

8:21 so anything >= 1.0 will drop an element

8:25 I mean > 0.0

8:25 ivenkys: ,( + 2 3)

8:25 clojurebot: 5

8: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.

8:26 Licenser: thanks for the advice rhudson and good breakfast

8:26 rhudson: have a great day

8:27 Licenser: mm can I add a protocol to a java class? I guess not right?

8:29 chouser: you can extend a protocol to a java class

8: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:

8:40 generate a warning but take the latter

8:40 or

8:41 having conflict resolution like, 'core wins', also with a warning

8: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 :)

8:43 Licenser: hmm I think conflicts should throw exceptions, otherwise LauJensen is right, it will be forgotten

8:44 cgrand: rhickey: conlict resolution between several refered libs or between the namespace-being-defined and refered libs/core?

8:44 Licenser: but perhaps make the exception a bite more expressive so

8:44 rhickey: cgrand: however the conflict occurs, not sensitive to context

8:45 Licenser: like saying 'can't refer #clojure.controb.funky/do since #clojure.core/do already claims this' just in propper english :P

8: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.

8:46 rhickey: Licenser: something like that, although core-wins probably isn't going to work out

8:46 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

8:46 Licenser: what about something like (use '(clojure.contrib.funky :overwrite do)

8:47 chouser: rhickey: right, in which case you have to follow the same steps you would today

8:47 rhickey: chouser: then this isn't solving the upgrade-without-breaking problem

8:47 chouser: roll back to an old clojure, rename your 'foo' to something else, refer-clojure to exclude or rename core/foo ...

8:48 not completely, but it would help some.

8:48 Licenser: I thinkit is good to be very annoying about overwriting core stuff

8:48 rhickey: chouser: the goal is upgrade without breaking, one release, 'replaced' things stay there, deprecated

8:49 Licenser: I'm not sure if you can upgrade w/o breaking

8:50 rhickey: so your build says 'overwriting core/foo', or 'overwriting core/shuffle' followed by 'deprecated contrib.seq/shuffle'

8:50 cgrand: rhickey: I guess that :added + :as-of doesn't satisfy you

8:50 rhickey: cgrand: still breaking in that you have to add that

8:51 cgrand: I like :as-of, but it doesn't exist yet

8:51 Licenser: hmm how about this rule:

8:52 clojure.core overwrite clojure.contrib, provate namespace overwrites clojure.core and of cause clojure.contrib

8:52 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

8:52 we can live old functions in clojure.contrib since core overwrites them

8: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

8:52 Licenser: :as-of 1.1.0 would give me the function of the 1.1.0 clojure?

8:52 rhickey: Licenser: sometimes, in moving to core, semantics or return types might change slightly

8:53 Licenser: hmmm

8:53 hmm hmmm

8: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

8: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

8: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

8:55 Licenser: with semver Clojure will be up to version 20 in no time

8:55 Licenser: rhickey: you can call it done with version 42 then :P

8:56 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

8:57 but when we don't have to follow semver with clojure break for good that at least forces people to update their stuff :P

8:57 but the :as-of stuff might be good

8:58 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?

8:58 if that works :as-of will solve a lot of problems

8:58 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

9: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'

9:01 rhudson: Licenser: one more thought: take a look at Groovy's SwingBuilder: http://groovy.codehaus.org/Swing+Builder

9:02 sexpbot: "Groovy - Swing Builder"

9:02 Licenser: rhudson: thank you I will

9:22 cgrand: maybe leaving stubs for moved/renamed vars or having per ns an history of renames/moves :-/

9:24 chouser: revision control systems are good at this kind of thing

9:25 perhaps "upgrade without breaking" is a false goal? There could be branch with bug fixes and non-breaking new features.

9: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

9:26 powr-toc: Does anyone know how to get swank to use a ~/.user.clj file?

9: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.

9:30 rhickey: chouser: yes, could be unobtainable goal

9:31 Chousuke: git's commit log is always a pleasure to read too. It requires a lot of discipline to achieve such consistency though.

9: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

9: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.

9: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

9:34 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

9:34 Licenser: crazy idea

9:34 since clojure code is just data, why not make a updateer :P

9:34 when the reader notices that your code is for 1.1.0 it asks you if it should update it for 1.2.0

9:35 might now work for every single peace of code (think eval and stuff) but for a lot

9:35 chouser: unfortunately, we still don't edit the code that is data

9: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

9:36 chouser: we edit text files that become data after relatively trivial rules are applied. Rules the lose important information like comments and spacing.

9:36 Licenser: _ato: well I like the warnings since it's bad charma to redefien core functions

9: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? :/

9:36 chouser: that lose

9:36 rhickey: _ato: this is not that, you aren't replacing the core thing in core, just in your view of the world

9:36 Licenser: chouser: noone will stop the reader to read comments and spacings too :P

9:37 _exterm: clojure.core question: how does eval work? http://gist.github.com/385198 looks like an infinite recursion to me.

9:37 Chousuke: _exterm: that's not a call to the eval function

9: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

9:38 Chousuke: _exterm: note the . form

9: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?

9:38 Chousuke: _exterm: it's calling the clojure.lang.Compiler/eval static method

9:38 Licenser: chouser: we've meta data here :)

9:38 chouser: Licenser: not on booleans

9:38 nor on Booleans

9:38 Licenser: then we add that :P

9:38 Chousuke: :P

9:39 not possible. sorry.

9:39 _exterm: Chousuke: really? I always thought that would be (. clojure.lang.Compiler eval form))

9:39 chouser: and even if we did, you want ^{:text-before "\n\n\n\n " :text-after "\n\n\n\n\n"} true !?

9:40 _exterm: Isn't that evaluated with the innermost expression first?

9:40 Chousuke: _exterm: no.

9:40 _exterm: . is a special form

9:40 chouser: _exterm: that's old-style interop syntax.

9:40 Licenser: Chousuke: of case make true a clojure.core.Boolean instead of a java.lang.Boolean

9:40 Chousuke: Licenser: that's not very neat.

9:40 chouser: _exterm: today we're write (Compiler/eval form)

9:40 Chousuke: Licenser: Clojure's interop is supposed to be wrapper-free :)

9:40 chouser: Licenser: I did say "sane" :-)

9: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?

9:41 Chousuke: you could of course write a special reader that returns whitespace elements as well.

9:41 Licenser: :P

9:41 annotations? *dodges*

9:42 _exterm: Chousuke: thanks :-)

9:42 chouser: Chousuke: hmm... said that way, it sounds interesting.

9:43 Chousuke: chouser: it would be useful for many tools at least

9: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

9:43 without error

9:43 Licenser: *nods* smart idea

9:43 chouser: the whitespace elements don't have to be strings. Could be objects that have the text, line number, file name, etc.

9:44 Chousuke: then the "real" reader could actually take that output and strip out those extra objects.

9: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.

9:45 chouser: or you could just have two modes for the reader if you designed the thing well enough I suppose.

9:45 chouser: what about the whitespace and comments between metadata and its target. :-/

9:46 Chousuke: you could return a metadata-element, whitespace-element, and the target-element

9:46 LauJensen: Chousuke: You made it restartable ?

9:47 Chousuke: LauJensen: no. I did toy with the idea once but it's not very easy ;P

9:52 cemerick: stuarthalloway: how is your 1.2.0-SNAPSHOT version spec ever touching the 1.2.0-master-SNAPSHOT stuff at all?

9:52 stuarthalloway: damn good question

9:53 if I specify the "and greater" form it finds master instead

9:53 cemerick: that's odd

9:53 stuarthalloway: but to spec

9:53 cemerick: oh really?

9:53 stuarthalloway: maven does a string compare on the "qualifier" section of the version number

9:53 _ato: yeah, that's just the way maven compares version numbers

9:53 stuarthalloway: and the word "master" is > any number

9:54 cemerick: oh, right, I see

9:54 * stuarthalloway just learning this stuff

9:54 stuarthalloway: but we shouldn't have two sets of artifacts anyway

9:54 cemerick: another nail in the coffin of artifacts corresponding to git branches

9:54 I'd strongly suggest blowing away the 1.2.0-master-SNAPSHOT dir

9:55 stuarthalloway: but that is the one consistent with the name in clojure :-(

9:55 _ato: ugh

9:55 stuarthalloway: no matter what I do I bet I break someone

9:55 _ato: please don't break all the dependencies again

9:55 chouser: cemerick: what should we do next time there's a branch with experimental changes that some people want?

9:55 _ato: bad enough when contrib got renamed

9:55 cemerick: except no one, but no one should be using it

9:55 _ato: wait until 1.3

9:56 cemerick: chouser: in that case, people should pull and build on their own

9:56 The activity of people on the bleeding edge should not leak out for everyone to see.

9:56 And the maven artifacts are the touchpoint for the entire userbase.

9: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"

9:56 chouser: really!? You're saying there should be no artifact id at all for such things?

9:57 _ato: change the artifactId instead of the version? clojure-with-awesome-feature-1.2-SNAPSHOT

9:57 cemerick: If there is to be one, it should have a different project name, or live in a different repo.

9:57 stuarthalloway: I am perfectly happy with the *clojure* artifact names. They all have version and branch in them, and are consistent

9:58 cemerick: stuarthalloway: well, when it was 1.2-new-SNAPSHOT vs. 1.2-master-SNAPSHOT, that wasn't as nice.

9:58 stuarthalloway: at least you knew what you were getting

9:58 * _ato never had any issues with it

9:58 _ato: but I wasn't using version ranges

9:58 cemerick: _ato: but for people who didn't even know what new vs. master was, it was a big problem.

9:59 Licenser: why not clojure-SNAPSHOT?

9:59 erm 1.2-SNAPSOT

9:59 sorry

9:59 cemerick: Licenser: yeah, that's really what it should be IMO.

9:59 stuarthalloway: clojure isn't hurting anybody, and that would be a breaking change if we did it now

9:59 Licenser: that is what I think since maven runs nuts with the -master thing I think

9: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 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 VCS is system of record, has concrete names for everything, knows what is derived from what else

10:04 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 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 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 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 * stuarthalloway tunes out for 10 min to implement workarounds while y'all chat theory

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 as we have knowledge about these things, just mvn doesn't

10:08 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 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 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 Those who don't like mvn can download a jar or build from source as they like.

10:24 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 * fogus Is starting to think his project's yak-shaved build system might not be all that bad

10:29 Borkdude: I like lein, but it needs easier Windows support and maybe some more intelligence for deleting old jars

10:29 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 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 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 a build is a value

10:36 you need an identity to refer to that value

10:36 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 ...with a red carpet into central, which is nice

10:41 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 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 Ran 354 tests containing 1242 assertions.

10:47 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 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 there's a reason ruby has had such a high take up

10:48 because they put energy into usability

10:48 stuartsierra: Ruby is also bug-ridden and dead slow.

10:48 _ato: yes

10:48 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 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 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 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 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 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 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 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 ok, really going now. :-)

11:08 stuartsierra: chouser: Maven predates Git by years.

11:08 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 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 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 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 release early, release often

11:15 :-/

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 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 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 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 (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 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 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 Okay - That doesn't seem very tricky actually

11:21 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 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 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 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 * cemerick chokes ;-)

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 * _ato hates the lot of them -- but level of hate differs ;-)

11:28 avar: unfamiliarity, blaming the inevitable broken *package* on the distribution system

11:29 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 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 sorry - this instead: (apply vector (map (fn [_] (ref (struct cell 0 0))) (range dim)) ))

11:50 with a (def dim 80)

11:51 ... 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 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 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 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 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 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 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 sorry about the delay

12:07 hiredman: oh no, if you are busy you are busy

12:08 * hiredman dispairs of the state of clojurebot

12:09 replaca: hiredman: just a short push to get pprint into 1.2 and a couple of other 1.2 things

12:10 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 * arohner is in jar hell

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 if not, slime is broken

12:13 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 oh, :exclusions

12:15 _ato: [leiningen/lein-swank "1.1.0" :exclusions [swank-clojure]]

12:15 yep

12:16 arohner: hiredman, _ato: thanks

12:17 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 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 ,(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 (or most of it)

13:03 cemerick: yuck, (str record-instance) returns classname@id

13:04 is the pr behaviour going to get roped into defrecord's .toString()?

13:10 ouch; is this expected? https://gist.github.com/31c64ee18cb631e3b54e

13:11 I presume that result is coming from the map impl in the generated record class, but...

13:12 rhickey: ^^

13:16 headius: cemerick: what's defrecord btw?

13:16 cemerick: headius: http://clojure.org/datatypes

13:17 headius: interesting

13:18 is that something you could feed to e.g. Hibernate as a model's data object?

13:18 cemerick: hrm, perhaps

13:18 might need a few annotations, though you can do that now too

13:19 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 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 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 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 thanks!

13:31 chouser: http://clojure-log.n01se.net/ is running agin

13:31 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 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:37 * abedra nods in agreement

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 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 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 I have to assume it's a bug.

13:53 rhudson: I betcha the impl has a getSize() method

13:53 yea

13:53 remleduff: What happens if you try to make field named "equals" ?

13:53 * cemerick prays :-P

13:54 cemerick: remleduff: works as expected. This only affects fields with the same name as no-arg methods.

13:54 (: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 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 (and fall back to slower lookup)

14:28 cemerick: stuarthalloway: https://gist.github.com/9d1769237b312eb49723

14:28 chouser: doesn't it have to in this case?

14:29 (. object field) will always invoke the field method, if it exists

14:30 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 * stuarthalloway thinking the same thing (about myself)

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 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 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 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 rare, but I've seen it needed

14:44 slyphon: chouser: um, where can i report a bug on thejoyofclojure?

14:45 s/on/in/

14:51 cemerick: _nj: Sorry, I've been sticking with the v0.3.x builds

14:51 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 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 it says "no method in multimethod 'conf' for dispatch value: :input-format"

15:10 but this is clearly defined in the library

15:10 there is a (defmethod conf :input-format ...)

15:11 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 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 unless you're using HDFS, which is pretty impressive

15:16 leifw: words of true encouragement :-/

15:16 we are

15:17 so that's useful I guess

15:17 YES IT IS DEFINED YOU BASTARD

15:17 ARGH

15:17 technomancy: sorry =(

15:17 leifw: haha that's ok

15:17 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 * slyphon thinks about this

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 If you want to use Hadoop, make sure you know the Java APIs first.

15:48 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 ,(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 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:00 * slyphon finally wrote a form-altering macro of some minor complexity

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 #' is to access the Var

17:13 aiui

17:13 '== is just (symbol "==")

17:14 #'== means "give me the value of var represented by (symbol "==")"

17:14 i *think*

17:14 * slyphon goes to look that up

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 laughs

17:16 slyphon: they're more like "labels"

17:16 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 my mistake

17:18 * slyphon was kind of hoping someone would correct him :)

17:19 mmarczyk: what about that do and chaining stuff in macros?

17:19 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 {:tag foo} is attached to the symbol by the reader

17:20 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 then that metadata gets copied onto the Var

17:20 so that it's accessible at runtime

17:21 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 ,(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 mmarczyk: https://gist.github.com/d6a6dabb9c0a85e154c2

17:23 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 ah

17:23 mmarczyk: looing now :-)

17:24 looking, I mean

17:24 * slyphon chuckles

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 :)

17:26 mmarczyk: you could probably put the second form from the do inside the let

17:26 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 * slyphon nods

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 i mean, at the top level

17:28 mmarczyk: Borkdude: '#^foo foo means (quote #^foo foo)

17:28 #^foo foo means the symbol foo with metadata of {:tag foo} attached at read time

17:28 (that foo in the metadata is also a symbol)

17:29 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 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 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 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 technomancy: but, my lein deps doesn't even get to that.

17:37 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 e.g. that 'ex/a is in the namespace ex

17:43 .getNamespace returns a string it'd be nice if there was a non-string way

17:44 Borkdude: (:ns (meta #'a))

17:45 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 ,(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 but clojurebot luckily truncates stuff

17:48 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 (the-ns 'user)

17:49 ,(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 "([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 ?

17:50 livingston: yes!

17:50 thank you

17:50 mmarczyk: livingston: which was it then?

17:50 arohner: livingston: that will return the var, or nil

17:50 (ns-resolve 'clojure.core 'map)

17:50 ,(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 I don't know what I missed but I was looking for the-ns

17:52 mmarczyk: livingston_: oh :-)

17:53 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 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 livingston_: in that case

17:55 ,(name (.getName (the-ns 'user)))

17:55 clojurebot: "user"

17:55 mmarczyk: see if that matches

17:55 ,(.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 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 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 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 ,(= (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 so is it possible to just-splice?

18:01 https://gist.github.com/d6a6dabb9c0a85e154c2

18:01 that causes an exception, because it doesn't know how to resolve the second set of symbols

18:01 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 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 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 ,(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 hmm

18:06 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 or wherever

18:07 they're coming in as "just strings" anyway

18:07 those strings are being interned at read time

18:08 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 so actually when you do a .getNamespace / (namespace ...), you get an interned string

18:09 and equality testing against another interned string should boil down to pointer equality

18:10 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 mmarczyk: that'll work too

18:11 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 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 the question is, why lein deps fails

18:13 bin/lein does point to the same clojure jar

18:13 the question is, why does lein deps need the contrib

18:13 mmarczyk: alexyk: the repl works, lein deps doesn't?

18:13 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 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 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 my lein now points to git-lein/bin/lein

18:16 technomancy: you said a while ago git pull should suffice

18:16 mmarczyk: alexyk: well git pull only updates the sources

18:16 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 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 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 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 livingston: they don't actually

18:24 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 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 def forms create Vars

18:25 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 are resolved to Vars

18:26 livingston: mmarczyk: right, ok .. huh

18:26 mmarczyk: unless treated specially, like 'if' in operator position

18:26 ,(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 btw, how about this?

18:27 ,(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 ,(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 tcepsa: :-)

18:29 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 a quote:

18:30 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 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 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 technomancy: from your repo or elsewhwere?

18:35 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 livingston: these are not enforced, though

18:38 and last time I checked < and > where not on the list

18:38 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 ,(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 http://clojure.org/reader

18:41 joshua-choi: At least, that's what I recal.

18:41 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 ,(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:52 * slyphon nods

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 short of going back to ocaml until the chips fall where they will...

18:54 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 * slyphon is happy living in the past

18:54 alexyk: slyphon: try it

18:55 replaca: slyphon: mostly, yeah

18:55 * slyphon is into tull

18:55 alexyk: contrib is completely berserk

18:55 ducl-streams is now io

18:55 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 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 * alexyk needs to review the field of battle

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 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 is the mailing list the same as the google group?

18:59 technomancy: "seq fns promoted to clojure.core!"

18:59 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 * joshua-choi is very happy about flatten and reductions

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 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 better yet

19:05 ,(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 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 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 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 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 (GET "/"

19:45 "Index page")

19:45 (ANY "*"

19:45 [404 "Page not found"])) Gives me an exception Unsupported binding form: Index page

19:46 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 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 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 Christophe Grand had a different idea

19:54 and Timothy Pratley -- a third one

19:54 not sure if any of those worked for the OP, but perhaps they will for you :-)

19:55 rsh: thanks!

20:07 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 actually I see that there's some improvements to be made to that answer

20:15 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 that's straightforward with a Ref, but cgrand had a nice trick to do that with an Atom:

20:17 cons a nil onto the seque

20:17 then use (first (swap! a rest)) to read elements

20:18 ,(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 I guess agents might in fact be unnecessary here, though

20:20 not sure what I was thinking :-)

20:26 rsh: i think this makes sense to me now, thanks for your help

20:27 (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 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 slime-redirect-inferior-output

20:53 hm, actually it's a function

20:54 right, just call that

20:54 then printouts from other threads should go to the repl buffer too

20:54 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:44 * cemerick clean building

22:45 cemerick: Anyway, I wish I had thought of that instead of futzing with a bandaid for 90 minutes :-(

23:23 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 and a pony.

23:51 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 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 i'd be into it if it makes it faster

23:57 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 i spent a lot of time on the ant scripts to make building it very easy

Logging service provided by n01se.net