#clojure logs

2010-09-17

00:01hiredman~translate from zh 青峰乡
00:01clojurebotQingfeng Township
00:01hiredmanno wonder it didn't work I misspelled translate
00:02technomancyhiredman: I pushed the sort-ns stuff I showed you: http://github.com/technomancy/durendal/blob/master/durendal.el
00:02technomancyended up not calling it Yonderboy after all.
00:03hiredmanheh
00:03hiredmannice
00:04The_Jon_Smithclojure gone rampant?
00:05technomancyhttp://www.discogs.com/artist/Lupus+Yonderboy <= review by a guy who calls himself "monad"
00:05scottjtechnomancy: what do you think of the highlight params in arg list change to swank-clojure? do you think you'll integrate it?
00:06technomancyscottj: was just about to take a look
00:07scottjok, don't have to integrate immediately, I've got fixes coming for inside let bindings and in apply, but don't want to keep working on it if I know it won't get integrated since now it's good enough for me
00:07technomancyI just want to make sure it works on the packaged release of slime since it sounds like you're using trunk
00:07scottjcorrect
00:08tomojgreat, the Mapper interface in hadoop 0.20.2 is deprecated in favor of a concrete Mapper class, subclass to extend
00:08technomancyhalf the classes in hadoop are deprecated
00:08scottjtechnomancy: btw I saw an issue or fork that claimed to fix autodoc on trunk. autodoc works for me on trunk
00:10technomancywith or without the patch?
00:10scottjwo
00:10technomancygotcha
00:10scottjI didn't look to see what exactly the patch addressed or how he was loading autodoc
00:11technomancyI may have gotten confused since autodoc is also the name of a Clojure project.
00:11scottjoh I didn't even think of that who knows, maybe that's what he was talking about
00:11technomancyI am actually not a very in-depth slime user myself; I don't use any contribs beyond slime-repl
00:12scottjautodoc is so great, otherwise the arglist only updates when you type not when you browse
00:13technomancyI really wish the slime maintainers would take my patches to package up slime =\
00:13technomancymaintaining that all in my own fork is a pain
00:13slyrusslime-autodoc didn't work for me a while back
00:13technomancydo you have to do anything extra beyond loading slime-autodoc.el?
00:13slyrusor, I should say, it sort of worked, it just also occasionally hung slime
00:13slyruswhich was no fun
00:14scottjI use (slime-setup '(slime-fancy))
00:14slyrusit would be great if it now worked reliably
00:14technomancyif the slime devs were more cooperative I'd have a lot more incentive to spend time getting the extra contribs working.
00:14slyruswhat's wrong with the slime developers?
00:15slyrusother than, you know, not wanting to make any changes to make life easier for non-CL developers? :)
00:15technomancythey're not really interested in producing releases; they just want everyone to follow trunk all the time.
00:15technomancyusing ... wait for it ... CVS.
00:15hiredmanthe drugstore?
00:16technomancynot much concern with stability or releases.
00:16slyrusgit://sbcl.boinkor.net/slime.git
00:16slyrusworks for me
00:16technomancyhiredman: in the words of Scott Chacon: "It's amusing that CVS sucks so much both as a VCS and as a pharmacy."
00:16slyrushey, at least one doesn't have to download a jar off of some random website :)
00:16technomancyin the words of Coda Hale: "Is there a guy in an alley with a trenchcoat full of film canisters named RCS, because that would seal the deal."
00:17scottjmy autodoc does stop working every once in awhile, though I'm not sure if that's ac-slime or swank-clojure, I don't think it's stalled slime itself though
00:18technomancyscottj: that slime-setup call doesn't seem to have an effect
00:18technomancyI should be looking for improved eldoc-style arg display in the minibuffer, right?
00:19scottjwell, with my swank-clojure yeah, but w/o it slime-fancy should give you an updating param list as you move the cursor w/o entering test
00:19scottjtext
00:19technomancyright, I've got your patches applied
00:20technomancyI'm not sure what I should be looking for with slime-autodoc and your patches
00:20technomancybut I guess they don't break anything, so I should just take 'em. =)
00:22scottjyou might have to add slime/contrib to load-path before slime-set slime-fancy thingy
00:22technomancyright, got that part to eval
00:22technomancyjust doesn't seem to affect my repl
00:23technomancywoo; Leiningen is now certified as 100% clean; no spyware/adware! http://mac.softpedia.com/get/Developer-Tools/Leiningen.shtml
00:23technomancyalso: apparently it is 8kb. who knew?
00:25technomancycertifications: because something's gotta go in that empty space in your sidebar.
00:27scottjhttp://img295.imageshack.us/i/screenshot2sy.png/
00:28technomancydang... that looks nice.
00:28tomojwhere's point?
00:28scottjright " of "bar"
00:28scottjdoesn't show up in screenshot for some reason
00:28tomojthat's nice, the having to press space thing is weird
00:29technomancyWell I went ahead and merged it even without getting it working
00:30technomancyand I added you to the project; so feel free to push future fixes as long as you can confirm they work in the latest slime package and not just trunk.
00:30technomancyanyone else want commit on swank?
00:30scottjlatest slime through elpa?
00:30technomancyright
00:31technomancyis this the fork you were talking about re: autodoc? http://github.com/technomancy/swank-clojure/pull/22
00:33scottjyeah
00:34scottjI wonder why he took arglist-for-echo-area and copied it to be called autodoc
00:35scottjoh nevermind was reading commits in wrong order
00:36scottjdamn, I should have looked closer at this, it might do exactly what mine does
00:36technomancyoh well, you won because you bugged me on IRC first. =)
00:37technomancyeven though he submitted his first ... oh well. =\
00:38scottjI'm checking his out now to see if it's better
00:41scottjwell to me it doesn't appear to do anything that wasn't already working, I'll ask him to clarify
00:42scottjit doesn't highlight current param
00:45hugodI believe that patch is a port of my original fix, to use rpc
00:45hugodin which case it doesn't do highlighting
00:45hugodit just fixed the protocol to not hang
00:46technomancyman... you guys know a lot more about slime than I do.
00:48lancepantzanyone happen to know anything about the resources directory in jetty?
00:49lancepantzi had been under the impression jetty included it on the class path for all contexts, intended for property files
01:20BahmanHi all!
01:20phobbshello
01:20phobbs=]
01:20lancepantzhi Bahman
01:21BahmanHey phobbs, lancepantz.
01:21phobbshehe
01:30thunkI missed the autodoc discussion a bit ago -- What're the correct incantations to get autodoc working sans hanging repl?
01:30thunkI'm running slime trunk and I just compiled and installed the newly patched swank-clojure, but I'm still getting the hanging repl.
01:33technomancycrazy kids with your trunk software, your long hair, and your loud music.
01:35pyrtsaAny Incanter developers up here?
01:36thunkThis edge, it's sharp! I cut myself!
01:36pyrtsaSeems there's a bug in Incanter's $= function; ($= 10 - 1 + 10) returns -1, not 19.
01:38pyrtsa(I mean, $= macro.)
02:01slyrustechnomancy: I thought it was us old lisp fogies that were running the trunk software?
02:02technomancyyeah, I'm confused
02:02technomancykids shouldn't be using cvs
02:03slyrusthe gateway version control system. next thing you know, they'll be wanting to use git.
02:04slyrushowever, the loud music, with headphones anyway, sounds like a good idea
02:26scottjthunk: new swank-clojure doesn't fix hanging repl though there is a fork that might be merged that apparently does that
02:28thunkscottj: Thanks. You mentioned that you're not seeing the hanging repl -- are you running that fork?
02:28scottjnope, mine works fine
02:28thunkHrm, any idea why?
02:28scottjdoes yours hang immediately or after a while?
02:30thunkIt hangs immediately on evaluation of any non-atomic expression
02:30thunkLike, it hangs on (+ 1 2), but not on 1
02:30scottjyeah I don't have that problem. using lein swank , slime-fancy, cvs trunk
02:32thunkswank-clojure 1.3.0-SNAPSHOT ?
02:32scottjyeah
02:32thunkWeird.
02:32scottjand I've been using autodoc for ages w/o problem
02:36scottjtechnomancy: just made several improvements. pushed to my fork, how do I add it to your's?
02:37zmila,(let [[f & r] (sorted-set 1 3 2)] [f r])
02:37clojurebotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentTreeSet
02:38zmila,(let [ss (sorted-set 1 3 2)] [(first x) (next x)])
02:38clojurebotjava.lang.Exception: Unable to resolve symbol: x in this context
02:38zmila,(let [ss (sorted-set 1 3 2)] [(first ss) (next ss)])
02:38clojurebot[1 (2 3)]
02:38phobbszmila: you're right
02:38zmilawhy nth in set-destruction?
02:39phobbsgood question
02:39hiredmanzmila: [] is used for destructuring linear things
02:39phobbssorted-set should be linear
02:39hiredmana set is not a linear thing like a list or a vector
02:40phobbs... it's sorted
02:40hiredman,(ancestors (class (sorted-set)))
02:40clojurebot#{clojure.lang.IPersistentSet clojure.lang.Sorted java.util.concurrent.Callable clojure.lang.IMeta clojure.lang.Counted clojure.lang.Seqable java.lang.Runnable java.io.Serializable java.util.Collection java.lang.Object java.util.Set clojure.lang.Reversible clojure.lang.IObj clojure.lang.APersistentSet :clojure.contrib.generic/any clojure.lang.IPersistentCollection java.lang.Iterable clojure.lang.AFn clojure.lang.IFn}
02:40hiredman^- not
02:40phobbs,(ancestors (class []))
02:40clojurebot#{java.util.List clojure.lang.IPersistentVector java.util.concurrent.Callable clojure.lang.Sequential clojure.lang.IMeta clojure.lang.Indexed clojure.lang.Counted clojure.lang.Seqable java.lang.Runnable java.io.Serializable java.util.Collection clojure.lang.ILookup java.lang.Object clojure.lang.Associative clojure.lang.IEditableCollection clojure.lang.Reversible clojure.lang.IObj clojure.lang.IPersistentStack java.util.Ran
02:41hiredmanclojure.lang.Sequential
02:41phobbsok
02:41phobbsso you're saying the system happens to be the way it is
02:41phobbsbut I'm saying it shouldn't be that way
02:41hiredman*shrug*
02:41phobbs[f & r] should destructure a sorted set, otherwise it's broken
02:41zmila,(let [[f & r] (seq (sorted-set 1 3 2))] [f r])
02:41clojurebot[1 (2 3)]
02:41phobbsah
02:41phobbsnice
02:54_na_ka_na_hello people, I want to make search functionality on my web app, is there a standard way or lib to do this?
02:54_na_ka_na_predicates can contain (in sql language) IN, NOT IN, <=, >= etc.. and contain numbers as well as strings
03:04TheBusbynakana: Apache's solr may be what you're looking for
03:13_na_ka_na_TheBusby: I already have a database ... what I'm looking for is .. some standard way to get search parameters from the ui (say json or xml) .. and convert it into clojure predicate function or something like that
03:14_na_ka_na_I don't want to invent a my own dsl for this
03:17tomojwhat's your database?
03:19tomojI mean, to do the search you're not going to just call filter on all your data with the predicate function, right?
03:20LauJensenGood morning guys - You have no idea how tough it was getting in here today :)
03:21TheBusbyLau: commute or network?
03:22thunk_na_ka_na_: Take a look at Apache Lucene and the way it's used in clojars-web: http://github.com/ato/clojars-web
03:22LauJensenWell. I boot up, only to find Awesome broken by an update. Jump out to tty1 to fix it, only to find out that I accidentally installed 'neo keyboard layout' for the ttys (dunno how I did that), so Ive had to sit and guess guys for 40 minutes until I could boot gnome instead
03:23TheBusbycan't SSH into the box from another machine?
03:23bobo_lol
03:23LauJensens/guys/keys/
03:23sexpbot<LauJensen> Well. I boot up, only to find Awesome broken by an update. Jump out to tty1 to fix it, only to find out that I accidentally installed 'neo keyboard layout' for the ttys (dunno how I did that), so Ive had to sit and guess keys for 40 minutes until I could boot gnome instead
03:24TheBusbyI use dwm+dvorak and have run across similar problems in the past. I usually just SSH in to the box if the keymap gets too broken.
03:25ordnungswidrigLauJensen: the fun with linux is that you are finally able to fix this in 40 minutes. On a windows box you'd have to reinstall the os and who knows what else, which would take 40 hours...
03:25bartj_na_ka_na_, give sphinx a look
03:26bartj_na_ka_na_, from what I have read, the search index is created from the database tables
03:27tomojnone of those provide a prebuilt way to map json into queries, though, do they?
03:27ordnungswidrigIntelliJ IDEA now has a "Powersafe mode" what the ???
03:27LauJensenThis stuff really ticks me off. When you boot your computer in the morning, its because you want to get to work, not to debug your system. Guess I should stop running off the Arch/TESTING repos. Everything on my system is unstable, incl. the kernel
03:27tomojwell, if you're using solr for example you can just query solr, so there's no need for clojure code to parse queries
03:27tomojsimilarly for the others I imagine
03:27bobo_LauJensen: yes, you should stop that
03:28tomojLauJensen: hah. maybe play with the unstable stuff on a non-work box?
03:28bobo_i feel dangerus for using chrome unstable on my workbox.
03:28bartj_na_ka_na_, you can find a great deal of information here: http://www.quora.com/How-do-Solr-Lucene-and-Sphinx-compare
03:28bartj_na_ka_na_, which should help you decide
03:29ordnungswidrigLauJensen: I know that, I usually run debian unstable. In 99% this gives me an advantage but the 1% days where suddenly "everthing" is broken are annoying
03:30TheBusbyI recommend having other systems running bleeding edge stuff, but have your desk terminal running something super stable and just leave it on for months.
03:30bobo_in what way does it give you an advantage?
03:30LauJensenGuess I just should just keep a 2-day old backup which I can revert system files to
03:30LauJensenTheBusby: You're not like me, I dont function well if Im not on the bleeding edge
03:30LauJensenordnungswidrig: yea, its weird hearing 'debian' and 'advantage' in the same sentence
03:30TheBusbyLau: I do that as well, just not on my main terminal
03:31ordnungswidrigbobo_: newer version of git, gnome, X, whatever. debian stable has a slow release cycle
03:31TheBusbyhave two computers sitting side by side, the stable one connected by mouse and keyboard and the other connected via ssh -x
03:31bobo_oh yeh true, debian is special in that way
03:31ordnungswidrigLauJensen: come on, the debian packaging system is rather well done and the package maintainers do an awesome job.
03:31ordnungswidrigLauJensen: renanimg firefox to iceweasel is akword, though
03:31LauJensenordnungswidrig: the maintainers are commited, but apt-get is the worst packagemanager in the history of slow programs
03:32ordnungswidrigLauJensen: slow?
03:32LauJensenapt-get is über slow. I think its like 110x slower than pacman
03:32LauJensenI can do about 80 system upgrades in around 80 seconds. apt-get cant even read its own database in that timeframe
03:33ordnungswidrigLauJensen: I must admit that I never took care about that. But you're right, it is surprisingly slow. But I think in the last year it became faster. Might be my faster system.
03:33LauJensenBut I remember the day, I had to install debian on a system for a hosted application. And there was some problem with the source I was loading, so I did a rebase and it said "rebase command not recognized", and I was like O_o. Then I hit git-version, and it was 1.1 or something like that, and this was 2007. I nearly fell of my chair, then determined never to install that distro anywhere ever again
03:34LauJensenI think I'll make a hacked Arch which just reports itself to be Debian in case a customer demands debian
03:34ordnungswidrigLauJensen: *g* I suppose this was debian stable?
03:34LauJensenordnungswidrig: apt-get is still slow. And it doesn't clean up right
03:34LauJensenordnungswidrig: yea
03:35TheBusbyI have better luck with Ubuntu server LTS releases
03:35ordnungswidrigdebian stable can be expected to be old. Except you hit the first 6 months after releae.
03:35ordnungswidrigLauJensen: you're on arch?
03:35LauJensenordnungswidrig: always, yea
03:37LauJensenAlso, when you install Ubuntu and hit 'sudo netstat -lnput', you almost have to pipe that to 'more', on arch you get zero services on the network
03:37ordnungswidrigLauJensen: so I'll try next time I install a desktop.
03:37LauJensenordnungswidrig: I have a screencast where I install Arch and then set it up as a pseduo-clustered Hadoop server :)
03:37TheBusbyLau: there is a significant difference between the desktop and server versions...
03:37LauJensenDoesn't tell you anything about its desktop capabilities. But be warned, if you dont know Arch, it takes a full day to install and customize
03:37ordnungswidrigLauJensen: heard of nixos? Nice concept, isolate every package and every dependency by using hard-links and build a snapshot infrastructure for your system.
03:37LauJensenordnungswidrig: Never heard of it
03:37ordnungswidrigLauJensen: about arch: I know how to google
03:37ordnungswidrig"In NixOS, the entire operating system — the kernel, applications, system packages, configuration files, and so on — is built by the http://nixos.org/nix from a description in a purely functional build language."
03:38tomojLauJensen: pseudo-clustered means one box acting like a cluster?
03:38scottj,(/ (* 24 60 60) 80)
03:38clojurebot1080
03:38scottjjust wondering how many times I can run apt-get while you install arch
03:38LauJensentomoj: yea, a cluster only defined in xml, doesn physically exist
03:38ordnungswidrigscottj: point for you
03:38bobo_i use apt-get at most once a day. its okay if it takes a min
03:38tomojLauJensen: do you use stuartsierra's clojure-hadoop?
03:38LauJensentomoj: yes
03:39ordnungswidrigthe idea of nixos resembles the idea of persistent data structures in a way
03:39tomojI've been thinking today about my experience with it
03:39tomojwhich has been terrible
03:39LauJensenreally?
03:39LauJensenI loved it
03:39tomojso I started trying to think up a replacement
03:39tomojbut I think I just haven't figured out how to use it yet
03:39tomojI ended up uberjaring every time I wanted to do a run
03:40tomojand debugging runs that errored out was difficult
03:40ordnungswidrigI think nixos has potential: "This builds and starts a virtual machine that contains the new system configuration"
03:40tomojI think what I'd like is to be able to run a job from the repl and have exceptions pop up in the repl
03:40tomojnow I have to figure out if clojure-hadoop can do that...
03:41ordnungswidrigwhat do you guys use hadoop for?
03:41LauJensentomoj: To run it from the repl requires some tricks, since Hadoop only accepts jobs in the jar format right?
03:41ordnungswidrigI never hat such big datasets that I was in need for massive job distribution
03:41tomojwell..
03:41tomojclojure-hadoop provides a way to run a job where you don't have to use hadoop's framework
03:42tomojjust for running the job on your local machine to develop/test/debug
03:43tomojso there must be some way to, from clojure, run a job
03:43LauJensenOk, you mean just to simulate?
03:43tomojI guess I can just call the gen-class's -main function..
03:44tomojyeah, I had problems with input/output encoding for example, and I just kept uberjaring and running, and only got non-interactive cryptic stacktraces
03:44tomojordnungswidrig: I use hadoop for some NLP stuff
03:45ordnungswidrigwould hadoop be the right to for implementing a recommender system? I mean the training phase?
03:46tomojyes, but have you seen mahout?
03:47ordnungswidrignope
03:47ordnungswidrigoh, nice.
03:48LauJensenordnungswidrig: Hadoop is right when you need to run a major (distributed) map-reduce process
03:49ordnungswidrigLauJensen: you mean, when couchdb won't fit anymore :)
03:49_na_ka_na_tomoj: We are still tinkering to find the right db .. but we've created an interface layer between the app and the db .. so the app is bound to the interface .. one of the first impls is simply a in-memory db .. so my first thoughts are json --> clojure --> db specific .. what do you think?
03:49LauJensenordnungswidrig: no, 'map-reduce process'
03:50TheBusbyHowever sick this sounds, I've actually had better luck with small C tools and the bashreduce script...
03:50ordnungswidrigLauJensen: just kidding :-)
03:53LauJensenTheBusby: Sounds a little sick... We want the big guns :)
03:54TheBusbythe implementation isn't "enterprisey", but it ends up being much faster than hadoop
03:54TheBusbyat least for the jobs I need to deal with
03:55LauJensenWell, C is sickly fast
03:55LauJensenQuite impressive
03:56ordnungswidrigTheBusby: do you have many long jobs or very many short ones?
03:56TheBusbyordnungswidrig: long jobs
03:56ordnungswidrigwell, I suppose, a cluster of FPGAs might be even faster
03:57ordnungswidrigbut we'll have to wait for CiC until we have clojure on an FPGA, right?
03:58jlkhello everyone - i've got a bit of a problem with invoking a dynamic method on a java bean object, with the intent of calling a setXXX method using a map as an argument. looking around there seems to be two ways of doing this, one using a macro, which seems to fail when providing functions as arguments, or by using clojure.lang.Reflector, which seems to fail when proving a nil value to (into-array). has anyone had any luck with this
03:58jlkhave any pointers?
03:59ordnungswidrigjik: have an example, gist, paste?
04:00jlkto clarify, (bean-cfg obj (merge {:name "value"} {:icon nil})) should evaluate as (.setName obj "value") (.setIcon obj nil)
04:00jlkone idea is using this (clojure.lang.Reflector/invokeInstanceMethod
04:00jlk obj
04:00jlk method-name
04:00jlk (into-array Object [v]))))
04:00jlk
04:00jlkwhich comes from the pragmatic programmers book
04:00TheBusbyOh, one last thing and I'll shut up. Piping things together in bash runs each in piece in parallel, so you're really bound by IO and available CPU.
04:02jlkthe other is using a macro to expand to (doto obj (.setXXX val)) etc, but i can't seem to get this working when the map is a function
04:05ordnungswidrigpost your example to http://clojure.pastebin.com/
04:05jlkok - i'll get onto that after tea :)
04:07LauJensenhttp://mailman.archlinux.org/pipermail/arch-dev-public/2010-September/017852.html
04:07LauJensenHard not to think fondly of Slackware...
04:10TheBusbyLauJensen: if you don't mind my asking, what do you find are the major advantages of awesome of dwm? (just found conkeror and wondering what other goodies you're already aware of ;)
04:10TheBusbys/of dwm/over dwm/
04:10LauJensenTheBusby: It enabled me to throw the mouse out the window :)
04:10sexpbot<TheBusby> LauJensen: if you don't mind my asking, what do you find are the major advantages of awesome over dwm? (just found conkeror and wondering what other goodies you're already aware of ;)
04:12AWizzArdDo we have a Swing expert here?
04:13LauJensenGotta boot, I think Ive sorted out the broken cairo package now
04:15LauJensenThere we go, much better
04:15LauJensenAWizzArd: Whats your Swing problem?
04:15javehello all
04:17AWizzArdLauJensen: I am not sure what code exactly I am supposed to run in the Swing thread. As I understand it right now *all* code that modifies visible components must be executed via SwingUtilities/invokeLater.
04:18LauJensenAWizzArd: Things like setText setForground setBackground etc dont need invokeLater, and somethings like setVerticalPosition of a ScrollPane does
04:18LauJensenand sometimes, (future) works just as well :)
04:23AWizzArdLauJensen: how can I find out what exactly I should run via invokeLater?
04:23LauJensenthe docs for invokelater? or trial and error.
04:23LauJensenSwing has many many inconsistencies
04:29AWizzArdSo, the best strategy will be to let all fast running code run in that thread. Gui creation itself, and each modification of it.
04:37LauJensenAWizzArd: I know this sounds silly, but because of the amount of inconsistencies I build the main UIs, added the animation, found the 1 component which broke and put that in its own thread
04:57fliebelmorning
04:58LauJensenmorning
04:58bartjfliebel, morning
05:02raekhow do I kill from the point to the beginning of the line in emacs?
05:09r0manraek: C-u -1 C-k ?
05:09r0manraek: no, nearly ;)
05:10r0manraek: C-u 0 C-k
05:11phobbsraek: C-k
05:12LauJensenraek: C-u 0 C-k, like r0man said
05:13raekthat did what I wanted. thanks!
05:15fliebelIs that the equivalent of d ^ in vim?
05:15LauJensenfliebel: frankly, who cares? :)
05:19phobbsfliebel: no
05:19phobbsin Vim that would be "d $"
05:19phobbskilling to _end_ of line
05:20phobbsby default there isn't an easy way to kill to beginning of line without a kill-region
05:20phobbsbut it's pretty easy to define a function that would
05:21phobbs(defun kill-to-beginning () (interactive) (kill-region (point) (beginning-of-line)))
05:21LauJensenAny JFreeChart experts here?
05:21raekLauJensen: those who use vim and are happy with it, I guess.
05:21LauJensenraek: you mean Chouser?
05:23phobbser, nevermind
05:24phobbs(defun kill-to-beginning () (interactive)
05:24phobbs (kill-region (point)
05:24phobbs (save-excursion (beginning-of-line)
05:24phobbs (point))))
05:24phobbsgeh
05:24phobbsthat's annoying
05:25phobbsoh right, (line-beginning-position)
05:25phobbsmy elisp is so rusty
05:26phobbsI also fail at reading
05:26phobbsdurrr
05:27phobbsbed time
05:27phobbsI cannot think
05:27jlk ordnungswidrig: hello again, i've posted some examples to http://clojure.pastebin.com/x3ibpy8e
05:28jlkordnungswidrig: i had some more, but have managed to delete them!
05:55zmyrgelhi, how can I test if a char is present in a string?
05:56mrBliss,(some {\a} "bladibla")
05:56clojurebot1
05:56mrBliss,(some {\a} "blodiblo")
05:56clojurebot1
05:56mrBlissnot like that :)
05:57LauJensen,((set "hi there") \h)
05:57clojurebot\h
05:58LauJensen,((set "nil") \h)
05:58clojurebotnil
05:58bobo_,(.contains "asdfasdfasdfasdf" "a")
05:58clojurebottrue
05:58mrBlissforgot the #!
05:58bobo_,(.contains "asdfasdfasdfasdf" "i")
05:58clojurebotfalse
05:58mrBliss,(some #{\a} "blodiblo")
05:58clojurebotnil
05:58mrBliss,(some {\a} "bladibla")
05:58clojurebot1
05:58mrBlissdid it again ;(
05:59zmyrgelI think the .contains is a good way to go
05:59mrBlissI agree
06:00LauJensenIts by far the best of the options shown here
06:01zmyrgelits pretty hard to make chess engine with clojure
06:01shanmuHello there, I am a newbie to Clojure, and I learning to process xml with Clojure
06:01LauJensenzmyrgel: really, why?
06:02zmyrgelLauJensen: can't just rewrite other engines as they aren't done with functional programming
06:02shanmuwhat's the difference between lazy-xml/parse-seq and lazy-xml/parse-tree, I have not been able to get lazy-xml/parse-seq to work with the examples from the source code?
06:03zmyrgelthat and the fact that I haven't done any 'real' work with clojure :)
06:03LauJensenzmyrgel: ok, yes its hard to port imperative code to Clojure, but I think writing a chess engine will be a lot more gratifying in Clojure than any other language, especially PHP and Java
06:03mrBlissshanmu: have a look at clojure.xml and clojure.contrib.zip-filter.xml
06:04zmyrgelLauJensen: yeah, its been pretty fun coding this.
06:04shanmumrBliss: Thanks, I did look at them and I was able to use them fine. I was interested in lazy-xml since it support xmlpull parsers...
06:05mrBlissshanmu: I'm planning to look into that myself sometime in the future
06:06shanmumtBliss: I meant clojure.contrib.lazy-xml
06:06mrBlissshanmu: I figured
06:07shanmumrBliss: oh..ok.. I am able to use lazy-xml/parse-trim fine.. its with lazy-xml/parse-seq I have problems
06:15mrBlissshanmu: same here :)
06:18shanmumrBliss: :)
06:24fliebelI seem to remember there is some magic in Java to concatenate paths, can someone hint me it's location?
06:25LauJensenfliebel: java.io.file takes 2 constructors, root path and file, thats sometimes helpful
06:27cemerickfliebel: see clojure.java.io/file
06:27cemerickWraps those ctors nicely
06:27fliebelcemerick: Helpful :)
06:29LauJensenfliebel: yea cemerick designed them nicely (make-file "<rootpath>/etc/</rootpath" "<filename>rc.conf</filename>"), it really couldn't be any simpler :)
06:30mrBlissshanmu: I got it working, have a look at http://github.com/clojure/clojure-contrib/blob/b8d2743d3a89e13fc9deb2844ca2167b34aaa9b6/src/main/clojure/clojure/contrib/lazy_xml.clj#L211
06:32LauJensencemerick: that talk you gave about deployment recently, is it up anywhere?
06:32cemerickLauJensen: no; that was a dry run of the draft of a talk I suspect I'll be giving at the conj next month
06:33LauJensenAre those all being recorded?
06:33cemerickI'll probably keep the lid on the materials until then
06:33cemerickAFAIK, yes
06:33LauJensenGreat
06:39shanmumrBliss: that example only tests lazy-xml/parse-trim not lazy-xml/parse-seq
06:43fliebelWhat is this supposed to mean? java.lang.Exception: lib names inside prefix lists must not contain periods (site.clj:1)
06:43neotyklast Wednesday Amsterdam Clojurians hosted Uncle Bob Martin doing Clojure introduction, here is a recording of it: http://vimeo.com/15046335
06:44fliebelneotyk: Cool
06:44mrBlissfliebel: you cannot do (use '[clojure xml contrib.io])
06:44mrBlissmind the last .
06:45zmyrgelWhere I can find which chars are allowed in records, function names etc.?
06:46fliebelmrBliss: Mine looks like (ns site (:use 'net.chouser.moustache))
06:46fliebelnvm
06:46fliebelquote
06:46mrBlissfliebel: indeed
06:47mrBlisszmyrgel: "Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, and ? (other characters will be allowed eventually"
06:50zmyrgelmrBliss: Thanks. Apparently gotta find new name for my 0x88state record
07:13zmyrgelHow can I make my recur to be in tail position?
07:13zmyrgelhttp://pastebin.com/xBei5k5J
07:17fliebelzmyrgel: You have some parens mixed up I think, the board at the end is causing trouble
07:18fliebelzmyrgel: A fn is also a recur point, so why the loop?
07:22zmyrgelfliebel: no need to supply the arguments
07:22zmyrgelbut I got it going again by replacing (when ..) stuff with cond
07:22fliebelokay :)
08:21_fogus__,+
08:21clojurebot#<core$_PLUS_ clojure.core$_PLUS_@2dacc6>
08:23LauJensenIm having this issue with JFreeChart, where the chart doesnt render if its not inside a JTabbedPane, JScrollPane and JPanel don't work - Anybody know whats up with that?
08:34LauJensen_fogus__: any good?
08:40LauJensenAWizzArd: Ive just seen an example now, where updating UI components using invokeLater caused the update to hang
08:41_fogus__LauJensen: It's not too bad. Very Uncle Bob-ish (tiny errors, mixed with grand statements, mixed with large errors, mixed with fact)
08:42LauJensenhehe
08:42LauJensenI'll have to see for myself I guess :)
08:43fliebelWhat is the best way to make data available to a Ring middleware? Lets say I gave a arg to my app, now hanging somewhere in -main, which started a jetty server. How is my poor middleware ever going to get to that arg? It feels wrong to put it somewhere global, so the middleware can access it.
08:46fliebelI could stuff it in an atom somewhere, or do something smart with closures, but it all feels wrong and very tightly coupled.
08:47cemerickfliebel: the premise seems like a warning sign
08:47cemerickmiddleware are ideally pure functions
08:47fliebelcemerick: It probably is...
08:47shooverfliebel: is it application state, or configuration data?
08:48fliebelshoover: Configuration. It's the path where the whole thing is running.
08:48shooverI don't see anything wrong with putting that in a global var
08:48cemerickthat's a perfectly-reasonable var
08:48cemerickfliebel: although I'll have to berate you at some point for caring about where the whole thing is running ;-)
08:49AWizzArdLauJensen: Do you have a link to that example?
08:49LauJensenAWizzArd: no, its a proprietary system Im working on right now
08:50shooverfliebel: Also, if you consistently start java from the application root directory, relative paths in File objects will work fine
08:50fliebelshoover: That is the point, it might be started somewhere else, with a path as argument, and I'd like to know where to find my stuff in that case.
08:51AWizzArdLauJensen: Can you explain it? The only idea I have is that this update is time consuming and should run in a SwingWorker instead?
08:51fliebelcemerick: But I can't define a var inside of -main, can I?
08:51cemerickfliebel: you can, but problably wouldn't want to
08:52cemerick.setRootBinding will work, or you can just reset! an atom you put in the var
08:52Chousukealter-var-root rather :P
08:52fliebelcemerick: So how do i get my path in a var? Atom?
08:52cemerickChousuke: I'm old-school, I guess. :-P
08:52LauJensenfliebel: (app (with-your-middleware your-date) [""] your-handler)
08:52cemerickfliebel: Needing to know where the app is running should be absolutely unnecessary, it seems.
08:53LauJensens/date/data/
08:53sexpbot<LauJensen> fliebel: (app (with-your-middleware your-data) [""] your-handler)
08:54shoovercemerick: One example of that in action is how ring looks for static files, looking in public/
08:55fliebelshoover: You pass a path to wrap-file, don't you?
08:55cemerickshoover: I think having ring serve static files is a little nutty. *shrug*
08:56Chousukefliebel: couldn't you pass a classpath-relative path?
08:56cemerickjust about any app container will serve static files better than ring will
08:58shoovercemerick: Probably so. Maybe someday I'll have enough traffic to care
08:58cemerickeh, it's not a scale thing, it's a separation-of-concerns thing.
08:59cemerickhrm, and a mime-type and etag and ... thing
09:00shooverring can do Content-Type and Last-Modified, at least
09:00fliebelcemerick: I don't need to know where my app is running, but rather which dir contains the files to be served. When it's not '.', I'm screwed. So that is why my middleware needs to know where to look. That path is a command-lin arg, so only available in -main currently.
09:01cemerickfliebel: just use an app container, and let it serve your files (jetty or tomcat or grizzly or jboss or ... will do)
09:02fliebelcemerick: I'd do that for a real server, but this is only sortof a preview thing, which actually parses markdown, and not justs sends html.
09:02cemerickshoover: Yeah, it's not a hard problem at all, just something that I don't think should be in the stack at all. More-than-one-way-to-do-it is poisonous over the long haul, especially for commodity functionality.
09:03cemerickfliebel: you're not using jetty already somewhere?
09:03fliebelcemerick: Yea, for static files, but I need my Moustache app to parse markdown files, which live on the path variable I'm after.
09:05shooverfliebel: Pick one of def, alter-var-root, or binding, and you'll be fine
09:05cemerickfliebel: I'd drop them in the classpath, as Chousuke suggested. That's how I access enlive templates.
09:06shooverer, not binding, since other threads will probably process the requests
09:06fliebelcemerick: Fair enough…
09:08fliebelCake puts resources on the path, right? So I can use that for testing.
09:10fliebelHmmm, it seems Leiningen does, but Cake doesn't.
09:11shoovercemerick: Container and separation of concerns are such big words, and yet (route/files "/") is so easy. Do you know of any simple recipes to point to for ring+jetty+server static files from the container?
09:14cemerickshoover: It (and a pile of other things) become trivial once you internalize the use of war files.
09:14cemerickif you're hosting using embedded jetty, you'd have to dig into jetty's API (which is excellent, and very comprehensive)
09:15shoovercemerick: That hasn't happened yet :)
09:16cemerickshoover: Further on the dark side, there's jetty-maven-plugin, which will start an embedded jetty server and automatically add your projects' webapp resources to the static file search path.
09:18lpetitcemerick: (just arrived in the room) NOOOoooo ! Don't tell me you're rewriting a servlet container in pure clojure for the needs of your generic repl server ! ! ! :)
09:19cemericklpetit: good lord no :-)
09:19lpetitfeeew
09:19cemerickTrying to get folks to reuse webapp deployment tools, etc. :-)
09:19cemerickA common refrain for me these days, it seems.
09:20cemericklpetit: Any thoughts on a default timeout for REPL invocations?
09:21lpetitcemerick: Concerning a user interaction, not an IDE interaction ?
09:22cemerickapplicable to both, that would apply if no timeout is supplied by the client
09:23cemerickIt seems like we shouldn't allow naive usage to spin up an infinite computation.
09:23lpetitaren't we supposed to work in asynchronous mode ?
09:23lpetitOh, it's the timeout for the computation on the server side, sorry
09:23cemerickright
09:23lpetit1 minute ?
09:24cemerickheh, that's what I had chosen as a first thought
09:24cemerick:-)
09:24lpetitLong enough for most computations, small enough so that the user has the patience to wait and not brutally kill his REPL / IDE
09:24lpetitgreat minds etc. :)
09:27fliebelcemerick: I've added my dir to the cp. So far I'm able to load and do clojure stuff from it, but things like clojure.contrib.duck-streams/read-lines really do want a real path.
09:28cemerickfliebel: read-lines takes anything that duck-streams/reader will accept, including the URL you'd get from querying the classpath for a resource
09:30cemericklpetit: FYI, a first cut of the REPL is done -- I'm getting the tests nailed down now. Everything should be in a github repo by noon-ish.
09:30lpetitcemerick: lein's support in ccw seems to be within reach of few work. Stephan Mühlstrasser had already done the hard work of understanding how to embed lein in an OSGi plugin (for use of the new "labrepl support" feature he added, which is not working in 0.0.62, but which I have debugged and will be part of 0.0.63). So now, thanks to lein's embedded support functions, it seems quite easy to dynamically generate "push-only" menu en
09:31cemerickthat got cut off
09:31cemerick"push-only"
09:31cemerick?
09:31lpetitcemerick: wow. Almost wish I hadn't accepted this week-end trip with our friends, so that I could have played with it by tomorrow morning ! :)
09:31fliebelcemerick: Sounds good to me… How do I query the cp? I can't go about importing text files, can I?
09:33cemerickfliebel: use Class.getResource(). Getting a class from the right classloader (as opposed to just using java.lang.String, etc) is most easily done by referring to the class of a fn in your local namespace.
09:33lpetitcemerick: maybe, I must re-read the log's history... anyway I've given the links to yesterday's (or was it wednesday's ?) conversation on #clojure to smuhlst, he's willing to do it (and I'll don't have much time the next 30 days with the preparation of the slides for the conj)
09:33cemericklpetit: well, I still need to get ccw using the new REPL
09:34cemerickThat shouldn't take long, though the async nature of it may require a little reorganization.
09:34lpetitcemerick: I can help too
09:35cemerickYeah, I'm wondering just how much breakage you're willing to walk into ;-)
09:35lpetithmmm
09:48fliebelcemerick: I'm totally lost here… (.getResource Class "index.md") returns nil, and I can't figure out what you mean bu the ClassLoader stuff.
09:49cemerickfliebel: That will look for "index.md" via Class' class, which will use the boot classpath, which doesn't include your file.
09:50cemerickClassloader hierarchies are good things to know about.
09:50fliebelSo I have to have a class in the location I want to use?
09:50chouserunfortunately, have also been known to cause brain damage
09:50cemerickAnyway, if you have a fn 'foo' in the middleware's namespace, then just do (.getResource (class foo) "index.md")
09:51cemerickhrm, or "/index.md", I forget if a slash prefix is necessary or not
09:51chousernot
09:51chouser,(.getResource (class (fn [])) "clojure/core.clj")
09:51clojurebotnil
09:51chouseroh. well, that worked for me just now
09:51fliebelOkay, so I'll need to define something there first,
09:51chouser,(.getResource (class (fn [])) "clojure/core__init.class")
09:52clojurebotnil
09:52chouserhmph
09:53cemerickfliebel: that's just a shortcut -- any fn that is loaded in the same classloader as that which contains a path to the dir that index.md is in will work as well
09:53fliebeloooh, it gives a java.net.URL
09:53cemerickyup
09:53LauJensen,(-> (clojure.lang.RT/baseLoader) (.getResource "clojure/core.clj"))
09:53clojurebotnil
09:53LauJensenoh well, works when its not in the sandbox
09:54fliebelI see :)
09:54cemerick,(-> (fn []) class (.getResource "clojure/core.clj"))
09:54clojurebotnil
09:54cemerickhrm
09:54cemerickThat doesn't seem to be a sandbox issue -- there's no security manager denial.
09:55LauJensencemerick: It works locally and Ive used it in webapps to serve resources from the jar
09:55cemerick,(-> (File. "/") .listFiles seq)
09:55clojurebotjava.lang.IllegalArgumentException: Unable to resolve classname: File
09:55LauJensen-> (-> (clojure.lang.RT/baseLoader) (.getResource "clojure/core.clj"))
09:55sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: ()
09:55cemerick,(-> (java.io.File. "/") .listFiles seq)
09:55clojurebotjava.security.AccessControlException: access denied (java.io.FilePermission / read)
09:55LauJensen$mail Raynes (-> (clojure.lang.RT/baseLoader) (.getResource "clojure/core.clj"))
09:55sexpbotMessage saved.
09:55chouserI knew about RT/baseLoader's .getResource, but didn't realize it was a method of Class.
09:55LauJensencemerick: heard of file-seq ?
09:56cemerickLauJensen: yeah, but haven't internalized it nearly as well as I have File's methods
09:56LauJensengetResourceAsStream is the most useful in webapps
09:56LauJensencemerick: commence internalization now plz
09:57cemerickunlikely. Just like I'll never forget .addActionListener, etc.
09:58LauJensencemerick: Why should you forget that?
09:58cemerickHopefully for a future where I'm not doing swing UIs anymore.
10:01shooverBut you'd still need cemerick's snippet if for some reason you didn't want the seq to recurse, right?
10:11LauJensenshoover: yep
10:26fliebelYeeeeeaaaa! It works! I dumped all my absolute paths for cp relative paths
10:26arkhis there a way to enumerate or count the number of running threads?
10:27chouserarkh: (keys (Thread/getAllStackTraces))
10:27arkhchouser: thank you
10:29fliebelWow, I'm on 8 if I start a frsh repl :-o
10:29chouser4 here
10:30chouser,(map #(.getName %) (keys (Thread/getAllStackTraces)))
10:30clojurebotjava.lang.Exception: No such namespace: Thread
10:30chouser->(map #(.getName %) (keys (Thread/getAllStackTraces)))
10:30sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: ()
10:31chousermeh
10:31chouser("Reference Handler" "Signal Dispatcher" "main" "Finalizer")
10:31fliebel("Reference Handler" "Finalizer" "Thread-1" "Thread-0" "Signal Dispatcher" "DestroyJavaVM")
10:32arkhis there an issue with clojure.java.shell/sh leaving a thread hanging out after it's exec'ed process is finished? For every call of (sh), (count (keys (Thread/getAllStackTraces))) comes back with one addition thread
10:32AWizzArdDo you use Nimbus or http://weblogs.java.net/blog/wzberger/archive/2009/11/22/synthetica-blackeye-highlights ?
10:32chouserarkh: uh oh.
10:32AWizzArdoops, wrong window, that was for LauJensen :)
10:32arkhmy program won't exit until I call (shutdown-agents)
10:32chouserarkh: yeah, that's expected. but the leaked thread is not, I think.
10:32cemerickthe non-daemon threads in Agent.java strike again
10:33chousercemerick: we also really did have issues when the default was the other way around.
10:33arkhat a repl, the prompt returns (so it's not totally blocking) but thread count increments with each call to (sh) still
10:34chouseroh, it's using future.
10:35cemerickchouser: IIRC, only in cases where mains would send some actions off (or similar) and assume that the related threads would hold the vm open
10:35arkhfwiw, future uses clojure.lang.Agent
10:35chouserarkh: I would expect those threads to get reused and/or cleaned up eventually
10:36arkhchouser: gc might take care of them?
10:36arkhI'd be ok with that
10:36chouserno, but the thread pool executor used by future should.
10:36arkhoh
10:38arkhchouser: you're correct
10:38arkh: )
10:39arkhif I do this: (dotimes [_ 10] (let [s (clojure.java.shell/sh "ls")] (prn s))), wait 10 seconds, do it again, I have 6 threads running by the end of it
10:39chouserheh, yeah. I just did: (dotimes [_ 1000] (clojure.java.shell/sh "ls") (Thread/sleep 100))
10:39chouser6 threads immediately afterward
10:40chouserthat runs for almost 2 minutes, so don't get panicky
10:40arkhI feel good about using (sh) then - thanks : )
10:40chouserIt would be nice if Agent named it pool threads better
10:53hugodI think I understand part of why the tests fail in c.c.logging - there is interaction between the tests, as if the tests were running in parallel - adding a binding for log/*logging-agent* within each of the failing tests should "fix" them
11:10stuartsierrahugod: can you post that somewhere I can look at it later?
11:10stuartsierrabetter yet, write a patch :)
11:12hugodstuartsierra: where would you like it - the user list? I'm at a loss to explain why there is an interaction
11:17stuartsierrahugod: are you on the dev list? I had a thread there about it
11:17hugodstuartsierra: membership pending last I checked...
11:19cemerickhuh, I'm surprised that the conj talks are one / speaker
11:19stuartsierrahugod: user list, then
11:25chousercemerick: I'm not too surprised. With one track, they probably just ran out of time slots.
11:26shooveroh man, if I can make it to clojure/conj I will know everything I need to about WAR files
11:26chouserassuming one talk per hour, we've already got 7 hours per day
11:27cemerickchouser: Didn't someone on the speakers list say the slots were 30m?
11:27chousercemerick: yep, plus "plenty of time for questions and discussions" or something like that.
11:27cemerickoh, that's talk-time, not full-time-on-stage
11:28chouserI hope to prepare a couple of interesting things to talk about/collaborate on to fill up the unscheduled time.
11:28cemerickI really enjoyed the format of those quickfire talks at ILC.
11:28chouser"talk about" in the truely interactive sense -- conversations, not speeches.
11:42chousercemerick: I didn't see any of those
11:42chouserpaid for a whole conference and went for one day. :-P
11:43cemerickchouser: Right, I forgot you were only there the first day.
11:43cemerickIt was a good time.
11:44chouserI'm sure it was
11:44cemerickI got to have dinner with Rich, Guy Steele, Sussman, Alexy Radul, and a variety of others.
11:44cemerickQuite memorable.
11:44chouserwow, awesome.
11:45chouserI ran into Guy Steele in the hall, but had nothing to say. :-/
11:46cemerickI can't say I had anything genius to say, either -- I remember there was a lot of transactional memory talk, as that was apparently the specialty of Victor and one other fellow on Guy's Fortress team.
11:46cemerickI was mostly there to take advantage of the osmosis. :-)
11:47chouseryeah, it's good to have other smart people there to ask questions for you. :-)
11:47cemerickha
11:52fliebelAnyone knows what this might mean? http://clojure.pastebin.com/r3Wq4P6y I hate stack traces...
11:53chouser,{:a 1 :a 2}
11:53clojurebotDuplicate key: :a
11:53chouser,{"" 1, "" 2}
11:53clojurebotDuplicate key:
11:53chousermaybe something like that?
11:53chouser,{nil 1, nil 2}
11:53clojurebotDuplicate key: null
11:53fliebelOkay… Could be… no idea where though...
11:54chouserfile_info.clj line 100
11:54sdeobaldHmm. I asked this in #leiningen, but I think everyone there is asleep or disinterested: Is there a standard way to force-execute code after `lein repl' finishes requiring in deps?
11:54fliebelchouser: That's a Ring files
11:55sdeobaldLooking at the code, user-init runs before deps are loaded, and the loading of deps with load-hooks only requires (which makes sense).
11:56sdeobaldOr perhaps there's a more sensible way to get a repl executing code when it starts? I'm sure there's an obvious answer I'm not thinking of.
11:57ohpauleezsdeobald: What do you need to run?
11:57ohpauleezcould you just pack it in a function and call it via the repl?
11:57ohpauleezyou can also write your own script and put it in 'scripts'
11:57sdeobaldohpauleez: Just a function as an entry point to a back-and-forth between the user and the repl.
11:58ohpauleezYou may want to look into using a custom script (that in turn calls clojure's Repl stuff)
11:58sdeobald'scripts'? -- is that a standard lein thing?
11:59sdeobaldAh
12:00chouserfliebel: might be worth looking at that ring line anyway. Looks like the http request is bad somehow.
12:01fliebelchouser: Nope, my response is bad I think...
12:01ohpauleezsdeobald: Not a core feature, but a common plugin
12:01sdeobaldohpauleez: Ah, cool. Thanks.
12:02hiredmanuh
12:02ohpauleeznp
12:02hiredmandoes lein repl actually require deps?
12:02hiredmanor does it just put lib on the classpath?
12:02sdeobaldhiredman: heh... just noticed that.
12:03chousernooo.. Uncle Bob lying to the masses...
12:03sdeobaldThe latter.
12:03hiredmanchouser: stop the presses!
12:03hiredman(actually I am watching his video as we speak)
12:03chouserabout Clojure, though. Someone is wrong on the internet!
12:03chouserhiredman: me too
12:03ohpauleezlink?
12:03clojurebotyour link is dead
12:04hiredmanclojurebot: botsnack
12:04clojurebotthanks; that was delicious. (nom nom nom)
12:04cemerickchouser: what's the offense this time?
12:04chouserHis intro to def and Var is wrong.
12:04cemerickdidn't get that far
12:04chouserhe said redefining a Var is undefined.
12:04chouser~17 minutes in
12:04clojurebotGabh mo leithscéal?
12:04chouserohpauleez: http://vimeo.com/15046335
12:04ohpauleezchouser: thank you kindly
12:05hiredmanoh geez
12:05hiredmanhis code has parens on trailing lines
12:05chouserheh
12:06chousergah
12:06chouser[] is not a Java Vector
12:06cemerickjeez, seriously?
12:07chouserI'm enjoying his style -- I'm sure many people will find it engaging and interesting.
12:07adbenHi everyone,
12:08adbenI just want to share with you guys, this interesting intro video to clojure, http://vimeo.com/15046335 by Uncle bob martin
12:08chouseradben: we were just talking about that. :-)
12:09hiredmancritiquing that
12:10cemerickchouser: I'm upbraiding him now. That vector snafu was bad.
12:11chouserhe's now introducing defstruct
12:11cemerickyeah
12:11cemerickwe need to get him in here on a regular basis or something.
12:11chouser:-)
12:12technomancymore like self-defstruct, amirite?
12:12chouserheh
12:12chouserunderscore in fn name. heehee
12:13ohpauleezhahaha
12:14chouserbut again, these are all fiddly details. The structure of this talk is good and engaging.
12:15chouser,(instance? java.util.HashMap {})
12:15clojurebotfalse
12:15neotyk,(instance? java.util.Map {})
12:15clojurebottrue
12:15neotykbut he attracted a lot of people to this meeting
12:16chouseryup, fiddly detail. His point was correct, what he actually said was ... close.
12:16hiredmanmaybe I should get clojurebot's twitter transport working so ub can play with clojurebot via twitter
12:16neotykwe never had so many new faces in here so far
12:18scottjI can't stand his style, in this talk or his smalltalk one. he strikes me as one of those big idea guys that's not concerned with whether the precise details match up with his vision.
12:18burritoboyI have installed clojure and clojure-contrib through homebrew but clojure-contrib doesn't seem available when I try requiring through clj
12:19chouserscottj: hm, but at least he's at a repl. you can only get so far from the truth and still get things to actually work.
12:19neotykand it was introduction session, way he is building things one on another was nice
12:19chouserneotyk: yes, I agree with that.
12:20hiredmanburritoboy: don't "install" clojure
12:20burritoboyhiredman: why not?
12:20chouserI've done a couple intro talks recently and while I said fewer things that were untrue, I'm sure it was less interesting.
12:20raekburritoboy: that's usually not how clojure is used
12:21hiredmanclojure is just another project dependency, so you will specify which versions of clojure/contrib in project.clj or pom.xml and your dependency management will get the right version for your project
12:21chouserreally?
12:21hiredmanclojurebot: lein?
12:21clojurebotlein uberjar bug is usually when you don't have a :main specified correctly: http://groups.google.com/group/leiningen/msg/d0a36ae9b92ab1f1
12:21hiredmanclojurebot: jerk
12:21raekburritoboy: use http://github.com/liebke/cljr or http://github.com/technomancy/leiningen or http://github.com/ninjudd/cake to start up clojure
12:21clojurebotI don't understand.
12:22technomancyclojurebot: forget lein uberjar bug
12:22cemerickI suspect burritoboy is already confused. :-(
12:22clojurebotleiningen is a build tool designed not to set your hair on fire (http://github.com/technomancy/leiningen)
12:22cemerickburritoboy: there are getting started guides here for various environments: http://www.assembla.com/wiki/show/clojure/Getting_Started
12:22hiredmanchouser: regardless of how you do it, using homebrew/apt-get/whatever system package management is clearly a bad idea
12:23amalloyyes. apt-get made things a hassle for me before i tried lein
12:23chouser:-(
12:23cemericksystem package managers make a hash of anything java-library-related, AFAICT
12:24chouserI'm pretty sure that's java's fault
12:24chouserbut I guess that's where we are, so ... *sigh*
12:24technomancyit's the fault of the don't put everything on the classpath mentality
12:24cemerickchouser: that's decidedly not the case IMO
12:25burritoboyso, I mean if I am just in the REPL and want to use a clojure-contrib lib then, I have to completely redo how I have clojure set up?
12:25hiredmanyou just have to do it right
12:25hiredmanif you want it dirt simple
12:25hiredmanclojurebot: dirt simple
12:25clojurebothttp://www.thelastcitadel.com/dirt-simple-clojure
12:25cemerickburritoboy: if the contrib jar is on your classpath to begin with, then you can use contrib libs at your leisure
12:25technomancyhiredman: heh; syslink
12:26hiredmandamn it
12:26hiredmanI always do that
12:26burritoboyok cool
12:27raekburritoboy: clojure-contrib needs to be on the classpath somehow. that's about it. there are vaious ways of handling the classpath and calling java on the command line might not be the simplest one...
12:27chouser"there is no looping construct in clojure except calling yourself"
12:27scottjwhile? :)
12:27technomancywat
12:27mrBlissscottj: loop
12:28burritoboyraek: yeah, right now my CLASSPATH is blank, so I guess that is the only issue
12:28scottjmrBliss: oh I think of loop as a fn with recur as calling itself
12:29chouserscottj: that's mostly ok. :-)
12:29hiredmanthere was a time when fns weren't recur targets
12:30chouser,((fn f [a & b] (if (zero? a) (f 1 2 3) :ok)) 0)
12:30clojurebot:ok
12:30chouser,((fn f [a & b] (if (zero? a) (recur 1 2 3) :ok)) 0)
12:30clojurebotjava.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 2 args, got: 3
12:30raekwith leiningen, after creating a project: "lein repl", manually: java -cp 'path/to/clojure.jar:path/to/clojure.contrib.jar:path/to/src/:path/to/another/lib.jar' clojure.main
12:31raekburritoboy: if you want to "just get a repl", try cljr. you only need to download one jar, then cljr takes care of everything else
12:33chousers/list/seq/
12:34burritoboyraek: I have a repl working just fine, I am just to the next step of needing something from clojure-contrib, looks like I need to do a little more config to get that pulled into my classpath
12:35cemerickburritoboy: what language/platform are you most familiar with already?
12:35burritoboycemerick: ruby
12:35burritoboycemerick: unfortunately haven't done any java before
12:36chouserburritoboy: Steel yourself. It may hurt, but will be worth it in the end.
12:37cemerickburritoboy: Unless you want to learn the JVM bits in earnest right now (nevertheless recommended/necessary at some point), I'd point you at cake.
12:38astoddardNaive clojure swank question - it looks like having a big classpath results in very slow swank server startup. I should expect this?
12:38burritoboychouser: yeah, thanks I am doing a little 'clojure for beginners' online class
12:38burritoboycemerick: cool, I will take a look at cake
12:39cemerickburritoboy: if you're going to be helping anyone with any java or .NET background, I'd suggest you point them at maven + clojure-maven-plugin
12:40burritoboycemerick: I am mostly being helped now, but I will be sure to point those folks that way, thanks
12:40cemerickoh, *you're* in the class -- I read your last msg as you were teaching others :-)
12:41burritoboycemerick: ah, no, pupil here (if you couldn't already tell)
12:42cemerickYou can go a long ways with just clojure core, a command line REPL, and little JVM-specific knowledge.
12:42chouserlet does not create a var
12:43burritoboycemerick: I am making headway with clojure core, and REPL, I basically know nothing of the JVM though
12:44burritoboychouser: what about binding? ;)
12:44Raynesburritoboy: Which one are you? I'm one of the mentors on that class.
12:44chouserburritoboy: good question! binding also does not create a var. :-)
12:45burritoboyRaynes: Bobby Wilson
12:45RaynesLauJensen: Why should that work?
12:46chouserburritoboy: perhaps you're thinking of with-local-vars, but that it pretty rarely used.
12:49LauJensen Raynes: you know the deal
12:49RaynesLauJensen: No, seriously, I don't have any idea what that does.
12:51chousertype hints do not do "strong static typing", nor does hinting a fn's formal args make calls to it any faster.
12:52LauJensenRaynes: The deal is, if I cant eval code, I mail you :) And that just lets me get a URL or Stream handle to a resource on the classpath
12:52LauJensenI have to jet, good weekend everybody
12:53ohpauleezchouser: what brought that up? Just reviewing yesterday's lessons? :)
12:54chouserohpauleez: I'm making true statements that contradict or clarify things I'm hearing Uncle Bob Martin say on this recording.
12:54ohpauleezohh, gotcha. I couldn't get more than halfway through
12:54chouserohpauleez: oh?
12:55chouserwhew, done.
12:55ohpauleezI appreciated how he went about moving through the topics, and I'm happy to see more talks about clojure being done
12:55chouserNow I suppose I should collect these notes and do something useful with them.
12:55chouserohpauleez: I fully agree.
12:56scottjpost them in the comments to the video
12:56ohpauleezbut I didn't like the general tone
12:57ohpauleezI tend to type hint when I don't have, for readability. Is this a bad practice that I should break?
12:57mattreplif anyone's been using clj-oauth, please let me know. I'm baffled why it worked with Twitter a month ago, but now it doesn't. but it still works fine with other OAuth services
12:57cemerickI do the same thing
12:57ohpauleezIt's usually done when I clean up comments, reorganize, etc
12:57mattreplI'd like to collect a compatibility list so I can make sure bugs are squashed
12:57cemerickI'm not pedantic about it, but I certainly do it to clarify ambiguities
12:57ohpauleezsame here
12:58scottjit beats writing a doc string that just relists all the args and what type they are
12:58chouserohpauleez: I would generally recommend against it.
12:58chousergenerally, type hinting things that don't need to by type hinted will not be checked by the compiler
12:58ohpauleezchouser: for style purposes or is there an unseen consequence?
12:59chouser,(let [a "5" b 10] (Integer/valueOf ^Integer a b))
12:59clojurebot5
13:00ohpauleezright
13:00ohpauleezso you're argument is they can be misleading
13:00ohpauleezor all together wrong
13:00chouserthe type hint there is no better than a comment in it's effect on the compiler, but looks like its code that matters.
13:00ohpauleezah, gotcha
13:00RaynesOh wow. I have a src directory set up like src/clj src/jvm, and when I add src to the git repo with git add, it only sees src/jvm.
13:00RaynesThat is *annoying*
13:01chouserRaynes: what?
13:01cemerickthe src/clj dir is probably empty
13:01chouserah
13:01Raynescemerick: Nosir.
13:01RaynesI can't even add it after the fact. It's as if it simply doesn't see it.
13:02cemerickwell, you can't add directories...
13:02chousergit add is recursive by default
13:02cemericknm then
13:02RaynesI know, but there is definitely a file in there.
13:02cemerickI always use gitx :-P
13:02scottj.gitignore?
13:02chouserRaynes: do you have an .ignore setting somewhere?
13:02chouserwhat scottj said. :-)
13:03RaynesOh, I think I see what might have caused that.
13:03RaynesYeah, one of my subdirectories is webrepl, and I had that gitignore'd
13:03RaynesNever would have thought of that.
13:04RaynesThis was one of those rare cases where I actually touched the .gitignore file.
13:07ohpauleezstyle suggestion: http://gist.github.com/584553
13:08ohpauleezdon't mind the code, it's more or less justa delay
13:08scottjI think ^:foo is ^{:foo true}
13:09stuartsierrascottj: only in 1.3 onwards
13:09ohpauleezahh, awesome, thank you scottj
13:09ohpauleezthat's ok, I'm using 1.3
13:09ohpauleezbut should it be done in style 1 or style 2
13:10ChousukeI like the second one
13:11Chousukelooks somewhat like a decorator
13:11ohpauleezthat was my thought too, weird. But in the if statement, it looked a little funny
13:28scottjtesters: what are you using to continually run your tests and display readable results?
13:29scottjs/results/error messages. it can be hard to see differences in not = form, would be nice to have differences highlighted or something
13:29ohpauleezscottj: difftest looks cool
13:30ohpauleezhttp://github.com/brentonashworth/lein-difftest
13:31scottjohpauleez: sweet, thanks
13:31ohpauleeznp
13:40fliebelIs there a way to get a defn- form another module? I mean… are they private in the Python or the Java sense of the word?
13:41RaynesI believe you can refer to a private var in another namespace with #'someprivatevar, can't you?
13:42chouserhm... hinting a static fn's args to be primitive may make some calls to it faster.
13:42chouserRaynes: yeah, #'other-namespace/var-name
13:42RaynesOh.
13:42hiredmanfliebel: compile time var resolution is blocked by {:private true} in the vars metadata
13:42RaynesI knew it was something like that.
13:42chouserthat's the var itself. precede with @ if you want the value
13:43fliebelLet me see
13:43hiredmanclojure doesn't have modules
13:43hiredmanperhaps you mean namespaces?
13:43fliebelyea, those :)
13:43fliebel#'works :)
13:43hiredmanwell, say what you mean then
13:44technomancychouser: some tools will show arglists in a more convenient place than the docstring, so I could see a case for putting human-facing type hints there.
13:44RaynesWhoa.
13:44RaynesPlay nice. :\
13:44fliebelhiredman: I was trying to get a private var form another namespace, but #' seems to work. What exactly does it mean?
13:44testfoobarWow, a decent browser-based irc client!
13:45hiredman,(macroexpand-1 '#'foo)
13:45clojurebot(var foo)
13:45hiredmanclojurebot: special_forms
13:45clojurebotExcuse me?
13:45hiredmanclojurebot: special forms?
13:45clojurebotexcusez-moi
13:45hiredmanclojurebot: I hate you
13:45clojurebotexcusez-moi
13:45Rayneshttp://clojure.org/special_forms#var
13:45technomancyhiredman: gotta keep your automaton under control.
13:46hiredmanthere is a list of special forms on the clojure website
13:46hiredmanclojurebot: special forms |are| http://clojure.org/special_forms
13:46clojurebotAlles klar
13:47unclebobmartinAm I here?
13:47cemerickunclebobmartin: hey, you made it! :-)
13:47unclebobmartin<grin>
13:47unclebobmartinAll the way from amsterdam...
13:47cemerickchouser: got those notes for unclebobmartin ?
13:47cemerick;-)
13:48fliebelunclebobmartin: Missed your talk there :( I was with the Amsterdam Clojurians just the week before.
13:48cemerickunclebobmartin: we were talking about your vid earlier.
13:48unclebobmartinYeah, I saw them on twitter.
13:48unclebobmartinI was trying to be kind to the audience.
13:48unclebobmartinI did the presentation before records were added, and haven't changed it yet...
13:48cemerickIndeed, usually a good plan.
13:49chouserunclebobmartin: I just added some notes to your video.
13:49unclebobmartinCool, thanks. I'll look them over.
13:49cemerickunclebobmartin: I found myself in a pedantic mood today, unfortunately. Glad to have you here, in any case.
13:50unclebobmartinThe business about [1,2,3] being a vector... I understand that the vector is persistent, but I thought you could still pass it to Java as a java vector. Am I wrong about that?
13:50cemerickClojure vectors are java.util.Lists
13:50chouserunclebobmartin: as I mentioned here before you arrived, I've given some intro talks recently and appreciated the way you structured yours -- much more engaging.
13:50cemerickso, no, you're right about the interop aspect, but there are huge semantic differences
13:51unclebobmartinPlease go on...
13:51cemerickunclebobmartin: about Clojure vectors?
13:51chouserI have some details about that in my vimeo comments
13:51chouserhere: http://vimeo.com/15046335
13:51unclebobmartinYes, the semantic differences.
13:51scottjis there a predicate for whether a symbol is bound to a var? I'm trying to test if swank is loaded
13:52chouserscottj: try resolve
13:52chouser,(resolve 'this.is/not-here)
13:52clojurebotnil
13:52cemerickchouser: I don't see any comments of yours there?
13:53chouser,(resolve 'clojure.core/map)
13:53clojurebot#'clojure.core/map
13:53chousercemerick: they ... just deleted them? and closed the comments!?
13:54unclebobmartinI'm looking for comments, but I don't see any on the vimeo page. what am I missing?
13:54chouserI didn't save them anywhere else, dangit.
13:54cemerickunclebobmartin: All clojure data structures are persistent, for one. Second, those that support efficient lookup are also IFns.
13:54@rhickeyunclebobmartin: Clojure vectors are immutable while Java vectors are not. Clojure vectors are more like Java's ArrayLists in interface. But in all cases, Clojure's collections are different from the Java ones, but implement the read-only portion of the corresponding parent interface, i.e. j.u.List/Map/Set
13:54chouserI said all this :-(
13:54cemerickchouser: moderated?
13:54chouserit was visible. looks like it was then deleted.
13:55@rhickeychouser: in your comments? I can't see without refreshing, but am still watching
13:55chouserrhickey: my comments got deleted
13:55cemerickrhickey: they're just gone :-|
13:55chouserok, just found a backup. yay vim.
13:56unclebobmartinI"m not an irc wiz. can I reply to someone by just using their name and a colon? Is that a convention or does it keep the reply private?
13:56fliebelunclebobmartin: It just notifies the author
13:56cemerickunclebobmartin: Yup, that's right. that web irc client I linked for you also supports tab-completion of names.
13:56unclebobmartincemerick: Oh, that's nice!
13:57cemerickYeah, it's pretty decent :-)
13:57cemerickI'd suggest colloquy if you're going to use irc more than occasionally, though.
13:58@rhickeyunclebobmartin: I've got to run, but cemerick and chouser are definitive, especially when combined :)
13:58cemerickThis sounds like a Voltron episode.
14:00chouserok, my comments: http://gist.github.com/584634
14:01chousercemerick: I'm so glad you didn't say "power rangers"
14:01fliebelI thought I was supposed to put paths together like (clojure.java.io/file "/source" "/dir/" "/index.md") and Clojure would handle the slashes. But it gives me java.lang.IllegalArgumentException: /dir is not a relative path
14:02_fogus__Looks like I missed all the unclebob fun :(
14:03chouser_fogus__: he's still here
14:03chouserunclebobmartin: http://gist.github.com/584634 -- in case you missed my earlier link
14:03stuartsierrafliebel: 'file' assumes directory slashes between strings
14:04fliebelstuartsierra: I figures that… But now I nee to find another solution… Back to string magic, I guess.
14:04scottj(when (resolve 'somelib/foo) (somelib/foo)) doesn't work, is there another way to only eval/compile some code if a required lib is already there?
14:04bobo_chouser: very nice put
14:04unclebobOK, now I'm using colloquy.
14:04stuartsierrafliebel: (file (str ...))
14:08fliebelstuartsierra: I only need the path, I was using file to avoid having to deal with slashes or not. So just str with some selective striping will do.
14:08stuartsierrao
14:08stuartsierrak
14:10hiredmanclojurebot: forget?
14:10clojurebotyou need to put the verb in pipes
14:11chouserscottj: (when-let [foo (resolve 'somelib/foo)] (foo 1 2))
14:11_fogus__unclebob: Nice talk. Sounded like a fun group and definitely a fun speaker. :-)
14:13unclebob_fogus_: Thanks. I enjoy myself a bit too much with those talks.
14:14cemerickunclebob: I saw you were using IDEA -- what's your take on the current status of the clojure support there?
14:14cemerickI stay well-versed with the eclipse and netbeans plugins, but I rarely look in on intellij.
14:14_fogus__unclebob: It comes through in the audio. I wish that my talks were as effortless.
14:14hiredmanalso saw your trailing parens
14:15jstirrell`ok so I have to submit a school assignment and we can use any language so I'm using clojure. are there any problems with just sticking clojure.jar and a clj file in the same directory and calling clojure.main from the command line? does it matter what my namespace is with this structure? I'm running into wierd errors and im not sure if this is the reason
14:16bobo_jstirrell`: if you can, i would use leinigen och cake. makes everything easier.
14:17ohpauleezjstirrell`: I also suggest leiningen, and just build a jar or uberjar
14:17Rayneshiredman: Somewhere near, Greg Slepak is applauding.
14:17scottjcemerick: broken in several ways. someone said a total rewrite is coming soon, not sure if reliable
14:17chouserjstirrell`: something like java -cp clojure.jar clojure.main assignment.clj should work just fine
14:17jstirrell`yeah i normally do, but I was trying to avoid it to make things as simple as possible for the teacher who probably has never even heard of clojure
14:17cemerickscottj: hrm, so basically where it's always been :-|
14:18cemerickI'm nearing the point of putting all my eggs in the eclipse basket. Seems like a pretty good bet.
14:18scottjccw is good, and it's the only one that's been updated in many months I think
14:18chouserjstirrell`: uberjar isn't a bad idea either. then users only have to: java -jar your-uber.jar
14:19jstirrell`k sweet ill try that
14:19cemerickscottj: It definitely has a number of contributors. Laurent, cgrand, myself, and a few others.
14:27_fogus__So I guess I don't truly understand the format of the Conj talks. 30mins and then?
14:28chouser...then everybody mobs rhickey until the next talk starts.
14:28_fogus__Oh, so I guess I *did* understand. :p
14:28cemerick_fogus_: I was poking around the same topic earlier. I'm sure a schedule isn't far away.
14:29chouserI don't know either, but I expect unscheduled time to be very enjoyable and maybe even productive.
14:29jstirrell`anyone know a good place to put the lein file in gentoo?
14:29hiredman~/bin
14:29clojurebotIt's greek to me.
14:30jstirrell`k thank
14:30chousersingle track should allow for more ad-hoc activities than if people were off in different rooms
14:30cemerickI suspect a number of people will have things running on the side in between talks, after lunch, etc.
14:30cemerickI have one pet topic that I'd like to get something around. Hopefully it'll come off nicely.
14:30chousercemerick: yeah, like that. whatever it is. :-)
14:31_fogus__I guess my question is, the talks are 30-mins, and then what happens next? Milling around for 30-mins until the next talk?
14:31_fogus__I guess I should wait for a schedule.
14:31bobo_im going insane on paredit, is there any good video tutorial anywhere? havent found any
14:32scottjchouser: valiant effort. couldn't get your way to work for me so used eval, let me know if I missed something http://gist.github.com/584694
14:33dnolenbobo_: visual guide here, http://mumble.net/~campbell/emacs/paredit-beta.html
14:33scottjhmm, cemerick's pet topic, could it be ide support? :)
14:33bobo_dnolen: thanks il have a look
14:33cemerickscottj: no, Laurent is going to cover that ably, I'm sure.
14:34scottj_fogus__: does 30 min include questions?
14:34chouserscottj: no
14:35ranjit_cCan somebody help me figure out what I'm doing wrong in trying to use a library?
14:35chouserwe'll need at least 30 minutes between talks to get the next speaker's laptop working with the projector
14:35ranjit_cif i evaluate this : (use '(clojure.contrib.combinatorics))
14:36ranjit_cand then this: (doc cartesian-product)
14:36chouserscottj: doing def-things in eval like that isn't too horrible
14:36ranjit_ci get an error
14:36ranjit_ci'm not sure why
14:36chouserranjit_c: try (use 'clojure.contrib.combinatorics)
14:37ranjit_cthat worked, thanks
14:37ranjit_ci was pretty sure i tried that, but i guess no
14:37ranjit_ct
14:38arohnerstupid question: how do you build lein? lein uberjar isn't uber'ing for me
14:38arohner(no jars included in the uber, except lein.jar)
14:40ohpauleezarohner: Pull the git repo, and there are hacking directions in there
14:40ohpauleezeseentially you use lein and lein compile
14:40ohpauleezuse a stable lein, to compile the dev lein
14:40ohpauleezthen soft link your lein command to the new dev command
14:41ohpauleezand move the old stable lein to lein-stable
14:41arohnerohpauleez: I'm looking at the hacking instructions, and I don't see it
14:41vlaisneyarohner: you need only to get the script, which downloads and compile lein
14:42arohnerI'm experimenting with a bug fix. I've made the "normal" lein jar, and now I want to make a standalone jar that I can put in ~/.m2, because that's what the bash script looks for
14:43arohnerand the lein uberjar I built doesn't have the dependency jars, but the one I downloaded does
14:43jstirrell`ok anyone have any idea why this program isn't working (it prints 0 for all values) as it's supposed to, but if i just put everything in the repl (not in functions) it works fine?
14:43jstirrell`http://gist.github.com/584718
14:44arohnerjstirrell`: map is lazy. It only prints when it has to. The repl forces map to print, but your program doesn't
14:44arohnersorry, it only *evaluates* when it has to
14:44jstirrell`so dorun to the maps should fix that?
14:44arohnerjstirrell`: yes
14:45jstirrell`ok thanks! i thought it was something like that
14:47ranjit_cokay, so i've still got a problem
14:47ranjit_c(doc cartesian-product) works
14:47clojurebot"clojure.contrib.combinatorics/cartesian-product;[[& seqs]]; All the ways to take one item from each sequence"
14:47ranjit_cbut for some reason (cartesian-product (1 2) (3 4)) dies
14:48sivajagHi
14:48ranjit_cwith the error unable to resolve symbol in this context
14:50ranjit_cactually now (use 'clojure.contrib.combinatorics) doesn't work either
14:50ranjit_ci get this error: Could not locate clojure/contrib/combinatorics__init.class or clojure/contrib/combinatorics.clj on classpath:
14:51ranjit_cis there something i'm supposed to configure in setting up the repl?
14:52chouserranjit_c: (1 2) will try to call function 1 with the argument 2 -- not what you want.
14:52ranjit_cquoting it didn't help though
14:53ranjit_cwhen i tried it before it worked, but i launched swank from within a copy of incanter i checked out from github
14:53sivajag_hey
14:53poincare101hello.
14:54ranjit_cnow when i try it in another directory that i created the (use ...) expression throws an error
14:54chousersivajag_, poincare101: hello
14:55chouserranjit_c: perhaps you have some relative path (like ".") in your classpath, in which case the directory you start the jvm in will matter.
14:55ranjit_chow can i check that?
14:56ranjit_ci'm a bit rusty with the shell
14:56ranjit_ci just tried printenv
14:56ranjit_ci don't see anything named CLASSPATH
14:56ranjit_cisn't that what i should see?
14:56chouserit completely depends on how you start the jvm, I'm afraid
14:56ranjit_cah
14:57chouserI'm not yet familier with any of the way kids are starting clojure these days, but people seem to like cake, lein, etc.
14:57ranjit_ci think it's being started by the command "lein swank"
14:57ranjit_cactually i guess it must be
14:58ranjit_cthen i connect from emacs to the repl
14:58chouserah, yes. so lein is managing your classpath for you. just make sure it knows you want contrib, perhaps via the project.clj file?
14:59ranjit_cthat's what i would have guessed, but when I looked at the project.clj for incanter i don't think I saw an explicit reference to contrib
14:59ranjit_ci'll check again
14:59jstirrell`sorry for all the noob questions, but what's the best way to directly print a unicode value
15:00_fogus__ranjit_c: Incanter is modularized, so the core module might not use contrib.
15:01ranjit_coh so i'm able to see contrib because there's a project.clj further down the tree that includes it?
15:01shooverchouser: Are you writing your own shell script launchers?
15:01ranjit_cyes there it is
15:01chousershoover: not anymore, I promise!
15:01_fogus__ranjit_c: Could be.
15:01ranjit_cthanks that makes sense now
15:01shooverchouser: just asking :)
15:02chousershoover: I just have what I wrote before lein was a twinkle in technomancy's eye. It hasn't broken badly enough yet for me to fix it.
15:02ranjit_ci see a reference to clojure itself
15:02ranjit_cis that really necessary?
15:02chouserer, replace it.
15:02jcromartieI am saddened by an apparent mismatch between Clojure and typical relational database schemas.
15:03_fogus__,\u30DE
15:03clojurebot\マ
15:03_fogus__interesting
15:03jcromartieor is it just ORMs and Clojure that I'm having trouble grokking
15:03shooverwhat is that?!
15:04chouserjcromartie: ORMs are mismatches personified
15:04jcromartieyeah, hmm
15:04chouser:-)
15:04_fogus__jstirrell`: Is that what you mean? ^^^
15:05jcromartiehmm, maybe treat the database itself as a ref...
15:05jcromartieor a ref-like object
15:05hiredmanhuh
15:05hiredmana database table is like a vector of maps
15:05hiredmanwhere is the mismatch?
15:07jcromartieI guess it's not inehrent
15:07scottjvector binding supports :as, does it support defaults?
15:07_fogus__,(str \u30DE \u30A3 \u30AF)
15:07jcromartiea database could be designed so that rows are immutable
15:07clojurebot"マィク"
15:07jcromartieor at least as much as possible
15:07jcromartiesome way of mapping seqs to database tables would be awesome
15:08jcromartielike, say, I've got this accounting system, and I'd like to store bills as an initial state and a seq of changes
15:09pjstadig_fogus__: what are you up to? :)
15:09jcromartieto just be able to deal with the seq of changes in Clojure and then say "save this" would be nice
15:09jcromartieand probably totally doable
15:09_fogus__jcromartie: http://github.com/brentonashworth/carte
15:11_fogus__pjstadig: Originally trying to answer a question, but now just having fun
15:11jcromartievery nice
15:11jcromartiethanks
15:11jcromartie(_fogus__)
15:15scottjis there a shorter version of (defn foo [& [b]] (let [b (or b "default")] b))
15:16scottjother than keyword args
15:16scottjand multi fntails
15:19jcromartienilfn?
15:19jcromartiefnil
15:21jcromartienevermind
15:21jcromartiefnil has a fixed arity
15:21jcromartiethe result, that is
15:22chouserscottj: arity overriding looks pretty nice in this case.
15:23chouser(defn foo ([] (foo "default")) ([b] b))
15:23chouseroverloading
15:23scottjyeah, it doesn't scale well to several args though
15:23jcromartieI think it would be clean
15:24scottjI hate writing the arg names twice just to define a default value for an optional arg
15:24jcromartieif you just mean you have 1, 2, and 3 args, etc.
15:25chouseryou want something like (defn foo [& [(b "default")]] b) don't you
15:26scottjyep, or (defn foo [& [b :or {0 "default"}]..
15:27chouser(defn foo [& [b :or {b "default"}]] ...) maybe
15:27scottjdoes :or work in vector binding?
15:27scottjI couldn't get it to work
15:28hiredman:or is a feature of associative destructuring
15:29hiredman[] is for sequential destructuring
15:32scottj[] is associative (I know I know)
15:33hiredmanas a datastructure vectors are associative
15:33hiredmanbut as a binding form, they are for binding sequential things
15:33hiredmandestructuring form rather
15:33hiredmanif you want to destructuring something in an associative way use a map desctructur
15:43bhenrydon't forget clojure.contrib.def/defnk. (defnk foo [positional args :keyword-args "default values"] ...)
15:45chouserI think you used to be able to destructure vectors on their indexes, but keyword destructuring took over that syntax
15:45chouserI'mnot sure.
15:47hiredman,(let [{a 0 b 1} [:A :B :C]] [a b])
15:47clojurebot[:A :B]
15:48hiredmanyou can destructure a vector associatively just fine
15:48scottjbhenry: but can you invoke a fn from defnk with one optional arg w/o giving a keyword?
15:48chouserhiredman: oh, indeed. what was I doing?
15:49chouseroh, but not the seq that & makes for you, of course.
15:51hiredmanof course, because it's a seq and not associative in anyway
15:51chouserright. I don't know what I was thinking.
15:52chouserwhat was that proposed syntax for expressions on the left side
15:52chouser-> I think.
15:52sexpbotjava.lang.Exception: Unable to resolve symbol: I in this context
15:53hiredmanhuh?
15:53chouser(defn foo [& [(-> (or "default") b)]] b)
15:53hiredmaneww
15:54Rayneso.o
15:54chouserheh. I wrote a patch and everything
15:55chouserbut even those of us who were strangely attracted to it knew it wasn't good.
15:55hiredmanI'm still reeling, tried to get clj-nstools used at work and was shouted down
15:55chouserby clojure users?
15:55hiredmanphil and I even used user.clj to monkey patch clojure.core so ns+ would be available everywhere without an extra use
15:56hiredmanyes
15:58scottjhow do you get lein to user user.clj for repl, swank, test?
15:58hiredmanyou put it in src/
15:58hiredmanclojure RT loads it
15:59scottjoh I was thinking ~/.clojure/user.clj
15:59hiredmanclojure RT loads the first user.clj it finds
15:59fliebelhiredman: How do you monkey patch something in Clojure?
15:59hiredmanvery carefully
16:00RaynesYou just need to have access to a monkey and wear and eyepatch.
16:00Raynesan*
16:00hiredmanwith great panache
16:00hiredmanwith style and grace
16:00hiredmanvery well
16:01chouser(doc intern)
16:01clojurebotDENIED
16:01chouser,(doc intern)
16:01clojurebotDENIED
16:01chouserheh
16:01chousernot that way, apparently
16:11fliebelI fixed a few things in Ring, how can I get Leiningen/Cake to use it?
16:11lancepantzfliebel: put it on clojars
16:12fliebellancepantz: Can I just upload my own version, and still call it Ring? Sounds like a confusing action.
16:13dnolenfliebel: you can run lein install, no need to push to clojars.
16:13lancepantzyes, you just have to change the project.clj of your version to include your group id
16:13lancepantzthen qualify the dependency with your group id
16:14fliebeldnolen: I'll try that first...
16:14lancepantzyeah, dnolen's suggestion is easier i suppose
16:16ninjuddfliebel: subprojects in cake will also handle that (or 'cake install' for that matter)
16:19fliebelninjudd: What does subprojects do?
16:20ninjuddlet's you specify a location for the git checkout of a project and pull the dependency from there instead of from clojars
16:21ninjuddfliebel: just add something like this to .cake/config
16:21ninjuddsubproject.ring = /home/fliebel/code/ring
16:22ninjuddthen do 'cake deps force' whenever you change the code in /home/member:fliebel/code/ring
16:22arohnerdoes anyone else occasionally get NPEs when running lein deps?
16:22fliebelninjudd: Useful :) i did it with lein install now
16:22fliebeltesing...
16:24eshirahi, im trying to install labrepl. i did a git clone and lein upgrade. but when I do a lein deps, i get these errors: http://gist.github.com/584880
16:24eshiraany ideas?
16:24bobo_looks like the jar has gone missing
16:25bobo_hm
16:27eshirawhich one? i don't understand the error message.
16:27eshiraitext?
16:27bobo_it cant find itext.jar in any of the maven repos it knows
16:27bobo_what you can do is find that jar somewhere, and use the mvn install command listed in the error
16:28bobo_but you shouldnt have to.
16:28hiredmanbest to complain to the authors that their dependencies aren't right
16:29bobo_the jar is there. can you try again eshira ?
16:29bobo_http://repo2.maven.org/maven2/com/lowagie/itext/1.4/
16:29jstirrell`if I have a few vars which i just need to increment based on what each character is in a text file, using an agent is ideal right?
16:30dnolenjstirrell: why not some atoms?
16:30jstirrell`yeah that's what I had originally, just checking
16:31dnolen,(let [x (atom 0)] (swap! x inc) @x)
16:31clojurebot1
16:31jstirrell`i was just thinking that the inc could be asynchronous
16:31eshirabobo_ i get the same thing
16:32dnolenjstirrell: why would it need to be async?
16:32bobo_eshira: i belive it worked for me. weird :-/
16:32jstirrell`it wouldn't need to be, but it could be? just figured it might be a minor optimization to not block since it's not really necessary
16:33bobo_eshira: http://repo2.maven.org/maven2/com/lowagie/itext/1.4/itext-1.4.jar does that link work for you?
16:33eshirayep..
16:35eshirawhoops , i didn't include the whole error: http://gist.github.com/584905
16:37bobo_im clueless :-(
16:41eshirai really want to just kill all my clojure dependencies and libs and start over. i've tried so many different management toools that i bet i have some weird dependency issue
16:41bobo_eshira: if you want to remove all maven crap, its in ~/.m2/repositories
16:42bobo_rm -r ~/.m2/repositories is harmless unless you pay for bandwidth :-)
16:42bobo_repository not repositories
16:46eshirahah, that worked. rm -r ~/.m2/repository and then lein deps
16:46eshirawho knows what went wrong before.. oh well
17:03DASONIXI am here
17:08DASONIXhello anyone?:
17:08DASONIXanyone here?:
17:08dakrone_yes, there are many people here
17:09ohpauleezDASONIX: what's up. Just looking for people or do you have a specific question
17:09DASONIXgood. I'm testing out the clojure irc script... not sure if anything I was typing was making it into the channel :-):
17:09ohpauleezah
17:09ohpauleezcool
17:10DASONIXhttp://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/:
17:10DASONIXloaded it into the REPL and it just works :-):
17:11DASONIXspeaking of which though. People at my work are excited about clojure. Any good starting points? websites?... I still don't know wth i'm doing, hehe:
17:12amalloylabrepl?
17:12amalloyor you could talk to Laujensen about conj-labs if you happen to be in europe
17:13ohpauleezDASONIX: amalloy is spot on. Labrepl is a good start: http://github.com/relevance/labrepl
17:13amalloyalso, the only clojure book i've read was The Joy Of Clojure, so while i can't give a comparative analysis i thought it was quite helpful
17:13ohpauleez2 for 2, I love The Joy of Clojure
17:13amalloyand if you/they don't have a grounding in functional programming already, SICP is an excellent resource
17:14DASONIXAwsome, yeah i've got a subscription to safari books, I'll have to see if they have it:
17:14ohpauleezamalloy: it's as if you're reading an auto response from my brain
17:14ohpauleezhaha
17:14amalloyTJOC is still in electronic form; not published yet
17:14DASONIXI had a college in course in lisp/scheme years ago... probably could use some freshening up though:
17:14ohpauleezit's a Manning Publishing book
17:15ohpauleezDASONIX: you may be fine with just using labrepl
17:15amalloyand SICP is free online: http://mitpress.mit.edu/sicp/
17:15Raynes3 for 3, Joy is awesome.
17:16DASONIXWe use groovy/grails at work mostly these days.. but some people are beginning to migrate towards finding similar uses for clojure:
17:17ohpauleezClojure + Ring + Moustache/Compojure + Enlive/Hiccup is an amazing stack
17:17ohpauleezI've had great experiences rolling out solutions and deploying them
17:17ohpauleezI've even done a system that was half in Python (using Pylons) and half in Clojure (using Moustache), that was just a dream to deploy, scale, and maintain
17:18ohpauleezand it also handled financial transactions
17:19amalloyohpauleez: what on...that is too many tools i don't know about. tell, tell!
17:19ohpauleezDASONIX: Another example of power... I wrote a fully parallel (simple) job queue in 8 total lines of clojure. It took maybe 15 minutes to write and maybe 15 minutes toying at the REPL
17:19DASONIX you being serious about the 'dream to deploy'?:
17:19ohpauleeztotally
17:20ohpauleezwith lein, it's dead simple
17:20DASONIX I remember in that college class, functional programming languages could have massive massive precision... hundreds and hundreds of digits :
17:21ohpauleezamalloy: what specifically do you want to hear about. I'd love to share any bits of knowledge
17:22DASONIX I guess at this point I need to learn the language better :-) :
17:22ohpauleezlabrepl is a great way
17:22ohpauleezVery gentle learning curve
17:23DASONIX I just basically installed clojure through mac ports :
17:23amalloyohpauleez: well atm i'm not really doing anything in particular. developing a back-end application with no interesting front-end. so i don't need eg compojure, but i don't know what any of the other tools are. are there any you think would be interesting to me given my setup?
17:24ohpauleezamalloy: I really like Moustache if I'm building more of RESTful service. Moustache is really just a routing framework, but it lets you do some interesting things
17:24ohpauleezit's also just a Ring middleware, and it can wrap around any other Ring Middleware
17:25ohpauleezEnlive is pretty nice for templating.
17:25ohpauleezAs far as community and help goes. There's a dedicated Clojure-web google group
17:26ohpauleezCompojure html facility is called hiccup, which I've only played with a little, but want to really use in a pet project
17:28ohpauleezI've done a few different deployment structures: from just the simple run-jetty, to putting a few jetty instances behind NGINX (doing load balancing), to war deployment in tomcat
17:28ohpauleezI've recently started playing with aleph (asynchronous server technology for clojure)
17:29ohpauleezonce I got my head around it all, it's been pretty nice and am writing a routing library for it
17:31amalloyheehee, hiccup
17:31amalloythanks ohpauleez
17:32ohpauleezamalloy: np. Glad to share anytime
17:34Raynes(doc map)
17:34clojurebot"([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."
17:35_Vi"Clojure 1.2 is released!" Why there is no refs/tags/1.2.0 in git repo?
17:36amalloyhttp://github.com/clojure/clojure has a tag 1.2.0
17:37_Viamalloy, OK, found. I was using the wrong repository.
17:37amalloy_Vi: i had the same problem not too long ago
17:37RaynesSomebody should throw the new repo into the title.
17:37RaynesThe topic*
17:38_ViWas it "git://github.com/richhickey/clojure.git"?
17:38Chousukeyeah
17:38Chousukethe url just changed, the repo is still the same :)
17:40Chousukethe url is pretty easy to update by editing .git/config
17:40_ViChousuke, Already done. Set this as "origin" remote and previous URL as "richhickey" remote.
17:41Chousukeor git config remote.origin.url url-here
17:41_Vigit remote rm origin && git remote add origin http://github.com/clojure/clojure.git # cleaner way
17:42Chousukewonder if that messes with the tracking branches :/
17:43_ViThe answer to the mess with "tracking branch" is just don't use tacking (no "pull", always fully specified "push"). But this discussion is for #git channel.
17:43ChousukeI find tracking useful
17:44Chousukeespecially with multiple remotes.
17:44jjidois there a way to exit a reduce?
17:44Chousukethough I guess you could always use remote/foobranch when you need the remote
17:44Chousukejjido: throw an exception :P
17:45jjidoChousuke: is that costly?
17:45Chousukeprobably
17:45Chousukeunless you preallocate the exception
17:45jjidoI will still do it for now
17:45Chousukebut a better way is probably not to use reduce or write a version that allows short-circuiting somehow
17:47ryszard_hello
17:47ryszard_I am trying to install Leiningen
17:47ryszard_I followed the instructions in the readme
17:47amalloyryszard_: on what OS?
17:47ryszard_but I am getting this:
17:47ryszard_and I am getting this
17:47ryszard_http://gist.github.com/585008
17:48ryszard_(MacOs X)
17:49amalloyryszard_: i think leiningen relies heavily on bash. i imagine it's clever enough to switch shells for you, bu there could be some issues getting the env vars set up right
17:50ryszard_amalloy: I guess that the script itself shouldn't be affected... It uses /bin/sh
17:50ryszard_amalloy: however, I suspect this might be a CLASSPATH issue
17:52sivajag_ryszard_: did you do lein self-install?
17:53sivajag_this task will install all needed jars
17:53amalloyryszard_: yes, self-install is an important step that's easy to forget
17:53ryszard_sivajag_: yes, I tried it
17:53ryszard_it gives me the exact same error
17:53amalloyyou can edit `which lein` and add in something to make it echo the classpath, by changing JAVA_CMD from java to echo
17:54amalloyif you can see the actual command line it's using that might give you a clue
17:56sivajag_ryszard_: self-install is the task that will download lein jars to your local maven
17:56ryszard_sivajag_, amalloy: the CLASSPATH is ::src/:
17:56sivajag_the error u r seeing is that lein-standalone jar is missiing
17:56sivajag_can u paste the error u get when u do lein self-install
17:57ryszard_sivajag_: lein self-install finishes w/o an error
17:57sivajag_also can u check whether you have lein jars under
17:57sivajag_$HOME/.m2/repository/leiningen/leiningen/
17:58ryszard_sivajag_: however, when I try to run lein after it, the error from the gist occurs
17:58ryszard_sivajag_: There's /Users/ryszard/.m2/repository/leiningen/leiningen/1.2.0/leiningen-1.2.0-standalone.jar
17:59sivajag_what command are you trying to do?
17:59sivajag_lein new?
17:59ryszard_yes
18:00sivajag_in error message
18:00sivajag_it looks like u types "lein"
18:00sivajag_can you type "lein new"
18:01ryszard_sivajag_: same error :(
18:01sivajag_lein version
18:01sivajag_mm
18:01sivajag_can u type "lein version"
18:01_ViIs (read ...) secure? Can we feed data that anonymous send to socket into it?
18:02scottjhmm. easy way to pull out the <body> of a string that's html but might be "<p>foo</p>" or "<doctype...head..body..." (e.g. html email). enlive doesn't appear to wrap html in html/body if it's not there
18:02scottj_Vi: I don't think so
18:03_Viscottj, What can it do? (Input length is limited)
18:03sivajag_ryszard_: can u type the output for "lein version"
18:04_ViHow to deserialize data from insecure source in oneliner?
18:05ryszard_sivajag_: same error. I am pretty convinced my classpath is wrong and the stuff installed by maven is not seen by my java.
18:07scottj_Vi: (read-string "#=(println \"here's the trick\")")
18:08_ViReader macros? Is there way to force reader into some basic always-the-same syntax (where data expected to come, not code).
18:08sivajag_ryszard_: the thing lein should load lein jars and clojure jars from maven repo
18:08scottj_Vi, I think the bot here has something like that written, it may be a library somewhere
18:09sivajag_ryszard_: so I am not sure how the classpath could be bad if u r running using lein
18:09ohpauleezRaynes: Can you comment on ^?
18:09sivajag_also I am not sure why it is trying to download lein when u just type "lein"
18:09ohpauleezie: on _Vi's request
18:10RaynesThere is a sandbox library called clj-sandbox that powers sexpbot's Clojure evaluation.
18:10_Viscottj, So there is no easy way to get some structured data from user without opening vulnerability, right?
18:10Raynes$google clj-sandbox
18:10sexpbotFirst out of 183 results is: Licenser's clj-sandbox at master - GitHub
18:10sexpbothttp://github.com/Licenser/clj-sandbox
18:11sivajag_anyone has suggestion for a good xmpp library?
18:11ohpauleez_Vi: ^
18:11RaynesIt isn't perfect, but does the trick.
18:11ohpauleezThanks Raynes
18:11_ViRaynes, "isn
18:12Raynes(binding [*read-eval* false] (read-string "#=(println \"here's the trick\")"))
18:12Raynesscottj: ^
18:12_Vi't perfect" means "there can be vulnerabilities" or slow or something else safe?
18:13Raynes_Vi: It's generally pretty safe. When vulnerabilities are found, they're fixed. There haven't been any found in a while though.
18:13RaynesYou can take advantage of the JVM's own sandbox, and construct a sandbox that is as safe or as vulnerable as you want it to be.
18:14_ViAt least if there are ways to inject code when reading using "[*read-eval* false]" then they are considered Bugs, not Features and got fixed as security issues, right?
18:24SirNickIf a function's body defines a macro and that function is not called until runtime, can the macro still be expanded at runtime even though it's after compilation? Or does this cause more compilation?
18:24chousermacros aren't expanded at runtime unless you call eval or something
18:25amalloyhowever you declare a macro, it is accessible at (and only at) compile time, in whatever scope the declaration has
18:26amalloywhat use case did you have in mind?
18:27SirNickI didn't really have a usecase exactly, I was just wondering if there was any reason that would cause on the fly compilation during runtime in some way.
18:27amalloy(eval) is pretty much it
18:28SirNickAwesome, thanks
18:28_Vi"(defn foo [x] (foo x))" ; Why doesn't it warn that "(recur x)" should be used?
18:28amalloybecause maybe recur x shouldn't be used....?
18:29_Viamalloy, I don't mean this particular function, I mean any function calling itself in a tail position.
18:29amalloyespecially for lazy sequences, you can't use recur
18:30amalloy,(source iterate)
18:30clojurebotjava.lang.Exception: Unable to resolve symbol: source in this context
18:30thunk,(clojure.repl/source iterate)
18:30amalloy,(clojure.repl/source iterate)
18:31clojurebotSource not found
18:31clojurebotSource not found
18:31amalloyclojurebut: lame
18:31amalloyman, i can't even spell clojurebot. guess i'm the lame one
18:32amalloy-> (clojure.repl/source iterate)
18:32sexpbotjava.lang.ClassNotFoundException: clojure.repl
18:34kennedywmAnyone using clojure-clr?
18:35hiredman~def iterate
18:42_ViI.e. is "if we can change tail call to 'recur' and it gives no compiler error then we should change it to 'recur'" holds?
18:42_Vi*Does "..." hold?
18:48Raynes-> (doc defn)
18:48sexpbot⟹ "Macro ([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with a... http://gist.github.com/585094
18:48RaynesThere we go. Pretty doc formatting.
18:49RaynesAnd I totally didn't steal most of that formatting from clojurebot.
18:49curiouscattest
18:53amalloy_Vi: this comes up fairly often. i'm newish to the clojure community, and what you say makes sense to me. however, i'm pretty sure this has been discussed and declined lots of times
18:54amalloy_Vi: one of the issues is that if the compiler magically converts naive recursion into TC for you, you run the risk of writing code you think is TC but actually is blowing up the stack. the manual (recur) vs (myfunc) makes you think about the difference, and notice when you do it wrong (ie recur illegally)
18:56jjidoamalloy: what I miss is recur for an enclosing function
18:56technomancywhat I want is for :| to be an alias for recur
18:56technomancyfor the musicians in the audience
18:57amalloyjjido: we're waiting for the JVM to implement general tail-call optimization so we can just use theirs, aren't we?
18:57jjido(fn [x] #(recur (dec x)))
18:57technomancyalso we need to raise funds to hire John Rose as a hacker-errant so he can work on awesome JVM features like TCO instead of what his oracle overlords tell him to do.
19:00hiredmanjjido: not possible given the way functions are implemented and the limitations of the jvm
19:00hiredmancheckout trampoline
19:00jjidohiredman: yeah thanks
19:01_Viamalloy, ... and people that have got used to real TCO are usually experienced and thinking (Lisps, Schemes, dignified and complicated...) and will cope with the difference, right?
19:01jjidowhat can I do with a quoted value?
19:02hiredmanclojure totally needs generally TCO, I would use that all the time
19:02jjido,(doc unquote)
19:02clojurebot"; "
19:02hiredmanjjido: a quoted value is the value
19:02_Vihiredman, Means it is unlikely they will do "novice mistakes" of forgetting about "(recur)".
19:03hiredman_Vi: recur is there because the general case is currently not possible without using a different call stack which would run counter to clojure's host integration goals
19:04_Vi/* Imagining Clojure as some beast which has lost it's tail in some accident */
19:04ohpauleezchouser: ping
19:05_Vihiredman, I mean the necessity of doing compiler warning for non-using of "recur".
19:05hiredmanbecause it's not always a mistake
19:05hiredmanso warning is ridiculous
19:06hiredmanif you want to calla the 3 arg body from the 2 arg body of a multifn, you would get a warning
19:06hiredmansame for multimethods, etc
19:07ohpauleezHas anyone else documented 'show' being broken in 1.3? http://gist.github.com/585121
19:07_Vihiredman, Where is it ridiculous? Can you give an example? Why deliberately non-use of "recur"?
19:07jjidohiredman: if the quoted value is '(1 2 3), I can use it as a list. If it is '(fn [] 42), I cannot execute it?
19:09hiredmanthat is also a list
19:09mrBlissjjido: use (eval '(fn [] 42))
19:09hiredman_Vi: I just gave 2
19:09hiredmanmrBliss: that won't execute it, that will turn the list into a function object
19:10jjidomrBliss: thanks!
19:10jjidohiredman: then it is just one step away from being executed...
19:12_Vihiredman, Don't see them (having looked at answers about multimethods and multifn and this is not that). It should where we technically can put "recur" instead of some function call, and "recur" will use that function, but we don't need it.
19:13hiredman_Vi: well, I have answered your question, if you don't understand the answer the deficiency lies with you
19:13_Vihiredman, (Still thinking that if we can change some call to "recur" that points to the same thing then we should do it)
19:31jjidocan I use eval to do contextual scoping?
19:38eshiraI'm using lein. I :dev-include org.clojars.brandonw/lein-nailgun "1.0.0" and then lein deps. Every other "lein deps" works w/o error, but the other ones end up with: http://gist.github.com/585147 . any ideas?
19:42eshiraand so naturally "lein nailgun" runs but then running vim, I get this: http://gist.github.com/585151
19:50lazy1eshira: If you find the solution, let me know :)
19:52eshirahah, will do. anyone had success w/ lein-nailgun here
20:12jjidocan a struct refer to itself? (Java this)
20:23hiredmanjjido: how could that be possible?
20:23technomancyeshira: I've seen that bug elsewhere. very rare, but it's consistently reproducible
20:24technomancyeshira: http://github.com/technomancy/leiningen/issues#issue/105
20:24technomancypossibly an obscure maven bug?
20:25technomancyI don't have anything helpful to say except you're not the first to run into this.
20:25jjidohiredman: (let [x (struct mystruct :myself this)] (:myself x))
20:29_ViVimClojure instruction. "\sr (should open a new window)". How to press '\sr'? Is it literal \, S and R?
20:34eshiratechnomancy: thanks, that helps. it prevents me from wasting more time on it ;)
20:35eshira_Vi: yes, it is "\", or whatever your vim command key is
20:35_Vieshira, Probably I need to install "Gorilla" to make it work.
20:36eshira_Vi good luck. I've gotten vimclojure to work once a long time ago, but then I upgraded some things and now my set up is broken
20:36_ViIsn't there a comprehensive guide to install VimClojure (with all deps)?
20:36eshiraalso, if you're using the latest vimclojure (2.2.0-SNAPSHOT), the instructions found at http://kotka.de/projects/clojure/vimclojure.html is outdated I'm pretty sure
20:37_Vi"You need a Ruby enabled Vim" Ruby? Dependency hell...
20:37eshiraI wished. If I ever get the perfect vim + clojure setup then I will write it up, but so far it's just been hours of going in circles
20:38lancepantzi just gave up and switched to emacs
20:38lancepantzwould recommend the same to anyone
20:39lancepantzemacs has viper mode- modal, with vim chords- if you want to ease into it
20:39_Vilancepantz, (From emacs I remember only "Ctrl+X, Ctrl+C". I've tried to learn it three-four times, unsuccessfully)
20:39lancepantzbut even a fully functional vimclojure doesn't compare to slime
20:40_Vilancepantz, Is emacs/slime considered the primary IDE for Clojure?
20:40lancepantzby far
20:41eshirayeah i might have to do that, at least until vimclojure catches up (which I'm sure it will). but i love vim so much. it will be hard
20:41lancepantz62%, http://cemerick.com/2010/06/07/results-from-the-state-of-clojure-summer-2010-survey/
20:42lancepantzninjudd and myself work on a project called cake, that is ripe for non-emacs integration, it has a persistent vm that's a bit cleaner than nailgun
20:42lancepantzsome people have been integrating it with textmate
20:43lancepantzif one was to take the time, you could get a pretty killer vim integration, but i'm probably not going to be that one :)
20:44Rayneslancepantz: Me either. Not until someone writes a Clojure to VimScript compiler.
20:45lancepantzhttp://chasemerick.files.wordpress.com/2010/08/5.png?w=500&amp;h=300
20:45RaynesThat's a handsome 404 page.
20:47lancepantzyeah, ninjudd just told me that, must be in my browser cache
21:27joegalloI'm writing a "cleanup my use declarations" function in elisp, http://gist.github.com/585230, does anyone have any advice?
21:27joegalloI don't really have tons of elisp experience.
21:27bhenryhere's my advice http://github.com/technomancy/durendal
21:28joegalloBlast!
21:29bhenryalthough ns-cleanup is still on the to-do. perhaps you could use it as a starting point.
21:30rickmodeis there a way to do something like instance? or isa? with a protocol?
21:31rickmodenevemind... just saw extends?
21:36chouser_rickmode: see also satisfies?
21:40rickmodechouser_: ya ... that's the one that seems to work... thanks
22:04lazy1I there a library like hiccup to generate XML?
22:08Rayneslazy1: There is some stuff in contrib: http://clojure.github.com/clojure-contrib/prxml-api.html
22:08RaynesNot sure if there is anything hiccup-like.
22:08RaynesOh, I guess it is.
22:08RaynesNeat.
22:19lazy1Thanks
22:21lazy1This prints to *out*, can you remind me what should I bind *out* go get a string?
22:27chouserjust use (with-out-str ....)
22:28lazy1Great
23:13brehautis there a clojure feed generation library (RSS, Atom) anywhere?
23:22brehautin answer to my own question: laujensen's bestinclass.dk has a simple solution in templates.clj
23:53eshiralazy1: i got vimclojure working: http://groups.google.com/group/vimclojure/browse_thread/thread/69abeea9f57cb73b/9360432c165c2beb?lnk=gst
23:58technomancyjoegallo: wow... the timing on that is crazy
23:59technomancyjoegallo: I didn't get it to sort long lines that had to wrap though; that would be a neat trick. does yours do that?