#clojure logs

2010-09-25

00:32technomancywhee---test selectors implemented in lein
00:33technomancyso you can run a subset of your test suite based on predicates that get passed the test var's metadata
00:34technomancyhttp://github.com/technomancy/leiningen/commit/b13efc5c
01:34maravillasvery nice
01:35maravillasi'm especially a fan of the test/test_test.clj path
01:36technomancyyeah, that's been on my low-pri list to rearrange
01:36technomancyperfect low-hanging fruit for the aspiring Leiningen contributor
01:36technomancyif you haven't sent in a patch yet, here's your chance to qualify for a sticker.
01:37maravillas:)
01:37maravillasso many things to whittle out time for
01:37technomancyhow many projects send you a sticker for your contributions?
01:37maravillasan excellent point!
01:38ninjuddi want a sticker
01:39maravillasby the way, one of the things i'm most anticipating at the conj is an immersion into the correct pronunciation for leiningen
01:39maravillasi can read it, but it doesn't stick
01:40technomancymaravillas: "line again" is close enough
01:40amalloyheh. it won't matter; nobody gets volkswagen right (and most of them spell it wrong too)
01:40technomancyninjudd: all you gotta do is get your name on this list: https://www.ohloh.net/p/leiningen/contributors
01:40maravillasyeah, the problem for me is that since the command is "lein," it futzes up the full word
01:41amalloymaravillas: don't really get that. lein should be pronounced line. it's the "again" instead of "in-jen" that gets me
01:41ninjuddi always thought it was LINE-ENGINE
01:41technomancymaravillas: whatever you do, don't watch "The Naked Jungle" because they totally screw up the pronounciation in that film.
01:42maravillasamalloy: "lein" looks an awful lot like "lien" to me, which is how i read it
01:43technomancyninjudd: that's how they say it in the movie
01:43technomancybut my german-speaking friends have informed me it's incorrect
01:43ninjuddtechnomancy: i did submit something long ago, before the schism
01:44technomancyninjudd: oh, it must not have been a formal patch
01:44amalloyspeaking of schism, ninjudd, i'm trying out cake
01:44ninjuddtechnomancy: it was a pull request. i'll see if i can find it
01:44technomancyoh, I see it; your nick is in the comment; it's just not attributed to you since it didn't come through git
01:45Raynesamalloy: Tastes good, man.
01:45amalloyi love having repl and swank start up instantly, but when i'm fooling around at the repl i prefer lein; it seems like cake doesn't use JLine?
01:45ninjuddcake uses Readline
01:46RaynesAnd has completion.
01:46amalloywell, i can file a bug then, because cake repl inserts ^[A crap when i use the arrow keys
01:46RaynesThat's definitely a bug.
01:46technomancyamalloy: you know about LEIN_REPL_PORT=4009 lein repl & and then just hitting up nc localhost 4009?
01:46ninjuddcheck to see if you have ~/.inputrc or ~/.editrc
01:47amalloytechnomancy: i usually just use the emacs repl via lein/cake swank
01:47technomancyamalloy: yeah, I never use it either. but I get the feeling nobody knows about that feature.
01:48ninjuddamalloy: sounds like the repl may be in vim mode
01:48ninjuddi get that same feeling all the time ;)
01:48RaynesWhat I want to see at the conj is a ninjudd+Raynes vs technomancy+a partner of his choosing mud wrestling match, the winner getting technomancy's Leiningen talk slot.
01:49amalloyninjudd: my .inputrc sets completion-ignore-case, but nothing that looks like it modifies keybindings
01:49ninjuddtechnomancy: so you just need to write a cake plugin and the cycle will be complete
01:49RaynesI think I could take him.
01:49ninjuddyou'll give me a sticker, i'll give you some cake, and everyone will be happy
01:50ninjuddRaynes: ha!
01:50RaynesDon't forget my cake and cookies. You promised me cookies for cake-autodoc and hinted around about cake for cake-github.
01:50technomancyRaynes: I dunno; hiredman is pretty brutal
01:50ninjuddi think we would lose that one
01:50RaynesI bet sexpbot could take clojurebot.
01:51technomancyone and a half people named after william gibson characters; if I brought along zenspider we'd have the ultimate fighting team.
01:51technomancyninjudd: sounds like a fair trade.
01:52ninjuddamalloy: mind gisting your .inputrc? or moving it out of the way and trying again?
01:52amalloyninjudd: http://malloys.org/~akm/rc.txt if you want to check it yourself. (ignore the cygwin stuff; i just copied .inputrc to my ubuntu install from cygwin
01:53ninjuddis that whole thing your inputrc?
01:53amalloyyes
01:53amalloymostly commented
01:55amalloyi'll try moving it and launching a repl though
01:56amalloyninjudd: no good. with .inputrc renamed, logging out, and logging back in, i still get stuff like user=> fdsfaf^[[D^[[D^[[A^A
01:56ninjuddstrange
01:56ninjuddwhat os?
01:56amalloyubunto 10.04
01:57ninjuddah
01:57amalloybut lein repl works (score one for technomancy?)
01:57ninjuddwhat ruby version?
01:58amalloy1.8.7
01:58ninjudddo you have irb installed?
01:58technomancyubuntu breaks up its ruby packages into like forty different debs
01:58amalloyyes, i have irb
01:58ninjuddif you run irb, you you have history?
01:58amalloyno
01:59ninjuddaha
01:59ninjuddthere is likely a ruby-readline package on ubuntu
02:00RaynesMan, cake-github is becoming so much prettier now that we added the *opts* destructuring bit.
02:00ninjuddamalloy: looks like you need to install libreadline5-dev
02:00amalloyaha
02:01ninjuddand then maybe reinstall ruby? not sure about that
02:01ninjuddwhich is crappy
02:01technomancyhttp://25.media.tumblr.com/tumblr_l8ou93Vgze1qz4foko1_400.jpg
02:02technomancyprobably libreadline-ruby1.8
02:03amalloyi've only been on ubuntu for a few months; is there a better way to reinstall ruby than apt-get remove...apt-get install?
02:03technomancyamalloy: I always built from source back when I used to use ruby
02:03Raynesapt-get reinstall works, I think.
02:03RaynesOr not.
02:04amalloyno such luck :P
02:04technomancypulling in readline is not the kind of thing that would require you to reinstall unless you built from source in the first place though
02:04Raynessynaptic has a "reinstall" button.
02:04amalloytechnomancy: well, pulling in readling and readline-ruby didn't fix the repl problem without a reinstall
02:04Raynesamalloy: apt-get takes a --reinstall option
02:05amalloyah, neat
02:05RaynesSo, probably apt-get install package --reinstall or something similar.
02:05amalloythat hasn't made a difference either
02:07amalloy(and the --reinstall did make a difference, because it said it was replacing ruby)
02:09amalloyi can try building from source, but i'd be surprised if that were necessary
02:10ninjuddtesting on an ubuntu machine as well
02:10ninjuddinstalling cake now
02:11RaynesMy cake is running on Lynx as well.
02:11amalloythe crowd holds its breath...
02:11RaynesNever had anything remotely resembling this problem.
02:11ninjudddoh. works for me on ubuntu
02:12ninjuddthough it is using REE
02:12amalloyhm
02:12ninjuddnevermind, not REE
02:12ninjuddruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
02:13amalloyi'm only at patch-level 173. no doubt this precise issue is what they fixed in 174
02:13Raynes._.
02:13ninjuddha
02:14ninjuddamalloy: what happens if you do: require 'readline'
02:14ninjuddin irb
02:15amalloyLoadError: no such file to load -- from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
02:15amalloyfrom /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
02:15amalloyfrom (irb):1
02:15RaynesDing.
02:15ninjuddthat is it. perhaps i should make cake warn in that case. so people don't just think the repl sucks
02:16amalloyhooray, a bug. also a fix, we hope?
02:17ninjuddoh, i mean. the fix is to install ruby with readline
02:17amalloyyeah. how do i make that happen, though? i don't do any ruby
02:19ninjuddyou could try upgrading to 1.9.
02:19RaynesIs that even in the repositories?
02:19ninjuddor upgrading 1.8 to the latests
02:19amalloyRaynes: yes
02:19RaynesI built Ruby from source because I have a thing about building stuff from source.
02:21ninjuddamalloy: here are the packages i have installed that may be relevant: http://gist.github.com/596542
02:22RaynesSpeaking of Ruby, I should install the final version of 1.9.2. I still have an old dev version.
02:29amalloymmmmm, make -j makes building from source so much faster
02:32amalloylol. well now irb has history, but cake repl doesn't work. do i have to reinstall cake or anything?
02:33ninjudddid you install with gem?
02:33amalloyoh it's some sort of gem-related thing
02:33ninjuddeach ruby version has it's own gem repo
02:34ninjuddRaynes: do you use clj-stacktrace?
02:35amalloyninjudd: gem installing cake again; is that all i'll have to do?
02:35ninjuddyeah
02:36amalloywooo a repl
02:37ninjuddwoohoo!
02:37amalloyincidentally, where do i change the secondary prompt? the user=* bugs the hell out of me since i can't copy/paste
02:39ninjuddoh, i'll have to add a patch to read that option from .cake/config
02:39Raynesninjudd: No.
02:40Raynesninjudd: Any particular reason?
02:40ninjuddi just love it's rainbowy goodness
02:41RaynesI'll have to look into it.
02:42ninjuddamalloy: though you can just hit up arrow to get a single line version of your last form
02:42RaynesI love the user=* stuff because I *can* copy and paste.
02:43amalloyoh you're right, ninjudd. i love that feature already
02:44ninjuddyou still want the no secondary prompt feature? almost done with it
02:44amalloyheh. i'd prefer it, yeah
02:45amalloyor you could make up-arrow give you a multi-line version with no secondary prompts. then i can't think what i'd need no-secondary-prompts for
02:46ninjuddunfortunately that would require writing my own readline implementation
02:47ninjuddthat would be a good jumping off point for an incredibly amazing programmer who wants to contribute to cake ;-)
02:47Raynesninjudd: I bet you're exhausted. You're usually asleep (or just not around) way before now.
02:48ninjuddyeah, past my bedtime
02:50amalloyso if i'm an aspiring programmer, i contribute to lein and get a sticker...
02:51amalloyif i'm hardcore awesome, i contribute to cake and get my soul crushed by the difficulty?
02:52ninjuddand a cake
02:52ninjuddor other delicious sweet
02:53amalloyi don't think i can trust my apartment building to receive a delicious package for me
02:53amalloyif you happen to be in san francisco i'll stop by and pick it up; otherwise i'll waive my cake
02:53ninjuddi can have a friend drop it off
02:53ninjudddone. add this to ~/.cake/config
02:54ninjuddrepl.disable-secondary-prompt = true
02:54ninjuddyou'll need to install from github though
02:54amalloyneato, thanks
02:54ninjuddit's easy, just clone the repo and symlink bin/cake into your path
02:54amalloysure thing, not expecting any problems with that
02:55ninjuddRaynes: for clj-stacktrace goodness, just add :dev-dependencies [[clj-stacktrace "0.2.0"]] to ~/.cake/project.clj
02:56ninjuddthen run 'cake deps --global'
02:56ninjuddand add 'clj-stacktrace = color' to ~/.cake/config
02:59amalloyanyone know if emacs has a convenient color-blind setting sort of thing? i can manage with XEmacs, but when i'm using a terminal over ssh, the light colors on the grey backgrounds are just impossible
03:01ninjuddM-x global-font-lock-mode
03:02ninjuddor did i misunderstand the question?
03:02sthuebneramalloy: check out color-theme: http://www.nongnu.org/color-theme
03:02amalloyninjudd: nope, that's close enough to what i wanted. ideally i could change it to somehow translate difficult colors into easy ones, but this is way better than font-lock on
03:03amalloysthuebner: thanks! i'll look at that once i've got cake configured to suit my...tastes (audience groans)
03:04Raynesamalloy: Also, check out tramp mode.
03:05amalloyRaynes: yeah, tramp is great, but when i'm booted in windows i don't have XEmacs so ssh is my best choice anyway
03:05Raynesamalloy: People still use XEmacs? :\ isn't it a long-dead project?
03:06amalloyman, i dunno. whatever it's called. the one with a gui
03:06RaynesThe regular Emacs has a gui.
03:07amalloythat's probly the one i mean, then. it just interfaces with X, is all; can't really do everything with curses
03:10RaynesCurse that curses!
03:11amalloycurse it N times, even?
03:20jjidohello, what is the equivalent of s.foreach(lambda [e] ....)
03:21ninjuddjjido: for or map
03:21jjidomap creates a list
03:21jjidolooking for....
03:21amalloydoseq
03:21ninjudd,(doseq [i [1 2 3 4 5]] (println i))
03:21clojurebot1 2 3 4 5
03:22jjidothanks, doseq
03:23amalloysthuebner: color-theme seems to have worked - the colors are much nicer now, thanks!
03:24Raynes-> (doseq [i (map (partial + 3) [1 2 3 4])] (println i))
03:24sexpbot⟹ 4 5 6 7 nil
03:24ninjuddi love partial
03:25ninjuddand comp
03:25RaynesI'd love it more if it had a shorter name.
03:25RaynesSame with identity.
03:25ninjuddyeah
03:25RaynesIf you're going to go "partial", you might as well go "compose" as well.
03:26ninjuddcurry
03:27RaynesI'd much rather identity be id.
03:27RaynesJust because you could do stuff like #(id %)
03:28ninjuddhm.. i use id for other stuff all the time though
03:28ninjuddevent ident
03:28ninjudds/event/even/
03:28sexpbot<ninjudd> even ident
03:28RaynesI've never used the name 'id' for anything.
03:28RaynesNot even locals.
03:28ninjuddfor db stuff
03:29RaynesI have to say, I do enjoy Clojure's longer, more descriptive names though.
03:29RaynesEven if they aren't always as convenient as they could be.
03:29RaynesI'm just whiny about having to hit the enter key.
03:29amalloyRaynes: and you can always define shortcuts to them if you're using them heavily somewhere
03:29Raynesamalloy: Exactly.
03:30RaynesI like one-liners.
03:30amalloysuch a relief after learning CL - (funcall) makes things so awkward
03:31RaynesNothing like Kraft Mac & Cheese at 2:30AM.
03:31ninjudd$8ball is it time for bed?
03:31sexpbotninjudd: Yes.
03:31amalloyRaynes: beg to differ. cheerios at 10:30PM is about the same
03:32ninjuddok, goodnight then
03:32amalloynight ninjudd, thanks bundles
03:32ninjuddno problem
03:33RaynesNight.
03:49amalloy_Raynes: i assume that .el files can tell whether i'm using a terminal or X. do you know what variable that information is stored in, so that i can choose a different color theme?
03:50RaynesNo clue.
03:50jjido,(empty? (range 0))
03:50clojurebottrue
03:50jjido,(empty? (range 10))
03:50clojurebotfalse
03:54amalloy_Raynes: in case you want to do anything with that yourself, the variable is window-system
04:34yayitsweiSo, my program runs fine under the lein repl, but with cake I get java.security.NoSuchAlgorithmException: Algorithm HmacSHA1. I'm guessing it's a difference in Java version, how do I check that?
04:45fliebelclojurebot: where are the logs?
04:45clojurebotlogs is http://clojure-log.n01se.net/
04:47amalloy_yayitswei: (System/getProperty "java.version")
04:48amalloy_or getProperties if you want to look at all of them
04:49yayitsweiamalloy_: oh nice, thank you
04:50yayitsweiturns out the Java version is the same, any other possible difference between lein and swank?
04:52amalloy_probably. not really my area though, and ninjudd/technomancy have gone to bed
04:53amalloy_are you trying to use SHA and it doesn't work, or this SHA problem just appears out of nowhere?
04:54yayitsweitrying to use SHA1
04:54RaynesI'm not sure why there would be any difference between them.
04:56yayitsweiI'm trying to compare the classpaths (from getProperties) but nothing's turned up yet
04:58RaynesDo you know what code is failing?
04:59RaynesCan you isolate it enough to provide a small example to reproduce the problem?
05:01yayitsweigood idea, let me try
05:11yayitsweiok, can probably be simpler, but try this: http://gist.github.com/596646
05:11yayitswei(hmac "test" "test")
05:16Raynesyayitswei: What is this supposed to return?
05:16RaynesJust curious.
05:16yayitswei"DJRRXBXlCVuKh6ULoN87847QX+Y="
05:17yayitsweiI'm trying to make a simpler test
05:17Raynesyayitswei: clojure-contrib.base64/encode-str
05:17Raynesoauth.digest=> (hmac "test" "test")
05:17Raynes"dGVzdA=="
05:19yayitsweiraynes: does encode-str do the same thing?
05:20RaynesProbably, look at the docs. I screwed up your example though, which is why the output was different.
05:20Rayneshttp://clojure.github.com/clojure-contrib/base64-api.html
05:27yayitsweiraynes: I don't believe it's the same thing, is encode-str used for cryptography as well?
05:29RaynesI just noticed that you were using some other base64 encoder, and that there is that one in contrib. I don't know whether or not it serves your purpose. Either way, unless the error is caused by the encoder you were using, I'm not getting any errors.
05:29RaynesIn cake, that is.
05:33yayitsweiRaynes: can you try this in cake for me? ,(javax.crypto.Mac/getInstance "HmacSHA1")
05:34yayitswei,(javax.crypto.Mac/getInstance "HmacSHA1")
05:34clojurebot#<Mac javax.crypto.Mac@15044a>
05:34Raynesoauth.digest=> (javax.crypto.Mac/getInstance "HmacSHA1")
05:34Raynes#<Mac javax.crypto.Mac@3dc13d>
05:34yayitsweiin my cake, I get java.security.NoSuchAlgorithmException: Algorithm HmacSHA1
05:35Raynes._.
05:36RaynesThat's just weird.
05:38yayitsweihere's the backtrace: http://gist.github.com/596671. everything else seems to work fine!
05:39RaynesOh, you're doing this using swank?
05:39RaynesI was just using cake rewpl
05:39Raynesrepl*
05:41yayitsweihere's my repl: http://gist.github.com/596672
05:41Raynesyayitswei: It works in a swank REPL as well.
05:43sempahdoes anybody know, since when clojure was developed?
05:43sempahjust find something like "appeared in 2007"
05:43Raynesyayitswei: Could you do cake --version
05:44iGNOSaurusIf I'm using the standard lein-layout for a project, and I have a txt data-file, where is it common to put it? Is there a convention?
05:44yayitsweicake 0.4.15
05:44RaynesiGNOSaurus: You could put it in resources.
05:44Raynesyayitswei: I'm using 0.4.17
05:44RaynesWhat version of swank-clojure is in your deps?
05:45yayitsweiraynes: swank-clojure "1.2.1"
05:45RaynesWell, that's irrelevant.
05:45RaynesSince it happens with cake repl.
05:45yayitsweibut I think it's not a problem with swank, yep
05:46amalloy_iGNOSaurus: i would pick some sort of "resources"-like name too. i don't know if there's a clojure or maven standard name, but "res" or "resources" sounds right. "r" is probably even acceptable
05:46yayitsweilet me try upgrading to 0.4.17
05:46iGNOSaurusOk, I'll do that. But how does that relate to search path of file-functions and classpath and stuff?
05:46iGNOSaurusIf I were doing this in C# I'd read a file with a path described in app.config or such. Is there a similar construct here?
05:47Raynesresources is put on the classpath.
05:47iGNOSaurusAh, OK.
05:47RaynesAnd the location of it is relative to where you start the application/repl or whatever.
05:47RaynesWhatever your (System/getProperty "user.dir") is at the time.
05:48RaynesOf course, you can still use absolute paths.
05:48yayitsweiraynes: still get the NoSuchAlgorithmException with the latest cake
05:48iGNOSaurusAh, I should look at the Java facilities for this. Thanks. :)
05:49amalloy_iGNOSaurus: confirmed. if you put stuff into ./resources, then lein/cake jar puts them into the root of the jar file
05:49Raynesyayitswei: I'm at a bit of a loss. You might have to wait for ninjudd or lancepantz for this one. I have no idea why this would happen in cake REPL but nowhere else. And since I can't reproduce it, there isn't much I can do. You might want to make an issue at http://github.com/ninjudd/cake about it.
05:49iGNOSaurusSo it moves it up a level?
05:50yayitsweiraynes: no worries, thanks so much for your help
05:50iGNOSaurusOr it puts the resources-directory in the root?
05:50amalloy_i wouldn't describe it that way
05:50amalloy_yes, the latter
05:50amalloy_er
05:50yayitsweiraynes: By the way, the subprojects feature of cake (that you suggested a couple days ago) works great
05:50RaynesAwesome. :)
05:50amalloy_it puts everything from the resources-directory into the root. if you want a subdirectory, feel free to make one
05:50RaynesI've never actually used it, but I figured it might work for your purposes.
05:50iGNOSaurusOk, makes sense. :)
05:51amalloy_iGNOSaurus: there's probably a clojure wrapper around this, but in java you would get at that with this.getClass().getResource("file.txt")
05:52iGNOSaurusYeah, I'll look up the Java stuff. I used to know some of it way back when. We've just not been on excellent terms lately.
05:52amalloy_heh
05:52amalloy_i tried to go back to java after learning lisp (but before clojure) and it was like, "...seriously? there's no map()? how do i process arrays, then?"
05:53iGNOSaurusTrying my best to avoid it. I do, however, love that Clojure runs on the JVM. A lot of stuff is happening at my company right now, and while we use C# mostly, the rest of the guys are using Java. If I am to be forced into that environment, I'm taking Clojure with me.
05:53iGNOSaurusYeah, a lot of this stuff just seems excellent.
07:07mericHi I'm new to clojure (and lisp)... I've heard/read about lispers don't (1. write code in editor 2. compile and run to check for failures 3. rinse and repeat), but instead use the repl. How does that work? How do you see the source code after you've developed a program? (I've asked this before and someone answered "you don't." but that wasn't helpful) What about version control, if there are no source code files? Anyway, I just want to figure o
07:07mericthe typical clojure workflow looks like because I want to learn it.
07:08mrBlissmeric: don't worry, you typically edit your files in an editor and compile them AND you can test things out in a repl
07:09mericokay then. :)
07:10mrBlissyou can build and shape your functions in a repl and then copy the functions to your source file
07:11mericah that makes sense.
07:11mericyou'd be building your program from repl and your files at the same time
07:11mrBlissexactly
07:12jjidocan I get rid of this annoying warning? Warning: protocol #'user/SimpleListProtocol is overwriting function #'clojure.core/count
07:13RaynesSure -- don't override core functions. :p
07:14jjidoRaynes: but I like the name. I did (def cljcount count), and my function has more arguments
07:14jjidoso I get an error if I call the wrong one
07:17hoeckjjido: (ns your.namespace (:refer-clojure :exclude [count]) ...)
07:19jjidohoeck: works great, thanks!
07:21hoeckjjido: np :)
07:21jjidois there :rename as well?
07:23hoeckjjido: yes, see (doc refer)
07:23hoeckjjido: should be (ns (:refer-clojure :rename {count cljcount}) ...)
07:48nickikHow to read in from the terminal in clojure?
07:49mrBlissnickik: read-line (but it doesn't really work in slime)
07:51nickikah ok and if i want to read in direktly on programm start? ">programmname -p path"
07:54mrBlissif you want to use command line parameters, this might help: http://stackoverflow.com/questions/1341154/building-a-clojure-app-with-a-command-line-interface
08:01nickikthx, could find that question befor but I know it was somewhere on there.
08:48mrSpecHello
08:50mrSpecI have problem with some libraries in my clojure's project. Using netbeans I've set in properties path to jar files and everything works fine. But now I'd like to run this file under emacs... and it cant find this lib.
08:51mrSpecCan I load jar file from specific directory?
08:53raeknormally, ones leinginen or cake to take care of that
08:53raekthat is how it's usually done with emacs
08:53v-alexmrSpec: you can "load" a jar if it's found in the classpath
08:54raekI have no idea how things work in netbeans
08:54raekcd project-directory/ && lein swank
08:54mrSpecv-alex: and if it isnt?
08:54v-alexmrSpec: so try first setting the correct classpath
08:54raekin emacs: M-x slime-connect
08:55v-alexmrSpec: or do as rack suggests
08:55raekmrSpec: are you using slime in emacs?
08:55mrSpecraek: yes
08:55raekok, then just slime-connect to the swank server started by yout build tool
08:56raekleiningen takes care of library jar downloading and putting them in the class path
08:56mrSpecleiningen?
08:56clojurebothttp://github.com/technomancy/leiningen
08:56mrSpecah
08:56raekleiningen's project structure has become the de facto structure of clojure projects
08:57mrSpecbut I'm going to use some java library, not clojure
08:57raekif it is in the maven repo, leiningen will find it
08:57v-alexmrSpec: same thing, lein takes care of any depedency
08:57mrSpecok
08:57mrSpeccould you give me some tutorial about this leiningen?
08:58raeksure
08:58v-alexmrSpec: look at the configuration section on the link given
08:58mrSpecheh, emacs Integration
08:58mrSpecok. Thanks!
08:59raekmost you need to know is here http://github.com/technomancy/leiningen and here http://github.com/technomancy/swank-clojure
08:59raekhere, I search for the (java) tagsoup library: http://mvnrepository.com/artifact/org.ccil.cowan.tagsoup/tagsoup/1.2
08:59raekthe info you will be looking for is "group id", "artifact id" and "version"
09:00raekin leiningen, the format is [groupId/artifactId "version"]
09:00raekfor example: [org.ccil.cowan.tagsoup/tagsoup "1.2"]
09:00raekyou add that to you project.clj file
09:00raekstart a new project with "lein new <project name>" (after installing lein)
09:01raekedit the project.clj file and add any deps
09:02raekalso add :dev-dependencies [[swank-clojure "1.2.1"]]
09:02mrSpecsounds nice
09:02raekthen do "lein deps" and "lein swank"
09:02raekthen you can connect to it with slime-connect
09:07raekon wednesday, it will be finished.
09:09mrSpecraek: "FIXME: to be written" Oh yeah :D
09:20__debaseris it true that vectors are the same as quoted lists?
09:21RaynesNo. Vectors are an entirely different collection.
09:21__debaserbut (= [3] '(3)) evaluates to true
09:23raekyes, because they are both sequential and have the same contents
09:23__debaserraek: and that is the reason why this comparison does not work with maps?
09:23Raynes-> (identical? [3] '(3))
09:23sexpbot⟹ false
09:23__debaserb/c theire not sequential?
09:23Raynes= is value equality.
09:24__debaserthanks a lot
09:24Raynes->(sequential? {})
09:24sexpbot⟹ false
09:24__debaser:-D
09:25__debasergotta run, thanks for making this clear to me
09:26Raynes#clojure is on your side! <3
09:26RaynesI hope nationwide doesn't steal me for using their slogan in an unamusing and bland way.
09:35nickiki have a (:gen-class) and a -main function then i did "lein uberjar" but if i do "java -jar name.jar" it throws: "Failed to load Main-Class manifest attribute from name.jar"
09:37Raynesnickik: You need to put :main in your project.clj.
09:37Raynesnickik: :main namespace.containing.-main
09:49iGNOSaurusIs there an idiomatic way to parse/convert a string to a number?
09:50pdk,(int "13")
09:50clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
09:51pdkhmm
09:51mrBliss,(Integer/parseInt "13")
09:51clojurebot13
09:51iGNOSaurusOk, thanks!
09:51hoeck,(Integer/valueOf "1")
09:51clojurebot1
09:52Raynes-> (read-string "1") ; There is also this. As long as your strings aren't user input, this should be okay. Beware that this reads any object -- not just integers.
09:52sexpbot⟹ 1
09:52Raynes-> (read-string "1.0")
09:52sexpbot⟹ 1.0
09:52iGNOSaurusAh, that's useful.
10:22bhenryis my ring version out of date if i keep getting this?
10:22bhenryWARNING: spit already refers to: #'clojure.core/spit in namespace: ring.util.servlet, being replaced by: #'clojure.contrib.duck-streams/spit
10:35Raynesbhenry: What version are you on?
10:36iGNOSaurusAnyone familiar with the template engine "fleet"? I'm getting an error trying to use it: No such var: clojure.contrib.lazy-xml/escape-xml (I've tried putting clojure.contrib.lazy-xml in the list of usings)
10:36iGNOSaurus"Flamefork's fleet".
10:38iGNOSaurusI get the error just adding it to the using-list. I could try another library, anyone know of a good templating-library?
10:39RaynesiGNOSaurus: Check out enlive and hiccup.
10:39iGNOSaurusOk! Thanks!
10:43bhenryRaynes: [ring "0.2.2"]
10:43Raynesbhenry: The latest ring is 0.3.0
10:43bhenryholy moly. let's find out what breaks.
10:44bhenrythe most difficult part about clojure is keeping up with the dependencies
10:45RaynesNot if you subscribe to the ring mailing list like a good boy. ;)
10:48bhenrythere should be a service that will check your project.clj and tell you what's out of date.
10:49RaynesThat actually wouldn't be too hard to implement, given that it would only work for jars in clojars.
10:51technomancybhenry: lein-search does that, I think
10:54nickikis this write if i want to make an jar? http://github.com/nickik/TimeTool/blob/master/project.clj
10:54technomancynickik: :main just needs to point to a namespace, not a function
10:54technomancythat is, :main TimeTool.core is enough
10:56RaynesI'll put a cake task for that functionality on my list of things TODO
10:57technomancywhy not just call lein search?
10:57technomancyit's just a function
10:59RaynesI never had good luck with lein search.
10:59RaynesPlus, I like reinventing the wheel just to piss Chas off.
10:59technomancyoh yeah, he would totally hate that.
11:15bhenrytechnomancy: i did lein search and it asked for a "what"
11:15bhenrythen lein update and it rewrote my project.clj, but didn't actually change it, just messed up the indentation.
11:15bhenrymight that mean i'm up to date on everything else?
11:16RaynesThat too.
11:16RaynesIt's invasive. :(
11:16RaynesMakes Rayne said.
11:16Raynessad, even
11:18technomancypprinting arbitrary macros is hard
11:18technomancyI'll have to ask replaca what the trick is for that
11:18RaynesI'd probably just report what is out of date and such.
11:18technomancyhe's obviously thought long and hard about it
11:18RaynesLein search isn't just for that functionality though.
11:18RaynesObviously
11:21technomancyhiredman: you feel like implementing a custom classloader?
11:21technomancyI'm about fed up with ant.
11:23technomancyimplementing with me, I mean
11:23technomancynext seajure project
11:36nickikdoes pprint not work if you have a jar
12:07ircmastermanhttp://bit.ly/c6bASW http://bit.ly/caKqiG
12:07technomancyok, so ... are the Calendar Lads a fictional group, or a fictional fictional group?
12:07technomancyhttp://wondermark.com/432/
12:08technomancyif they are a fictional fictional group, would they still qualify for Wikipedia's "List of fictional music groups" page?
12:08technomancyinquiring minds want to know.
12:09technomancyI could see the wikipedia deletionists using metafictionality to disqualify new entries.
12:09technomancymaybe I should just add them to the page about Chickens
12:09technomancyhttp://www.everytopicintheuniverseexceptchickens.com/
12:27ApeShotHey #clojure, when using slime, recompiling a function does not update all the functions which depend on it. This makes sense most of the time, but when doing interactive development it is kind of a hassle to recompiling a whole set of functions when you make a change to just one. Is there a mode with slime that keeps track of this stuff for you and/or just recompiles everything?
12:28ApeShotOr some other way of dealing with this issue?
12:30chousertechnomancy: too deep for me.
12:31chouserApeShot: generally you don't have to redefine the dependent functions.
12:32chouser(defn x [] 5) (defn y [] (x)) (defn x [] 10) (y) ;=> 10
13:29_schulte_does a function like this already exist in the std lib?
13:29_schulte_(defn first-where
13:29_schulte_ "Return the index in coll of the first place where f returns true."
13:29_schulte_ [f coll]
13:29_schulte_ (loop [ind 0 c coll] (if (f (nth c ind)) ind (recur (inc ind) coll))))
13:33_schulte_ugh, posted poorly..., see http://gist.github.com/597084
13:35Raynes_schulte_: I think clojure.contrib.seq/positions does something similar.
13:36the-kenn`_schulte_: I would name the function "first-index-where"
13:36the-kenn`ah, positions takes a predicate. Didn't know that
13:37Raynes_schulte_: The difference is that positions returns all of the indexes where the predicate is true -- not just one.
13:37maravillasand for some enlightenment, take a look at the impl of positions, too
13:37the-kenn`Raynes: Note it returns a lazy seq, so (first (positions ...)) is just fine and doesn't do unnecessary work.
13:37Raynesthe-kenn`: I was about to mention that. You type too fast for me.
13:38the-kenn`Raynes: Heh ok, sorry
13:38Raynesthe-kenny: Did you just apologize for typing faster than me? :o
13:39_schulte_great, I'll take a look at positions, figured something like that would already exist
13:40v-alexhey guys, seeing the fn above i though it could be implemented using filter and non-local return. So, what's the operating procedure for non local returns in clojure?
13:41the-kennyRaynes: Yes :p
13:48hoeckv-alex: there are only local returns in clojure
13:51v-alexhoeck: i guess so - and filter wouldn't do either. thx
13:55hoeckv-alex: but as the-kenn already said, filter is lazy so you don't need non-local-returns to except for performance, maybe
13:56somniumyou could throw an exception. some jvm scheme's hack in call/cc that way.
13:57v-alexhoeck: i wasn't thinking of performance
13:58chouserexceptions are not particularly performant
13:58v-alexsomnium: that seems alot of trouble to got to
13:58somniumv-alex: agreed, and ugly to boot
13:58chouser(first (filter ...)) is a pretty common idiom
14:00chouser,(first (keep-indexed #(when (== 15 %2) %1) (range 10 20)))
14:00clojurebot5
14:01v-alexchouser: nice, thx
14:02Rayneschouser: Do you just have an API search engine embedded directly into your classes or something?
14:02Raynesglasses*
14:07_rata_hi clojurians
14:23_rata_why when I write at the REPL (use 'a.b-c) it says that it can't find the file a/b_c.clj in the classpath instead of the file a/b-c.clj?
14:26hoeck_rata_: because the jvm does not allow dashes in classnames, namespaces become classes on AOT compilation
14:27_rata_buuu dashes are much more beautiful than underscores :P
14:31hoeck_rata_: well, at least more appealing to lispers
14:31_rata_=)
14:32hoeck_rata_: anyway, just keep in mind to use underscores in filenames instead of dashes
14:32_rata_can I use dots?
14:32Chousukedon't try
14:33Chousuke(I'm pretty sure the answer is no, anyway)
14:33_rata_probably not, because dots are treated as slashes
14:36_rata_(directory separators)
14:36_rata_and why can't it be that it reads the file a/b-c.clj but creates the class b_c?
14:39hoeck_rata_: consistency, because you can also have dashes anywhere in the namespace, not only in the filename part
14:40_rata_but everything in the namespace is also in the filename, isn't it?
14:40hoeck_rata_: imagine foo-bar.baz, should clojure look for foo_bar/baz.clj or foo-bar/baz.clj but foo_bar/baz.class??
14:40hoecksorry, I meant the namespaces name
14:41hoeckdashes in the namespaces name
14:41_rata_mmmm ok
14:41_rata_yeah, the directory is a problem
14:42_rata_because it should look for foo-bar/baz.clj, but it would have to create the foo_bar directory
14:42_rata_and that'd be a mess
14:49_rata_another question: why when I recompile a file using slime it throws me java.lang.IllegalStateExceptions about vars already defined in the namespace? is there any way to force the compilation to overwrites what is already in the namespace?
14:54klang_rata_: that only happens when you have imported, used or required a var, riht?
14:55_rata_yeah, that's right
14:56klang_rata_, two choices then .. don't :use that var or use another name in your namespace .. sorry to be a smart-ass.
14:57hoeck_rata_: or do an (ns-unmap *ns* 'the-offending-var) to fix it temporarily
14:58hoeckhappens often when I'm moving functions between namespaces and there are some stale definitions around
14:59_rata_klang, how do I use another name in my namespace?
15:01klang_rata_, depends. if it's a stale name, as in hoeck's case follow the ns-unmap advice, if it's a function or var you don't need, but you need something else from an :use or :require clause, exclude it from that clause.
15:02ninjuddstuartsierra's lazytest has a reload function that uses the ns dependency graph. would be nice if someone patched swank-clojure to use that
15:02klang_rata_ something like, (:use [basic.core] :reload-all), will also get rid of stale names, I suppose ..
15:02hoeck_rata_: one advice is to use :use sparingly and try to use :require more often, makes your code more readable and avoids those erros
15:03ninjuddmodifying cake to use that is on my todo list
15:04ninjuddor perhaps cemerick would be interested in adding that to nREPL. then the mythic nREPL version of swank-clojure could use that
15:05klangninjudd, "mythic"? .. do you see no future for nREPL?
15:07ninjuddklang: not at all. i think it will be very valuable, and i'm planning to use it for cake if i can force cemerick to implement some of the complex stream behavior i need
15:08ninjuddi just meant that there may or may not end up being an implementation of swank clojure built on nREPL
15:09hoeckninjudd: complex stream behavior?
15:09wwmorgan1_rata_: use also has a :rename option. See how the IllegalStateExeption is avoided if you rename the name you're importing http://paste.lisp.org/display/114893
15:12ninjuddhoeck: if i were to use nREPL for cake, it would have to support streaming stdin and stdout from the client to the REPL server, which is difficult when commands are supposed to be asynchronous and discrete.
15:12klangninjudd: I was just wondering. Pay no attention to me, reading about cake ..
15:13ninjuddwhich is why i've been trying to convince cemerick to make nREPL synchronous and just use a separate socket if you need to execute commands in parallel
15:14ninjudd(which is what i've already done for cake's persistent JVM)
15:15ninjuddbut you know cemerick, he's into rewriting stuff from scratch, right Raynes? ;-)
15:17ninjudd$8ball is Raynes asleep already?
15:17sexpbotninjudd: Cannot predict now.
15:20technomancyninjudd: steve gilardi has a new version of load that does reloading automatically based on timestamps on disk
15:20technomancymight as well implement that at the lowest level rather than in tools like swank/lazytest
15:20technomancyalthough it may make sense in swank for backwards compatibility reasons since not everyone could upgrade
15:21ninjuddtechnomancy: agreed. does it use the ns dependency graph to reload dependent namespaces?
15:21technomancyyeah
15:21technomancyscgilardi could possibly comment further
15:21ninjuddtechnomancy: is it on github?
15:22technomancythis is probably it: http://github.com/scgilardi/clojure/tree/load-tracking
15:22technomancyundoubtedly slightly bitrotten
15:24ninjuddhmmph. clojars makes me change my password to change my ssh key
15:25ninjuddtechnomancy: oh, he did it as a patch to clojure. i see
15:26technomancyright... that's where load is located =)
15:26ninjuddreally?
15:27technomancyM-. clojure.core/load does not lie
15:28ninjuddwhich means it will be ages before it is available
15:29technomancy...
15:29technomancysad but true
15:37hugodtechnomancy: do you know if scgilardi's vesion makes the ns-dependency graph visible in the clojure api? I had to hack a solution to get it in lein-namespace-depends.
15:39technomancyhugod: no idea if it does in its current state, but it seems likely that a finished version would.
15:41ninjuddperhaps scgilardi and stuartsierra should combine their implementations into a clj-reload project until it gets into clojure/core
15:43ninjuddtechnomancy: that reminds me. did i ever tell you a distilled the completion functionality from swank-clojure into standalone library?
15:43technomancyninjudd: ISTR you mentioned you were working on something; did you finish it?
15:44ninjuddhttp://github.com/ninjudd/clojure-complete
15:45technomancycool; would love to see that integrated with swank for reusability
15:46antares_technomancy: hey, is this the right channel to ask a leiningen-related question?
15:46technomancyswank is such a rat's nest
15:46ninjuddyeah. i added a few things swank doesn't support
15:46technomancyantares_: sure; user questions are better for here
15:46technomancyantares_: #leiningen is mostly for dev chatter
15:46technomancyninjudd: what kind of things?
15:46antares_technomancy: I have this at the bottom of project.clj: http://gist.github.com/597196 — the problem is, this code breaks lein deps (because there is no javac plugin after fresh repository clone)
15:47ninjuddtechnomancy: hehe. i told you to add java-compilation to lein
15:47antares_technomancy: so my question is, what is the best way to add hooks conditionally? I tried If + find-ns but compiler seems to evaluate everything
15:47ninjuddeven submitted a patch for it ;)
15:48antares_ninjudd: absolutely, I agree that javac plugin needs to be part of core lein ;)
15:48technomancyninjudd: I told you I'd add it once the patch saw some wider usage
15:48technomancythat's my policy with adding pretty much any task
15:49technomancyantares_: put the hook in src/leiningen/hooks/javac.clj
15:49technomancyantares_: problems loading hooks are not fatal for precisely this reason
15:51technomancyyou can put extra stuff in project.clj, but it's usually cleaner to avoid that
15:51technomancyespecially if it includes an ns call that doesn't match the filename; that's usually a red-flag in any case
15:52antares_technomancy: that helped, thank you
15:52technomancyantares_: sure
15:53ninjuddtechnomancy: i added special form completion and something else i can't recall now
15:53antares_technomancy: ninjudd so you guys are going to integrate javac plugin into the core? How can I help with that?
15:53ninjuddhehe, i'm not ;)
15:53antares_ninjudd: I see :)
15:53mavalladNovice question
15:53amalloyninjudd: fork it off into a new repo and start stealing technomancy's clientele
15:54ninjuddfork what?
15:54mavalladI have a function to check if an element is in one of the subsequences of a sequence
15:54amalloythe javac thingy? make it part of core
15:54technomancyantares_: why don't you start a thread on the mailing list about it; see if anyone has any outstanding issues. if it's stable and works well for people then I can just drop it in for the next release and add a bit of logic to call it from the regular compile task
15:54mavalladHere it is my code: http://pastie.org/1181469
15:55ninjuddamalloy: i already did http://github.com/ninjudd/cake/blob/master/src/cake/tasks/compile.clj
15:55klangninjudd: would clojure-complete be part of the project.clj's :dev-dependecies?
15:55chouserwhy doesn't AbstractMethodError tell me the name of the method it's trying to call?
15:55mavalladBut my call to some returns always nil
15:55antares_technomancy: ok, that works
15:56ninjuddklang: i use it directly in cake for the repl task
15:57technomancyantares_: next release will probably add lein-search, lein-plugin, and lein-run plugins as well. might end up just being an assimilation release
15:57amalloymavallad: i just pasted that into my repl and it works
15:57amalloyuser=> (present-in-collections? 1 [[1]])
15:57amalloyx 1 c [1]
15:57amalloy(some #{1} [1]) 1
15:57amalloytrue
15:57klangninjudd: so it wouldn't provide me anything that emacs doesn't? (damn)
15:58ninjuddklang: not unless technomancy uses it in swank or you are using 'cake repl'
15:58chousermavallad: worked for me too with (present-in-collections? 5 [[1 2 3] [4 5 6] [7 8 9]])
15:59amalloychouser: maybe Sun doesn't care about providing debug info to people who are running code that javac can't produce? :P
15:59technomancyninjudd: honestly if you went through swank to extract that code you probably know more about the internals of swank than I do.
15:59ninjuddwould be nice if clojure-mode used it for completions
15:59ninjuddtechnomancy: lol
16:00mavalladBut why this doesn't work? (present-in-collections? 10 '('(10 20 30)))
16:00ninjuddtechnomancy: don't get any ideas. i'm not taking over maintenance of swank-clojure ;)
16:01klangninjudd: fair enof; not using cake repl, yet, as having two jvm's running at the same time seems a bit too much for the minor league stuff I do in clojure ;-) .. maybe I'm wrong or haven't seen the light yet ..
16:01amalloymavallad: you're misusing the ' operator
16:01amalloymavallad: try '((10 20 30))
16:01ninjuddklang: stay tuned. cake won't have two JVMs for long...
16:01technomancyone of these days I'll find someone who will...
16:01mavalladAh, yes, that works!
16:02mavalladThen I don't have to quote the inner list
16:02amalloyright. ' automatically quotes everything at every depth
16:02mavalladSorry, my fault, didn't know that
16:02mavalladThank you very much
16:02serabehi
16:02amalloyof course it's your fault! you brought broken code and asked to have it fixed! :) that's what #clojure is for
16:03klangninjudd: certainly. nREPL is exciting as well, easier to maintain that swank-clojure, perhaps?
16:04technomancyklang: you'd have to write an elisp frontend for it, which would be loads of work.
16:04ninjuddklang: or a swank wrapper
16:04technomancybest to hold off until a clojure->elisp compiler exists
16:04ninjuddtechnomancy: you're almost done with that, right?
16:05technomancyalmost done picking a suitable name
16:05ninjuddgood, that means is will be finished at the next seajure meeting
16:05technomancyI think Orestes would be nice.
16:05_schulte_probably right after Emacs learns how to handle multiple threads
16:06technomancyyou could probably pull off some parallels between elisp/CL and agamemnon/clytamnestla if you got imaginative.
16:06technomancy_schulte_: have you tried the concurrency branch?
16:06klangtechnomancy: my elisp-fu is weak, but the point of nREPL also seems to be factoring emacs out of the equation (or giving free choice of client, once a swank existed)
16:06technomancy_schulte_: it sort of works!
16:06_schulte_no, is that based on guile?
16:06_schulte_no way
16:06technomancy_schulte_: not at all
16:07technomancyit's just a branch on Emacs 24
16:07_schulte_huh, I've heard some big talk about running elisp on the guile VM, and all of Emacs low-level issues being subsumed by guile
16:07technomancy_schulte_: yeah... that's a pipe dream if you ask me
16:07technomancythere are already branches to add threading and lexical scope to the current codebase
16:07_schulte_I may have to try that out, even if it only works for gnus it'd be a huge improvement
16:08technomancymulti-language VMs are herculean efforts if you want to maintain backwards compatibility
16:08technomancywitness the relative ease of implementing Clojure on the JVM vs the insane amount of hackery required to get ruby working on it.
16:08_schulte_says the person working on a lisp on the java VM :)
16:09_schulte_oh, I see, as in languages need to be implemented *for* the vm
16:09technomancy_schulte_: well... it's much easier because you're free to go with the grain of the VM
16:09_schulte_yea
16:09chouseramalloy: ha
16:09technomancy_schulte_: there are schemes and CL for the JVM, but they haven't taken off because they're fighting against the current
16:09technomancyespecially since call/cc requires an interpreter
16:10technomancyguile might be different because they'd probably be a lot more willing to bend over backwards for elisp vs the hotspot devs being only half-interested in non-java langs
16:10technomancybut it's still loads of work
16:11_schulte_yea, subsuming Emacs would drastically increase the guile user pool
16:11technomancy_schulte_: what kind of stuff are you doing with Clojure these days?
16:11_schulte_but I'm not sure that they have the man-power at the moment
16:11_schulte_evolution of x86 assembly code
16:12_schulte_so take your buggy program, compile it to x86, then we "evolve" it to fix bugs, improve performance, etc...
16:12_schulte_just don't expect to get back any patches you'd want to apply to your code base
16:13technomancywow, that's wild
16:13_schulte_yea, it's crazy that it actually works (in some cases) on real programs
16:13chouserTakeV: call/cc could be done if you use trampoline for every fn call, I think.
16:13chousertechnomancy: ^^^ sorry
16:14_schulte_technomancy: if you're interested I'm keeping the code up here http://gitweb.adaptive.cs.unm.edu/asm.git
16:15technomancychouser: sure, but that's still going against the grain.
16:15_schulte_although I still haven't fully adjusted to clojure (still using elisp function names (e.g. length) etc...)
16:15technomancynot saing it's not doable, just that it's awkward
16:15technomancy_schulte_: cool
16:16ninjudd_schulte_: you're at unm?
16:16_schulte_ninjudd: yup, just starting my second year
16:17ninjuddi went there
16:17technomancypoll: if you're going to write predicates for choosing a subset of your test suite to run, would you want the predicate to take the test var or the metadata of the test var?
16:18ninjudds/there/there!/
16:18sexpbot<ninjudd> i went there!
16:18_schulte_ninjudd: nice, I'm enjoying working with some of the professors in the CS dept.
16:19ninjudd_schulte_: yeah, there are some really good professors
16:19technomancytaking the metadata seems nicer because it means yoru predicates can just be keywords
16:20amalloythat's a pretty small gain though, right? i mean (comp :keyword meta)
16:21ninjudd_schulte_: are you grad or undergrad? i noticed your link is under adaptive.cs.unm.edu
16:21_schulte_ninjudd: yea, definately happy I came here, even if NM isn't the most temperate of climates
16:21technomancyamalloy: well... yes, but what kind of predicate are you going to write that would take advantage of having the var itself?
16:21_schulte_ninjudd: grad, just passed my comps earlier this month
16:21ninjuddnice, who is your advisor?
16:21technomancyI can't think of anything useful you can do with the var that you can't do with the var's metadata in that context.
16:21_schulte_ninjudd: Stephanie Forrest, and I'm also working a little bit with Dave Ackley
16:21technomancybut if you can think of one I'm open to the idea
16:22ninjuddwow! Stephanie was my advisor
16:22_schulte_no way!
16:22amalloytechnomancy: not really. i haven't used the test framework at all, so i'm just making stuff up here
16:22technomancyamalloy: also there's what looks like a bug in clojure.walk that's preventing me from supporting anything other than keywords and fn forms in the :test-selectors clause
16:23technomancyshould be fixable, but I'm not that familiar with clojure.walk
16:23_schulte_she's got a great lab going, she's leading the research I linked to earlier
16:23technomancyand if it requires a patch to clojure.walk then it probably won't get applied until february unless I can steal a few minutes on certain someone's laptop at the conj
16:24ninjudd_schulte_: http://www.cs.unm.edu/~forrest/students.html i'm Justin Balthrop
16:24ninjuddlooks like someone deleted http://www.cs.unm.edu/~judd
16:25_schulte_well, that's crazy
16:25_schulte_yea, I'm up at http://cs.unm.edu/~eschulte/
16:25_schulte_I'll have to mention you to her
16:25ninjuddyeah. say hi! i haven't spoken with her in a while
16:25_schulte_will do
16:26chousertechnomancy: right, only correcting the need for an interpreter. But then your fn calls wouldn't be java method calls anymore. It seems likely hotspot would just give up on inlining entirely.
16:27technomancychouser: good thing we're not scheme!
16:27chousertechnomancy: for your test predicates, you could pass in (assoc (meta v) :var v)
16:27technomancychouser: brilliant. thanks.
16:28technomancyactually (assoc (meta v) ::var v) in order to avoid the slight possibility of overwriting something important, but consider it applied.
16:28chouserah, good point
16:28chouserI did something similar for filtering class members in 'show' and have been pleased with the results.
16:29_schulte_RE: call/cc and virtual machines, I think the incompatability is pretty JVM specific, e.g. in the haskell intermediate langauge everything is turned into a continuation by the compiler, unless I'm missing something...
16:29chousersure, it's just easier if either the vm or the language is designed with the other in mind
16:30chousersuch as java/jvm, groovy/jvm, clojure/jvm, C#/CLR, ruby/rubyc, etc.
16:30technomancyI keep coming back to the idea that raising a "Make John Rose independently wealthy so he can hack on whatever he thinks the JVM needs" fund would be a fruitful endeavour, but I haven't been able to bring any rich sponsors to see my point of view so far.
16:30_schulte_sure
16:30technomancyI mean... if we had that, all our problems would be solved in a year or so
16:31technomancymodulo patent concerns
16:31chouserthings get messy fast when they were each developed independently and then you try to munge them together. ruby/jvm, elisp/jvm, etc.
16:31_schulte_getting dreamy, it'd be great to see haskell compiler team turn from creating the "unified functional language" to implementing a "unified functional vm", so different functional langauges could mingle
16:32chouserhm, interesting. Had honestly never considered trying to compile clojure to haskell.
16:33chouserseems like it would be tricky to keep the same semantics.
16:33_schulte_the intermediate language used by the haskell compiler is basically just simple lambda-calc with a couple of data types
16:33chousermaybe a lisp-flavoured-haskell would be more fruitful angle
16:34technomancy_schulte_: did you make it to seattle.rb when you were still up here?
16:34technomancychouser: ISTR that exists
16:34_schulte_technomancy: just a couple of ruby meetings, but that was a long time ago
16:34chousertechnomancy: I know there's lispy erlang, but hadn't heard of that for haskell.
16:34technomancyclojurebot: google liskell
16:34clojurebotFirst, out of 393 results is:
16:34_schulte_chouser: I think that a lisp on haskell would be near impossible given haskell strictness about type checking
16:34clojurebotCFruhwirth&#39;s Weblog: Liskell standalone
16:34clojurebothttp://blog.clemens.endorphin.org/2009/01/liskell-standalone.html
16:35chouserthere's also templated haskell or some such for lisp-style macros, but the datatypes get hairy fast compared to clojure macros.
16:35technomancy_schulte_: well... there is typed scheme and qi
16:37_schulte_yea, but some things like http://gist.github.com/597285 are impossible in haskell
16:38_schulte_thanks for the pointer to liskell
16:38technomancyno idea if it's beyond a toy
16:38_schulte_yea understood
16:43serabedoes anybody know how to modify the arglists retrieved by doc method in a function created through a macro?
16:43technomancyserabe: you can supply your own :arglists key in the metadata
16:43technomancymetadata is so great
16:44technomancyit's one of those things you just brush off as "that's cool, I guess" when you're first learning, and then it allows you to do all kinds of things that are really hard in other langs
16:45serabetechnomancy: thanks, am I doing anything wrong? this doesn't seem to work: http://gist.github.com/597291
16:46ninjudd_schulte_: did they get rid of the undergraduate Scheme class at UNM?
16:46technomancyserabe: maybe putting the arglists on the fn meta instead of the var?
16:48_schulte_ninjudd: I'm not sure, but I think most of the undergrad classes are in java, although there is at least one scheme class taught by Lance
16:49arkhis there a short/good way to express a (when-let [x (returns-a-string)] (some-predicate? x)) but still have it return x instead of true/false ?
16:49serabetechnomancy, one moment please
16:49ninjudd_schulte_: oh, i found it. they just changed it from CS257 to CS357
16:49serabetechnomancy, nop, it doesn't work either
16:51ninjudd_schulte_: that class is what made me fall in love with lisp. lance is a great teacher. loved his "Geometric and Probabilistic Methods in Computer Science" too
16:51arkhactually, it's closer to (when-let [x (might-return-a-string)] (some-predicate? x)) ;=> needs to return x, not true/false
16:51_schulte_nice, I haven't taken any classes with him yet, but I'd like to
16:52_schulte_I just noticed he's got a fantastic logo on that classes web page http://cs.unm.edu/~williams/lambdahead.gif
16:52amalloyarkh: seems like there ought to be a builtin for this, but you could do something like (defn satisfying [pred x] (if (pred x) x nil)))
16:53ninjudd_schulte_: hehe. i remember that logo
16:53amalloyer. or to write it less badly: (defn satisfying [pred] (fn [x] (when (pred x) x)))
16:53arkhamalloy: yeah, I kind of thought there'd be a way to do that already too. Thank you.
16:54amalloyarkh: there probably is. i just don't know where to look
16:55_schulte_anyone know why clojure scripts can 10s of seconds to shut down after all computation has finished? If they use alot of memory does the JVM do some sort of cleanup?
16:56raekhrm... the predicate-to-validator function tuns up again...
16:57raeks/tuns/turns/
16:57sexpbot<raek> hrm... the predicate-to-validator function turns up again...
16:58raekhave anyone seen Kaali around lately?
16:59technomancyantares_: actually re: javac; that hook actually belongs in the javac plugin
16:59LauJensen~seen Kaali
16:59clojurebotno, I have not seen Kaali
16:59technomancyantares_: no need for all javac users to cart it around themselves
16:59technomancyit should probably just hook eval-in-project instead of hooking tasks directly though
16:59antares_technomancy: for those two tasks, yes
17:00antares_what's the difference?
17:00technomancyantares_: well lots of tasks use eval-in-project
17:00technomancyit's a single entry point; any code that wants to run code inside the project will go through it
17:00technomancyso even plugins that are external to lein will be affected
17:01technomancyusing The Magic of Robert Hooke™
17:03nroot7If I need disk based persistent storage with STM semantics (MVCC and no locking) is the correct way to use PostgreSQL ?
17:04antares_technomancy: I am not sure Java source recompilation should be hooked a place that affects *a lot* of things :/
17:04ninjudd*cough* dependency-based task model *cough*
17:05technomancyantares_: well, it shouldn't recompile every time
17:05antares_nroot7: PostgreSQL uses MVCC to implement transactions, but it is completely hidden from you. I would not say PG has any "MVCC support".
17:05amalloynroot7: someone claims to have written a persistent version of refs/atoms recently. i'm sure it's still in alpha, but http://tinyurl.com/2c6bdqr
17:05technomancyjust check for .java files that are newer than the corresponding .class files; no problem
17:05technomancymemoize it if you're worried that it might still be too costly
17:05technomancyfunctions... aren't they great?
17:06antares_technomancy: I know what incremental compilation is ;) well, ok, it may be worth a discussion on the mailing list
17:07technomancyantares_: sure, the point is it shouldn't be hard to make it cheap to call in cases where it's not needed
17:28antares_technomancy: when you were talking about mailing list, you were referring to Clojure mailing list, right? Leiningen does not have a separate one?
17:29technomancyantares_: no, there's a leiningen one
17:29technomancyhttp://groups.google.com/group/leiningen
17:29antares_technomancy: thanks!
17:41antares_technomancy: FYI http://groups.google.com/group/leiningen/browse_thread/thread/3807e9c133b2410c
18:06sumbachhas anybody seen the clojure repl appear to hang in OSX, but you can recover with ctrl+z then fg?
18:07sumbachit doesn't always get stuck in the same place, and it appears to be IO-related
18:24serabetechnomancy: I'm still having problems
18:24serabetechnomancy, do you know if def deletes arglists in meta?
18:29serabeleaving to sleep on it
18:35jjidois this efficient for catening two vectors? ,(apply (partial conj [1 2 3]) [7 8 9])
18:37arohnerjjido: why not just use (concat [1 2 3] [7 8 9]) ?
18:38jjidoarohner: you mean (vec (concat [1 2 3] [7 8 9]))?
18:38lpetit,(doc into)
18:38clojurebot"([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined."
18:38lpetit,(into [1 2 3] [ 7 8 9])
18:38clojurebot[1 2 3 7 8 9]
18:38arohnereven better
18:38jjidolpetit: ooh yes great
18:39lpetitpreserves the type of the first arg
18:46lpetithmm
18:46lpetit,(source into)
18:46clojurebotjava.lang.Exception: Unable to resolve symbol: source in this context
18:47raek(source into)
18:47lpetithey, it's almost what you tried: (reduce conj to from)
18:47raekclojurebot: (source into)
18:47clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
18:47lpetitjjido: ^^
19:06bmhat
19:06bmhoops.
19:23Lajla,(+)
19:23clojurebot0
19:23Lajla,(+ nil)
19:23clojurebotnil
19:23Lajla,(+ 1 nil)
19:23clojurebotjava.lang.NullPointerException
19:26lpetithmmm, would the systematic use of a different implementation ns than the ns with the :gen-class directive be a way to currently prevent the full AOT compilation of the ns the implementation depends upon ?
19:27lpetitprobably, yes, and a careful web of only "AOT gen-* declarations" could use (require) for requiring other AOT'd classes, while still preserving this property.
19:27lpetiteureka !
20:04jjido,(Character/isUpperCase (first "Hello"))
20:04clojurebottrue
20:04jjido,((comp Character/isUpperCase first) "Hello")
20:04clojurebotjava.lang.Exception: Unable to find static field: isUpperCase in class java.lang.Character
20:05jjidoer....
20:06dnolenjjido: Java methods are not first class
20:06jjido,((comp 'Character/isUpperCase first) "Hello")
20:06clojurebotnil
20:06dnolen,((comp #(Character/isUpperCase %) first) "Hello")
20:06clojurebottrue
20:07jjidodnolen: I see...
20:07jjidocould as well write
20:08jjido,(#(Character/isUpperCase (first %)) "Hello")
20:08clojurebottrue
20:10dnolen,((fn [c & rest] (Character/isUpperCase c)) "Hello")
20:10clojurebotjava.lang.IllegalArgumentException: No matching method found: isUpperCase
20:10dnolen,((fn [[c & res]t] (Character/isUpperCase c)) "Hello")
20:10clojurebotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: sandbox$eval7718$fn
20:10dnolenerg
20:10dnolen,((fn [[c & rest]] (Character/isUpperCase c)) "Hello")
20:10clojurebotfalse
20:11dnolenhuh
20:12jjidodnolen: false, you are wrong ;)
20:12dnolenjjido: heh, it's true on machine
20:12dnolenon my machine
20:13dnolen,((fn [[c & rest]] c) "Hello")
20:13clojurebot\H
20:17jjidocan I test if a function returns a Boolean?
20:19jjido,(instance? Boolean (Character/isUpperCase 'H))
20:19clojurebotjava.lang.IllegalArgumentException: No matching method found: isUpperCase
20:19jjido,(instance? Boolean (Character/isUpperCase (first "Hello")))
20:19clojurebottrue
20:21jjidoMmh, seems impossible in a dynamically typed language
23:45gerryxiaohello
23:45gerryxiao,(def a-agent (agent {}))
23:45clojurebotDENIED
23:45gerryxiao,(def a 30)
23:45clojurebotDENIED
23:46gerryxiao$(def a 30)
23:48gerryxiao,(println 1)
23:48clojurebot1
23:58bhenrygerryxiao: use a let.