#clojure log - Sep 25 2010

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

0:32 technomancy: whee---test selectors implemented in lein

0:33 so you can run a subset of your test suite based on predicates that get passed the test var's metadata

0:34 http://github.com/technomancy/leiningen/commit/b13efc5c

1:34 maravillas: very nice

1:35 i'm especially a fan of the test/test_test.clj path

1:35 * technomancy glances around nervously

1:36 technomancy: yeah, that's been on my low-pri list to rearrange

1:36 perfect low-hanging fruit for the aspiring Leiningen contributor

1:36 if you haven't sent in a patch yet, here's your chance to qualify for a sticker.

1:37 maravillas: :)

1:37 so many things to whittle out time for

1:37 technomancy: how many projects send you a sticker for your contributions?

1:37 maravillas: an excellent point!

1:38 ninjudd: i want a sticker

1:39 maravillas: by the way, one of the things i'm most anticipating at the conj is an immersion into the correct pronunciation for leiningen

1:39 i can read it, but it doesn't stick

1:40 technomancy: maravillas: "line again" is close enough

1:40 amalloy: heh. it won't matter; nobody gets volkswagen right (and most of them spell it wrong too)

1:40 technomancy: ninjudd: all you gotta do is get your name on this list: https://www.ohloh.net/p/leiningen/contributors

1:40 maravillas: yeah, the problem for me is that since the command is "lein," it futzes up the full word

1:41 amalloy: maravillas: don't really get that. lein should be pronounced line. it's the "again" instead of "in-jen" that gets me

1:41 ninjudd: i always thought it was LINE-ENGINE

1:41 technomancy: maravillas: whatever you do, don't watch "The Naked Jungle" because they totally screw up the pronounciation in that film.

1:42 * amalloy surreptitiously adds something to his netflix queue

1:42 maravillas: amalloy: "lein" looks an awful lot like "lien" to me, which is how i read it

1:43 technomancy: ninjudd: that's how they say it in the movie

1:43 but my german-speaking friends have informed me it's incorrect

1:43 ninjudd: technomancy: i did submit something long ago, before the schism

1:44 technomancy: ninjudd: oh, it must not have been a formal patch

1:44 amalloy: speaking of schism, ninjudd, i'm trying out cake

1:44 ninjudd: technomancy: it was a pull request. i'll see if i can find it

1:44 technomancy: oh, I see it; your nick is in the comment; it's just not attributed to you since it didn't come through git

1:45 Raynes: amalloy: Tastes good, man.

1:45 amalloy: i 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?

1:45 ninjudd: cake uses Readline

1:46 Raynes: And has completion.

1:46 amalloy: well, i can file a bug then, because cake repl inserts ^[A crap when i use the arrow keys

1:46 Raynes: That's definitely a bug.

1:46 technomancy: amalloy: you know about LEIN_REPL_PORT=4009 lein repl & and then just hitting up nc localhost 4009?

1:46 ninjudd: check to see if you have ~/.inputrc or ~/.editrc

1:47 amalloy: technomancy: i usually just use the emacs repl via lein/cake swank

1:47 technomancy: amalloy: yeah, I never use it either. but I get the feeling nobody knows about that feature.

1:48 ninjudd: amalloy: sounds like the repl may be in vim mode

1:48 i get that same feeling all the time ;)

1:48 Raynes: What 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.

1:49 amalloy: ninjudd: my .inputrc sets completion-ignore-case, but nothing that looks like it modifies keybindings

1:49 ninjudd: technomancy: so you just need to write a cake plugin and the cycle will be complete

1:49 Raynes: I think I could take him.

1:49 ninjudd: you'll give me a sticker, i'll give you some cake, and everyone will be happy

1:50 Raynes: ha!

1:50 Raynes: Don't forget my cake and cookies. You promised me cookies for cake-autodoc and hinted around about cake for cake-github.

1:50 technomancy: Raynes: I dunno; hiredman is pretty brutal

1:50 ninjudd: i think we would lose that one

1:50 Raynes: I bet sexpbot could take clojurebot.

1:51 technomancy: one and a half people named after william gibson characters; if I brought along zenspider we'd have the ultimate fighting team.

1:51 ninjudd: sounds like a fair trade.

1:52 ninjudd: amalloy: mind gisting your .inputrc? or moving it out of the way and trying again?

1:52 amalloy: ninjudd: 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

1:53 ninjudd: is that whole thing your inputrc?

1:53 amalloy: yes

1:53 mostly commented

1:55 i'll try moving it and launching a repl though

1:56 ninjudd: no good. with .inputrc renamed, logging out, and logging back in, i still get stuff like user=> fdsfaf^[[D^[[D^[[A^A

1:56 ninjudd: strange

1:56 what os?

1:56 amalloy: ubunto 10.04

1:57 ninjudd: ah

1:57 amalloy: but lein repl works (score one for technomancy?)

1:57 ninjudd: what ruby version?

1:58 amalloy: 1.8.7

1:58 ninjudd: do you have irb installed?

1:58 technomancy: ubuntu breaks up its ruby packages into like forty different debs

1:58 amalloy: yes, i have irb

1:58 ninjudd: if you run irb, you you have history?

1:58 amalloy: no

1:59 ninjudd: aha

1:59 there is likely a ruby-readline package on ubuntu

2:00 Raynes: Man, cake-github is becoming so much prettier now that we added the *opts* destructuring bit.

2:00 ninjudd: amalloy: looks like you need to install libreadline5-dev

2:00 amalloy: aha

2:01 ninjudd: and then maybe reinstall ruby? not sure about that

2:01 which is crappy

2:01 technomancy: http://25.media.tumblr.com/tumblr_l8ou93Vgze1qz4foko1_400.jpg

2:02 probably libreadline-ruby1.8

2:03 amalloy: i've only been on ubuntu for a few months; is there a better way to reinstall ruby than apt-get remove...apt-get install?

2:03 technomancy: amalloy: I always built from source back when I used to use ruby

2:03 Raynes: apt-get reinstall works, I think.

2:03 Or not.

2:04 amalloy: no such luck :P

2:04 technomancy: pulling in readline is not the kind of thing that would require you to reinstall unless you built from source in the first place though

2:04 Raynes: synaptic has a "reinstall" button.

2:04 amalloy: technomancy: well, pulling in readling and readline-ruby didn't fix the repl problem without a reinstall

2:04 Raynes: amalloy: apt-get takes a --reinstall option

2:05 amalloy: ah, neat

2:05 Raynes: So, probably apt-get install package --reinstall or something similar.

2:05 amalloy: that hasn't made a difference either

2:07 (and the --reinstall did make a difference, because it said it was replacing ruby)

2:09 i can try building from source, but i'd be surprised if that were necessary

2:10 ninjudd: testing on an ubuntu machine as well

2:10 installing cake now

2:11 Raynes: My cake is running on Lynx as well.

2:11 amalloy: the crowd holds its breath...

2:11 Raynes: Never had anything remotely resembling this problem.

2:11 ninjudd: doh. works for me on ubuntu

2:12 though it is using REE

2:12 amalloy: hm

2:12 ninjudd: nevermind, not REE

2:12 ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]

2:13 amalloy: i'm only at patch-level 173. no doubt this precise issue is what they fixed in 174

2:13 Raynes: ._.

2:13 ninjudd: ha

2:14 amalloy: what happens if you do: require 'readline'

2:14 in irb

2:15 amalloy: LoadError: no such file to load -- from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'

2:15 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

2:15 from (irb):1

2:15 Raynes: Ding.

2:15 ninjudd: that is it. perhaps i should make cake warn in that case. so people don't just think the repl sucks

2:16 amalloy: hooray, a bug. also a fix, we hope?

2:17 ninjudd: oh, i mean. the fix is to install ruby with readline

2:17 amalloy: yeah. how do i make that happen, though? i don't do any ruby

2:19 ninjudd: you could try upgrading to 1.9.

2:19 Raynes: Is that even in the repositories?

2:19 ninjudd: or upgrading 1.8 to the latests

2:19 amalloy: Raynes: yes

2:19 Raynes: I built Ruby from source because I have a thing about building stuff from source.

2:21 * amalloy downloads source for {libreadline,}ruby1.9

2:21 ninjudd: amalloy: here are the packages i have installed that may be relevant: http://gist.github.com/596542

2:22 Raynes: Speaking of Ruby, I should install the final version of 1.9.2. I still have an old dev version.

2:29 amalloy: mmmmm, make -j makes building from source so much faster

2:32 lol. well now irb has history, but cake repl doesn't work. do i have to reinstall cake or anything?

2:33 ninjudd: did you install with gem?

2:33 amalloy: oh it's some sort of gem-related thing

2:33 ninjudd: each ruby version has it's own gem repo

2:34 Raynes: do you use clj-stacktrace?

2:35 amalloy: ninjudd: gem installing cake again; is that all i'll have to do?

2:35 ninjudd: yeah

2:36 amalloy: wooo a repl

2:37 ninjudd: woohoo!

2:37 amalloy: incidentally, where do i change the secondary prompt? the user=* bugs the hell out of me since i can't copy/paste

2:39 ninjudd: oh, i'll have to add a patch to read that option from .cake/config

2:39 Raynes: ninjudd: No.

2:40 ninjudd: Any particular reason?

2:40 ninjudd: i just love it's rainbowy goodness

2:41 Raynes: I'll have to look into it.

2:42 ninjudd: amalloy: though you can just hit up arrow to get a single line version of your last form

2:42 Raynes: I love the user=* stuff because I *can* copy and paste.

2:43 amalloy: oh you're right, ninjudd. i love that feature already

2:44 ninjudd: you still want the no secondary prompt feature? almost done with it

2:44 amalloy: heh. i'd prefer it, yeah

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

2:46 ninjudd: unfortunately that would require writing my own readline implementation

2:47 that would be a good jumping off point for an incredibly amazing programmer who wants to contribute to cake ;-)

2:47 Raynes: ninjudd: I bet you're exhausted. You're usually asleep (or just not around) way before now.

2:48 ninjudd: yeah, past my bedtime

2:50 amalloy: so if i'm an aspiring programmer, i contribute to lein and get a sticker...

2:51 if i'm hardcore awesome, i contribute to cake and get my soul crushed by the difficulty?

2:52 ninjudd: and a cake

2:52 or other delicious sweet

2:53 amalloy: i don't think i can trust my apartment building to receive a delicious package for me

2:53 if you happen to be in san francisco i'll stop by and pick it up; otherwise i'll waive my cake

2:53 ninjudd: i can have a friend drop it off

2:53 done. add this to ~/.cake/config

2:54 repl.disable-secondary-prompt = true

2:54 you'll need to install from github though

2:54 amalloy: neato, thanks

2:54 ninjudd: it's easy, just clone the repo and symlink bin/cake into your path

2:54 amalloy: sure thing, not expecting any problems with that

2:55 ninjudd: Raynes: for clj-stacktrace goodness, just add :dev-dependencies [[clj-stacktrace "0.2.0"]] to ~/.cake/project.clj

2:56 then run 'cake deps --global'

2:56 and add 'clj-stacktrace = color' to ~/.cake/config

2:59 amalloy: anyone 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

3:01 ninjudd: M-x global-font-lock-mode

3:02 or did i misunderstand the question?

3:02 sthuebner: amalloy: check out color-theme: http://www.nongnu.org/color-theme

3:02 amalloy: ninjudd: 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

3:03 sthuebner: thanks! i'll look at that once i've got cake configured to suit my...tastes (audience groans)

3:04 Raynes: amalloy: Also, check out tramp mode.

3:05 amalloy: Raynes: yeah, tramp is great, but when i'm booted in windows i don't have XEmacs so ssh is my best choice anyway

3:05 Raynes: amalloy: People still use XEmacs? :\ isn't it a long-dead project?

3:06 amalloy: man, i dunno. whatever it's called. the one with a gui

3:06 Raynes: The regular Emacs has a gui.

3:07 amalloy: that's probly the one i mean, then. it just interfaces with X, is all; can't really do everything with curses

3:10 Raynes: Curse that curses!

3:11 amalloy: curse it N times, even?

3:20 jjido: hello, what is the equivalent of s.foreach(lambda [e] ....)

3:21 ninjudd: jjido: for or map

3:21 jjido: map creates a list

3:21 looking for....

3:21 amalloy: doseq

3:21 ninjudd: ,(doseq [i [1 2 3 4 5]] (println i))

3:21 clojurebot: 1 2 3 4 5

3:22 jjido: thanks, doseq

3:23 amalloy: sthuebner: color-theme seems to have worked - the colors are much nicer now, thanks!

3:24 Raynes: -> (doseq [i (map (partial + 3) [1 2 3 4])] (println i))

3:24 sexpbot: ⟹ 4 5 6 7 nil

3:24 * Raynes didn't have any real reason for doing that.

3:24 ninjudd: i love partial

3:25 and comp

3:25 Raynes: I'd love it more if it had a shorter name.

3:25 Same with identity.

3:25 ninjudd: yeah

3:25 Raynes: If you're going to go "partial", you might as well go "compose" as well.

3:26 ninjudd: curry

3:27 Raynes: I'd much rather identity be id.

3:27 Just because you could do stuff like #(id %)

3:28 ninjudd: hm.. i use id for other stuff all the time though

3:28 event ident

3:28 s/event/even/

3:28 sexpbot: <ninjudd> even ident

3:28 Raynes: I've never used the name 'id' for anything.

3:28 Not even locals.

3:28 ninjudd: for db stuff

3:29 Raynes: I have to say, I do enjoy Clojure's longer, more descriptive names though.

3:29 Even if they aren't always as convenient as they could be.

3:29 I'm just whiny about having to hit the enter key.

3:29 amalloy: Raynes: and you can always define shortcuts to them if you're using them heavily somewhere

3:29 Raynes: amalloy: Exactly.

3:30 I like one-liners.

3:30 amalloy: such a relief after learning CL - (funcall) makes things so awkward

3:31 Raynes: Nothing like Kraft Mac & Cheese at 2:30AM.

3:31 ninjudd: $8ball is it time for bed?

3:31 sexpbot: ninjudd: Yes.

3:31 amalloy: Raynes: beg to differ. cheerios at 10:30PM is about the same

3:32 ninjudd: ok, goodnight then

3:32 amalloy: night ninjudd, thanks bundles

3:32 ninjudd: no problem

3:33 Raynes: Night.

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

3:50 Raynes: No clue.

3:50 jjido: ,(empty? (range 0))

3:50 clojurebot: true

3:50 jjido: ,(empty? (range 10))

3:50 clojurebot: false

3:54 amalloy_: Raynes: in case you want to do anything with that yourself, the variable is window-system

4:34 yayitswei: So, 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?

4:45 fliebel: clojurebot: where are the logs?

4:45 clojurebot: logs is http://clojure-log.n01se.net/

4:47 amalloy_: yayitswei: (System/getProperty "java.version")

4:48 or getProperties if you want to look at all of them

4:49 yayitswei: amalloy_: oh nice, thank you

4:50 turns out the Java version is the same, any other possible difference between lein and swank?

4:52 amalloy_: probably. not really my area though, and ninjudd/technomancy have gone to bed

4:53 are you trying to use SHA and it doesn't work, or this SHA problem just appears out of nowhere?

4:54 yayitswei: trying to use SHA1

4:54 Raynes: I'm not sure why there would be any difference between them.

4:56 yayitswei: I'm trying to compare the classpaths (from getProperties) but nothing's turned up yet

4:58 Raynes: Do you know what code is failing?

4:59 Can you isolate it enough to provide a small example to reproduce the problem?

5:01 yayitswei: good idea, let me try

5:11 ok, can probably be simpler, but try this: http://gist.github.com/596646

5:11 (hmac "test" "test")

5:16 Raynes: yayitswei: What is this supposed to return?

5:16 Just curious.

5:16 yayitswei: "DJRRXBXlCVuKh6ULoN87847QX+Y="

5:17 I'm trying to make a simpler test

5:17 Raynes: yayitswei: clojure-contrib.base64/encode-str

5:17 oauth.digest=> (hmac "test" "test")

5:17 "dGVzdA=="

5:19 yayitswei: raynes: does encode-str do the same thing?

5:20 Raynes: Probably, look at the docs. I screwed up your example though, which is why the output was different.

5:20 http://clojure.github.com/clojure-contrib/base64-api.html

5:27 yayitswei: raynes: I don't believe it's the same thing, is encode-str used for cryptography as well?

5:29 Raynes: I 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.

5:29 In cake, that is.

5:33 yayitswei: Raynes: can you try this in cake for me? ,(javax.crypto.Mac/getInstance "HmacSHA1")

5:34 ,(javax.crypto.Mac/getInstance "HmacSHA1")

5:34 clojurebot: #<Mac javax.crypto.Mac@15044a>

5:34 Raynes: oauth.digest=> (javax.crypto.Mac/getInstance "HmacSHA1")

5:34 #<Mac javax.crypto.Mac@3dc13d>

5:34 yayitswei: in my cake, I get java.security.NoSuchAlgorithmException: Algorithm HmacSHA1

5:35 Raynes: ._.

5:36 That's just weird.

5:38 yayitswei: here's the backtrace: http://gist.github.com/596671. everything else seems to work fine!

5:39 Raynes: Oh, you're doing this using swank?

5:39 I was just using cake rewpl

5:39 repl*

5:41 yayitswei: here's my repl: http://gist.github.com/596672

5:41 Raynes: yayitswei: It works in a swank REPL as well.

5:43 sempah: does anybody know, since when clojure was developed?

5:43 just find something like "appeared in 2007"

5:43 Raynes: yayitswei: Could you do cake --version

5:44 iGNOSaurus: If 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?

5:44 yayitswei: cake 0.4.15

5:44 Raynes: iGNOSaurus: You could put it in resources.

5:44 yayitswei: I'm using 0.4.17

5:44 What version of swank-clojure is in your deps?

5:45 yayitswei: raynes: swank-clojure "1.2.1"

5:45 Raynes: Well, that's irrelevant.

5:45 Since it happens with cake repl.

5:45 yayitswei: but I think it's not a problem with swank, yep

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

5:46 yayitswei: let me try upgrading to 0.4.17

5:46 iGNOSaurus: Ok, I'll do that. But how does that relate to search path of file-functions and classpath and stuff?

5:46 If 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?

5:47 Raynes: resources is put on the classpath.

5:47 iGNOSaurus: Ah, OK.

5:47 Raynes: And the location of it is relative to where you start the application/repl or whatever.

5:47 Whatever your (System/getProperty "user.dir") is at the time.

5:48 Of course, you can still use absolute paths.

5:48 yayitswei: raynes: still get the NoSuchAlgorithmException with the latest cake

5:48 iGNOSaurus: Ah, I should look at the Java facilities for this. Thanks. :)

5:49 amalloy_: iGNOSaurus: confirmed. if you put stuff into ./resources, then lein/cake jar puts them into the root of the jar file

5:49 Raynes: yayitswei: 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.

5:49 iGNOSaurus: So it moves it up a level?

5:50 yayitswei: raynes: no worries, thanks so much for your help

5:50 iGNOSaurus: Or it puts the resources-directory in the root?

5:50 amalloy_: i wouldn't describe it that way

5:50 yes, the latter

5:50 er

5:50 yayitswei: raynes: By the way, the subprojects feature of cake (that you suggested a couple days ago) works great

5:50 Raynes: Awesome. :)

5:50 amalloy_: it puts everything from the resources-directory into the root. if you want a subdirectory, feel free to make one

5:50 Raynes: I've never actually used it, but I figured it might work for your purposes.

5:50 iGNOSaurus: Ok, makes sense. :)

5:51 amalloy_: iGNOSaurus: there's probably a clojure wrapper around this, but in java you would get at that with this.getClass().getResource("file.txt")

5:52 iGNOSaurus: Yeah, 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.

5:52 amalloy_: heh

5:52 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?"

5:53 iGNOSaurus: Trying 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.

5:53 Yeah, a lot of this stuff just seems excellent.

7:07 meric: Hi 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

7:07 the typical clojure workflow looks like because I want to learn it.

7:08 mrBliss: meric: don't worry, you typically edit your files in an editor and compile them AND you can test things out in a repl

7:09 meric: okay then. :)

7:10 mrBliss: you can build and shape your functions in a repl and then copy the functions to your source file

7:11 meric: ah that makes sense.

7:11 you'd be building your program from repl and your files at the same time

7:11 mrBliss: exactly

7:12 jjido: can I get rid of this annoying warning? Warning: protocol #'user/SimpleListProtocol is overwriting function #'clojure.core/count

7:13 Raynes: Sure -- don't override core functions. :p

7:14 jjido: Raynes: but I like the name. I did (def cljcount count), and my function has more arguments

7:14 so I get an error if I call the wrong one

7:17 hoeck: jjido: (ns your.namespace (:refer-clojure :exclude [count]) ...)

7:19 jjido: hoeck: works great, thanks!

7:21 hoeck: jjido: np :)

7:21 jjido: is there :rename as well?

7:23 hoeck: jjido: yes, see (doc refer)

7:23 jjido: should be (ns (:refer-clojure :rename {count cljcount}) ...)

7:48 nickik: How to read in from the terminal in clojure?

7:49 mrBliss: nickik: read-line (but it doesn't really work in slime)

7:51 nickik: ah ok and if i want to read in direktly on programm start? ">programmname -p path"

7:54 mrBliss: if you want to use command line parameters, this might help: http://stackoverflow.com/questions/1341154/building-a-clojure-app-with-a-command-line-interface

8:01 nickik: thx, could find that question befor but I know it was somewhere on there.

8:48 mrSpec: Hello

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

8:51 Can I load jar file from specific directory?

8:53 raek: normally, ones leinginen or cake to take care of that

8:53 that is how it's usually done with emacs

8:53 v-alex: mrSpec: you can "load" a jar if it's found in the classpath

8:54 raek: I have no idea how things work in netbeans

8:54 cd project-directory/ && lein swank

8:54 mrSpec: v-alex: and if it isnt?

8:54 v-alex: mrSpec: so try first setting the correct classpath

8:54 raek: in emacs: M-x slime-connect

8:55 v-alex: mrSpec: or do as rack suggests

8:55 raek: mrSpec: are you using slime in emacs?

8:55 mrSpec: raek: yes

8:55 raek: ok, then just slime-connect to the swank server started by yout build tool

8:56 leiningen takes care of library jar downloading and putting them in the class path

8:56 mrSpec: leiningen?

8:56 clojurebot: http://github.com/technomancy/leiningen

8:56 mrSpec: ah

8:56 raek: leiningen's project structure has become the de facto structure of clojure projects

8:57 mrSpec: but I'm going to use some java library, not clojure

8:57 raek: if it is in the maven repo, leiningen will find it

8:57 v-alex: mrSpec: same thing, lein takes care of any depedency

8:57 mrSpec: ok

8:57 could you give me some tutorial about this leiningen?

8:58 raek: sure

8:58 v-alex: mrSpec: look at the configuration section on the link given

8:58 mrSpec: heh, emacs Integration

8:58 ok. Thanks!

8:59 raek: most you need to know is here http://github.com/technomancy/leiningen and here http://github.com/technomancy/swank-clojure

8:59 here, I search for the (java) tagsoup library: http://mvnrepository.com/artifact/org.ccil.cowan.tagsoup/tagsoup/1.2

8:59 the info you will be looking for is "group id", "artifact id" and "version"

9:00 in leiningen, the format is [groupId/artifactId "version"]

9:00 for example: [org.ccil.cowan.tagsoup/tagsoup "1.2"]

9:00 you add that to you project.clj file

9:00 start a new project with "lein new <project name>" (after installing lein)

9:01 edit the project.clj file and add any deps

9:02 also add :dev-dependencies [[swank-clojure "1.2.1"]]

9:02 mrSpec: sounds nice

9:02 raek: then do "lein deps" and "lein swank"

9:02 then you can connect to it with slime-connect

9:06 * raek should really take time to sit down and write on http://raek.se/clojure-emacs.html

9:07 raek: on wednesday, it will be finished.

9:09 mrSpec: raek: "FIXME: to be written" Oh yeah :D

9:20 __debaser: is it true that vectors are the same as quoted lists?

9:21 Raynes: No. Vectors are an entirely different collection.

9:21 __debaser: but (= [3] '(3)) evaluates to true

9:23 raek: yes, because they are both sequential and have the same contents

9:23 __debaser: raek: and that is the reason why this comparison does not work with maps?

9:23 Raynes: -> (identical? [3] '(3))

9:23 sexpbot: ⟹ false

9:23 __debaser: b/c theire not sequential?

9:23 Raynes: = is value equality.

9:24 __debaser: thanks a lot

9:24 Raynes: ->(sequential? {})

9:24 sexpbot: ⟹ false

9:24 __debaser: :-D

9:25 gotta run, thanks for making this clear to me

9:26 Raynes: #clojure is on your side! <3

9:26 I hope nationwide doesn't steal me for using their slogan in an unamusing and bland way.

9:35 nickik: i 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"

9:37 Raynes: nickik: You need to put :main in your project.clj.

9:37 nickik: :main namespace.containing.-main

9:49 iGNOSaurus: Is there an idiomatic way to parse/convert a string to a number?

9:50 pdk: ,(int "13")

9:50 clojurebot: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character

9:51 pdk: hmm

9:51 mrBliss: ,(Integer/parseInt "13")

9:51 clojurebot: 13

9:51 iGNOSaurus: Ok, thanks!

9:51 hoeck: ,(Integer/valueOf "1")

9:51 clojurebot: 1

9:52 Raynes: -> (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.

9:52 sexpbot: ⟹ 1

9:52 Raynes: -> (read-string "1.0")

9:52 sexpbot: ⟹ 1.0

9:52 iGNOSaurus: Ah, that's useful.

10:22 bhenry: is my ring version out of date if i keep getting this?

10:22 WARNING: spit already refers to: #'clojure.core/spit in namespace: ring.util.servlet, being replaced by: #'clojure.contrib.duck-streams/spit

10:35 Raynes: bhenry: What version are you on?

10:36 iGNOSaurus: Anyone 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:36 "Flamefork's fleet".

10:38 I get the error just adding it to the using-list. I could try another library, anyone know of a good templating-library?

10:39 Raynes: iGNOSaurus: Check out enlive and hiccup.

10:39 iGNOSaurus: Ok! Thanks!

10:43 bhenry: Raynes: [ring "0.2.2"]

10:43 Raynes: bhenry: The latest ring is 0.3.0

10:43 bhenry: holy moly. let's find out what breaks.

10:44 the most difficult part about clojure is keeping up with the dependencies

10:45 Raynes: Not if you subscribe to the ring mailing list like a good boy. ;)

10:48 bhenry: there should be a service that will check your project.clj and tell you what's out of date.

10:49 Raynes: That actually wouldn't be too hard to implement, given that it would only work for jars in clojars.

10:51 technomancy: bhenry: lein-search does that, I think

10:54 nickik: is this write if i want to make an jar? http://github.com/nickik/TimeTool/blob/master/project.clj

10:54 technomancy: nickik: :main just needs to point to a namespace, not a function

10:54 that is, :main TimeTool.core is enough

10:56 Raynes: I'll put a cake task for that functionality on my list of things TODO

10:57 technomancy: why not just call lein search?

10:57 it's just a function

10:57 * technomancy hums "conj junction, what's your function"

10:59 Raynes: I never had good luck with lein search.

10:59 Plus, I like reinventing the wheel just to piss Chas off.

10:59 technomancy: oh yeah, he would totally hate that.

11:15 bhenry: technomancy: i did lein search and it asked for a "what"

11:15 then lein update and it rewrote my project.clj, but didn't actually change it, just messed up the indentation.

11:15 might that mean i'm up to date on everything else?

11:16 Raynes: That too.

11:16 It's invasive. :(

11:16 Makes Rayne said.

11:16 sad, even

11:18 technomancy: pprinting arbitrary macros is hard

11:18 I'll have to ask replaca what the trick is for that

11:18 Raynes: I'd probably just report what is out of date and such.

11:18 technomancy: he's obviously thought long and hard about it

11:18 Raynes: Lein search isn't just for that functionality though.

11:18 Obviously

11:21 technomancy: hiredman: you feel like implementing a custom classloader?

11:21 I'm about fed up with ant.

11:23 implementing with me, I mean

11:23 next seajure project

11:36 nickik: does pprint not work if you have a jar

12:07 ircmasterman: http://bit.ly/c6bASW http://bit.ly/caKqiG

12:07 technomancy: ok, so ... are the Calendar Lads a fictional group, or a fictional fictional group?

12:07 http://wondermark.com/432/

12:08 if they are a fictional fictional group, would they still qualify for Wikipedia's "List of fictional music groups" page?

12:08 inquiring minds want to know.

12:09 I could see the wikipedia deletionists using metafictionality to disqualify new entries.

12:09 maybe I should just add them to the page about Chickens

12:09 http://www.everytopicintheuniverseexceptchickens.com/

12:27 ApeShot: Hey #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:28 Or some other way of dealing with this issue?

12:30 chouser: technomancy: too deep for me.

12:31 ApeShot: generally you don't have to redefine the dependent functions.

12:32 (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 (defn first-where

13:29 "Return the index in coll of the first place where f returns true."

13:29 [f coll]

13:29 (loop [ind 0 c coll] (if (f (nth c ind)) ind (recur (inc ind) coll))))

13:33 ugh, posted poorly..., see http://gist.github.com/597084

13:35 Raynes: _schulte_: I think clojure.contrib.seq/positions does something similar.

13:36 the-kenn`: _schulte_: I would name the function "first-index-where"

13:36 ah, positions takes a predicate. Didn't know that

13:37 Raynes: _schulte_: The difference is that positions returns all of the indexes where the predicate is true -- not just one.

13:37 maravillas: and for some enlightenment, take a look at the impl of positions, too

13:37 the-kenn`: Raynes: Note it returns a lazy seq, so (first (positions ...)) is just fine and doesn't do unnecessary work.

13:37 Raynes: the-kenn`: I was about to mention that. You type too fast for me.

13:38 the-kenn`: Raynes: Heh ok, sorry

13:38 Raynes: the-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:40 v-alex: hey 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:41 the-kenny: Raynes: Yes :p

13:48 hoeck: v-alex: there are only local returns in clojure

13:51 v-alex: hoeck: i guess so - and filter wouldn't do either. thx

13:55 hoeck: v-alex: but as the-kenn already said, filter is lazy so you don't need non-local-returns to except for performance, maybe

13:56 somnium: you could throw an exception. some jvm scheme's hack in call/cc that way.

13:57 v-alex: hoeck: i wasn't thinking of performance

13:58 chouser: exceptions are not particularly performant

13:58 v-alex: somnium: that seems alot of trouble to got to

13:58 somnium: v-alex: agreed, and ugly to boot

13:58 chouser: (first (filter ...)) is a pretty common idiom

14:00 ,(first (keep-indexed #(when (== 15 %2) %1) (range 10 20)))

14:00 clojurebot: 5

14:01 v-alex: chouser: nice, thx

14:02 Raynes: chouser: Do you just have an API search engine embedded directly into your classes or something?

14:02 glasses*

14:07 _rata_: hi clojurians

14:23 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:26 hoeck: _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:31 hoeck: _rata_: well, at least more appealing to lispers

14:31 _rata_: =)

14:32 hoeck: _rata_: anyway, just keep in mind to use underscores in filenames instead of dashes

14:32 _rata_: can I use dots?

14:32 Chousuke: don't try

14:33 (I'm pretty sure the answer is no, anyway)

14:33 _rata_: probably not, because dots are treated as slashes

14:36 (directory separators)

14:36 and why can't it be that it reads the file a/b-c.clj but creates the class b_c?

14:39 hoeck: _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:40 hoeck: _rata_: imagine foo-bar.baz, should clojure look for foo_bar/baz.clj or foo-bar/baz.clj but foo_bar/baz.class??

14:40 sorry, I meant the namespaces name

14:41 dashes in the namespaces name

14:41 _rata_: mmmm ok

14:41 yeah, the directory is a problem

14:42 because it should look for foo-bar/baz.clj, but it would have to create the foo_bar directory

14:42 and that'd be a mess

14:49 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:54 klang: _rata_: that only happens when you have imported, used or required a var, riht?

14:55 _rata_: yeah, that's right

14:56 klang: _rata_, two choices then .. don't :use that var or use another name in your namespace .. sorry to be a smart-ass.

14:57 hoeck: _rata_: or do an (ns-unmap *ns* 'the-offending-var) to fix it temporarily

14:58 happens 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:01 klang: _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:02 ninjudd: stuartsierra's lazytest has a reload function that uses the ns dependency graph. would be nice if someone patched swank-clojure to use that

15:02 klang: _rata_ something like, (:use [basic.core] :reload-all), will also get rid of stale names, I suppose ..

15:02 hoeck: _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:03 ninjudd: modifying cake to use that is on my todo list

15:04 or perhaps cemerick would be interested in adding that to nREPL. then the mythic nREPL version of swank-clojure could use that

15:05 klang: ninjudd, "mythic"? .. do you see no future for nREPL?

15:07 ninjudd: klang: 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:08 i just meant that there may or may not end up being an implementation of swank clojure built on nREPL

15:09 hoeck: ninjudd: complex stream behavior?

15:09 wwmorgan1: _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:12 ninjudd: hoeck: 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:12 klang: ninjudd: I was just wondering. Pay no attention to me, reading about cake ..

15:13 ninjudd: which 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:14 (which is what i've already done for cake's persistent JVM)

15:15 but you know cemerick, he's into rewriting stuff from scratch, right Raynes? ;-)

15:17 $8ball is Raynes asleep already?

15:17 sexpbot: ninjudd: Cannot predict now.

15:20 technomancy: ninjudd: steve gilardi has a new version of load that does reloading automatically based on timestamps on disk

15:20 might as well implement that at the lowest level rather than in tools like swank/lazytest

15:20 although it may make sense in swank for backwards compatibility reasons since not everyone could upgrade

15:21 ninjudd: technomancy: agreed. does it use the ns dependency graph to reload dependent namespaces?

15:21 technomancy: yeah

15:21 scgilardi could possibly comment further

15:21 ninjudd: technomancy: is it on github?

15:22 technomancy: this is probably it: http://github.com/scgilardi/clojure/tree/load-tracking

15:22 undoubtedly slightly bitrotten

15:24 ninjudd: hmmph. clojars makes me change my password to change my ssh key

15:25 technomancy: oh, he did it as a patch to clojure. i see

15:26 technomancy: right... that's where load is located =)

15:26 ninjudd: really?

15:27 technomancy: M-. clojure.core/load does not lie

15:28 ninjudd: which means it will be ages before it is available

15:29 technomancy: ...

15:29 sad but true

15:37 hugod: technomancy: 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:39 technomancy: hugod: no idea if it does in its current state, but it seems likely that a finished version would.

15:41 ninjudd: perhaps scgilardi and stuartsierra should combine their implementations into a clj-reload project until it gets into clojure/core

15:43 technomancy: that reminds me. did i ever tell you a distilled the completion functionality from swank-clojure into standalone library?

15:43 technomancy: ninjudd: ISTR you mentioned you were working on something; did you finish it?

15:44 ninjudd: http://github.com/ninjudd/clojure-complete

15:45 technomancy: cool; would love to see that integrated with swank for reusability

15:46 antares_: technomancy: hey, is this the right channel to ask a leiningen-related question?

15:46 technomancy: swank is such a rat's nest

15:46 ninjudd: yeah. i added a few things swank doesn't support

15:46 technomancy: antares_: sure; user questions are better for here

15:46 antares_: #leiningen is mostly for dev chatter

15:46 ninjudd: what kind of things?

15:46 antares_: 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:47 ninjudd: technomancy: hehe. i told you to add java-compilation to lein

15:47 antares_: 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:47 ninjudd: even submitted a patch for it ;)

15:48 antares_: ninjudd: absolutely, I agree that javac plugin needs to be part of core lein ;)

15:48 technomancy: ninjudd: I told you I'd add it once the patch saw some wider usage

15:48 that's my policy with adding pretty much any task

15:49 antares_: put the hook in src/leiningen/hooks/javac.clj

15:49 antares_: problems loading hooks are not fatal for precisely this reason

15:51 you can put extra stuff in project.clj, but it's usually cleaner to avoid that

15:51 especially if it includes an ns call that doesn't match the filename; that's usually a red-flag in any case

15:52 antares_: technomancy: that helped, thank you

15:52 technomancy: antares_: sure

15:53 ninjudd: technomancy: i added special form completion and something else i can't recall now

15:53 antares_: technomancy: ninjudd so you guys are going to integrate javac plugin into the core? How can I help with that?

15:53 ninjudd: hehe, i'm not ;)

15:53 antares_: ninjudd: I see :)

15:53 mavallad: Novice question

15:53 amalloy: ninjudd: fork it off into a new repo and start stealing technomancy's clientele

15:54 ninjudd: fork what?

15:54 mavallad: I have a function to check if an element is in one of the subsequences of a sequence

15:54 amalloy: the javac thingy? make it part of core

15:54 technomancy: antares_: 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:54 mavallad: Here it is my code: http://pastie.org/1181469

15:55 ninjudd: amalloy: i already did http://github.com/ninjudd/cake/blob/master/src/cake/tasks/compile.clj

15:55 klang: ninjudd: would clojure-complete be part of the project.clj's :dev-dependecies?

15:55 chouser: why doesn't AbstractMethodError tell me the name of the method it's trying to call?

15:55 mavallad: But my call to some returns always nil

15:55 antares_: technomancy: ok, that works

15:56 ninjudd: klang: i use it directly in cake for the repl task

15:57 technomancy: antares_: next release will probably add lein-search, lein-plugin, and lein-run plugins as well. might end up just being an assimilation release

15:57 amalloy: mavallad: i just pasted that into my repl and it works

15:57 user=> (present-in-collections? 1 [[1]])

15:57 x 1 c [1]

15:57 (some #{1} [1]) 1

15:57 true

15:57 klang: ninjudd: so it wouldn't provide me anything that emacs doesn't? (damn)

15:58 ninjudd: klang: not unless technomancy uses it in swank or you are using 'cake repl'

15:58 chouser: mavallad: worked for me too with (present-in-collections? 5 [[1 2 3] [4 5 6] [7 8 9]])

15:59 amalloy: chouser: maybe Sun doesn't care about providing debug info to people who are running code that javac can't produce? :P

15:59 technomancy: ninjudd: honestly if you went through swank to extract that code you probably know more about the internals of swank than I do.

15:59 ninjudd: would be nice if clojure-mode used it for completions

15:59 technomancy: lol

16:00 mavallad: But why this doesn't work? (present-in-collections? 10 '('(10 20 30)))

16:00 ninjudd: technomancy: don't get any ideas. i'm not taking over maintenance of swank-clojure ;)

16:01 klang: ninjudd: 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:01 amalloy: mavallad: you're misusing the ' operator

16:01 mavallad: try '((10 20 30))

16:01 ninjudd: klang: stay tuned. cake won't have two JVMs for long...

16:01 technomancy: one of these days I'll find someone who will...

16:01 mavallad: Ah, yes, that works!

16:02 Then I don't have to quote the inner list

16:02 amalloy: right. ' automatically quotes everything at every depth

16:02 mavallad: Sorry, my fault, didn't know that

16:02 Thank you very much

16:02 serabe: hi

16:02 amalloy: of course it's your fault! you brought broken code and asked to have it fixed! :) that's what #clojure is for

16:03 klang: ninjudd: certainly. nREPL is exciting as well, easier to maintain that swank-clojure, perhaps?

16:04 technomancy: klang: you'd have to write an elisp frontend for it, which would be loads of work.

16:04 ninjudd: klang: or a swank wrapper

16:04 technomancy: best to hold off until a clojure->elisp compiler exists

16:04 ninjudd: technomancy: you're almost done with that, right?

16:05 technomancy: almost done picking a suitable name

16:05 ninjudd: good, that means is will be finished at the next seajure meeting

16:05 technomancy: I think Orestes would be nice.

16:05 _schulte_: probably right after Emacs learns how to handle multiple threads

16:06 technomancy: you could probably pull off some parallels between elisp/CL and agamemnon/clytamnestla if you got imaginative.

16:06 _schulte_: have you tried the concurrency branch?

16:06 klang: technomancy: 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:06 technomancy: _schulte_: it sort of works!

16:06 _schulte_: no, is that based on guile?

16:06 no way

16:06 technomancy: _schulte_: not at all

16:07 it'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:07 technomancy: _schulte_: yeah... that's a pipe dream if you ask me

16:07 there 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:08 technomancy: multi-language VMs are herculean efforts if you want to maintain backwards compatibility

16:08 witness 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 oh, I see, as in languages need to be implemented *for* the vm

16:09 technomancy: _schulte_: well... it's much easier because you're free to go with the grain of the VM

16:09 _schulte_: yea

16:09 chouser: amalloy: ha

16:09 technomancy: _schulte_: there are schemes and CL for the JVM, but they haven't taken off because they're fighting against the current

16:09 especially since call/cc requires an interpreter

16:10 guile 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:10 but it's still loads of work

16:11 _schulte_: yea, subsuming Emacs would drastically increase the guile user pool

16:11 technomancy: _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 evolution of x86 assembly code

16:12 so take your buggy program, compile it to x86, then we "evolve" it to fix bugs, improve performance, etc...

16:12 just don't expect to get back any patches you'd want to apply to your code base

16:13 technomancy: wow, that's wild

16:13 _schulte_: yea, it's crazy that it actually works (in some cases) on real programs

16:13 chouser: TakeV: call/cc could be done if you use trampoline for every fn call, I think.

16:13 technomancy: ^^^ 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:15 technomancy: chouser: 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:15 technomancy: not saing it's not doable, just that it's awkward

16:15 _schulte_: cool

16:16 ninjudd: _schulte_: you're at unm?

16:16 _schulte_: ninjudd: yup, just starting my second year

16:17 ninjudd: i went there

16:17 technomancy: poll: 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:18 ninjudd: s/there/there!/

16:18 sexpbot: <ninjudd> i went there!

16:18 _schulte_: ninjudd: nice, I'm enjoying working with some of the professors in the CS dept.

16:19 ninjudd: _schulte_: yeah, there are some really good professors

16:19 technomancy: taking the metadata seems nicer because it means yoru predicates can just be keywords

16:20 amalloy: that's a pretty small gain though, right? i mean (comp :keyword meta)

16:21 ninjudd: _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:21 technomancy: amalloy: 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:21 ninjudd: nice, who is your advisor?

16:21 technomancy: I 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:21 technomancy: but if you can think of one I'm open to the idea

16:22 ninjudd: wow! Stephanie was my advisor

16:22 _schulte_: no way!

16:22 amalloy: technomancy: not really. i haven't used the test framework at all, so i'm just making stuff up here

16:22 technomancy: amalloy: 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:23 should 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:23 technomancy: and 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:24 ninjudd: _schulte_: http://www.cs.unm.edu/~forrest/students.html i'm Justin Balthrop

16:24 looks like someone deleted http://www.cs.unm.edu/~judd

16:25 _schulte_: well, that's crazy

16:25 yea, I'm up at http://cs.unm.edu/~eschulte/

16:25 I'll have to mention you to her

16:25 ninjudd: yeah. say hi! i haven't spoken with her in a while

16:25 _schulte_: will do

16:26 chouser: technomancy: 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:27 technomancy: chouser: good thing we're not scheme!

16:27 chouser: technomancy: for your test predicates, you could pass in (assoc (meta v) :var v)

16:27 technomancy: chouser: brilliant. thanks.

16:28 actually (assoc (meta v) ::var v) in order to avoid the slight possibility of overwriting something important, but consider it applied.

16:28 chouser: ah, good point

16:28 I 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:29 chouser: sure, it's just easier if either the vm or the language is designed with the other in mind

16:30 such as java/jvm, groovy/jvm, clojure/jvm, C#/CLR, ruby/rubyc, etc.

16:30 technomancy: I 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:30 technomancy: I mean... if we had that, all our problems would be solved in a year or so

16:31 modulo patent concerns

16:31 chouser: things 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:32 chouser: hm, interesting. Had honestly never considered trying to compile clojure to haskell.

16:33 seems 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:33 chouser: maybe a lisp-flavoured-haskell would be more fruitful angle

16:34 technomancy: _schulte_: did you make it to seattle.rb when you were still up here?

16:34 chouser: ISTR that exists

16:34 _schulte_: technomancy: just a couple of ruby meetings, but that was a long time ago

16:34 chouser: technomancy: I know there's lispy erlang, but hadn't heard of that for haskell.

16:34 technomancy: clojurebot: google liskell

16:34 clojurebot: First, 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:34 clojurebot: CFruhwirth&#39;s Weblog: Liskell standalone

16:34 http://blog.clemens.endorphin.org/2009/01/liskell-standalone.html

16:35 chouser: there's also templated haskell or some such for lisp-style macros, but the datatypes get hairy fast compared to clojure macros.

16:35 technomancy: _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 thanks for the pointer to liskell

16:38 technomancy: no idea if it's beyond a toy

16:38 _schulte_: yea understood

16:43 serabe: does anybody know how to modify the arglists retrieved by doc method in a function created through a macro?

16:43 technomancy: serabe: you can supply your own :arglists key in the metadata

16:43 metadata is so great

16:44 it'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:45 serabe: technomancy: thanks, am I doing anything wrong? this doesn't seem to work: http://gist.github.com/597291

16:46 ninjudd: _schulte_: did they get rid of the undergraduate Scheme class at UNM?

16:46 technomancy: serabe: 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:49 arkh: is 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:49 serabe: technomancy, one moment please

16:49 ninjudd: _schulte_: oh, i found it. they just changed it from CS257 to CS357

16:49 serabe: technomancy, nop, it doesn't work either

16:51 ninjudd: _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:51 arkh: actually, 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 I just noticed he's got a fantastic logo on that classes web page http://cs.unm.edu/~williams/lambdahead.gif

16:52 amalloy: arkh: 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:53 ninjudd: _schulte_: hehe. i remember that logo

16:53 amalloy: er. or to write it less badly: (defn satisfying [pred] (fn [x] (when (pred x) x)))

16:53 arkh: amalloy: yeah, I kind of thought there'd be a way to do that already too. Thank you.

16:54 amalloy: arkh: 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:56 raek: hrm... the predicate-to-validator function tuns up again...

16:57 s/tuns/turns/

16:57 sexpbot: <raek> hrm... the predicate-to-validator function turns up again...

16:58 raek: have anyone seen Kaali around lately?

16:59 technomancy: antares_: actually re: javac; that hook actually belongs in the javac plugin

16:59 LauJensen: ~seen Kaali

16:59 clojurebot: no, I have not seen Kaali

16:59 technomancy: antares_: no need for all javac users to cart it around themselves

16:59 it should probably just hook eval-in-project instead of hooking tasks directly though

16:59 antares_: technomancy: for those two tasks, yes

17:00 what's the difference?

17:00 technomancy: antares_: well lots of tasks use eval-in-project

17:00 it's a single entry point; any code that wants to run code inside the project will go through it

17:00 so even plugins that are external to lein will be affected

17:01 using The Magic of Robert Hooke™

17:03 nroot7: If I need disk based persistent storage with STM semantics (MVCC and no locking) is the correct way to use PostgreSQL ?

17:04 antares_: technomancy: I am not sure Java source recompilation should be hooked a place that affects *a lot* of things :/

17:04 ninjudd: *cough* dependency-based task model *cough*

17:05 technomancy: antares_: well, it shouldn't recompile every time

17:05 antares_: nroot7: PostgreSQL uses MVCC to implement transactions, but it is completely hidden from you. I would not say PG has any "MVCC support".

17:05 amalloy: nroot7: 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:05 technomancy: just check for .java files that are newer than the corresponding .class files; no problem

17:05 memoize it if you're worried that it might still be too costly

17:05 functions... aren't they great?

17:06 antares_: technomancy: I know what incremental compilation is ;) well, ok, it may be worth a discussion on the mailing list

17:07 technomancy: antares_: sure, the point is it shouldn't be hard to make it cheap to call in cases where it's not needed

17:28 antares_: technomancy: when you were talking about mailing list, you were referring to Clojure mailing list, right? Leiningen does not have a separate one?

17:29 technomancy: antares_: no, there's a leiningen one

17:29 http://groups.google.com/group/leiningen

17:29 antares_: technomancy: thanks!

17:41 technomancy: FYI http://groups.google.com/group/leiningen/browse_thread/thread/3807e9c133b2410c

18:06 sumbach: has anybody seen the clojure repl appear to hang in OSX, but you can recover with ctrl+z then fg?

18:07 it doesn't always get stuck in the same place, and it appears to be IO-related

18:24 serabe: technomancy: I'm still having problems

18:24 technomancy, do you know if def deletes arglists in meta?

18:29 leaving to sleep on it

18:35 jjido: is this efficient for catening two vectors? ,(apply (partial conj [1 2 3]) [7 8 9])

18:37 arohner: jjido: why not just use (concat [1 2 3] [7 8 9]) ?

18:38 jjido: arohner: you mean (vec (concat [1 2 3] [7 8 9]))?

18:38 lpetit: ,(doc into)

18:38 clojurebot: "([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined."

18:38 lpetit: ,(into [1 2 3] [ 7 8 9])

18:38 clojurebot: [1 2 3 7 8 9]

18:38 arohner: even better

18:38 jjido: lpetit: ooh yes great

18:39 lpetit: preserves the type of the first arg

18:46 hmm

18:46 ,(source into)

18:46 clojurebot: java.lang.Exception: Unable to resolve symbol: source in this context

18:47 raek: (source into)

18:47 lpetit: hey, it's almost what you tried: (reduce conj to from)

18:47 raek: clojurebot: (source into)

18:47 clojurebot: source is http://github.com/hiredman/clojurebot/tree/master

18:47 lpetit: jjido: ^^

19:06 bmh: at

19:06 oops.

19:23 Lajla: ,(+)

19:23 clojurebot: 0

19:23 Lajla: ,(+ nil)

19:23 clojurebot: nil

19:23 Lajla: ,(+ 1 nil)

19:23 clojurebot: java.lang.NullPointerException

19:26 lpetit: hmmm, 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:27 probably, 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:27 eureka !

20:04 jjido: ,(Character/isUpperCase (first "Hello"))

20:04 clojurebot: true

20:04 jjido: ,((comp Character/isUpperCase first) "Hello")

20:04 clojurebot: java.lang.Exception: Unable to find static field: isUpperCase in class java.lang.Character

20:05 jjido: er....

20:06 dnolen: jjido: Java methods are not first class

20:06 jjido: ,((comp 'Character/isUpperCase first) "Hello")

20:06 clojurebot: nil

20:06 dnolen: ,((comp #(Character/isUpperCase %) first) "Hello")

20:06 clojurebot: true

20:07 jjido: dnolen: I see...

20:07 could as well write

20:08 ,(#(Character/isUpperCase (first %)) "Hello")

20:08 clojurebot: true

20:10 dnolen: ,((fn [c & rest] (Character/isUpperCase c)) "Hello")

20:10 clojurebot: java.lang.IllegalArgumentException: No matching method found: isUpperCase

20:10 dnolen: ,((fn [[c & res]t] (Character/isUpperCase c)) "Hello")

20:10 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: sandbox$eval7718$fn

20:10 dnolen: erg

20:10 ,((fn [[c & rest]] (Character/isUpperCase c)) "Hello")

20:10 clojurebot: false

20:11 dnolen: huh

20:12 jjido: dnolen: false, you are wrong ;)

20:12 dnolen: jjido: heh, it's true on machine

20:12 on my machine

20:13 ,((fn [[c & rest]] c) "Hello")

20:13 clojurebot: \H

20:17 jjido: can I test if a function returns a Boolean?

20:19 ,(instance? Boolean (Character/isUpperCase 'H))

20:19 clojurebot: java.lang.IllegalArgumentException: No matching method found: isUpperCase

20:19 jjido: ,(instance? Boolean (Character/isUpperCase (first "Hello")))

20:19 clojurebot: true

20:21 jjido: Mmh, seems impossible in a dynamically typed language

23:45 gerryxiao: hello

23:45 ,(def a-agent (agent {}))

23:45 clojurebot: DENIED

23:45 gerryxiao: ,(def a 30)

23:45 clojurebot: DENIED

23:46 gerryxiao: $(def a 30)

23:48 ,(println 1)

23:48 clojurebot: 1

23:58 bhenry: gerryxiao: use a let.

Logging service provided by n01se.net