#clojure logs

2010-04-30

00:40Tordekhi
00:40TordekI'm trying to use fact, but I think I'm doing it wrong
00:41TordekI got the source and built the jar, but then "java -jar fact.jar" says it can't find the library
00:48Blackfooti haven't used fact, but what is the specific error?
00:49Tordeksorry, er
00:50Tordek$ java -jar fact.jar
00:50TordekFailed to load Main-Class manifest attribute from
00:50Tordekfact.jar
00:50sexpbotCommand not found. No entiendo lo que estás diciendo.
00:53BlackfootTordek: so it looks like the -main function is in fact.main in main.clj. you may need to do something more along the lines of java -cp fact.jar fact.main
00:54Tordek$ java -cp fact.jar fact.main
00:54TordekException in thread "main" java.lang.NoClassDefFoundError: fact/main
00:54sexpbotCommand not found. No entiendo lo que estás diciendo.
00:54Tordeksame with just "main"
00:54Tordekoh, wait, it goes deeper than that
00:55Tordekthere are no .class files in the jar
00:55Tordekhmm, the ant task just skips the compile phase
00:57Blackfootyea, that's what i'm seeing. i think it needs to know where clojure.jar is in order to build it
00:58Tordekodd... I'm almost certain it compiled once..
00:59Tordekok, so, how do I inform it of the location of clojure?
00:59Blackfootant -Dclojure.jar=clojure-1.1.0.jar
00:59Blackfoot(assuming you have that file in the current dir)
01:01Tordekok, at least it errors on compile now...
01:01Tordek [java] java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes
01:02Blackfoothrm i did not see that when mine build. what clojure version did you use?
01:03Tordek1.1.0
01:03leifwany clojure-hadoop users arrived?
01:05Blackfootso here's what i did: git clone git:...fact.git, cd fact, cp ../clojure-1.1.0.jar . , ant -Dclojure.jar=clojure-1.1.0.jar
01:06Blackfootthat clojure.jar came from another project that was using lein
01:08Tordekodd... I deleted the folder and recloned it and now it compiled (with a little bitchin' about not finding clojure-conrib, but then I added it and it shut up)
01:09Blackfoothrm, maybe a leftover class or something
01:09Blackfootso then i can run it with java -cp fact.jar:clojure-1.1.0.jar fact.main
01:10Blackfootbut i think it is supposed to take a directory with tests in it
01:12Tordekok, I managed to get it running
01:12Tordeknow, I gotta learn how to write the tests, apparently >_>
01:50LauJensenGood morning all
01:51hoeckgood morning Lau
01:53LauJensenUbuntu 10.04 is released
02:03RaynesLauJensen: I preordered a disc a few days ago.
02:04LauJensenCool - But why ?
02:04LauJensen@ Raynes
02:05RaynesBecause I'm running on a dial-up connection.
02:05LauJensenah.. then running isn't the word
02:05RaynesCrawling.
02:05LauJensenHow much do you have to pay to get a disk sent your way ?
02:05RaynesNada.
02:05RaynesIt's free.
02:05RaynesBecause I'm a poor young padawan.
02:06RaynesIt just takes forever.
02:06RaynesUp to 10 weeks.
02:06RaynesI'm still running on Hardy.
02:06RaynesCrawling*
02:06Raynes;)
02:07LauJensenAh ok - Its a shame we dont live a little closer, and you not in the US, because then I could have sent you a CD today :|
02:07RaynesI'd rather wait a month or so until bugfixes are out anyway.
02:08RaynesI'm going to be doing a fresh install on a dedicated partition this time, so I need time to figure out how I'm going to back all my stuff up.
02:10LauJensenOh
02:11LauJensenI always have something like sda1=root, sda2=home, sda3=root2 sda4=swap
02:11LauJensenSo I can reinstall any linux on sda1 and boot up to the exact same desktop every time, and run experimental OS's on sda3, also with the same desktop
02:12LauJensenAnd the trick is, I wrapped apt-get install to always pipe the name of the app into a file in my home, so when I reinstall I just run a script on that file which installs all the programs that I manually installed on the old version
02:14scottjand you haven't had any problems with experimental gnome etc messing up your settings for the stable version?
02:15LauJensen scottj: One time a KDE desktop did add some garbage, which I flushed with the OS but nothing major
02:17replacaRaynes: I'm with you dude, still on Hardy
02:18Raynesreplaca: Hardy is awesome, isn't it? It works.
02:18RaynesThat's the most important thing: it works.
02:18vu3rddLauJensen: you can use dpkg-scanpackages
02:18replacaI was excited to upgrade today, but life got a little crazy and I need to keep the machine going
02:18mmarczykgood morning :-)
02:19LauJensenRaynes: If thats your attitude you should be on Debian, enjoying all the benefits of Git 0.8 or so :)
02:19mmarczykUbuntu 10.04, well what do you know
02:19vu3rddproblem with ubuntu is that upgrades are never smooth. You have to do fresh install to get all the advantages of the new release.
02:19replacayeah, but slowly I've begun to want to be on something newer. about a month ago I decided to upgrade, but I realized that lynx was right around the corner
02:19LauJensenUbuntu 10.04 is miles ahead of Hardy
02:19mmarczykmore interestingly, a new version of Sun JDK
02:20mmarczykvu3rdd: I might be especially lucky, but I haven't had any problems with upgrades thus far
02:20LauJensenmmarczyk: I've never had anything but problems with the dist-upgrades
02:20LauJensen(and I dont know of anybody who has except you)
02:20mmarczykin fact, I don't recall having to reinstall Linux for any reason other than wanting to switch distros :-)
02:20mmarczykalright then, guess I might be especially lucky
02:20vu3rddmmarczyk: Oh. ok. I had a lot of issues in the past on a work laptop and finally I converted that machine (also) to debian.
02:21replacamy probs have all been cause of my nvidia card, but lynx is supposed to fix that
02:21mmarczykthough that's also with a machine at the uni :-)
02:21mmarczykand a friend is doing the same with annoying, but fixable issues
02:21vu3rddBut yes, fresh installs are really nice.
02:21RaynesThey are when you don't have a ton of stuff to backup and nowhere to put it.
02:22scottjyou have bigger problems than upgrading your distro if you don't have a backup of valuable stuff :)
02:23mmarczykscottj: spot on :-)
02:23RaynesI'm running on a Wubi installation and I have been for about a year and a half. I backup stuff by moving the root disk file to the Windows side.
02:23mmarczykalso, where's the foss spirit, if we don't break our systems with dist-upgrade and report the bugs then who's gonna do it? ;-)
02:24RaynesSo my valuable stuff is indeed backed up, but that wont count when I install on a dedicated partition.
02:24RaynesBecause that could screw up Windoze as well.
02:25LauJensenmmarczyk: Dont get me started on that spirit. You know this tradition where someone says "I tried to installed X and it broke my system", and instead of helping the support goes "Why are you trying to install X anyway, you should be using Y instead of being a moron..."
02:26LauJensenThen I really found a keeper recently, this guy had his battery in his Macbook Pro roasted by poor power management in Ubuntu and the capacity degraded 20 - 40% over a few weeks only. The supporter goes "Why are you trying to run Linux on overpriced hardware like Apple anyway?" :)
02:26RaynesPriceless.
02:29mmarczykLauJensen: aye, that's rather off-putting
02:29LauJensenhappens all the time if you follow irc/forum discussions :)
02:29LauJensenAnd you have seen me do the same, if something have complained about a problem with VimClojure :)
02:30LauJensens/something/someone
02:30mmarczyk:-)
02:30LauJensenRaynes: You should plug that into Botjure, if someone says s/x/y it replaces the text and reprints
02:30Raynes$sed #clojure i s/plug/secks/
02:30sexpbotRaynes: You should secks that into Botjure, if someone says s/x/y it replaces the text and reprints
02:30RaynesIt just isn't automagic.
02:31RaynesI didn't write that though, and the person who did is on the verge of a bit of a rewrite right now. Once he's finished, I'll incorporate your idea, because it's awesome.
02:31LauJensenERC does it though, you guys just cant see
02:32mmarczykLauJensen: still, I'd say sending in the occasional bug report is a nice thing to do, and if its re: dist-upgrade breakage, it's likely to be received in a more reasonable way
02:33mmarczykERC :-)
02:33mmarczykincidentally, your blog post made me give ERC a try
02:33RaynesI'm not man enough for ERC.
02:33LauJensenI found a kernel regression in 10.04 and it actually popped up itself asking a series of questions, collecting information, checking if I wanted to report only to Ubuntus staff or also Kerneloop, and at the final dialog it borks "Cannot report problem: This is not an Ubuntu package"
02:33mmarczykwhen I finally decided to come to #clojure
02:33mmarczykthanks for that!
02:33LauJensenmmarczyk: Are you liking it? :)
02:34LauJensenSweeeet :)
02:34mmarczykI can't believe the sort of things I'm doing in Emacs these days
02:34LauJensenI set mine up so I open Emacs and start working, then when I miss Raynes too much, I hit f1, enter my password and off it goes
02:34clojurebotemacs is an out-moded belief system
02:34mmarczykand I'm only getting started
02:34RaynesI'm not man enough for erc.
02:34mmarczykI mean, started on using Emacs for stuff other than Lisp coding
02:35LauJensenmmarczyk: tell me about it. Couple of weeks ago I was sitting at a clients office developing a financial app in Emacs, feels good though
02:41mmarczykif I find a way to stop ansi-term from flickering, I'll actually switch to doing all my terminal stuff inside Emacs
02:41mmarczykI already use it a lot, along with eshell for stuff which doesn't require proper terminal emulation
02:42mmarczykI'm doing it, yet I'm having a hard time believing it :-)
02:43woobyi've found it easier to run screen inside emacs than vice versa, with ansi-term
02:43woobymy buffer of no shame, filled with screen and vim :)
02:47mmarczykyeah, I actually tried running Vim inside Emacs too :-D
02:48mmarczykthen I told myself I was being ridiculous and fired up a separate gvim :-)
02:48mmarczykI guess one day I might not stop myself!
02:49woobylol
02:56LauJensenmmarczyk: you can view files in Emacs as well, you dont need Vim for that
02:56mmarczykLauJensen: you don't say :-)
02:57mmarczyk(got my morning tea, good... :-))
02:58LauJensenIm actually on tea this morning as well.... weird
02:58mmarczykI need to figure out the VC magic in Emacs, then I can stop mixing in Vim for writing commit messages
02:59mmarczykI actually find that Vim's rendering works better for me, though
03:00mmarczykdo you guys have the problem where sometimes little arrows like those indicating word wrap appear in Emacs when no word wrapping is actually needed
03:00mmarczykand then never go away until M-x redraw-display ?
03:00LauJensenNot me
03:00mmarczykand don't get me started on C-n jumping to mid-page without moving the visible part of the buffer when I attempt to scroll
03:01mmarczykwhen a line is being wrapped
03:01LauJensenBut for VC you have either Magit if you're advanced, or Egg if you just want a simple pretty interface for branching committing, stashing etc
03:01mmarczykthough that's not much of a problem, since I tend to either truncate-lines or use longlines-mode
03:01LauJensenmmarczyk: you can complain all you want, but you know its configurable right? E
03:01mmarczykLauJensen: my particular complaints have to do with bugs
03:02mmarczyka way to configure those a way could be considered a 'bug fix' -- and I'd love to know of one :-)
03:02mmarczykre: Magit -- is it worth the time investment in your opinion?
03:02Chousukeyes
03:03LauJensenDepends entirely on your use. I personally dont use the advanced features more than 2 times a year, so I'm sticking with Egg.
03:03mmarczykhm :-)
03:03mmarczykwith these two opinions, I'm about where I was before ;-)
03:03mmarczykguess I'll give both a go
03:03LauJensenmmarczyk: hang on
03:04ChousukeI use magit since it's still being developed, albeit somewhat slowly
03:04LauJensenhttp://alexvollmer.com/posts/2009/01/18/meet-magit/
03:04sexpbot" Alex Vollmer — Meet Magit!"
03:04mmarczyk(note that I occasionally complain about both Vim and Emacs and I love them both :-))
03:04LauJensenEverything that guy does with Magit in terms of reflogs, pushing pulling cannot be done in Egg, but Egg looks muuch nicer, as you can see on its Github page
03:04mmarczykLauJensen: cool, thanks!
03:04Chousukein any case, magit is much preferable to git add -p
03:04Chousukein my opinion, that's enough reason to use it.
03:04LauJensenChousuke: thats certainly true
03:05mmarczyk-p ? I didn't even know that switch :-(
03:05Chousukemmarczyk: it allows you to stage chunks of code instead of whole files
03:05Chousukemmarczyk: useful if you make unrelated changes in a single file, or just don't want to commit everything
03:06mmarczykoh? in that case, *why didn't I know of that switch!?*
03:06mmarczykthanks :-)
03:06LauJensenmmarczyk: But you can do the same in Egg
03:06Chousukemmarczyk: with magit you just press tab on a staged/unstaged files and it expands to a chunk view and you can again stage/unstage those
03:07hiredmanmagit lets you stage lines
03:07ChousukeLauJensen: egg doesn't let you split the chunks though as far as I know :/
03:07RaynesMagit is awesome.
03:08ChousukeLauJensen: that was the primary reason I moved to magit. And the unmaintainedness of egg :P
03:08mmarczykwow, guys, thanks a bunch
03:08LauJensenChousuke: No you dont split line-wise like hiredman mentions, but you do get to see your editions to a file as patches, which you can individually stage/unstage
03:08ChousukeLauJensen: yes, but can you split those patches?
03:08LauJensenno
03:09mmarczykI get the feeling that I won't be able to understand what my work flow might have looked like before after I start using one of these :-)
03:09Chousukegit add -p and magit let you do that if the chunk is too large
03:09RaynesIf you load an ns with a bunch of method definitions for a multimethods, and use remove-ns on it, are those methods still seen by the multimethod?
03:09Rayness/multimethods/multimethod/
03:09Chousukeyes.
03:10RaynesIs there anyway to make them disappear?
03:10RaynesI'd like to murder them with an axe.
03:10ChousukeI think multimethods have a java method fro that.
03:10mmarczyk,(doc remove-method)
03:10clojurebot"([multifn dispatch-val]); Removes the method of multimethod associated with dispatch-value."
03:10RaynesI'll check that out.
03:10Chousukeoh, right.
03:11RaynesWell, that would work.
03:11mmarczykdon't know of a way to remove them by ns, though
03:11RaynesA bit more tedious than I hoped, but it fit's in with my current plugin system.
03:11mmarczykor actually
03:12mmarczykyou could use
03:12RaynesBecause each plugin's set of commands are categorized in a command-map by the name of the plugin, so I can just iterate through the keys.
03:12mmarczyk,(doc methods)
03:12clojurebot"([multifn]); Given a multimethod, returns a map of dispatch values -> dispatch fns"
03:12ChousukeI suppose namespaces don't support watchers
03:12mmarczykthan check metadata on the fns
03:12mmarczykthen
03:12RaynesI thought the ns the methods are defined in wasn't put in metadata?
03:12RaynesI believe I asked about something similar a while back.
03:12mmarczykright :-(
03:12mmarczykoh bother
03:13mmarczykyou could try extracting their class names
03:13Chousukemeh
03:13mmarczykthey contain a mangled ns name
03:13Chousukejust have an explicit unload function for each plugin ;P
03:13mmarczykat this point I'm beginning to wonder if it's worth the trouble, though
03:13Chousukethat way you can also allow the plugin to do any teardown it might need.
03:13RaynesChousuke: I do, but right now, it isn't "true" unloading. Right now, all I do is remove the commands from the command list. And that actually works just fine.
03:14RaynesI'm just curious.
03:14RaynesEach plugin attaches an unload and load fn that does the right thing to the modules ref.
03:16RaynesIt unloads the commands (and the hooks when I'm finished with it tonight), but the ns and multimethods are still there. It's probably better that way anyway, but it's nice to know that there is a way to do what I was talking about with multimethods.
03:18LauJensenOk, 10.04 is burned and ready to be installed, later :)
03:20mmarczykgood luck :-)
03:21Raynesmmarczyk: I give him 3 hours before he is in here whining about bugs.
03:22RaynesOf course, I don't really have a choice, seeing as Canonical is obviously not in a hurry to get me my fix.
03:22mmarczyk:-)
03:23mmarczykno chance of some magazine bundling a cd?
03:25Raynesmmarczyk: Well, probably.
03:26RaynesI could just buy one and have it in like 3 days.
03:26RaynesBut then I'd still be waiting a month before I install it.
03:26RaynesBecause I'm a scared lolkitten, and I really do need to figure out how I'm going to backup my stuff OFF of the harddrive.
03:27mmarczykoh, ok
03:27RaynesOh wow. Irclj has more watchers than sexpbot.
03:27Raynes:o
03:27RaynesAnd you're one of them!!!
03:28Rayneshttp://github.com/Raynes/irclj/graphs/traffic You can see the spike in views from when you guys were playing with sexpbot once the new plugin system was introduced the other day.
03:28mmarczykyup, I'll brush up on irc-fu while reading Clojure, which is always nice :-)
03:29RaynesI don't promise standards compliance in Irclj. I just hacked it together in such a way that I could replace Pircbot in sexpbot very cleanly, and try to make it prettier to use.
03:29RaynesI need to look at the reference and make sure I'm doin' it rite.
03:29mmarczykthere's no way I'm interested enough to read any irc-related standards
03:29mmarczykbut reading your lib should be fun enough :-)
03:30mmarczykthen I might become interested in the standards just to see if it works as it should ;-)
03:30RaynesMy lib /works/ which is the most important thing. But, if people are actually ever going to use it, I need to make sure it's standard compliant (mostly).
03:30RaynesIn case, you know, hiredman uses it for clojurebot. ;)
03:30mmarczyk:-)
03:30RaynesWhen I started it, I really knew nil about IRC. I asked many questions in #botters and such.
03:31mmarczykthat's where I'm at now
03:31RaynesIrclj is good enough to power sexpbot on two different servers, so I'm content.
03:44LauJensenHmm
03:44LauJensenThe install took 20 minutes or so, but the first boot was like..5 - 6 seconds. I dont want to be untruthful in any way, but I think it was that fast or faster
03:44woobywb LauJensen, looks like at least networking is working!
03:45LauJensenthanks
03:45LauJensenI mean that was _really_ fast
03:46mmarczykLauJensen: now let's see if you can be equally fast to break it :-)
03:46LauJensenLike a type-hinted version of Ubunjure
03:46LauJensenmmarczyk: yea gimme a sec :)
03:47LauJensenDoes anybody have an oppinion on Chrome vs Chromium ?
03:48RaynesFirefox.
03:48LauJensenhehe
03:48LauJensenFirefox feels so 1980s now
03:48RaynesFFJure.
03:48RaynesSo does Hardy.
03:48LauJensenTrue
03:48RaynesYou, with your new fangled Lynx.
03:48mmarczykLauJensen: I'm more interested in Chrome vs. Opera :-)
03:48LauJensenI tried forcefully to go back to Firefox, using plugins to fill the backs - I just couldnt
03:49RaynesMe sitting here on dial-up with Hardy running on Wubi in a Vista installation.
03:49RaynesMight as well just stop programming completely and sink into the 30s.
03:49mmarczykwell, actually I'll be interested in that again when 10.5 appears on Linux
03:49LauJensenRaynes: Yea with your dad running the treadmill so you can get power
03:49RaynesIt's my cat running the treadmill.
03:49LauJensenI never found Opera remotely appealing, because of the lack of plugins
03:49vu3rddwhen you do (use '[] :only ()) isn't it strange that the vector does need quote but the list does not need it?
03:50LauJensen(:use [something]) or (use '[something])
03:50vu3rddyes, the former inside the ns
03:50LauJensenyes
03:50LauJensenthe latter on the ladder
03:50vu3rddok.
03:51LauJensenvu3rdd: But yea, the whole import,require,use,:use,refer stuff is still a bit confusing to me
03:51vu3rddyes, to me too. I keep looking at the docs or code every time I use it
03:52mmarczykLauJensen: well, there's user js for things like click-to-flash
03:52mmarczykbut there's no equivalent to rikaichan / rikaikun
03:52LauJensenmmarczyk: yes, and you can also modify the core in a hex-editor, but whats your point?
03:53mmarczykmy point is that all the things I used to use plugins for in FF (a ways back) or Chrome are done better in Opera out-of-the-box
03:54LauJensenok
03:54mmarczykbut of course I didn't intend that as an argument
03:54mmarczykas mentioned, I use rikaikun in Chrome -- no equivalent in Opera to that :-(
03:55LauJensenwill have to look that up
03:55mmarczykthere's no equivalent to the way in which Opera allows you to configure all keybindings etc.
03:55mmarczykthen carry that config around
03:56mmarczykplus I think its session manager is just about the best of those I've used
03:56LauJensenI would like to write a plugin for Chrome, so that it read my .emacs
03:56mmarczykrikaichan (FF) / rikaikun (Chrome) -- hover your cursor over a kanji to have a cartoon bubble with translations come up :-)
03:57mmarczykalso does clusters of consecutive kanji/kana
03:57mmarczykLauJensen: oh, please do :-D
03:58LauJensenLooking at your plugin, I must admit I have zero need of understanding Japanese and infact I would like suggest that we outlaw it
03:58AWizzArdMorning.
03:58mmarczykLauJensen: in that case I think you can't possibly have a valid reason not to use Opera, since that's the only worthwhile thing it doesn't have ;-)
03:58mmarczykAWizzArd: morning
03:58LauJensenok :)
03:59LauJensenJapanese is back in the game!
03:59LauJensenMorning Andre
03:59mmarczyk:-)
04:05LauJensenOk, ~18 seconds with all my packages installed
04:05LauJensen(I'll give Ubuntu a rest now)
04:08esjLauJensen: it is extremely nice
04:10mmarczykbtw, how would one go about setting up a small separate window for erc to send various notices to?
04:11mmarczykI've got them turned off so as not to have them clutter up the chat window, but if I could use a separate pane for them, that'd be cool
04:11LauJensenmmarczyk: depends a little on which level you're asking, but you need to hook ERC's events and then you can handle them like you want
04:11mmarczykI was hoping for an event received hook, yeah
04:12mmarczykalso, is there a standard hook for after joining a channel?
04:12LauJensenIf you search site:emacswiki.org you'll get demos for many hooks, though I cant claim to known them all, or even a fraction
04:12mmarczykyeah, tried doing that; maybe not dilligently enough
04:12LauJensen#emacs is always helpful
04:12mmarczykwill try again tonight
04:13mmarczykoh, good idea
04:13mmarczykthanks, I'll try that
04:13LauJensennp
04:22stilkov,(format "%" "please ignore")
04:22clojurebotjava.util.UnknownFormatConversionException: Conversion = '%'
04:22stilkov,(format "%s" "please ignore")
04:22clojurebot"please ignore"
04:24LauJensen stilkov: for non-general-interest stuff, I think you can actually query the bot
04:25stilkovLauJensen: sorry about that, you are right
04:25LauJensenits not a problem, just wanted to make sure you knew :)
04:46hircusis there a known problem with the latest leiningen? It just stops after "Copied :dev-dependencies"
05:36Licenserhmm I found something very odd:
05:37Licenser(. GridBagConstraints LINE_END) ; => 22
05:37Licenser(let [c GridBagConstraints] (. c LINE_END)) ; => No matching field found: LINE_END for class java.lang.Class
05:37Licenseris there some evil magic going on here?
05:41sidsLicenser: I believe . expects the literal class name. This should work: (let [c GridBagContraints] (eval `(. ~c LINE_END))
05:42RaynesYike.s
05:42Licenser*cries*
05:42RaynesYikes.*
05:42Licenserthakns you sids
05:43Licenserthis is more then horrible but it works
05:46Licenserthis is ugliish ugly so to say
05:47Licensergood greif
05:48mmarczyk,(require '[clojure.contrib.java :as java])
05:48clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/java__init.class or clojure/contrib/java.clj on classpath:
05:48mmarczyk,(require '[clojure.contrib.reflect :as reflect])
05:48clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/reflect__init.class or clojure/contrib/reflect.clj on classpath:
05:48mmarczykwutsitcalled
05:48mmarczyk,(require '[clojure.contrib.java-utils :as java])
05:48clojurebotnil
05:49mmarczyk,(let [c Integer] (java/wall-hack-method c 'MAX_VALUE c))
05:49clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: java-utils$wall-hack-method
05:49mmarczykhm, worked for me at a 1.2 repl
05:49mmarczykaaaah
05:49mmarczyk,(let [c Integer] (java/wall-hack-field c 'MAX_VALUE c))
05:49clojurebotjava.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
05:50mmarczykwell, that's likely clojurebot's sandboxing in action
05:51sidsmmarczyk: works on the 1.1 repl too
05:52mmarczyksids: right; sandboxing it is with the bot
05:52sidsbut it is (almost) as ugly as the eval solution
05:53mmarczykI'm considering taking issue with the notion that my reflective solution might not be the ugliest ;-)
05:53sids:)
05:55Licensersids: but it ets way less ugly when you concider that I do this in a mcaro and the conbination of `in ~ in ~ in ' and ~@ makes it a major PITA
05:56sidsLicenser: yeah, it'll start looking like perl!
05:56LicenserI don't even get it working since it's too silly :P
05:57Licenseror I am too stupid
05:57mmarczykgot a gist?
06:00Licenserhttp://gist.github.com/385022 L 32
06:00RaynesLicenser: You know, you can anchor to lines right?
06:01LicenserRaynes: not in gits
06:01Licenserat least not in this one, don't ask me why
06:01LicenserI tried it
06:01RaynesHuh.
06:01mmarczykChrome vs. line numbers on GitHub, the hopeless battle
06:01RaynesThat's odd.
06:01RaynesI thought you could.
06:01mmarczykoh, but fortunately they look fine this time
06:01Licensermmarczyk: nope safari
06:01AWizzArdHow can I open a repl in VimClojure?
06:01Licenserworked great iup to now
06:01mmarczykLicenser: I mean Chrome misplaces them and I'm using Chrome now
06:02mmarczykLicenser: nothing to do with anchoring
06:02Licenserheh
06:02Licenserah
06:02mmarczykso that's set-constraint!, right?
06:02Licenserit's wooooookring
06:02Licensermmarczyk: yea
06:02mmarczykoh :-)
06:02mmarczykok then
06:02Licenserhttp://gist.github.com/385022 is too
06:03mmarczykcool :-)
06:04mmarczykclj-swing ?
06:04Licensermmarczyk: yea working on that
06:05mmarczyka greatly promising name! :-)
06:05Licensermmarczyk: assuming I get it ever to work - yes :P
06:05RaynesI think you mean swingjure
06:05Raynes:p
06:05mmarczyk:-)
06:06Licensertried that, lein complained
06:06Licenserj/k
06:06LauJensenLicenser: use leinjure instead :)
06:06mmarczyk:-)
06:08LicenserI should rename the project to macro-madness
06:09_extermHey everybody, I just read through a bit of the swank-clojure repl startup code and don't quite understand it. It's this piece http://gist.github.com/385027
06:09_extermWhy is stop set to return true?
06:10_extermis the start-server bit executed for every call to the :read callback of the repl?
06:13mmarczyk_exterm: it would probably be user to try & answer if you posted a link to the relevant bit of swank-clojure's source in its natural context :-)
06:13mmarczykhttp://github.com/technomancy/swank-clojure/
06:13LauJensenwow that code looks old... (swap! stop (fn [_] true)) => (swap! stop (fn [] true)) => (reset! stop true)
06:14mmarczykhttp://github.com/technomancy/swank-clojure/blob/master/src/swank/swank.clj#L60
06:19sparievswank-clojure is probably the oldest third-party clojure code in the entire universe
06:20mmarczykwell it seems to me that this simply sends the server-starting expression back to the repl
06:20mmarczykand as soon as that's executed, it sends the exit form
06:21_extermah, that makes sense :-)
06:22mmarczykdoes it? oh good. I don't know how start-server is defined, so wouldn't know :-)
06:22mmarczyknow I'd be curious to find out why is a sensible thing to do
06:26LauJensenAll Emacers simple hit 'M-. start-server' in the REPL to find out how its defined
06:27mmarczykyeah, I could do that too
06:27mmarczykbut I'm too lazy to look it up on GH to post a link *and* open it in Emacs
06:29_extermhttp://github.com/technomancy/swank-clojure/blob/master/src/swank/swank.clj#L48
06:30mmarczykI think I'm going to write a function to come up with the GitHub link for a file in a repo cloned from GH :-)
06:30_exterm;-)
06:31mmarczyktogether with your suggestions re: Magit / Egg from earlier, that'll make for the ultimate source control bliss :-)
06:32mmarczyk_exterm: yup, noticed that ;-) but only followed to setup-server now
06:33mmarczykI can't believe this code :-)
06:35mmarczykLauJensen: does Emacs have something like C-o (in normal mode) for "jump back"?
06:40mmarczykM-* ! lovely :-)
06:40RaynesIf I have several maps with the same keys and each value is a different sequence, what would be the best way to turn {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}} into {:this [1 2 3 4 5 6]}?
06:42mmarczyk,{:this (reduce into (map #(:this (% 1)) {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}}))}
06:42clojurebot{:this [1 2 3 4 5 6]}
06:43RaynesCool.
06:43mmarczyk,(apply merge-with into (vals {:blah {:this [1 2 3]} :blah2 {:this [4 5 6]}}))
06:43clojurebot{:this [1 2 3 4 5 6]}
06:43mmarczykbetter :-)
06:43RaynesCooler.
06:43RaynesThanks.
06:43mmarczyknp
06:43RaynesDidn't know about merge-with.
06:43RaynesExactly what I was looking for.
06:44mmarczykperhaps concat would be more appropriate though
06:44_atommarczyk: with slime you can use M-. and M-,
06:44mmarczykif the seqs might not be all vectors
06:44mmarczyk_ato: lovely! thank you
06:48mmarczykhttp://code.google.com/p/wave-client-for-emacs/
06:48sexpbot" wave-client-for-emacs - Project Hosting on Google Code"
06:48mmarczykoh come on now!?
07:08rsynnottHey, does anyone know in what version protocols were added/will be added?
07:09hoeckrsynnott: 1.2
07:09rsynnottah, thanks
07:09hoeckwill be added in 1.2
07:11hoeckrsynnott: they are, it's big fun programming with them!
07:14bozhidarhoeck: good one :-)
07:16hoeckbozhidar: thats not from me, found it there: http://www.zazzle.com/clojure+programmers+have+more+fn+gifts
07:16sexpbot" Clojure Programmers Have More Fn T-Shirts, Clojure Programmers Have More Fn Gifts, Art, Posters, and more"
07:22bozhidarnice
07:33ivenkysStella.........................
07:33ivenkysoh i mean afternoon gents
07:37Raynesmmarczyk: Stop getting all the easy questions! :p
07:42Licenserso has anyone used clojure with swing a lot? I am looking for some code examples here
07:42Licenserand I don't mean the few blog posts out there that show some tutorial programs but seriouse code :P
07:43rsynnottLicenser: the blog posts with tutorial code should give you the general idea
07:43rsynnottafter that it should be rather like using swing with java, I would have thought
07:44Licenserrsynnott: I know, but my goal is not to use swing but to make a nice clojury wraper/lib for it
07:45Licenserso I can either do it on a theoretical base of 'what I think might be needed' or look at actual code and see how people use it - which I think is much more helpful
07:45rsynnotthmm
07:46rhudsonLicenser: I would imagine that Incanter does a lot of Swing
07:46LicenserI went through the blog posts already and harvested everything I could as usage cases there
07:46Licenser*peaks at incanter then*
07:48hoeckLicenser: whats the goal of your lib?
07:48Licenserhoeck: making it easy (I like that word a lot :P) to make clojure programs with a gui
07:48hoeckLicenser: do you aim at having a clojure-friendly way to do guis?
07:48Licenseryap
07:49hoeckwhat about apache pivot then?
07:49Licenserhoeck: I know you've this apache pivot lib but it requires an extra dependency and I am not entirely sure if pivot is good for desctop apps
07:49hoeckgot a nice clojure wrapper for it :)
07:50LicenserI know I know hoeck ^^
07:50hoeckokay, its currently limited to only one single host frame
07:50hoeckand its lacks good examples
07:52LicenserI've no idea what single host frames are o.O and examples are true :P I didn't find any
07:53rhudsonA few years back I did a fair bit of Swing using Jython. My recollection is that dynamic typing and first-class functions eases a lot of the pain of Swing.
07:54rhudsonA crucial aspect of keeping things sane with Swing is to somehow arrange that the tree structure of widgets be reflected in tree structure of code.
07:55rhudsonThat's my two bits -- not that USD0.25 gets you far these days.
07:57Licenserrhudson: this is what I got so far: https://gist.github.com/9e9fb363b502733a0e31
07:58Licenser(look at the very botton the two functions there are examples)
07:59rhudsonLooks good
08:00Licenser:)
08:03rhudsonI think it might be a bit clearer, though, if you had a list of components under frame -- e.g. lines 92--95 would be a separate form.
08:03rhudsonThat way it's easier to have separate functions to generate subassemblies.
08:04rhudsonBut maybe just judicious use of commas would do the trick.
08:08Licenser*looks at the lines*
08:09hamza,(drop (int 1/2) [1 2 3])
08:09clojurebot(1 2 3)
08:09hamza,(drop 1/2 [1 2 3])
08:09clojurebot(2 3)
08:09rhudsonThat button is at [1 1] ? It's probably better to be explicit about thata
08:09hamza^ is this expected or a bug?
08:10Licenserrhudson: my first attempt was to make that a single form but it turned out to be non functional since sadly the constrains are not related to the object but they have to be passed to the container when you add the child
08:10Licenserthe idae of this slowly changing of constraint is from stuart sierras blog
08:11rhudsonNot sure I like that idea...
08:12Licenserrhudson: neither am I :P hence my trying to find some input
08:13_atohamza: if it were a bug what would you expect to get instead?
08:13Licenserhttps://gist.github.com/e0c50ac49c001361cb84 was another attempt
08:13hamza[1 2 3] in both cases?
08:13rhudsonRight, the constraints are container args, so somethng like (add-to container :x 1 :y 1 (button ...))
08:14rhudson& then do you have something like (doto container ....) to add children
08:14_ato,(drop 3/2 [1 2 3])
08:14clojurebot(3)
08:14_ato,(drop 0.9 [1 2 3])
08:14clojurebot(2 3)
08:15Licenserrhudson: *nods* I thought about that too but that usually let you with a huge let around the whole code where you define your buttons/lables/boxes/fields etc then glue them together and I found that ugly
08:15hamza,(drop 0.4 [1 2 3])
08:15clojurebot(2 3)
08:15_ato,(drop (int 1/2) [1 2 3])
08:15clojurebot(1 2 3)
08:15_atoyeah, I guess it's a bug
08:16_atoalthough a lot of people might say that it's just invalid input
08:16Licenser,(drop (int 1) [1 2 3])
08:16clojurebot(2 3)
08:17_ato,(take 1/2 [1 2 3])
08:17clojurebot(1)
08:17_atoguess it's consistent with take at least
08:18jweissi didn't even know you could write a number as "1/2"
08:19_ato1/2 is the syntax for ratios
08:19_ato,(class 1/2)
08:19clojurebotclojure.lang.Ratio
08:19_ato,1/2
08:19clojurebot1/2
08:19ivenkyshow do you invoke the bot gents ..?
08:19_atojust write some code prepended with a comma
08:20hamza_ato: even if rounds i would expect 0.4 to work but that would still drop the first element.
08:20hamza,(drop 0.4 [1 2 3])
08:20clojurebot(2 3)
08:20_ato~def drop
08:21_atoit just checks pos? and decrements and recurses
08:21_atoso anything >= 1.0 will drop an element
08:25_ato I mean > 0.0
08:25ivenkys,( + 2 3)
08:25clojurebot5
08:25rhudsonLicenser: parting thought (breakfast time!): try looking at some of the XML-based layout DSLs (Pivot, JavaFX, Flex) as a model for defining some reasonable widget-tree macros.
08:26Licenserthanks for the advice rhudson and good breakfast
08:26rhudsonhave a great day
08:27Licensermm can I add a protocol to a java class? I guess not right?
08:29chouseryou can extend a protocol to a java class
08:40rhickeyso, in an effort to ease migration pains, I am thinking about different policies for conflicts when trying to refer to something in a ns. Right now it just throws and exception saying, already refers to XXX, but it could instead:
08:40rhickeygenerate a warning but take the latter
08:40rhickeyor
08:41rhickeyhaving conflict resolution like, 'core wins', also with a warning
08:42LauJensenOne thing I like about the current exception throwing, is that things gets fixed. I remember in CL I had a tendency to resolve it temporarily and then hack away, forgetting about it - Might just me be though :)
08:43Licenserhmm I think conflicts should throw exceptions, otherwise LauJensen is right, it will be forgotten
08:44cgrandrhickey: conlict resolution between several refered libs or between the namespace-being-defined and refered libs/core?
08:44Licenserbut perhaps make the exception a bite more expressive so
08:44rhickeycgrand: however the conflict occurs, not sensitive to context
08:45Licenserlike saying 'can't refer #clojure.controb.funky/do since #clojure.core/do already claims this' just in propper english :P
08:46chousera general "first one in wins" plus a warning should allow core fns to win (which seems right) and be a stable simple behavior people can rely on.
08:46rhickeyLicenser: something like that, although core-wins probably isn't going to work out
08:46rhickeychouser: the problem is, you have your own code wich uses 'foo' then core comes around with a new 'foo', can't be what you want
08:46Licenserwhat about something like (use '(clojure.contrib.funky :overwrite do)
08:47chouserrhickey: right, in which case you have to follow the same steps you would today
08:47rhickeychouser: then this isn't solving the upgrade-without-breaking problem
08:47chouserroll back to an old clojure, rename your 'foo' to something else, refer-clojure to exclude or rename core/foo ...
08:48chousernot completely, but it would help some.
08:48LicenserI thinkit is good to be very annoying about overwriting core stuff
08:48rhickeychouser: the goal is upgrade without breaking, one release, 'replaced' things stay there, deprecated
08:49LicenserI'm not sure if you can upgrade w/o breaking
08:50rhickeyso your build says 'overwriting core/foo', or 'overwriting core/shuffle' followed by 'deprecated contrib.seq/shuffle'
08:50cgrandrhickey: I guess that :added + :as-of doesn't satisfy you
08:50rhickeycgrand: still breaking in that you have to add that
08:51rhickeycgrand: I like :as-of, but it doesn't exist yet
08:51Licenserhmm how about this rule:
08:52Licenserclojure.core overwrite clojure.contrib, provate namespace overwrites clojure.core and of cause clojure.contrib
08:52Licenserso if I have a foo method I declare myself, I likely want to keep it the same, even if core gives me one too
08:52Licenserwe can live old functions in clojure.contrib since core overwrites them
08:52LauJensenrhickey: It seems you want to try and prevent breakage of something which should rightfully break, ie. I dont want my program to run if functions are being added in an uncontrolled manner
08:52Licenser:as-of 1.1.0 would give me the function of the 1.1.0 clojure?
08:52rhickeyLicenser: sometimes, in moving to core, semantics or return types might change slightly
08:53Licenserhmmm
08:53Licenserhmm hmmm
08:53cgrandrhickey: so you'd like existing 1.1 libs to work with 1.2 even in case of nameclashes? Then I guess it's "last wins" + warning
08:54LicenserI generally don't think breaking is bad so, since a lot of what changes really needs user attention but I'm uncertain about version stuff then, is clojure using that semver system because then it should not be 1.2 but 2.0
08:54rhickeycgrand: existing client code. Maybe forcing :as-of now is the last we'll have to break as we move forward. But :as-of still requires changes as things move or are renamed
08:55rhickeyLicenser: with semver Clojure will be up to version 20 in no time
08:55Licenserrhickey: you can call it done with version 42 then :P
08:56Licenserbut yes I undestand the issue, could have left it 0.* to be server free untll the API is stable but that won't have looked good
08:57Licenserbut when we don't have to follow semver with clojure break for good that at least forces people to update their stuff :P
08:57Licenserbut the :as-of stuff might be good
08:58Licensercould I do (require [some.other.lib :as-of 1.1.0 :as sol]) to by that forcing the whole require tree of some.other.lib into 1.1.0?
08:58Licenserif that works :as-of will solve a lot of problems
08:58Licenserthe worst problem I see are in non accessable 3rd party libs. If it is your code, you can go around and change it once it breaks if it is not your code, you can't
09:00rhickeycode that breaks c.c.seq :as seq ... seq/shuffle, if it's not there. use c.c.seq :only (shuffle), but that might become 'harmless if missing'
09:01rhudsonLicenser: one more thought: take a look at Groovy's SwingBuilder: http://groovy.codehaus.org/Swing+Builder
09:02sexpbot"Groovy - Swing Builder"
09:02Licenserrhudson: thank you I will
09:22cgrandmaybe leaving stubs for moved/renamed vars or having per ns an history of renames/moves :-/
09:24chouserrevision control systems are good at this kind of thing
09:25chouserperhaps "upgrade without breaking" is a false goal? There could be branch with bug fixes and non-breaking new features.
09:25rhickeychouser: yeah, and when people were pulling Clojure from svn we never had these problem - not ready, don't pull. Now we have maven shapshot hell
09:26powr-tocDoes anyone know how to get swank to use a ~/.user.clj file?
09:30Chousukerhickey: the git project has a policy that master is always stable and "breaking" development happens in a branch that actually gets rebased every once in a while. It might not work for Clojure but I think it's worth taking a look at how they do things.
09:30rhickeychouser: yes, could be unobtainable goal
09:31Chousukegit's commit log is always a pleasure to read too. It requires a lot of discipline to achieve such consistency though.
09:31rhickeyChousuke: that doesn't really solve the problem of breaking when moving to new version. People do want the new version, new features, not just bugfixes
09:32Chousukerhickey: right. I think git's pretty strict about maintaining backwards compatibility, but obviously in that regard it's not very comparable with Clojure.
09:32rhickeyIn this case, the breaking is largeley on the side of users of contrib. But the foo-added-to-core problem is core breaking you, not itself
09:34rhickeye.g. from the perspective of a user of core, it got shuffle added. Non-breaking. cgrand's :as-of idea would protect you if you had a shuffle of your own, as would last-one-wins-with-warning
09:34Licensercrazy idea
09:34Licensersince clojure code is just data, why not make a updateer :P
09:34Licenserwhen the reader notices that your code is for 1.1.0 it asks you if it should update it for 1.2.0
09:35Licensermight now work for every single peace of code (think eval and stuff) but for a lot
09:35chouserunfortunately, we still don't edit the code that is data
09:35_atoI guess last-one-wins it's how it's handled in python and ruby, you can redefine a core function, it won't even warn
09:36chouserwe edit text files that become data after relatively trivial rules are applied. Rules the lose important information like comments and spacing.
09:36Licenser_ato: well I like the warnings since it's bad charma to redefien core functions
09:36Chousukerhickey: so you could in a ns declaration specify which version of clojure core you're targeting and the :as-of metadata is checked and newer stuff in core is not imported/you get a warning? :/
09:36chouserthat lose
09:36rhickey_ato: this is not that, you aren't replacing the core thing in core, just in your view of the world
09:36Licenserchouser: noone will stop the reader to read comments and spacings too :P
09:37_extermclojure.core question: how does eval work? http://gist.github.com/385198 looks like an infinite recursion to me.
09:37Chousuke_exterm: that's not a call to the eval function
09:37_atorhickey: that too. put a "def dir(x): x" in a foo.py and do "from foo import *" from the repl, no warning, the one you get is the last you imported
09:38Chousuke_exterm: note the . form
09:38chouserLicenser: I'd be very pleased to see a sane solution for that, but I haven't thought of any. If you read a file that has 10 lines, all blank except a middle one that was the word "true" indented by 6 spaces, how is that read?
09:38Chousuke_exterm: it's calling the clojure.lang.Compiler/eval static method
09:38Licenserchouser: we've meta data here :)
09:38chouserLicenser: not on booleans
09:38chousernor on Booleans
09:38Licenserthen we add that :P
09:38Chousuke:P
09:39Chousukenot possible. sorry.
09:39_extermChousuke: really? I always thought that would be (. clojure.lang.Compiler eval form))
09:39chouserand even if we did, you want ^{:text-before "\n\n\n\n " :text-after "\n\n\n\n\n"} true !?
09:40_extermIsn't that evaluated with the innermost expression first?
09:40Chousuke_exterm: no.
09:40Chousuke_exterm: . is a special form
09:40chouser_exterm: that's old-style interop syntax.
09:40LicenserChousuke: of case make true a clojure.core.Boolean instead of a java.lang.Boolean
09:40ChousukeLicenser: that's not very neat.
09:40chouser_exterm: today we're write (Compiler/eval form)
09:40ChousukeLicenser: Clojure's interop is supposed to be wrapper-free :)
09:40chouserLicenser: I did say "sane" :-)
09:41powr-tocHmmm I'm using slime-connect to connect to a mvn clojure:swank, and I'd like it to automatically include my ~/.clojure/user.clj file on the classpath... does anyone know how to do this?
09:41Chousukeyou could of course write a special reader that returns whitespace elements as well.
09:41Licenser:P
09:41Licenserannotations? *dodges*
09:42_extermChousuke: thanks :-)
09:42chouserChousuke: hmm... said that way, it sounds interesting.
09:43Chousukechouser: it would be useful for many tools at least
09:43_atoso for python, introducing new core functions has been non-breaking, since if someone had defined their own (or pulled one in from an older lib), there's no problem, they just get that one. The changes they really worry about are new reserved words. On the other hand that does mean they could import two libraries and one would clobber the other
09:43_atowithout error
09:43Licenser*nods* smart idea
09:43chouserthe whitespace elements don't have to be strings. Could be objects that have the text, line number, file name, etc.
09:44chouserChousuke: then the "real" reader could actually take that output and strip out those extra objects.
09:44Chousukeor a reader that can be restarted. could eg. "parse" incomplete clojure code in an editor and instead of getting weird exceptions the thing could efficiently mark the code as faulty, and then remove the marking once it's completed.
09:45Chousukechouser: or you could just have two modes for the reader if you designed the thing well enough I suppose.
09:45chouserwhat about the whitespace and comments between metadata and its target. :-/
09:46Chousukeyou could return a metadata-element, whitespace-element, and the target-element
09:46LauJensenChousuke: You made it restartable ?
09:47ChousukeLauJensen: no. I did toy with the idea once but it's not very easy ;P
09:52cemerickstuarthalloway: how is your 1.2.0-SNAPSHOT version spec ever touching the 1.2.0-master-SNAPSHOT stuff at all?
09:52stuarthallowaydamn good question
09:53stuarthallowayif I specify the "and greater" form it finds master instead
09:53cemerickthat's odd
09:53stuarthallowaybut to spec
09:53cemerickoh really?
09:53stuarthallowaymaven does a string compare on the "qualifier" section of the version number
09:53_atoyeah, that's just the way maven compares version numbers
09:53stuarthallowayand the word "master" is > any number
09:54cemerickoh, right, I see
09:54stuarthallowaybut we shouldn't have two sets of artifacts anyway
09:54cemerickanother nail in the coffin of artifacts corresponding to git branches
09:54cemerickI'd strongly suggest blowing away the 1.2.0-master-SNAPSHOT dir
09:55stuarthallowaybut that is the one consistent with the name in clojure :-(
09:55_atough
09:55stuarthallowayno matter what I do I bet I break someone
09:55_atoplease don't break all the dependencies again
09:55chousercemerick: what should we do next time there's a branch with experimental changes that some people want?
09:55_atobad enough when contrib got renamed
09:55cemerickexcept no one, but no one should be using it
09:55_atowait until 1.3
09:56cemerickchouser: in that case, people should pull and build on their own
09:56cemerickThe activity of people on the bleeding edge should not leak out for everyone to see.
09:56cemerickAnd the maven artifacts are the touchpoint for the entire userbase.
09:56stuarthallowayit would be great if somebody wrote a 1-2 page "all the maven you need to know to be on the edge of project"
09:56chouserreally!? You're saying there should be no artifact id at all for such things?
09:57_atochange the artifactId instead of the version? clojure-with-awesome-feature-1.2-SNAPSHOT
09:57cemerickIf there is to be one, it should have a different project name, or live in a different repo.
09:57stuarthallowayI am perfectly happy with the *clojure* artifact names. They all have version and branch in them, and are consistent
09:58cemerickstuarthalloway: well, when it was 1.2-new-SNAPSHOT vs. 1.2-master-SNAPSHOT, that wasn't as nice.
09:58stuarthallowayat least you knew what you were getting
09:58_atobut I wasn't using version ranges
09:58cemerick_ato: but for people who didn't even know what new vs. master was, it was a big problem.
09:59Licenserwhy not clojure-SNAPSHOT?
09:59Licensererm 1.2-SNAPSOT
09:59Licensersorry
09:59cemerickLicenser: yeah, that's really what it should be IMO.
09:59stuarthallowayclojure isn't hurting anybody, and that would be a breaking change if we did it now
09:59Licenserthat is what I think since maven runs nuts with the -master thing I think
09:59cemerickstuarthalloway: right, for the future, I mean
10:00stuarthallowayso 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:01cemerickstuarthalloway: surely there are logs where one can see if anyone is actually asking for 1.2-master-SNAPSHOT updates?
10:01Licenseroi (instance nil ...) is a NPE
10:01AWizzArdWill the "parallel branch" of the repository work under JDK 7?
10:02cemerickAnd 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:02stuarthallowaydysinger (or someone else behind his company firewall) could
10:02stuarthallowayI was doing the research in the other direction: grabbing clojure projects and reading their pom.xml or project.clj files
10:03rhickeyto the extent these deps systems are unaware of the VCS systems they are just wrong
10:04rhickeyVCS is system of record, has concrete names for everything, knows what is derived from what else
10:04rhickeyno manual naming 'schemes', interpretation issues etc
10:04cemerickrhickey: except the entire notion of version numbers has a lot of friction with DVCSs, or git anyway.
10:04cemericksequential* version numbers, that is
10:05_atoclojars.org log shows 1676 hits for clojure-contrib/1.2.0-master-SNAPSHOT and 3315 for clojure-contrib/1.2.0-SNAPSHOT
10:05_atoin the last 5 days
10:05rhickeycemerick: still, git has names (hashes) and knows what is derived from what else, the problem is in requiring version numbers, not git
10:05Licenserso away with -master! :P
10:05cemerickrhickey: except the whole world uses sequential version number to identify concrete builds and relationships between them.
10:06rhickeycemerick: not anymore they don't
10:06cemerickoh?
10:06rhickeynot once using git
10:06Licenserif we write a own dependecy management system for clojure count me in!
10:06Licenserhence I'll even start writing it :P
10:06cemerickrhickey: as a user, I want clojure 1.2, not clojure 453feb12
10:06Licenserstuarthalloway: good man!
10:07LauJensenrhickey: 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:07rhickeycemerick: you can always tag 453feb42 as version 1.2, that would also be known to git
10:07LicenserI don't think those things are mutally exclusive
10:08rhickeycemerick: but saying, no one can use anything not such tagged is onerous
10:08rhickeyas we have knowledge about these things, just mvn doesn't
10:08rhickeymvn should ask git/VCS
10:08AWizzArdhmm, interesting point
10:09cemerickrhickey: 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:09cemericke.g. the 1.1-new vs. 1.1-master
10:09rhickeycemerick: but retelling things is like a game of telephone, totally lossy
10:10cemerickrhickey: what's the retelling, the specifying of a version number outside of a git hash or tag?
10:10rhickeycemerick: yeah
10:10cemerickhrm
10:10Licenserhmmm to make maven happy use clojure-new 1.2.0-SNAPSHOT?
10:11Licenseror even new/clojure which would be the best way I geuss
10:11cemerickrhickey: I think the alignment of the two (version number and git rev) only occurs in specific cases.
10:11rhickeyalso, 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:11cemerickrhickey: heh; sorta like "I didn't have this oil change problem when I used a horse!" ;-)
10:12rhickeycemerick: not at all like that
10:12Licenserhmm perhaps rhickey was happyer with his horse?
10:12rhickeywe waste much more time on this stuff now than before maven solved our dependency problem
10:13LauJensenrhickey: Do you see an alternative to Maven which would rid us of these problems?
10:13Licenserhmm the only reason we have maven is the java world uses it right?
10:13cemerickrhickey: 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:15Licenserwell 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_atowe 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:15cemerickoy
10:15rhickeycemerick: 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:15BorkdudeAh, a German book on Clojure? http://bit.ly/dqWoBp
10:16sexpbot"Clojure: Einführung und Praxis: Amazon.de: Stefan Kamphausen, Tim Oliver Kaiser: Bücher"
10:16cemerickrhickey: who's having a harder time following clojure dev?
10:17rhickeycemerick: everyone with snapshot in their deps, who get things they aren't ready for?
10:17AWizzArdSince the switch to maven I am using build.clojure.org
10:18cemerickrhickey: There's mechanisms for controlling how and when you get new snapshot builds. *shrug*
10:18rhickeycemerick: documented where?
10:18Licenserrhickey: but does not people who have snapshots in their deps help the dev team find real world issues?
10:19wlangstrothLicenser: I don't know if using a snapshot with "real world" stuff would be advisable
10:19_atoyou 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:19cemerickrhickey: http://mojo.codehaus.org/versions-maven-plugin/lock-snapshots-mojo.html
10:19sexpbot"Versions Maven Plugin - versions:lock-snapshots"
10:19Licenserwlangstroth: don't mistake real world with production
10:19cemerickDoesn't help people using lein, but I don't have suggestions there.
10:19wlangstrothLicenser: ah, okay
10:20cemerickI locked my clojure and contrib snapshots to a build from Tuesday when I saw the big changes coming down the pike.
10:20rhickeycemerick: that page is completely meaningless to me
10:20cemerickrhickey: I doubt you're its intended target.
10:20_atoand to me
10:20AWizzArdwlangstroth: 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:21Licenserbut wlangstroth while I trust the dev team a lot, 100 coders see more then 10, it's a fact.
10:21cemerickrhickey: 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:22rhickeycemerick: but if the answers to these problems are pages like that, they remain problems
10:22wlangstrothAWizzArd: 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_atocemerick: 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:23rhickeycemerick: learn maven to use clojure is just as bad as learn emacs to use clojure, a hurdle
10:23Licenserwlangstroth: but using stable isn't much different when the crowd does not use the snapshot builds
10:23cemerickrhickey: I humbly submit that that page is well understood outside of this channel.
10:23_atooh.. does it use the one from your local repo?
10:23mefestoseems 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:23LicenserI mean that Rich releases it as stable is also 'just' him releasing something
10:23rhickeycemerick: as are emacs-isms amongst its fans
10:24cemerickrhickey: 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:24cemerickThose who don't like mvn can download a jar or build from source as they like.
10:24cemerickInventing or proposing to invent yet another system for this problem is the worst possible reaction.
10:25_atoheh
10:25cemerick_ato: no, it takes the current concrete SNAPSHOT you're depending upon, and writes that into the POM
10:25rhickeycemerick: 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:25Licensercemerick: you don't need to learn is true but if you dont 't lean it you'll experience lots of lots of pain
10:25wlangstrothto 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:25rhickeycemerick: build clojure from source and use with a lib that has a clojure dep, easy and obvious?
10:25cemerickrhickey: pull from github and build or download a jar?
10:25LauJensenWhat is this pain that new-comers feel when digging into Clojure?
10:25Licenserwlangstroth: you'll like lein-add then :P
10:26LauJensen(re: maven that is)
10:26mefestoimo, maven is overkill for many things
10:26rhickeycemerick: it wasn't obvious to me how to use even contrib with clojure from source
10:26LicenserLauJensen: yes it is
10:26LauJensenLicenser: not a yes/no question, WHAT is the pain?
10:26Licenserthe yes was meant to your response suggestion
10:26LauJensenBecause 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:27Licenserbut if we stick to maven we should follow it's rules so no 1.2-master-SNAPSHOT :P
10:27cemerickrhickey: 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:28LauJensenWhen we first configured clojureql with ant, that was a really painful experience that I wont soon forget
10:28wlangstrothcemerick: ant is pretty comfortable for people who are used to configure/make/make install
10:28cemerickAre 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:28wlangstrothbut are there that many of us?
10:29cemerickwlangstroth: right, I think that's the key question
10:29Licensercemerick: you haven't heared my rants about maven yet do you? :P
10:29cemerickLicenser: believe me, I hear plenty of rants :-)
10:29Licensergood good
10:29BorkdudeI like lein, but it needs easier Windows support and maybe some more intelligence for deleting old jars
10:29BorkdudeAnd Maven, I didn't have to learn it to use clojure, since I have lein
10:29chouserfor our "production" env we build our own clojure and contrib from specific git sha's.
10:30pjstadigthere is always a period of adjustment when learning a new language
10:30pjstadigwhether build tools, or idioms, or syntax
10:30Licenserpjstadig: of cause but that periode should focus around the language not about some third party tool
10:30LauJensenchouser: which system controls that ?
10:30cemerickchouser: we did that until very recently. I got tired of it.
10:30Licenserand I've needed more time to get used to maven then to get used to clojure to be frank
10:30chouserno unexpected breakage, no need to predict "big changes coming down the pike", no particular need to use a release version of anything.
10:30wlangstrothcemerick: haha - certainly maven isn't a barrier to entry
10:31pjstadigLicenser: that's the question, which potential new users are a target for clojure, and how can the transition be made simplest for them
10:31Licenserwlangstroth: 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:31chouserLauJensen: 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:31pjstadigyou can't be everything to everyone
10:31wlangstrothcemerick: ... but I can understand if people find it a pain in the ass
10:32LauJensenchouser: so 'rebuild' means manually running ant/maven ?
10:32cemerickwlangstroth: I can too, absolutely.
10:32chouserno
10:32wlangstrothLicenser: we're just going to get you going, here, aren't we?
10:32chousermake :-)
10:32pjstadigyou 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:32Licenserwlangstroth: yea maven is my new arch nenemis since clojure took java away from me
10:33foguschouser: Sounds like you've adopted my build system. :p
10:33wlangstrothLicenser: it's true that it would be nice to have a build/dependency tool that is to maven what Clojure is to Java
10:33Licenser*nods* yes it would
10:33chousermy 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:33Licenserand I think lein is a start in that direction, it shields you from a lot maven of maven I think
10:34pjstadigi have a theory that there's a philosophical underpinning (or worldview) to each language
10:34cemerickwlangstroth: wouldn't that roughly be the lowest-value project in the world? Yet another build system?
10:34pjstadigeither you have to learn to accept that worldview
10:34pjstadigor realize that it's different than yours, irreconcilable, and move on to something else
10:34Licenserpjstadig: and you might e right
10:34pjstadigi'll write a book
10:34cemerickThis is a social problem way, way, way more than it is a technical one.
10:34Licenserbut I din't think maven matches clojures philosophy
10:34foguspjstadig: What's the Ruby worldview?
10:34wlangstrothcemerick: 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:35pjstadigfogus: still needs more research, but i'd like to do a presentation on it to capclug
10:35Licenserfogus: one of them is
10:35rhickeycemerick: 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:35Licenser'it does what you expect'
10:35pjstadigperl of course is "there's more than one way to do it"
10:35Licenserone I like a lot :P and clojure has a lot of that too
10:35cemerickrhickey: what do you mean by "tie maven to..."?
10:35foguspjstadig: Would love to see it
10:35pjstadigruby is probably "programming should be a joy" or something like that
10:35rhickeycemerick: make maven use
10:35pjstadigi think Matz has said something to that effect
10:35cemerickoh, I see
10:35Borkdudepjstadig: you mean that builds should be immutable in clojure? ;-)
10:36pjstadighehe
10:36pjstadiga build is a value
10:36pjstadigyou need an identity to refer to that value
10:36pjstadiggit tag "1.2" is identity referring to git hash "3df65" as value
10:36chousernooo
10:36stuartsierrarhickey: I've tied maven builds to particular commits by looking at the reports on build.clojure.org
10:37chouserthat would mean "1.2" could mean something else later.
10:37_atoheh 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:37cemerickrhickey: 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:37rhickeystuartsierra: sounds tedious
10:37pjstadigchouser: good point
10:37stuartsierrarhickey: mostly I just let it track the current snapshot
10:37cemerickUnfortunately, it looks like the clojure and contrib maven deployments don't do that.
10:38Licenserhmm but depending on git hashes means also that we depend on git, is that good or bad?
10:38chouseris there not a maven plugin to allow fetching and building specific sha's from a git repo?
10:38rhickeycemerick: and how do you leverage that? manual search?
10:38cemerickchouser: yes, the release plugin. Generally not a userland sort of tool.
10:38_atolein inserts the git hash into poms when it generates them. The new version of the clojars UI I'm working on exposes this
10:38chousercemerick: why's that?
10:38pjstadiganyway i do think that using maven as a build tool is somewhat counter to clojure's philosophy, but that's just MHO
10:38wlangstroth_ato: sweet!
10:39cemerickrhickey: repositories like nexus allow you to search POMs in a variety of ways, including by tag/ref/sha
10:39Licenser(inc pjstadig)
10:39rhickeycemerick: do we have nexus?
10:39pjstadigfor one thing, because the vision for clojure is multi platform language, and maven seems to be a very java solution
10:39cemerickrhickey: no, the clojure repos are using hudson, which is essentially just apache sitting on top of its local repo, I believe.
10:40rhickeysigh
10:40cemericktechnomancy and I talked about future paths for clojure repos last week. FWIW, sonatype offers free nexus hosting for any open source project
10:41cemerick...with a red carpet into central, which is nice
10:41cemerickI don't know what he thought of any of that. :-)
10:42pjstadiganyway compatibility with maven *repos* is brilliant
10:42_atothis is what nexus looks like, btw, for those unfamiliar with it: http://repository.sonatype.org/
10:42sexpbot"Sonatype Nexus Maven Repository Manager"
10:42pjstadigbut that's something like hosting on the jvm, but not being java
10:42Leafwcemerick: 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:43cemerickLeafw: the build configuration is absolutely simpler. stuartsierra can talk more about the details.
10:43_atoI 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:43cemerickLeafw: No such thing as a "simple shell script", BTW, since they're all different.
10:43LauJensen_ato: Nexus looks really nice, but searching out Clojure and clicking it returns a 404 :\
10:44stuartsierraLeafw, cemerick: Switching the contrib build from Ant to Maven made it dramatically simpler.
10:44stuartsierraIt also exposed some subtle bugs resulting from implicit assumptions about order of compilation, which were fixed.
10:44cemerickit's true, the contrib build has a certain flair now
10:45LicenserLeafw: I think with lein things got quite a bit better.
10:45cemerick;-)
10:45chousercontrib 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:45stuartsierraMaven only helps Maven users, it's true.
10:45LauJensenchouser: Can you elaborate on how exactly in complicated things?
10:45rhickeychouser: ditto
10:45pjstadignot meaning to open up closed discussions about maven, and personally i've never really had a horrible time with maven
10:46rhickeyalso it's one ugly build now, lots of nonsense spewed
10:46_atoI think the only people it helped were SS and cemerick ;-)
10:46liebkeI 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:46rhickeyno sources to compile..., no test to run
10:46LeafwI 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:47chouserLauJensen: 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:47rhickeyTests run: 0, Failures: 0, Errors: 0, Skipped: 0
10:47rhickeyRan 354 tests containing 1242 assertions.
10:47rhickey0 failures, 0 errors.
10:47LicenserWell, maven is better then nothing at all. But I am sure it could still get a lot better
10:47stuartsierrarhickey: Ugliness of debugging output should not be a consideration.
10:47cemerickrhickey: surely that's not a material issue.
10:47_atoha
10:48_atoit sure is
10:48Licenserstuartsierra: I think it should, just not the first one.
10:48pjstadigthere's a lot of silliness in our maven build at sonian, but it think it is mostly related to living on snapshots
10:48_atothat sort of thing puts off new users
10:48_atothere's a reason ruby has had such a high take up
10:48_atobecause they put energy into usability
10:48stuartsierraRuby is also bug-ridden and dead slow.
10:48_atoyes
10:48_atobut still popular
10:48stuartsierraSpeaking as a fan.
10:48_atobecause of the usability
10:48Licenserbut tons if people use it
10:49Licenserstuartsierra: also thanks for the great posts of swing and clojure :)
10:50stuartsierraLicenser: you're welcome
10:51wlangstrothRuby is popular because of rails - easy, generic intranet sites (which are my money-maker, so I can understand the appeal)
10:53wthiddenQ: How can i test that a symbol references an atom?
10:54chouser(instance? clojure.lang.Atom x)
10:54wthiddenthank you.. I must be brain dead today.
10:55chouserhasn't always worked. atom early on didn't have it's own classname, iirc.
10:56wthiddengood to know.. I do like moving from defstruct -> defrecord there are nice class names
10:57_atorhickey: 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_atoto 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:58stuartsierraDependency and build management are not a simple problems.
10:58_atoI agree
10:58LauJensenWell, Im not convinced that they need to be complex problems either
10:58stuartsierraI aim.
10:59stuartsierraam
10:59chousermaybe we can use maven in a better way
10:59cemerickLauJensen: the history of build systems seems to indicate that they are.
10:59LauJensen10 years from now, we'll look back and ponder why we made it so hard
10:59stuartsierrachouser: how so?
10:59LauJensencemerick: ditto the history of many other things which are now simple
10:59stuartsierraLauJensen: 10 years ago, we were writing Makefiles
11:00pjstadigcode reuse is not a simple problem
11:00_atoI 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:00chouserwell, I'm not really sufficiently informed to say. What about including git sha's in the builds available on build.clojure.org?
11:00_atoInteroperability is important
11:00pjstadigmy software engineering professor did his PhD on the subject
11:00wlangstrothwere makefiles so bad? Oh, wait ...
11:00cemerickchouser: oh, please no, no.
11:00_atoBut I dislike decisions to stick with a system that sucks, just because it's popular
11:00cemerickversion numbers *are* sequential. SHAs are not.
11:01_atoYou can still interoperate with it, without being it
11:01pjstadigchanging interfaces and implementations, and the couplings between modules get sticky pretty quick
11:01chouserthe version number sequence is a lie
11:01stuartsierracemerick, chouser: yes
11:01drewrcemerick: YYYYMMDD-HHMMSS-<SHORTENED SHA> works very well
11:01chouserversion number builds could be made available as well
11:02cemerick_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:02chouserbut wouldn't this do away with the unlocked snapshot situation that causes undesirable breakage for maven and lein consumers of clojure+contrib?
11:03stuartsierrachouser: you can already peg maven builds to particular snapshots
11:03pjstadigi 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:03stuartsierrayou can even automate the process of locking & unlocking snapshots
11:03LauJensenstuartsierra: So what exactly are the conditions for breakage ?
11:03stuartsierrabreaking what?
11:04cemerickstuartsierra: 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:04stuartsierracemerick: Yeah, I know. Ooh, more XML, run away...
11:04LauJensenstuartsierra: 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:05chouserstuartsierra: so why are people complaining about changes in clojure breaking things?
11:05chouseroops, lunch. gotta go, sorry.
11:05cemerickchouser: because people (ab)use snapshots as actual releases.
11:06stuartsierrachouser: what cemerick said
11:06LauJensencemerick: beacuse they cant easily point to shas ?
11:06chouserso they're misusing maven?
11:06cemerickLauJensen: no one pointing at 1.2-SNAPSHOT cares or knows a whit about SHAs
11:06cemerickchouser: yes, or not using maven, or not familiar with the semantics of SNAPSHOT
11:07LauJensenI expect mostly the latter
11:07stuartsierrayes
11:07chouserbut you can't lock maven to a git version, right? just a snapshot date?
11:07stuartsierrachouser: correct
11:07cemerickchouser: insofar as you're using version numbers, yes
11:07wlangstrothwell yeah, people tagging SNAPSHOT on the end just want the latest to test, don't they?
11:07chouseror "don't" rather than "can't" anyway.
11:07chousersee, so that's a failure of maven to provide the right way.
11:08cemerickif you're absuing SHAs as version numbers, then you've gone astray in a variety of ways anyway
11:08cemerickchouser: totally disagree
11:08chouserand then an education issue of people using maven in ways other than the nearly-right way.
11:08chouserok, really going now. :-)
11:08stuartsierrachouser: Maven predates Git by years.
11:08stuartsierraAnd who says using SHAs as snapshot ID's is correct?
11:08cemerickSHAs 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:09cemerickstuartsierra: no one, but that's viewed as convenient and obvious.
11:09LauJensenstuartsierra: I think it sounds like a good idea, and a solution to the problem
11:09_atosnaphot dates aren't version numbers in that sense either
11:09pjstadigsha'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:09cemerick_ato: they are sequential, and the relationship between two concrete snapshot versions is obvious.
11:09LauJensenIt just gives me a way to get a 'stable' feel out of a current snapshot
11:10LauJensencemerick: yea thats the one problem with hashs, then dont sync well
11:10_atocode isn't sequential though when you have branches
11:10wlangstrothdidn't someone above post YYYYMMDD-HHMMSS-sha for a low-trouble solution?
11:10_atoso there's a semantic mismatch there
11:11_atowhich might have been Rich's point about subversion
11:11LauJensenwlangstroth: yea, but how do you look at clojure's hash, and contribs, and then figure out which 2 go together?
11:11_atoI'm not sure I entirely understoof that
11:11cemerick_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:11wlangstrothLauJensen: fair enough.
11:11LauJensencemerick: They need to be distributed though
11:11drewrLauJensen: each pom specifies the dependency's version it expects
11:12cemerickLauJensen: 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_atoI 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:13stuartsierra_ato: yes
11:13dnolenso 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:13stuartsierradnolen: but the APIs are not stabel
11:13cemerickdnolen: that's called a release :-)
11:13LauJensencemerick: Agreed, but 'new' doesnt tell me anything, then it should be '1.1-dev-0.1'
11:13stuartsierra'new' was a bad branch name
11:13_atothe reason everyone's using snapshots is because there are features they really desire that haven't been released
11:14cemerickLauJensen: I think that would still get caught up in the versioning range that stuarthalloway got tripped up with.
11:14wlangstrothLauJensen: that was the original issue, wasn't it? 1.1-dev-0.1.1, etc
11:14pjstadigi don't think one needs to apologize for breaking a build that lives on snapshots
11:15cemerickpjstadig: uh-huh
11:15pjstadighowever the fact that so many people seem to be living on snapshots might indicate a more fundamental problem
11:15pjstadigrelease early, release often
11:15pjstadig:-/
11:15cemerickpjstadig: nah, you can't pin that behaviour on the authors of a lib.
11:15pjstadigbut then again you don't want to release features that have a high probability of changing
11:15_atoperhaps we should throw away snapshots and instead have frequent, properly numbered development releases which aren't guranteeed backwards-compatible
11:15_atoeg an odd / even numbering scheme
11:16stuartsierra_ato: I've wondered about that too
11:16cemerick_ato: you think people will understand that better than an all-caps SNAPSHOT qualifier? ;-)
11:16wlangstroth_ato: what, like the linux kernel?
11:16cemerickThe funny/sad thing is that there isn't actually a problem to be solved here.
11:17wlangstrothcemerick: hehe - we've come full circle
11:17_atoa social problem is still a problem
11:17_atoa problem of education is still a problem
11:17stuartsierraProgrammers can't solve social problems.
11:17cemerickRight. RTFM is a meta issue.
11:17stuartsierraAnd should be banned from trying.
11:18wlangstrothhaha - may I quote you?
11:18LauJensenstuartsierra: cemerick: How do I target a specific contrib/clojure pair using maven ?
11:18wlangstroth(both)
11:18_atowlangstroth: yes. Interesting the linux kernel earlier had an odd/even model and has now moved to just regular releases
11:18_atobut part of the reason they can now do regular releases is they're a mature project
11:18cemerickLauJensen: Use concrete snapshot version numbers, like 1.2.0-20100427.160337-80
11:18cemerick(which is what I'm using for contrib right now)
11:18stuartsierrawhich you can find on build.clojure.org
11:19LauJensenok, and both repos carry the exact same suffix?
11:19stuartsierrano
11:19stuartsierrabut the pages detailing the builds are cross-linked
11:19_atoLauJensen: the same applies to lein and all the other tools. Just don't use "-SNAPSHOT" and you'll be happy
11:19cemerickor, you find the version of cloure you want, note the timestamp, and the take the version of contrib that immediately follows that timestamp
11:20cemerickstuartsierra's way is surely easier tho
11:20LauJensenstuartsierra: looking at build.clojure.org its not clear which version goes with which
11:20stuartsierrae.g. http://build.clojure.org/job/clojure-contrib/101/ (build #101) contains link to clojure build #111
11:20sexpbot"clojure-contrib #101 [Hudson]"
11:21LauJensenAh like that
11:21LauJensenOkay - That doesn't seem very tricky actually
11:21LauJensenThanks guys :)
11:21stuartsierrayou're welcome
11:22LauJensenNow if only we could figure out a way to prevent Halloway from breaking it, we'd be all set for primetime :)
11:22stuartsierraheh
11:22cemerickut-oh, that sounded remarkably like a maven success story ;-)
11:22LauJensen(j/k stuarthalloway)
11:22stuarthallowayI am breaking all sorts of stuff today
11:22stuarthallowayhttps://www.assembla.com/spaces/clojure/tickets/328-don-t-assume-chunked-seq-will-alway-stay-chunked
11:22sexpbot"#328 - don't assume chunked seq will alway stay chunked (Test) | Clojure | Assembla"
11:22stuartsierracemerick: It would be nice if we could get Hudson to report the actual SNAPSHOT version number on the build page.
11:23wlangstrothcemerick: that was a paper-and-pencil success story
11:23cemerickwlangstroth: that was a joke, there, son! :-)
11:24cemerickstuartsierra: Maybe there's a plugin. I'm not up on my hudson/maven integration fu.
11:24stuartsierrame neither
11:25wlangstrothcemerick: yes. yes it was.
11:25LauJensenBut 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:25cemerickLauJensen: bingo
11:26cemerickThat's why it's a social problem.
11:26LauJensenOf course I could make an emacs-plugin which solves it quite easily..... :P
11:26wlangstrothfriggin' emacs
11:27LauJensenGotta jet, good weekend to all
11:27wlangstrothpoverty? emacs has a plug-in for that. World peace? yup.
11:27stuartsierraCTAN, CPAN, Rubygems, Eggs, PEAR, Maven, apt: I have never seen a software distribution system that doesn't cause aggravation.
11:28avarUsually it's not the fault of the distribution system
11:28stuartsierramisuse, then?
11:28avarunfamiliarity, blaming the inevitable broken *package* on the distribution system
11:29avarconfusing a sucky distribution system with one sucky client, etc :)
11:29wlangstrothstuartsierra: this is starting to feel like "you remind me of a man. What man? The man with the power ..."
11:29stuartsierratrue enough
11:29stuartsierraanyway, I'm tired of rehashing this argument. later
11:32rhickeyI'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:34stuarthallowayrhickey: please approve 328
11:34rhickeystuarthalloway: done
11:38stuarthalloway...and pushed
11:40Licenserdo destract you people from your worries: http://xkcd.com/734/
11:40sexpbot"xkcd: Outbreak"
11:40patrickdloganclojure'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:43rhickeypatrickdlogan: you should be able to, yes
11:48arkahna 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:49arkahnsorry - this instead: (apply vector (map (fn [_] (ref (struct cell 0 0))) (range dim)) ))
11:50arkahnwith a (def dim 80)
11:51arkahn... or maybe I just need to go off and learn more functional programming style ; )
11:52patrickdloganrhickey: great - thx, worked like a charm.
11:53hiredmanarkahn: what other looping mechanism?
11:54Chousukearkahn: why do you need a vector of refs instead of a ref containing a vector?
11:54hiredmanto be fair I think I would prefer (take dim (repeatedly #(ref (struct cell 0 0))))
11:54Chousukearkahn: generally speaking, the more refs you have, the more trouble there will be managing all of them :)
11:55arkahnChousuke: the refs were needed as part of a larger example on concurrency - the rest of the program (and programming) goal call for refs
11:56arkahnhiredman: 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:56Chousukeanyway, I'd go with (vec (for [n (range 80)] (ref (struct cell 0 0))))
11:57Chousukebut there are many options
11:57hiredmanarkahn: "loops" in clojure are almost always expressed as opertaions over a sequence of values
11:57arkahnI guess those two examples look better to me - thank you
11:57hiredmannot loops
11:57hiredmanclojure has a while, but it is not a loop
11:57arkahnright - I agree there
11:57Chousukeyeah. explicit looping is nonidiomatic
11:57hiredmanfor is not a loop
11:58Chousukewhile is a loop but it's not very useful unless you have side-effects :P
11:59hiredmanclojure has a 'loop' which is strictly speaking a loop
11:59DeusExPikachuthe character ! is used to denote functions that change state and the character ? for predicates, anyone use characters to denote I/O?
11:59hiredmanbut if the jvm had tail calls it wouldn't need to be
12:00ChousukeDeusExPikachu: ! works for IO too
12:00ChousukeDeusExPikachu: though it might be redundant if the IOness is obvious
12:01hiredman,(doc io!)
12:01clojurebot"([& 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:02arkahnit 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:02Chousukearkahn: it's probably just the most different
12:02Chousukeof those languages, javascript is probably closest
12:03arkahnChousuke: 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:03Chousukeheh
12:03DeusExPikachuin symbol names, what's + used for?
12:04Chousukelike +foo+?
12:04DeusExPikachuChousuke, yeah
12:04Chousukeit's a CL convention for constants
12:04DeusExPikachuk
12:04Chousukelargely redundant in Clojure
12:04Chousukejust use "foo"
12:05replacastuarthalloway: should we have :added at the namespace level as well? (Autodoc will support it)
12:06hiredmanthe var stuff in the json contrib api index is still blank
12:07replacahiredman: yeah, it's on the list - I've gotten sidetracked with some other stuff
12:07replacasorry about the delay
12:07hiredmanoh no, if you are busy you are busy
12:09replacahiredman: just a short push to get pprint into 1.2 and a couple of other 1.2 things
12:10replacahiredman: 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:10hiredmanok
12:12wlangstrotharohner: it's a slippery slope
12:12arohnermy 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:12replacaarohner: try using ant, then you'll be in two hells at once
12:12wlangstrothhaha
12:13arohnerif I manually delete the older swank-clojure, everything works
12:13arohnerif not, slime is broken
12:13arohnerbut lein-swank doesn't need to be updated at all for swank-clojure 1.2, except to specify its dependency
12:14hiredmanarohner: you can remove the explicit dependency, or you can tell lein to ignore swank from lein-swank
12:14arohnerhiredman: how do I do the second?
12:14arohneroh, :exclusions
12:15_ato[leiningen/lein-swank "1.1.0" :exclusions [swank-clojure]]
12:15_atoyep
12:16arohnerhiredman, _ato: thanks
12:17arohneris it ever a good idea to have two versions of the same library in your classpath?
12:18cemericknope
12:19wlangstrotharohner: that's like hitting yourself
12:19arohnerI'm wondering if lein should detect that, and warn / throw
12:20replacawlangstroth: 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:21wlangstrothreplace: cool, thanks
12:21wlangstrothreplaca: ^
12:25replacawlangstroth: np
12:26Licenserhmm can I use macros in a doto?
12:27hiredmandepends on what macros expand to
12:27hiredman,(doto 1 (-> .toString println))
12:27clojurebot1
12:27Licenserah okay so they get expanded before the stuff gets inserted
12:27clojurebot1
12:27hiredmannope
12:28Licenserah okay then I should be able to put the macros in as long as they take the object as the first argument :)
12:28hiredmanjust like any other use of doto
12:28Licenserokay coolish :D
12:38stuarthallowayreplaca: added at namespace level sounds good to me
12:38abedratechnomancy: I ended up just sending a pull request over yesterday on -stable for the lein test exit code fixes
12:42replacacool - I just implemented the autodoc side code
12:42replaca(or most of it)
13:03cemerickyuck, (str record-instance) returns classname@id
13:04cemerickis the pr behaviour going to get roped into defrecord's .toString()?
13:10cemerickouch; is this expected? https://gist.github.com/31c64ee18cb631e3b54e
13:11cemerickI presume that result is coming from the map impl in the generated record class, but...
13:12cemerickrhickey: ^^
13:16headiuscemerick: what's defrecord btw?
13:16cemerickheadius: http://clojure.org/datatypes
13:17headiusinteresting
13:18headiusis that something you could feed to e.g. Hibernate as a model's data object?
13:18cemerickhrm, perhaps
13:18cemerickmight need a few annotations, though you can do that now too
13:19cemerickheh, it gets even sillier: https://gist.github.com/31c64ee18cb631e3b54e :-P
13:20Chousuke... what?
13:22krumholt,(doc defrecord)
13:22clojurebotGabh mo leithscéal?
13:22krumholt,(clojure-version)
13:22clojurebot"1.1.0-master-SNAPSHOT"
13:23headiusdefrecord seems to fit the niche of Struct in ruby
13:23headiusI wonder if we should be making Struct construct a real Java class
13:29chouserha! I lied. Or rather, I was only talking about work when I said "production"
13:29chouserthe clojure-log is out of date. Caused by: java.lang.IllegalAccessError: reductions is not public
13:30leifwargh clj-processing keeps crashing X
13:30leifwthis is infuriating
13:30chouserthere, delete one line, all fixed.
13:30rhudsonchouser: you fixed clojure-log?
13:31chouserrhudson: yes
13:31rhudson... or the defrecord issue?
13:31rhudsonthanks!
13:31chouserhttp://clojure-log.n01se.net/ is running agin
13:31chouseragain
13:31sexpbot"#clojure log - Apr 30 2010"
13:35stuarthallowayheadius: if you make a real java class, look to the classloader madness you will need to do
13:36headiuswe generate java classes all the time at runtime right now
13:36headiusmost ruby programs don't ever get compiled, but they eventually end jit to bytecode in jruby
13:37stuarthallowayp.s. it is evil to combine Hibernate and Clojure
13:38stuarthallowayit is like trying to get somewhere by driving ten miles north then ten miles south
13:42rhudsonstuarthalloway: 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:43stuarthallowayclj-record?
13:43stuarthallowaynosql?
13:44cemerickhibernate 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:44rhudson"Requirement: persistence must use MySQL, SQLServer, and Oracle"
13:44cemerickOf course, for greenfield stuff, you're a little crazy to choose it.
13:51cemerickHrm, no takers/opinions on this? https://gist.github.com/31c64ee18cb631e3b54e
13:52rhudsoncemerick: it's those specific field names, right?
13:52cemerickrhudson: no, I'll bet any no-arg method name will do it
13:52rhudsonLooks like implementation methods are being exposed
13:53somniumits a feature! name your field :seq for free functionality
13:53rhudsoncemerick: 2 is the number of fields (size of record)
13:53cemerickyeah, I know
13:53cemerickI have to assume it's a bug.
13:53rhudsonI betcha the impl has a getSize() method
13:53rhudsonyea
13:53remleduffWhat happens if you try to make field named "equals" ?
13:54cemerickremleduff: works as expected. This only affects fields with the same name as no-arg methods.
13:54cemerick(:blah record) probably gets expanded into (.blah ^RecordType record) or somesuch
13:55rhudsonThere must be only a few hundred of those in core...
14:07cemerickI'd say the issue is here: http://github.com/richhickey/clojure/blob/master/src/clj/clojure/core_deftype.clj#L181
14:10cemerickI'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:27stuarthallowaycemerick: do file a ticket on this!
14:27cemerickstuarthalloway: already got a patch; would you like to take a look before I post it?
14:28stuarthallowayok
14:28chouserI think getLookupThunk returning nil will cause the call-site caching to fail
14:28chouser(and fall back to slower lookup)
14:28cemerickstuarthalloway: https://gist.github.com/9d1769237b312eb49723
14:28cemerickchouser: doesn't it have to in this case?
14:29cemerick(. object field) will always invoke the field method, if it exists
14:30cemerickthere'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:30chouserwell, slow is certainly better than the behavior you're seeing. :-)
14:31stuarthallowaythe speed impact is only on map lookup, right?
14:31cemerickYeah, I'm pretty well confused by that mapcat in general.
14:33chousergrr. I shouldn't look at this right now.
14:33cemerickstuarthalloway: 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:34chousercemerick: does your patch set ~'k to nil when there are any no-arg methods in the class?
14:34stuarthallowaycemerick: go ahead and submit it, I will discuss with Rich
14:34stuarthallowayit will need (and get) some tests but I don't have time to wrap my head around this right now
14:34slyphonis the general use-case for pre/post conditions be that you'll run with assertions enabled during test/dev and off in production?
14:35cemerickOK, 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:35cemerickchouser: no, ~'k is nil only when ~'k is of the same name as the no-arg methods implemented in the class.
14:36chousercemerick: ok.
14:36cemerickI'm still confused by how the mapcat yields a single reify, though.
14:36chouserthe mapcat generates the body of the case
14:36cemerickoh, shite, didn't see the ~@ there
14:37cemerickin that case, I should just filter the base-fields seq
14:37_njHi 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:38chousercemerick: ok, yeah, that would make sense, if the goal is to simply skip this performanace feature for conflicting keys
14:38cemerickchouser: good, this makes sense now :-)
14:40chouserother 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:41cemerickthe latter is a general need elsewhere, too
14:41cemerickrare, but I've seen it needed
14:44slyphonchouser: um, where can i report a bug on thejoyofclojure?
14:45slyphons/on/in/
14:51cemerick_nj: Sorry, I've been sticking with the v0.3.x builds
14:51cemerickMaybe there's something in ring that is more general than run-jetty?
14:53kencauseyslyphon: http://www.manning-sandbox.com/forum.jspa?forumID=624
14:53sexpbot"Manning Forums: Joy of Clojure"
14:53slyphonah
14:53slyphonkencausey: thanks
14:58_njcemerick: Thanks, I'll look into ring
15:09leifwI'm getting an IllegalArgumentException when I try to use clojure-hadoop
15:09leifwit says "no method in multimethod 'conf' for dispatch value: :input-format"
15:10leifwbut this is clearly defined in the library
15:10leifwthere is a (defmethod conf :input-format ...)
15:11leifwalternatively, 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:13technomancyleifw: should be able to use the :namespaces key in project.clj
15:13leifwyup, found that just now, thanks
15:14technomancybut that is a lousy name; it will be renamed in 1.2
15:14leifwcool
15:14technomancyrenamed in a non-breaking way (with an old alias)
15:14cemerickchouser: 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:15leifwtechnomancy: how much do you know about clojure-hadoop though?
15:16leifwI am having the most terrible time getting it to run on the cluster
15:16technomancythat about jives with my experience with hadoop
15:16leifwugh
15:16technomancyit's a lot of work to get running correctly, and even then it doesn't provide a lot of value
15:16technomancyunless you're using HDFS, which is pretty impressive
15:16leifwwords of true encouragement :-/
15:16leifwwe are
15:17leifwso that's useful I guess
15:17leifwYES IT IS DEFINED YOU BASTARD
15:17leifwARGH
15:17technomancysorry =(
15:17leifwhaha that's ok
15:17leifwthanks for the help
15:33slyphonin a macro, if ~'blah is the idiom to capture a symbol, what does ~() mean?
15:33cemerickstuarthalloway: FYI: https://www.assembla.com/spaces/clojure/tickets/329
15:33sexpbot"#329 - Fix defrecord keyword lookup on fields matching no-arg methods (Test) | Clojure | Assembla"
15:33cemerickI keyed it to 1.2, which I presume is appropriate. :-)
15:34chouserslyphon: unquote the result of the evaluating the ()
15:34stuarthallowaycemerick: yes, thanks
15:34chouser, `[1 2 ~(+ 10 5) 3 4]
15:34clojurebot[1 2 15 3 4]
15:34slyphonah
15:47stuartsierraleifw: clojure-hadoop was written (by me) for Hadoop 0.18.3 and has not been updated since (nor will it be)
15:47stuartsierraIf you want to use Hadoop, make sure you know the Java APIs first.
15:48stuartsierraThen it's not too hard to add some Clojure.
16:21danlarkinscatterbrained: is there a function that does #(first (remove %1 %2))?
16:22Chousuke,((comp first remove) nil? [nil nil 1 nil])
16:22clojurebot1
16:24ChousukeI'm not usually a fan of pointfree style in clojure but in this case that works pretty neatly
16:27hiredman:let in for is pretty handy
16:35chouser,(some #(when-not (nil? %) %) [nil nil 1 nil])
16:36clojurebot1
16:48livingstonif 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:50rshif ref's can manage multiple locations (which means it can handle single location), then what is the purpose of having atoms?
16:56stuarthallowaylivingston: str uses StringBuilder internally, you should be good
16:56stuarthalloway,(source str)
16:56clojurebotSource not found
16:56stuarthalloway,(use 'clojure.contrib.repl-utils)
16:56clojurebotnil
16:57stuarthalloway,(source str)
16:57Chousukersh: atoms are simpler
16:57clojurebotSource not found
16:57Chousukersh: they're also not coordinated in any way
16:57livingstonstuarthalloway: 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:58livingstonI appreciate it.
16:58Chousukestr's probably going to be the most efficient way of concatenating strings. so long as you don't use it with reduce :)
17:00slyphonw00t!
17:01livingstonso 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:07slyphonis it common to use 'do' to chain together recursive expansions of a macro's arguments?
17:12Borkdudewhy do I need the # in (meta #'==) again?
17:13slyphonit's a reader macro
17:13slyphon#' is to access the Var
17:13slyphonaiui
17:13slyphon'== is just (symbol "==")
17:14slyphon#'== means "give me the value of var represented by (symbol "==")"
17:14slyphoni *think*
17:15Borkdudeah ok, so with (meta '==) i would ask for the metadata of a symbol, right
17:15arohnerBorkdude: right. And symbols don't have metadata, but vars do.
17:16Borkdudeand symbols are just stupid things in clojure
17:16slyphonthey're more like "labels"
17:16slyphonor names-of-interesting-things
17:17BorkdudeI was thinking of property lists in CL, it confused me a little
17:17mmarczykactually the ' in #' has nothing to do with the stand-alone '
17:18BorkdudeSo if i just remember that symbols are jjust labels with no further properties I should be fine in clojure?
17:18mmarczyk#'foo expands to (var foo), var is a special form and doesn't need quoting
17:18slyphonmmarczyk: oh?
17:18mmarczykthe effect is the same, though
17:18slyphonah
17:18slyphonmy mistake
17:19mmarczykwhat about that do and chaining stuff in macros?
17:19mmarczyknot sure I understand that one
17:19slyphonah
17:19mmarczykbtw, symbols can have metadata
17:19slyphonone sec
17:19mmarczykin fact that's how type hints work
17:19mmarczyk{:tag foo} is attached to the symbol by the reader
17:20mmarczykthen the compiler uses that
17:20Borkdudei see
17:20mmarczykif the symbol happens to occur as a name in a def* form
17:20mmarczykthen that metadata gets copied onto the Var
17:20mmarczykso that it's accessible at runtime
17:21mmarczyksince 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:21mmarczyk,(meta '#^foo foo)
17:21clojurebot{:tag foo}
17:22mmarczyk,(meta 'foo)
17:22clojurebotnil
17:22mmarczykiirc, anything implementing clojure.lang.IObj can have metadata attached
17:22slyphonit needs IMeta i think
17:23slyphonmmarczyk: https://gist.github.com/d6a6dabb9c0a85e154c2
17:23slyphonnow, that *works*
17:23mmarczykactually IObj seems to be needed for attaching data, while IMeta suffices for (meta ...) :-)
17:23slyphoni just wasn't sure if it was bad form, having those nested 'do's
17:23slyphonah
17:23mmarczyklooing now :-)
17:24mmarczyklooking, I mean
17:24slyphonah, yes
17:25Borkdudeeh, what does (meta '#^foo foo) mean?
17:26mmarczykslyphon: nothing wrong with that code to my eye :-)
17:26slyphonah, good
17:26slyphon:)
17:26mmarczykyou could probably put the second form from the do inside the let
17:26mmarczykbut if it's more trouble to write it this way
17:26slyphonah, that let is autogenerated by the doto
17:26mmarczykthere's no real reason to do that
17:26mmarczykyeah
17:26slyphonhoorj!
17:27mmarczyk:-)
17:27slyphoncan you only have one `() form in a macro?
17:27slyphoni mean, at the top level
17:28mmarczykBorkdude: '#^foo foo means (quote #^foo foo)
17:28mmarczyk#^foo foo means the symbol foo with metadata of {:tag foo} attached at read time
17:28mmarczyk(that foo in the metadata is also a symbol)
17:29mmarczykthen quote returns the symbol unchanged with the metadata intact
17:29livingstonslyphon: I can't tell exactly what that macro is doing, but why do you need the nested do?
17:29mmarczykand meta returns it (meaning the metadata)
17:29livingstoncan't you get away with (do (let ... ) (let ...) nil) ?
17:29mmarczykslyphon: macro needs to return a single form, yes
17:29slyphonah
17:30slyphonthat's the reason
17:30mmarczykhi livingston
17:30slyphonlivingston: it's only recursive because i'm not generating the let* there
17:30mmarczykre: (apply str seq-of-strings), I think that's perfectly fine (and definately reduce would be the wrong way to do it)
17:30slyphonthat's the result of a macroexpand-all
17:30slyphonso the let* is because of doto
17:31livingstonoh ok, usually sos you know what your macro is doing exactly you just look at macroexpand-1
17:31alexykcan lein work with 1.2.0-master-SNAPSHOT?
17:32Borkdudemmarczyk, I get it, tnx
17:32technomancyalexyk: it should, if not please let me know
17:33alexyktechnomancy: 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:33slyphonmmarczyk: i didn't know about the one-form rule
17:35arohnerslyphon: think about it. If you have a macro call in one branch of an 'if' statement, and the macro expands to multiple forms ...
17:35slyphonmake sense
17:35slyphoner, makes
17:35alexykah, is it because clojure-contrib's jar is clojure-contrib-1.2.0-SNAPSHOT, without master?
17:36technomancyalexyk: probably so
17:36alexykwhoever 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:37alexyktechnomancy: but, my lein deps doesn't even get to that.
17:37alexykI simply edited the CLOJURE_JAR in bin/lein; why would it want contrib then? is contrib configurable?
17:41livingstonwhat's the easiest way to test if a given symbol is in a given namespace?
17:42livingstone.g. that 'ex/a is in the namespace ex
17:43livingston.getNamespace returns a string it'd be nice if there was a non-string way
17:44Borkdude(:ns (meta #'a))
17:45BorkdudeReturns the namespace of var a
17:45livingstonI don't have vars just symbols
17:46mmarczyk,(contains? (ns-map 'clojure.core) '+)
17:46clojurebottrue
17:46mmarczyk,(contains? (ns-imports 'clojure.core) 'Integer)
17:46clojurebottrue
17:46Borkdudethen use ' instead of #'
17:47tcepsalivingston: 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:47mmarczyk:-)
17:47mmarczyk,(keys (ns-publics 'clojure.core))
17:47clojurebot(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:47livingstonthat's also a different problem - that tells me if a namespace contains a particular symbol...
17:47mmarczykouch, sorry, didn't think how long that would be
17:47mmarczykbut clojurebot luckily truncates stuff
17:48mmarczykwell, a symbol, as such, is not bound to any namespace
17:48livingston... 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:48mmarczykthere's no "interning" as in Common Lisp
17:48_njhow do I find out the type of a symbol?
17:49mmarczykI mean, there is presumably string interning, though I can't say I read actual code to do that in Clojure
17:49livingstonI just want to have (= (the-namespace-of 'ex/a) (create-ns 'ex))
17:49mmarczykoh, do you mean
17:49mmarczyk(the-ns 'user)
17:49mmarczyk,(the-ns 'user)
17:49clojurebot#<Namespace user>
17:49livingston,(doc the-ns)
17:49mmarczyk,(the-ns (.getNamespace 'foo/bar))
17:49clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol
17:50clojurebot"([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:50arohnerlivingston: (ns-resolve 'your-ns 'symbol)
17:50arohner?
17:50livingstonyes!
17:50livingstonthank you
17:50mmarczyklivingston: which was it then?
17:50arohnerlivingston: that will return the var, or nil
17:50arohner(ns-resolve 'clojure.core 'map)
17:50arohner,(ns-resolve 'clojure.core 'map)
17:50clojurebot#'clojure.core/map
17:51arohner,(ns-resolve 'clojure.core 'bogus)
17:51clojurebotnil
17:51Borkdudetnx for making my train journey enjoyable, gtg now
17:52livingston_(can I tell you how much I don't like this web client randomly dropping me)
17:52livingston_I don't know what I missed but I was looking for the-ns
17:52mmarczyklivingston_: oh :-)
17:53mmarczykgood
17:53livingston_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:53livingston_so that is not quite good either
17:54mmarczykwell, that's a problem of the design I'd say
17:54tcepsalivingston_: But if you know that the ns hasn't been created, then you know that no symbol is bound within that ns, right?
17:54mmarczykif you're going to ask if a namespace which doesn't exist is equal to another
17:54arohner,(ns-resolve 'bogus 'foo)
17:54clojurebotjava.lang.Exception: No namespace: bogus found
17:54livingston_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:54mmarczykhm, right, what tcepsa said
17:55mmarczyklivingston_: in that case
17:55mmarczyk,(name (.getName (the-ns 'user)))
17:55clojurebot"user"
17:55mmarczyksee if that matches
17:55mmarczyk,(.getNamespace 'foo/bar)
17:55clojurebot"foo"
17:56arohner,(find-ns 'bogus)
17:56clojurebotnil
17:56livingston_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:56arohner,(find-ns 'clojure.core)
17:56clojurebot#<Namespace clojure.core>
17:56mmarczyk,(doc find-ns)
17:56clojurebot"([sym]); Returns the namespace named by the symbol or nil if it doesn't exist."
17:56mmarczykoh, that's cool :-)
17:56mmarczykso *that* would be the solution
17:57tcepsalivingston_: ~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:57mmarczyktcepsa: he wants to be able to test symbols which have been qualified with *another* ns
17:57mmarczykwhich might not exist
17:58livingston_tcepsa: what mmarczyk said
17:58tcepsammarczyk: Yes, sorry, by "the namespace" I meant "the flagged namespace" not "the current namespace"
17:58slyphonhrm
17:58slyphonso ~@ causes evaluation?
17:58mmarczyk,(= (the-ns (symbol (.getNamespace 'foo/bar))) (the-ns 'user))
17:58clojurebotjava.lang.Exception: No namespace: foo found
17:59livingston_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:59mmarczykso that's a no go
17:59livingston_,(the-ns 'foobar/a)
17:59clojurebotjava.lang.Exception: No namespace: foobar/a found
18:00mmarczykhowever arohner's suggestion will work
18:00mmarczyk,(= (find-ns (symbol (.getNamespace 'foo/bar))) (the-ns 'user))
18:00clojurebotfalse
18:00livingston_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:00mmarczyk,(= (find-ns (symbol (.getNamespace 'user/bar))) (the-ns 'user))
18:00clojurebottrue
18:00tcepsaAh, and that's why you said that you'd be using exceptions as flow control in an unfortunate way.
18:00slyphonhmm
18:00slyphonso is it possible to just-splice?
18:01slyphonhttps://gist.github.com/d6a6dabb9c0a85e154c2
18:01slyphonthat causes an exception, because it doesn't know how to resolve the second set of symbols
18:01slyphoni.e. at line 58
18:02livingston_mmarczyk: as soon as I call getNamespace, namespace, etc. then I have strings ...
18:02mmarczyklivingston_: look at the examples above -- they seem to work?
18:02mmarczykyou can turn the strings into symbols with (symbol ...)
18:03slyphonhrm, shit, this isn't gonna work
18:03livingston_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:04livingston_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:04mmarczykwell there is no way to extract the ns a symbol is qualified with except with .getNamespace
18:05livingston_namespace does it too
18:05livingston_,(namespace 'foobar/a)
18:05clojurebot"foobar"
18:05mmarczyk,(class (namespace 'foobar/a))
18:05clojurebotjava.lang.String
18:06livingston_although I really think that should return the same type as:
18:06mmarczykso that's a wrapper
18:06alexykso -- does anybody run leiningen with a project depending on the clojure and contrib trunks?
18:06livingston_,(create-ns 'user)
18:06clojurebot#<Namespace user>
18:06mmarczykactually this does seem strange to me
18:06mmarczykhmm
18:06mmarczykalexyk: why?
18:06alexykmmarczyk: lein fails for me in that setup
18:07mmarczyklivingston_: actually if you've got symbols coming in from the outside world, say
18:07mmarczykor wherever
18:07mmarczykthey're coming in as "just strings" anyway
18:07mmarczykthose strings are being interned at read time
18:08mmarczykso then the string is stored as a pointer to the obarray (or whatever it's called) where it is interned, I'd guess
18:08mmarczykso actually when you do a .getNamespace / (namespace ...), you get an interned string
18:09mmarczykand equality testing against another interned string should boil down to pointer equality
18:10mmarczykso, 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:10livingstonlast I saw was interned string... but can you guarantee that?
18:10mmarczykwell I've just read the source for clojure.lang.Symbol
18:10livingstonI 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:11livingstonmmarczyk: that'll work too
18:11livingstonthere still should be a way to get from a symbol to it's namespace if it's there
18:11mmarczyklivingston: I believe it will be just like comparing symbols in CL / Scheme
18:11replacaQ: once, someone was talking about how to access private vars in macros. Does anyone remember that idiom?
18:11mmarczykin Scheme, a symbol is just an interned string, so actually it's the same in this case
18:11alexyktechnomancy: given I'm getting java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V now, should I rebuild lein from git or not?
18:12mmarczykalexyk: given this error, I'd say you might have a clojure-contrib.jar built with an older version of clojure.jar
18:12mmarczyknothing to do with lein, try java -cp your-clojure.jar:your-contrib.jar clojure.main
18:12alexykmmarczyk: I just checked that I build clojure-contrib with the same 1.2.0-master-SNAPSHOT
18:12livingstonmmarczyk: 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:13alexykmy repl works fine with those two jars, clojure and clojure-contrib
18:13alexykthe question is, why lein deps fails
18:13alexykbin/lein does point to the same clojure jar
18:13alexykthe question is, why does lein deps need the contrib
18:13mmarczykalexyk: the repl works, lein deps doesn't?
18:13mmarczyklivingston: well then use the-ns / find-ns
18:13technomancyalexyk: you can't use "lein deps" on its own lein checkout. you need to do "lein-stable deps"
18:14alexykmmarczyk: repl works when launched manually with the CLASSPATh from lib/
18:14alexykand I placed clojure and contrib there manually
18:14mmarczyktechnomancy: oh? I do it all the time and break things only 10% of the time :-)
18:15alexyktechnomancy: I didn't actually update lein via lein deps, I assumed we upgrade by git pull...
18:15technomancysee "Hacking" in the lein readme; I think it explains pretty well.
18:15mmarczyklivingston: 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:15mmarczyksince the constructor hardly does anything besides interning the strings
18:15alexykmeaning, in some prehistorical time I did the dance with lein-stable; do I need to do it again each time after git pull?
18:16alexykmy lein now points to git-lein/bin/lein
18:16alexyktechnomancy: you said a while ago git pull should suffice
18:16mmarczykalexyk: well git pull only updates the sources
18:16mmarczykalexyk: you'll have to take care of deps separately if they've changed
18:16livingstonmmarczyk: 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:17technomancyalexyk: 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:18alexyktechnomancy: aha!
18:18alexyknow it starts making sense
18:18mmarczyklivingston: I guess I see your point, but symbol-ns is straightforward enough to write
18:19mmarczykand you can pick your semantics (exception or nil on no-such-ns)
18:23livingstonwhen do symbols actually pick up a namespace in clojure?
18:23livingstonnot at read time right, unless qualified?
18:23mmarczykright
18:23alexykyay it works again
18:23mmarczyksometimes they never get namespaced
18:24livingstonso 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:24alexyktechnomancy: perhaps makes sense to add "redo lein-stable build on git lein upon major clojure/contrib changes" or something
18:24mmarczyklike a special symbol in operator position or a symbol naming a local
18:24mmarczyklivingston: they don't actually
18:24mmarczykif you write (let [x 1] x), the x never gets namespaced
18:24alexykbtw, strange thing: my lein hangs after it does its work
18:25alexykdid this for a bit
18:25livingstonreally, huh so it's actually the def forms that cause it?
18:25mmarczykwell I wouldn't put it this way
18:25mmarczykdef forms create Vars
18:25mmarczykwhich are bound to symbols in a given namespace
18:25livingstonbut then how are the symbols in your code linked to the gobal def'ed positions
18:25mmarczyksymbols which don't name locals in a given context
18:25mmarczykare resolved to Vars
18:26livingstonmmarczyk: right, ok .. huh
18:26mmarczykunless treated specially, like 'if' in operator position
18:26mmarczyk,(doc special-symbol?)
18:26clojurebot"([s]); Returns true if s names a special form"
18:26technomancyalexyk: sure, good point
18:26livingstonthat kinda creeps me out but ok
18:27mmarczyklivingston: hm? why? :-)
18:27mmarczykbtw, how about this?
18:27mmarczyk,(let [+ :foo] (binding [+ :bar] +))
18:27clojurebot:foo
18:27livingstoncoming from CL I expect symbols to have a home, and that being done by the reader
18:28mmarczykbinding rebinds the Var, but the + in this context still names a local and locals trump Vars
18:28mmarczyk,(let [+ :foo] (binding [+ :bar] clojure.core/+))
18:28clojurebot:bar
18:28mmarczykon the other hand, if you namespace by hand...
18:28livingstonif 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:28mmarczyk,(let [+ :foo] (binding [+ :bar] @#'+))
18:28clojurebot:bar
18:28mmarczyklivingston: yeah, I know
18:28tcepsammarczyk: You just blew my mind!
18:28mmarczykjust a sec, I've got a nice link
18:29mmarczyktcepsa: :-)
18:29mmarczykhttp://netzhansa.blogspot.com/2008/10/trying-clojure.html
18:29sexpbot"netzhansa: Trying Clojure..."
18:29mmarczykit's pretty old, but still relevant and *very* cool
18:30mmarczyka quote:
18:30mmarczykClojure 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:30mmarczykThat 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:30replacatechnomancy: did you say that there's a new improved magit in the wild?
18:30mmarczyk(um, longish)
18:30mmarczykthat's by Hans Hübner
18:30tcepsaHehe, awesome. And on that note, I'm off!
18:31technomancyreplaca: newer than the elpa version, yeah.
18:31replacatechnomancy: hmmm, I wonder which one I have...
18:32replacatechnomancy: from your repo or elsewhwere?
18:35replacaoh I see gitorious. Looks pretty busy, too
18:36livingstonare the any limitations on characters or length etc. on symbols (or namespace names, although that should be about the same)?
18:38mmarczyklivingston: the docs mention a set of acceptable chars for symbol names
18:38mmarczyklivingston: these are not enforced, though
18:38mmarczykand last time I checked < and > where not on the list
18:38mmarczykyet -> is doing fine in core
18:38joshua-choiAre you talking about characters allowed in symbols by the reader? :)
18:39livingstonyes, is the contents of this string a valid symbol name: "-52e95171:128508913e5:-7fff"
18:39mmarczykthe list was always explicitly meant to be expanded at some point, so I'd say any incompleteness is a big deal
18:39joshua-choiI asked this question on this list about a month ago
18:39livingston,(name 'user/-52e95171:128508913e5:-7fff)
18:39clojurebot"-52e95171:128508913e5:-7fff"
18:39mmarczykI seem to recall a lengthy discussion on the ggroup
18:40mmarczyk,(class 'user/-52e95171:128508913e5:-7fff)
18:40clojurebotclojure.lang.Symbol
18:40mmarczykSymbols 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:40joshua-choiThe 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:40mmarczykthat's from
18:40mmarczykhttp://clojure.org/reader
18:41joshua-choiAt least, that's what I recal.
18:41joshua-choiYes, that web page.
18:41mmarczykso apparently the above example is not properly named (because of the colons)
18:42livingstonhmmm I wonder what happens when that stream of what I'm guessing is hex stops being negative
18:42livingston,(name 'user/52e95171:128508913e5:-7fff)
18:42clojurebotInvalid token: user/52e95171:128508913e5:-7fff
18:42joshua-choiThe 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:42livingstonyeah... guess I prepend some crap to the front
18:42joshua-choiThe 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:51slyphon,(map (fn [x y] [x y]) (partition 2 (range 0 10)))
18:51clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--13140$fn
18:52slyphonhuh?
18:52replacaslyphon: you need an extra set of brackets to destructure
18:53replaca,(map (fn [[x y]] [x y]) (partition 2 (range 0 10)))
18:53clojurebot([0 1] [2 3] [4 5] [6 7] [8 9])
18:53slyphonright on
18:53alexykI 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:53alexykshort of going back to ocaml until the chips fall where they will...
18:54alexykstaying with 1.1.0 => living in the past; 1.2.0 => there's not much in the future yet...
18:54slyphonaren't they planning on making it backwards compatible?
18:54alexykslyphon: try it
18:55replacaslyphon: mostly, yeah
18:55alexykcontrib is completely berserk
18:55alexykducl-streams is now io
18:55alexykduck
18:55replacaalexyk: contrib should be close to bacwards compatible now
18:55alexykseq-utils is seq
18:55livingstonneed to cut 4 characters off the front of "anon-52" to get "-52"
18:55mmarczykagreed on berserk :-)
18:55replacaduck-streams is back in but deprecated
18:56alexykreplaca: what about seq-utils?
18:56replacaseq-utils, too, I think
18:56alexykalso, in str-utils2, which became str, the order of arguments in split devilishly switched
18:56alexykthings like that
18:56replacaalexyk: look at the autodoc for master - it's pretty up to date
18:57alexykliebke: do you support 1.2.0 trunk?
18:57technomancyalexyk: it's a lot of work, but those libs *will* get updated
18:57alexyksomnium: how about you and the 1.2.0 trunk?
18:57technomancyif you have time to help them do so, I'm sure they'd appreciate patches
18:57replacaI know liebke's been doing it cause I saw his changes go in
18:57technomancybut if not, just lock to a slightly older snapshot
18:58slyphontechnomancy: speaking of "locking"
18:58slyphonwhat does that look like?
18:58technomancyslyphon: there's a thread on the mailing list about it
18:58slyphonoh, ok, i'll go have a look
18:59slyphonis the mailing list the same as the google group?
18:59technomancy"seq fns promoted to clojure.core!"
18:59technomancyyeah
18:59joshua-choislyphon: Yeah, it is.
18:59slyphonkk
19:00alexykseq fns worked hard... they now can take a Hawaii vacation before starting the new position in core
19:01technomancyalexyk: how many libs are you using that break with the new clojure fns out of curiosity?
19:02alexyktechnomancy: I use about 5 altogether, was generally weary of redoing them. Probably should just try rebuilding and see.
19:02alexykI 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:03alexykbbl
19:03technomancywow. I guess the libs I use generally try to minimize their contrib usage.
19:03joshua-choi(def classifier (DynamicLMClassifier/createNGramProcess DynamicLMClassifier/CATEGORIES DynamicLMClassifier/NGRAM_SIZE))
19:03slyphonjoshua-choi: beat me to it
19:04livingstonis 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:04joshua-choi_brian2_: You can drop the prefix if you want depending on how you require/use.
19:04_brian2_ok
19:04mmarczyk,(require '[clojure.contrib.str-utils :as str])
19:04clojurebotnil
19:04mmarczyk,(str/drop 4 "asdfasdf")
19:04clojurebotjava.lang.Exception: No such var: str/drop
19:05mmarczykum, it's in c.c.string in 1.2
19:05mmarczykbetter yet
19:05mmarczyk,(subs "asdfasdf" 4)
19:05clojurebot"asdf"
19:05mmarczykthat would be the right way
19:06livingston,(subs "anon-52" 4)
19:06clojurebot"-52"
19:06livingstonworks for me
19:06mmarczyk(drop 4 "asdfasdf") would need to be stringified
19:06mmarczykyup, and subs is in core
19:06livingston,(doc subs)
19:06clojurebot"([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:06mmarczykotherwise you could just use .substring
19:06livingstonmmarczyk: yeah that's what I was seeing
19:31rshif 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:36livingstonrsh: 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:37livingstonthat's the java-ey way, I'm going to have a similar problem too though a little bit down the line
19:39rshyeah, I wonder if there is a different way to model this
19:41rshare agents really the best thing to use for this? all I have are threads that do work..they don't maintain any state
19:41livingstonthere 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:42livingstonagents seem more for doing things like, "hey you guy, do this,.. whenever you get around to it" and then hold onto the value
19:42rshthat is what I was thinking
19:43livingstonit sounds like you just have a thread pool pulling/pushing to one of these things, either atom or agent
19:44somnium,(doc future)
19:44clojurebot"([& 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:44rshalso, why is it that calling println does not show up in the repl when an agent runs some code?
19:45_nj(defroutes main-routes
19:45_nj (GET "/"
19:45_nj "Index page")
19:45_nj (ANY "*"
19:45_nj [404 "Page not found"])) Gives me an exception Unsupported binding form: Index page
19:46_njany help is appreciated :)
19:46rshhow is a future different from an agent and using send-off?
19:47somniumrsh: futures arent mutable, and deref blocks on reads
19:47livingstonthink of futures as one-shot deals
19:47somniumagents are mutable and reads dont block, afaik
19:48rshthanks
19:48lancepantz_nj: that looks like the 0.3 compojure syntax, are you trying to use it with 0.4?
19:48livingstonagents can also partisipate in some ways in transactions
19:49_njlancepantz: yes, I wasn't aware of that, any pointers to the new syntax?
19:49mmarczyk,(doc seque)
19:49clojurebot"([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:49mmarczykrsh: I wonder if this might help?
19:51mmarczykthen 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:52rshthat sounds promising
19:53mmarczykin fact a question came up on SO some time ago which may be relevant to you
19:53mmarczykhttp://stackoverflow.com/questions/2602791/clojure-agents-consuming-from-a-queue
19:53sexpbot"Clojure agents consuming from a queue - Stack Overflow"
19:53mmarczykI brought up the seque approach
19:53mmarczykChristophe Grand had a different idea
19:54mmarczykand Timothy Pratley -- a third one
19:54mmarczyknot sure if any of those worked for the OP, but perhaps they will for you :-)
19:55rshthanks!
20:07rshmmarczyk: any reason you say to use a ref instead of an atom in your solution to maintain the queue?
20:15mmarczykrsh: 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:15mmarczykactually I see that there's some improvements to be made to that answer
20:15mmarczyknamely do-stuff shouldn't self-call; recur would be appropriate; but that's pretty obvious
20:16rshalso, what is reason for creating an agent in a future as opposed to just send-off'ing agents directly?
20:17mmarczykmore importantly, I guess that seque needs to be moved passed the element that's been read
20:17mmarczykthat's straightforward with a Ref, but cgrand had a nice trick to do that with an Atom:
20:17mmarczykcons a nil onto the seque
20:17mmarczykthen use (first (swap! a rest)) to read elements
20:18mmarczyk,(let [a (atom (range 5))] (str (first (swap! a rest)) " " (first swap! a rest)))
20:18clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$first
20:19mmarczyk,(let [a (atom (range 5))] (str (first (swap! a rest)) " " (first (swap! a rest))))
20:19clojurebot"1 2"
20:20mmarczykas for the futures, they make for a nice way to start a background thread...
20:20mmarczykI guess agents might in fact be unnecessary here, though
20:20mmarczyknot sure what I was thinking :-)
20:26rshi think this makes sense to me now, thanks for your help
20:27rsh(doc future-done?)
20:27clojurebot"([f]); Returns true if future f is done"
20:46rshwhy does println or prn not print to the repl when an agent runs some code?
20:52mmarczykrsh: np :-)
20:52mmarczykre: printing from agents, would that be in the SLIME REPL?
20:52rshyes
20:52mmarczykI think there's a setting for that... slime-redirect-output or some such thing
20:52mmarczykslime-redirect-inferior-output
20:53mmarczykhm, actually it's a function
20:54mmarczykright, just call that
20:54mmarczykthen printouts from other threads should go to the repl buffer too
20:54mmarczykI have that in my slime-connected-hook
21:02rshthanks
22:25replacahiredman: 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:26rhickeycemerick: I fixed #329
22:36chouserah, neat! Hadn't thought of that.
22:42cemerickchouser: 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:44chouserworks here
22:44cemerickhrm
22:44chouser(. (clojure.lang.Box. 5) :val)
22:45cemerickAnyway, I wish I had thought of that instead of futzing with a bandaid for 90 minutes :-(
23:23cemerickchouser: OK, so almost everything looks good here -- note the last one: https://gist.github.com/17125de93ab466043505
23:50uberjarI want projobuffers
23:51uberjarand a pony.
23:51uberjarsomeone hook me up
23:52ninjuddhttp://github.com/ninjudd/clojure-protobuf
23:53cemerickhrm
23:53uberjarI don't know how I missed that.. thnx
23:53cemerickthat java compilation part is a bummer
23:54cemerickninjudd: are you eyeing deftype, etc. as a next step?
23:54ninjuddcemerick: do you mean reimplementing using deftype?
23:55cemerickright, to avoid any intermediate java step
23:55ninjuddwithout using google's code at all?
23:56ninjuddi'd be into it if it makes it faster
23:57ninjuddif not, then i don't see a reason why using java interop is bad
23:57cemerickit'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:58ninjuddmy goal is to make it a pleasant dev process either way
23:59ninjuddi spent a lot of time on the ant scripts to make building it very easy