#clojure log - Feb 07 2010

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

0:28 fullets: How do I make leiningen use the version of clojure I already have installed rather than its own version downloaded from somewhere?

0:30 tomoj: put your version into your maven repo, I guess

0:30 http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html is what I use

0:30 maybe use a different artifact id so you can be sure you're getting your custom version?

0:31 fullets: Oh dear maven is terrifying :(

0:32 tomoj: yeah, I was just wondering whether a lein plugin could do that

0:32 lein-install-jar maybe?

0:34 fullets: I was hoping there'd be a command line option - I already have perfectly good jars lying around my filesystem and it seems that using several different versions of Clojure for different things will someday end in tears

1:28 joschu: i have a weird problem: it seems that clojure slime isn't respecting the println's i put in my clojure code

1:28 the output isn't getting printed at the repl

1:29 so i put in (println "blah") and nothing happens. then i put in (/ 1 0) and i get an ArithmeticError exception

1:32 hiredman: check the inferior lisp buffer

1:35 joschu: yep, it's there!

1:35 hiredman: are you using agents at all?

1:35 joschu: no

1:36 this is some really simple single-thread code

1:36 hiredman: swank-clojure binds *out* thread locally to something that prints to the slime repl

1:36 outside of that binding it prints to the inferior lisp buffer

1:36 so your binding is broken somehow

1:36 *shrug*

1:36 joschu: actually the weird thing is, in *inferior-lisp*, the println result comes AFTER the exception

1:39 hiredman: maybe a buffer flushing issue

1:39 zaphyr: yeah, won't the exception print on System.err?

1:39 so there's no telling who comes out first

1:40 joschu: oh so maybe slime looks for the exception and thus it misses the last printlns

1:41 zaphyr: hmm, it shouldn't 'miss' printlns, just there's no promise that exceptions won't be printed in the same order as stuff to *out*

2:00 joschu: i can't figure out how to start up a repl and load my source file

2:00 hiredman: java -jar clojure.jar -i file.clj -r

2:02 joschu: thanks that works

2:02 i don't get jline though

2:02 hiredman: java -cp clojurestuff:jlinestuff jline.some.class clojure.main …

2:06 joschu: ok so i did this: java -cp /opt/jars/clojure-contrib.jar:/opt/jars/clojure.jar:/opt/jars/jline-0_9_5.jar jline.ConsoleRunner clojure.lang.Repl and i get a nice REPL. But then I can't load my file--it's not on the classpath

2:06 (ns user (:use paip))

2:06 hiredman: don't use Repl

2:06 clojure.main

2:07 Repl and Script have been superseded by clojure.main for almost forever

2:08 joschu: ok

2:10 now i'm trying to "import" my source files into the namespace

2:10 my file is called called paip.clj

2:10 hiredman: well import is only for java classes

2:10 joschu: i'm using (use paip) or (ns user (:use paip))

2:11 hiredman: you definitely don't want the latter

2:11 the user namespace already exists

2:11 joschu: i just want to load all the names so i can call the functions on the repl

2:11 hiredman: does paip have a proper namespace declaration?

2:12 joschu: I would just use load-file

2:12 if you just want to load-file then forget about all the namespace stuff

2:12 joschu: aha that works

2:12 thanks a lot

2:13 now i don't have the weird println problems

2:46 tomoj: I want a peepcode clone for clojure :)

3:00 LauJensen: Morning team

4:16 piccolino: Is there some way you can declare the return value of a function with a type hint?

4:18 hiredman: (defn #^SomeType f [x] ...)

4:19 piccolino: Ah, thank you.

4:19 So obvious in hindsight.

4:23 hiredman: I don't know if that actually helps

4:24 I wonder if that is not actually it

4:26 piccolino: Ah.

4:26 Oh well.

4:27 If Clojure is asked to use a Java method and there's only one possible method it could be in that class, would Clojure link right to that method, or would it still use reflection?

4:28 hiredman: my guess is it still would use reflection

4:28 piccolino: Yeah, that's what I figured.

4:29 hiredman: *warn-on-reflection* should tell you

4:29 piccolino: I haven't been able to ever get that to give me a warning.

4:29 So I don't know.

4:30 hiredman: it's a compile time thing

4:30 piccolino: Oooh.

4:30 hiredman: you don't set it when you are running the code

4:30 you set it when you are evaluating/compiling it

4:30 piccolino: Well, I've been using Slime.

4:31 So I thought that if I C-c C-k'd it, it would warn me.

4:31 hiredman: it might print the warnings to the inferior lisp buffer

4:31 piccolino: Nope

4:31 hiredman: *shrug*

4:32 piccolino: Ah, I just added it to the source file iteslf and now it does something.

4:35 Ah, OK, on the command line it works.

4:35 Thanks.

4:38 Well, at least now we know that when there's only one option, it still does reflection.

5:55 lypanov: morning

6:07 um...

6:20 is there an equiv of ffilter? as in, (first (filter pred coll))?

6:26 ah, when-first is what i actually needed. very cute.

6:34 http://gist.github.com/297384

6:34 * lypanov is getting to really like clojure

7:18 lypanov: um. mutually recursive infinite prime list gen is making my head go boom.

7:38 lpetit: hi there

7:38 any heavy paredit user in the room ?

7:44 Nikelandjelo: I'm new to clojure and trying to generate list of primes numbers, but I have some bug: http://pastebin.com/m34ed8d81 Can anybody help?

7:49 qed: lpetit: i dont know if i qualify as heavy -- i mean, i use the mode for everything practically, but...

7:50 lpetit: qed: I would like feedback concerning paredit design of a particular command

7:50 qed: which command

7:50 lpetit: forward delete (well, just hitting the delete key)

7:51 given the following "text spec" (where the pip symbol symbolizes the cursor place) :

7:51 "(a (b |(c d) e) f)"

7:51 here is how paredit works:

7:52 lypanov: Nikelandjelo: i'm doing something similar also at the moment while playing with projecteuler. taking a look at your code.

7:52 lpetit: "(a (b |(c d) e) f)" -> delete -> "(a (b (|c d) e) f)" -> delete -> "(a (b (| d) e) f)" -> delete -> "(a (b (|d) e) f)" -> delete -> "(a (b (|) e) f)" -> delete -> "(a (b | e) f)"

7:52 Hali_303: is there something like M-( in paredit, but not for ( instead [ ?

7:53 lpetit: qed: first, do we agree on paredit's behaviour, did I correctly describe it ?

7:53 tomoj: Hali_303: paredit-wrap-square

7:53 Hali_303: tomoj: what's the shortcut for that?

7:53 lpetit: Hali_303: what is M-( please ?

7:53 tomoj: there isn't one

7:53 Hali_303: tomoj: ahh, that's why it is not working

7:53 tomoj: Hali_303: add this to your init.el or whatever https://gist.github.com/44a2bd1b704d8b81ca9c

7:53 Hali_303: lpetit: http://mumble.net/~campbell/emacs/paredit.html

7:54 tomoj: you also get curlies :)

7:54 lpetit: thx

7:54 tomoj: maybe someday clojure-mode will add this for us

7:54 Hali_303: tomoj: thx

7:55 lpetit: qed: ?

7:56 tomoj: do you like the behavior of using the delete commande in paredit ?

7:56 qed: lpetit: it works the same to me as delete, just in reverse

7:57 tomoj: sometimes I find it a bit strange

7:57 qed: err backspace

7:57 tomoj: but I have not yet achieved paredit nirvana

7:57 what is an alternative behavior?

7:57 lpetit: tomoj: if it were "(a |(b c d) e)" -> delete -> "(a |b c d e)" instead, how would you like it ?

7:57 tomoj: hmm

7:57 lpetit: tomoj: deleting a paren would also delete the corresponding one

7:57 qed: lpetit: i actually really like that

7:58 tomoj: I don't think I've run into that path enough to have a valid opinion

7:58 Hali_303: tomoj: where's the init.el that I should add these lines?

7:58 tomoj: I would now use splice to do that

7:58 Hali_303: do you have a .emacs?

7:58 Hali_303: yes

7:58 lpetit: qed, tomoj: I'm currently porting paredit to eclipse, and arguing with cgrand to see where we could fork from paredit's behavior

7:58 tomoj: put it there

7:58 Hali_303: tomoj: I did that, but emacs gave an error than (variable is void or something like that)

7:58 tomoj: and I believe you need to require paredit before you add those shortcuts in order for that to work

7:58 yeah..

7:59 lpetit: tomoj: ok, splice is a separate paredit command, then ?

7:59 tomoj: (require 'paredit) before that

7:59 Hali_303: ^

7:59 lpetit: yeah, M-s

7:59 Hali_303: tomoj: thx, I'll try that

7:59 tomoj: (a (|b c d) e) -> splice -> (a b c d e)

8:00 qed: ^this is why i like lpetit's idea

8:00 usually i have to move one direction or the other to use splice

8:00 tomoj: I think part of paredit's philosophy is to treat parens as if they don't exist

8:00 lpetit: tomoj: ok. And if delete in the front of a sexpr called splice automatically, would you consider this a wrong default ?

8:00 qed: with a forward delete like petit's i wouldnt need to

8:00 tomoj: so when you try to delete a paren, it just say, "whoops! that doesn't exist, instead I'll move past it"

8:01 lpetit: I don't know, I don't feel qualified to answer that :)

8:01 lpetit: tomoj: but if you "(|)" -> delete then you get "|", that is paredit does something on the paren :-)

8:01 tomoj: ah, yeah

8:01 whoops! you tried to delete nothing, guess you meant you wanted to get rid of this sexp

8:01 lpetit: tomoj: ok, was just to know. I think we'll have to test it by ourselves anyway, just wanted to see whether there would be strong opinions against such experiments

8:02 tomoj: experiment away, I say

8:02 qed: lpetit: to be honest with you i think experimentation is key

8:02 tomoj: but as I said I am not a paredit buddha

8:02 qed: lpetit: i actually wouldnt mind a sort of "looking forward at the sexp"

8:02 versus "looking backward at the sexp" approach

8:02 versus "im inside"

8:02 i think they're three sub-modes

8:03 if that makes sense?

8:03 tomoj: I do relatively often find myself doing a bunch of forward deletes that leave empty forms behind until I delete them

8:03 qed: tomoj: same here

8:03 tomoj: I feel that your idea might solve that problem

8:03 but don't know if it would introduce others

8:04 I guess the question now is, how would you implement that idea?

8:05 qed: im guessing he'd use "code" ;)

8:05 lpetit: yeah, maybe automatically deleting the closing paren is too "magical", and in complex forms, modifies something that is too far from the current point of edition, and then it's easy to forget that we also deleted smthing else at the end .. humm

8:05 tomoj: hmm, yeah

8:05 splicing does radically change the meaning

8:05 qed: lpetit: i think like everything else users should be able to choose to a certain degree as well

8:05 tomoj: if you have (a (b c d) e), (a b c d e) rarely makes any sense, I think

8:06 qed: give me a checkbox for magic parens

8:06 lpetit: tomoj: the idea is currently implemented there : "(a (b c d) e)"

8:06 whoops

8:06 there http://github.com/laurentpetit/paredit.clj

8:06 but don't look at it too closely, it's a WIP

8:06 qed: tomoj: why wouldn't that make sense rarely?

8:07 err double negative

8:07 lpetit: but still, a working WIP (with just a handful of paredit commands ported, currently)

8:07 tomoj: 'C-h k C-d' describes the current behavior explicitly

8:07 which makes me think at least someone has thought about it

8:07 qed: tomoj: how hard is anyone's guess

8:07 tomoj: 'C-h f paredit-forward-delete' specifically

8:08 qed: in (a (b c d) e), b is being called as a function with c and d as arguments

8:08 switching to (a b c d e) radically changes the meaning

8:08 qed: tomoj: what if it was (a [b c d] e)

8:08 tomoj: now you're passing b, a function, along with the other arguments you were passing to b originally, and whatever was after, all to a

8:08 lpetit: tomoj: how do you change a set into a vector with paredit ?

8:09 "( a [b c d e] f)" -> "( a #{b c d e} f)" ?

8:09 tomoj: hmm

8:09 Hali_303: how to create a {:param1 val1, :param2: val2} from a "param1=val1&param2=val2" string? create a sequence of parameter names and values and then how to create the map dynamically?

8:11 tomoj: (a |[b c d] e) -> type '#' -> (a #|[b c d] e) -> M-{ -> (a #|{[b c d]} e) -> C-f -> (a #{|[b c d]} e) -> M-s -> (a #{|b c d} e)

8:12 I feel like I use the trick of first wrapping, then splicing the inner sexp

8:12 in order to transform one sexp type to another

8:12 s/use/often use/

8:12 qed: yeah i place a #{} before the [], slurp, M-s

8:13 tomoj: hmm

8:13 qed: im not fit to call myself a paredit user

8:13 i dont even have working curlies

8:14 tomoj: in any case I am pretty interested in plumbing the depths of paredit usage

8:14 I kind of want to rig up some kind of monitoring thing that will report statistics to me about my paredit usage

8:14 qed: tomoj: cool idea

8:14 tomoj: or find common patterns of keystrokes that can be abstracted away

8:15 qed: i am always C-b C-f'ing my way into sexps to M-s, etc.

8:15 that's why i like lpetit's idea

8:15 tomoj: yeah

8:16 I don't understand my current usage well enough to know whether I expect C-d to do what it does now

8:16 e.g. maybe I never really want C-d to step through a parens, I don't have a fuckin clue

8:16 need to write an AI in elisp that will know what I'm trying to do and tell me if there's a better way :D

8:16 qed: lol

8:16 M-x doctor

8:17 lpetit: :)

8:19 tomoj: hmm

8:19 an editing session is a sequence of keystrokes

8:19 the problem is to find subsequences which are repeated often

8:19 but fuzzily matching

8:19 NP-complete?

8:20 nah, as long as you restrict the length of the subsequences to search, it should be feasible, right?

8:20 then all you have to do is log every keystroke into a data file you can process later

8:21 qed: you also need to know about what each keystroke produced, though -- do you not?

8:21 tomoj: well, to figure out the right thing to do, maybe

8:22 but just having a list of the most common groups of nearly-identical sequences would be useful, wouldn't it?

8:22 lpetit: ok, must leave now, time to eat smth, thanks for the chat, and cu guys

8:22 qed: tomoj: a sequence of keystrokes in one place could be great, and terrible in another -- you might know this by how many keystrokes were required for one region of some length versus another region

8:22 tomoj: like if you're always doing 'M-[ C-f M-s'

8:23 qed: yes but the keystrokes after it could be further cleaning up what you created with that sequence

8:23 tomoj: that sequence would have a higher count and you could know that optimizing that process would maybe be valuable

8:23 ah, yeah

8:23 well, if the cleanup is similar in most cases...

8:23 if not, then yeah

8:24 qed: tomoj: i think it depends on how you approach the recording of this data

8:24 let's say you start with the clojure.core src and pay keen attention at random points in random sexps throughout the src

8:25 i guess what i was driving at is... if you looked at each movement in your file as a pre-meditated action, holding your paredit cheat sheet closely

8:26 tomoj: hmm

8:26 qed: the other thing might be to just run some sort of evolutionary algorithm or something on large ((()(()))()((()))) structures

8:27 tomoj: how about n-gramming where each element of an n-gram has some information about the context around point and the keystroke you do at that point

8:27 qed: and determine how to get out

8:27 or in

8:27 tomoj: i like that

8:28 tomoj: then, in cases where you're wasting keystrokes, the n-gram model should have low perplexity for a the overused sequence of keystrokes

8:28 and can automatically jump to the end result

8:29 qed: i think you need a way of describing the very abstract action of "i want to get in there to edit this [], #{}, (), etc., and while im in there i want to remove a \W and re-wrap it in (), [], #{}, etc.

8:30 call it "grappling", or something -- now you have some way of measuring keystrokes against a specific action, and could just brute force it

8:31 tomoj: I think an n-gram model might be able to do that

8:31 qed: you could automatically generate situations like that with sexps of any length

8:31 tomoj: if you pick the right contexts to stick in there

8:31 somnium: M-x paredit-obstacle-course

8:31 qed: :D

8:31 tomoj: I don't think automatic stuff is feasible

8:31 I think you would need to learn by observing real usage on real code

8:31 but I am just talking out of my ass

8:32 qed: that'd be a neat game actually -- give people an obstacle for a given sexp, record their keystrokes, have those keystrokes sent to you, where they are analyzed

8:32 tomoj: so the goal is to get to the answer with the fewest number of keystrokes?

8:32 qed: it places them at some random point and gives them a task

8:32 yes

8:33 somnium: like those japanese typing games, but editing sexps

8:33 very niche market

8:34 tomoj: can we have emacs log every keystroke with a context window around point without making it crawl?

8:35 I don't even have any clue how you'd implement that without having to rebind every single keystroke

8:35 qed: "You're located at the head of the 6th level in a 8 level sexp. At the 4th level there is a coin. How do you slurp the coin?"

8:35 somnium: :p

8:36 logging to another buffer would probably be easier

8:36 something like this: http://en.wikipedia.org/wiki/The_Typing_of_the_Dead to train people in the ways of paredit

8:36 qed: "You're facing a right paren. To your left there is a single argument to a function."

8:36 heh

8:37 somnium: that's cool

8:37 idk -- i play typeracer sometimes -- I actually would rather edit sexps

8:38 lypanov: wtf did my gist go from last night...

8:38 somnium: qed: cant be that much harder to port to emacs than tetris :)

8:42 qed: heh -- i read an interesting comment -- someone said "how is tetris 25 years old?"

8:42 reply: "in some asians countries they use base-1 to determine age"

8:47 i need to setup emacs to turn my lol's and idk's into "ha!" and "i don't know" respectively

8:48 emacs can make me appear 3-4 years older!

8:48 somnium: hmm, may exist. I get a fair amount of use from wtf-mode

8:49 tomoj: qed: erc?

8:49 qed: tomoj: it has that built in?

8:49 tomoj: no, just wondering if you're using it

8:49 if so, presumably easy to do what you want

8:49 though I still haven't hacked erc yet

8:49 qed: im in an irssi shell atm due to some init.el restructuring

8:50 tomoj: I was thinking that, if you're doing some kind of obstacle course, the examples should be real

8:50 qed: tomoj: that's why i suggested the core source

8:50 tomoj: like, you should record actual code and the final result after some changes

8:50 core source?

8:50 qed: clojure's source

8:51 tomoj: ah

8:51 and what, look at git diffs?

8:52 qed: i was thinking you'd randomly choose a sexp

8:52 tomoj: I think you probably want finer-grained than git commits

8:52 qed: and then depending on how difficult it is for people to traverse, you give it a rating

8:52 tomoj: ok, but how do you pick the target?

8:52 qed: you'd need some initial training

8:52 tomoj: a random mutation of the sexp is probably not indicative of actual use

8:52 hmm

8:53 rrc7cz: how can you apply for dynamically? like if I have a map {:numbers [1 2 3] :letters [\a \b \c]} I could hard code (for [n (coll :numbers) l (coll :letters)], but how could I make it so the list comprehension is applies to a collection of collections?

8:53 qed: tomoj: here's an idea...

8:53 you start with a clojure sexp, you're given a random clojure sexp which contains a valid expression that can be made using the parts from the first sexp

8:54 tomoj: rrc7cz: for is a macro, so.. :/

8:54 rrc7cz: tomoj: so I'd have to make a macro to expand the collections myself

8:54 tomoj: qed: you mean like, generate a bunch of random mutations and check for ones that compile successfully? maybe I'm not following

8:55 (if you start trying to do machine learning in your editor, have you simply gone off the deep end? :D)

8:55 qed: (a (a b [c d e] [f g] #{:x :y :z} (+ {42}) (h _) :g) :x)

8:55 let's assume that's real clojure source

8:56 i tell you: give me: (a #{:x :y :z} :g)

8:56 it doesnt matter if that actually compiles

8:56 tomoj: rrc7cz: hmm, I'm not sure. that doesn't sound wrong to me

8:56 you're looking for the cartesian product, yes?

8:57 rrc7cz: correct

8:57 tomoj: c.c.contrib has cartesian-product

8:57 rrc7cz: i'll take a look, thanks

8:57 tomoj: so (cartesian-product (vals the-map))

8:57 rrc7cz: perfect

8:57 qed: what's the cartesian product?

8:58 tomoj: but then how do you get the bindings?

8:58 you would need to know at code-time how many vals the map has

8:58 like (for [[a b] (cartesian-product (vals the-map))] ...)

8:58 no?

8:58 clojurebot: da da king of the road

8:58 rrc7cz: qed: think join in a RDBMS

8:59 part of relational algebra

8:59 basically a join though

8:59 qed: i looked it up :)

8:59 tomoj: clojurebot: trailers for sale or rent?

8:59 clojurebot: amespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it

8:59 rrc7cz: tomoj: not sure, gotta think about this one

8:59 qed: tomoj: what do you think of the above idea

9:00 somnium: rrc7cz: not this? (map (fn [coll] (for ...)) maps), what output do you want?

9:00 tomoj: qed: the problem is, how do you decide what to tell me what to give you?

9:00 er, how do you decide what to tell me to give you

9:01 e.g., where'd you get "(a #{:x :y :z} :g)" from

9:01 rrc7cz: desired output from my example: [{:numbers 1 :letters \a} {:numbers 1 :letters \b} {:numbers 1 :letters \c} ... ]

9:01 qed: tomoj: from the first sexp

9:01 tomoj: rrc7cz: oh, that's a nice idea

9:01 qed: (a (a b [c d e] [f g] #{:x :y :z} (+ {42}) (h _) :g) :x) becomes (a #{:x :y :z} :g)

9:01 tomoj: then you can use the keys binding to not care about how many sets your taking the product of

9:02 qed: I don't follow

9:02 how do you get from one to the other automatically?

9:02 qed: tomoj: you start at a point in the first expression, you're asked to simplify the first sexp

9:02 to make it become the second

9:02 tomoj: yeah

9:02 but how do you decide what the second is when you're making up the exercize?

9:03 qed: you just randomly select pieces of the first

9:03 tomoj: if it's just a random simplification, it might not be indicative of actual stuff that you really do when you're working on real code

9:03 that's my concern

9:04 maybe that won't matter in practice

9:04 qed: i thought about that -- two things: 1. you're being asked to look at real code in the first instance

9:04 somnium: you could weight complexity by nesting, number of elements, and sexp types?

9:04 qed: i can't help but think that when im thinking out how i'll solve it

9:04 tomoj: but I'm guessing you need to care about actual common transformations rather than just random transformations (even random transformations of real code)

9:04 again, talking out of my ass and have no evidence or argument for that

9:05 qed: yeah same here, it's fun to think about though

9:05 tomoj: for just learning to effectively use a fixed set of commands, I think that'd be great

9:05 somnium: I wonder if some people's answer to paredit would be 'syntax'

9:06 tomoj: huh?!

9:06 somnium: I bet being able to tear through gnarly random sexps would benefit every day use of paredit anyway

9:06 tomoj: yeah, I bet it would too

9:06 somnium: ah, I was thinking of the potential difficulties in marketing this product :)

9:06 qed: tomoj: what if the left over pieces of the first sexp had to be reconstructed in the 2nd half of a 2 part question?

9:07 tomoj: I was thinking of trying to automatically identify places where you'd benefit from a new command

9:07 npoektop: hi! can't find with google what -> means.

9:07 qed: tomoj: what if like tetris you were given pieces to assemble

9:07 tomoj: somnium: like, "why should I learn to be better at paredit, I'll just use a language that has more syntax?"

9:08 somnium: something like that

9:08 tomoj: ,(doc ->)

9:08 clojurebot: "([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

9:08 tomoj: somnium: I bet some people would probably think that indeed

9:08 npoektop: tomoj: thank you

9:08 tomoj: but it seems... backwards

9:09 qed: they're two equally valid ways of thinking

9:10 the minimalist in me prefers one way -- but syntax has its merits

9:10 somnium: well, (most) haskell code looks pretty clean

9:10 tomoj: like?

9:10 clojurebot: namespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it

9:10 tomoj: readability or something?

9:10 if we're talking about editing power I can't imagine an argument _for_ syntax

9:11 qed: tomoj: style?

9:11 tomoj: which is why saying "paredit? psh, syntax" makes no sense to me—paredit is designed for editing power

9:12 ah, yeah

9:12 qed: i mean it cannot be denied that editing power is still in some regard an aesthetic choice

9:12 tomoj: I've talked to some people who say that they just cannot see sexps as pretty

9:12 hmm

9:12 somnium: I tend to organize sexps into tables more than is probably called for

9:13 qed: it's like in anything else in life -- i know people who i think: "how does that guy's brain work? i cant imagine if my brain worked like that."

9:13 tomoj: I would admit that it's an aesthetic choice if I could conceive of a benefit for editing power from syntax

9:13 but i can't

9:13 somnium: overcompensation for the 'amoeba effect'

9:13 tomoj: I guess this is just because my aesthetics are different?

9:13 qed: somnium: hahahahahahaha

9:13 tomoj: i can appreciate picasso and the mona lisa equally for different reasons

9:14 tomoj: right, but I can't even think of a single reason :(

9:14 somnium: tomoj: to apprecate mona lisa or picasso?

9:14 tomoj: if you always write the correct code the very first time, maybe

9:14 somnium: to appreciate syntax as it relates to "editing power"

9:15 qed: somnium: bahaha im tired, cut me some slack

9:15 somnium: scala makes me feel ill, but f# and haskell are clean

9:15 tomoj: but in haskell I hit tab and it cycles through various options for the indentation of this line

9:15 somnium: I need to setup mono sometime to play with f# in earnest

9:15 tomoj: and if I wrote the wrong code (which I always do), there are no sexps :(

9:16 somnium: tomoj: well, you can bend emacs to your will

9:16 tomoj: so I have to work at a lower level while I'm reworking the code

9:16 (admittedly I haven't done a lot of haskell in emacs, maybe I underestimate it)

9:16 but that's the thing

9:17 emacs simply can't know which indentation I want, I believe

9:17 somnium: I havent written anything significant in haskell so its purely aesthetics in my case (most of my haskell use has been monad tutorials)

9:17 tomoj: whereas with sexps there are only some small corner cases where it might get it wrong

9:17 (and even if it does the code will still work :D)

9:18 qed: tomoj: good point

9:18 tomoj: I guess what I'm wondering is, what could possibly make haskell easier to edit than clojure

9:18 I'm willing to admit that haskell might be prettier

9:18 somnium: hmm, liskell?

9:18 qed: tomoj: i prefer ()'s to ;'s any day of the week -- but i can still, in a weird sense, understand how someone might come to enjoy the sight of a ;

9:19 tomoj: like the kidnapped come to sympathize with the kidnappers?

9:19 :P

9:20 guess I'm just too narrow-minded

9:21 qed: some people *enjoy* bloated masses of ketchup-laden hamburger, so much that you might literally throw up if you eat the whole thing

9:21 tomoj: "Hostages who develop Stockholm syndrome often view the perpetrator as giving life by simply not taking it."

9:22 "look at what I'm _not_ doing!"

9:22 somnium: :)

9:22 qed: people like bloated, disgusting things

9:22 and they look at other people's things and they say "wow that is disgusting."

9:22 tomoj: hmm, what was the actual quote

9:23 somnium: I was stolen from my parens at birth by c++ and now I cant love them

9:24 tomoj: ah, "look at all the things I'm _not_ doing"

9:24 Raynes: My great great grandfather's parentheses were passed down to me at birth. My first toy was a closing paren.

9:26 qed: I didn't get my first closing paren 'til I was nearly thirty-eight years old. Back in my day parens weren't cheap. Ya only got paid a nickel a day, and parens cost 40 cents."

9:26 tomoj: qed: yep, and we focus on the things which our easy in our favorite

9:26 loving it for that while ignoring the crap it forces us to do elsewhere

9:27 qed: like use paredit-mode! :)

9:27 tomoj: s/our easy/are easy/

9:27 crap? blasphemy!

9:27 you are hereby excommunicated from the church of paredit

9:27 qed: well if your sexps weren't predicated on the use of parens everywhere you wouldn't need a damned tool to balance them, now would ya smart guy?

9:27 ;)

9:28 tomoj: that's exactly the backwardness I can't seem to understand :(

9:29 qed: tomoj: it's all give and take -- and truthfully, i agree 100% with you, but there's a part of me that thinks no one should be too happy about ()'s ;'s or any of it.

9:29 tomoj: it's sounds like, "well if you rode a horse instead of using a fancy shmancy car, you wouldn't need to check your oil ever, now would ya?"

9:29 qed: It's all just extra crap you have to carry around to express yourself

9:29 somnium: I wonder if more syntax highlighting might create more visual information

9:29 tomoj: ok, yeah, having to buy gas sucks, but I need to get to work

9:30 qed: when it's a neural interface will the ( be a picture of a pony and ) is a rainbow

9:30 tomoj: I remember seeing something where they hid all parens and instead colored sexps according to nesting level

9:30 bah

9:30 somnium: I guess in would always break in macros

9:30 qed: tomoj: i was *just* imagining setting my parens to match the background

9:30 tomoj: pictures will be outmoded

9:30 somnium: qed sounds like a smilisp dialect

9:31 clojurebot: I will hold the money!

9:31 tomoj: I have them slightly lighter so they sorta fade out a bit

9:31 I don't think I would want to go fully invisible or have a bunch of different background colors for nesting levels, though.. /shrug

9:32 somnium: hmm, what about 3d effect in shades of gray

9:32 tomoj: how about stereoscopic code?

9:32 somnium: deeper nesting looks higher/lower?

9:32 :D

9:33 qed: i like that

9:33 tomoj: crossing my eyes gives me a headache though

9:33 somnium: lisp hacking with 3d glasses

9:33 tomoj: ah, 3d glasses would be better

9:33 qed: what if you can only see the surrounding ()'s and below no matter where you are

9:33 somnium: Id like to see someone explain why he needs --that-- to his boss

9:34 tomoj: my boss would take a toke and say "duuude awesome idea!"

9:35 qed: "im sick of coding in 2 dimensions"

9:35 tomoj: well, I think the neural interface stuff will be interesting if it happens in our lifetime

9:35 qed: yeah -- i really hope it does

9:35 tomoj: spatial dimensions will be outmoded as well I think

9:36 instead you can just experience lambda expressions directly, no need for an intermediate spatial representation

9:36 * tomoj goes to #crackpottery

9:36 Chousuke: you only need a reader for human thought patterns

9:36 qed: is that all

9:37 i think i have a git repo laying around somewhere with one of those

9:37 tomoj: hmm, I was thinking of starting at the other end

9:38 but that would be more effective and even more fantastical

9:38 just sit down and think of what you want and it shows up in code

9:38 qed: it might be harder than it seems

9:38 tomoj: yeah, that doesn't work so easily I think

9:38 qed: i think a lot of stupid things

9:39 somnium: if you could install a prosthetic keyboard on your arm would you still need paredit and auto-complete?

9:39 qed: im thinking some right now

9:39 tomoj: exactly

9:39 * somnium is saying them out loud

9:39 tomoj: we don't write bad code because of the languages, but because we're idiots

9:39 of course in this fantasy we will just hack our brains so that we aren't idiots anymore, I guess

9:39 qed: id have to disagree with that for the simple fact that I am, in fact, an idiot

9:40 somnium: what was the original set of self describing lisp expressions?

9:40 tomoj: somnium: how would moving the keyboard to your arm help?

9:40 lypanov: http://lib.store.yahoo.net/lib/paulgraham/jmc.lisp

9:40 ; Assumes only quote, atom, eq, cons, car, cdr, cond.

9:41 somnium: tomoj: more controlling it with your nerves, like those new replacement hands

9:41 ah, atom == symbol, hmm

9:42 does that handle arithmetic too?

9:42 tomoj: somnium: ooh, I see

9:42 still, I'd rather manipulate sexps than characters

9:43 being able to do so faster would just make paredit that much better :)

9:43 qed: what if the characters were cooler?

9:43 like some really great UTF8 looking thing that made you feel like an alien?

9:43 tomoj: hmm

9:44 I think you still need something analogous to paredit

9:44 qed: you could inject meaning into them like "be-gin trans-mis-sion" ∆do∂

9:44 somnium: http://www.gnu.org/software/emacs/its-cover.png

9:44 tomoj: you can't come up with a character set which describes everything you need, so you have to arrange the characters into some structures which represent some semantic constructs

9:45 and then you need to be able to manipulate those structures as structures rather than as sequences of characters

9:45 qed: tomoj: you could make the whole language about the affects of those characters on the structure, so the characters become the structure

9:45 tomoj: (of course if you can get rid of characters, there is no need for this, but...)

9:46 hmm

9:46 arkrost: hi! I have a problem with emacs, slime and classpath. Can anyone help?

9:47 tomoj: I can't imagine how to embed a language for computation into just sequences in a useful way, though I can't quite articulate what "useful" means

9:47 somnium: when the level of abstractions moves beyond category theory 3d images might come in handy

9:47 tomoj: arkrost: just tell us the problem, maybe someone can

9:51 arkrost: I examine that the classpath was set to the ~/.libs by the comand in slime: (System/getProperty "java.class.path")

9:54 tomoj: arkrost: you set that classpath manually by hacking on swank-clojure, or..?

9:56 if I were you, I would put the jars I need in /path/to/project/lib, and my clj source files in /path/to/project/src

9:56 qed: BIRMINGHAM, Ala.–(BUSINESS WIRE)–An unorthodox software company has achieved a first in the volatile, rapidly evolving world of computer technology: cutting edge software that allows computer users to enjoy aromatherapy in a variety of scents…through their computer speakers.

9:56 tomoj: and then use M-x swank-clojure-project

9:56 (and I'd use leiningen to help with the jars)

9:57 arkrost: In .emacs I have (setq swank-clojure-jar-path "~/.clojure/clojure.jar"

9:57 swank-clojure-extra-classpaths (list "~/.libs/" "~/.libs/*" "~/.clojure/clojure-contrib.jar"))

9:57 tomoj: yeah, that's pretty odd

9:58 any specific reason you want to use the same classpath for everything you work on?

10:01 if you really just want to get what you're doing working, paste (e.g. to paste.lisp.org) the value of java.class.path, the directory structure your clj files are in, and the error you get

10:12 ag90: Question. Is there a way to call the -main function automatically when being run as a script? Or through the command line, without opening the REPL?

10:13 Chousuke: -e (-main)?

10:13 ag90: Didn't seem to work. I'll try again, just to be sure.

10:13 Chousuke: I guess it might need at least one parameter.

10:14 lypanov: Nikelandjelo: i have a new one :)

10:15 ag90: Oh great it worked. Just needed to place the -e after the file name. So - java clojure.main file-with-main.clj -e '(-main)'

10:15 Thanks

10:43 wtetzner: ,(withmeta (fn [x] (* 2 x)) {:type :doubler})

10:43 clojurebot: java.lang.Exception: Unable to resolve symbol: withmeta in this context

10:43 wtetzner: ,(with-meta (fn [x] (* 2 x)) {:type :doubler})

10:43 clojurebot: java.lang.UnsupportedOperationException

10:44 wtetzner: is there a reason you can't have metadata on fn's?

10:46 the-kenny: wtetzner: I think metadata on functions will be in the next version or so

10:46 wtetzner: oh

10:46 ok

11:56 Raynes: Github is down. :|

11:57 cp2: :<

11:57 Raynes: And here I was all excited about cloning the Ioke repo and such. :|

12:02 mengu_: and i was gonna check compojure.

12:02 technomancy: usually the web interface is pretty decoupled from the repo serving

12:02 so if you know the URL you're fine

12:04 lypanov: its sooo pweeeeeeety

12:05 ag90: It's back up.

12:06 Raynes: I'm already cloning the mirror repo. :p

12:07 lypanov: laziness is really quite hard to get your head around at first.

12:11 somnium: playing with lazy-seqs in javascript is interesting

12:12 lypanov: damn. got it working.

12:12 *brain splat*

12:16 ska2342: hi. I trying to find a nice, idomatic solution for the creation of a map for which I have the keys in a seq and can create the values by calling a fn on each key. any pointers?

12:18 raek: map?

12:18 clojurebot: map and the other sequence functions used to be lazy, but with the advent of chunked sequences, may or may not be lazy, consult your local ouija board

12:20 ska2342: I can use map to create a seq of key, val-pairs, but I need them as a list to be stored into the hash-map. I could use a transient but rather won't, I could also store the keys with a let-binding, sure. It's the "nice and idiomatic" part that bothers me.

12:20 raek: ,(let [ks [:a :b :c]] (into {} (zip ks (map name ks))))

12:20 clojurebot: java.lang.Exception: Unable to resolve symbol: zip in this context

12:21 raek: ah

12:21 ,(let [ks [:a :b :c]] (into {} (zipmap ks (map name ks))))

12:21 clojurebot: {:c "c", :b "b", :a "a"}

12:21 raek: something like this?

12:21 ska2342: hmm. maybe "into" is, what I am really looking for. Thanks for the pointer, will try that later.

12:21 ag90: ska2342: (zipmap (map func vals) vals) ?

12:22 somnium: ,(into {} (map (fn [k] [k (str "v--> " k )]) [:zonk :42 :bulldozer]))

12:22 ag90: Where vals contains all the values and func is the function that gets the key for the value.

12:22 clojurebot: {:zonk "v--> :zonk", :42 "v--> :42", :bulldozer "v--> :bulldozer"}

12:23 raek: zipmap is nice for making key-value-pairs of a sequence of keys and a sequence of values

12:24 but, as somnium points out, you could make the key-value-pair in your function instead

12:25 ska2342: I think, into is really the answer. I was not considering a different approach to the _creation_ of my map, instead was only thinking about how to get the data to (apply hash-map ...). Thank you.

12:26 rrc7cz: how can you evaluate an expression at the REPL, but supress printing out the return value?

12:26 tcrayford: use with-out-str?

12:27 ,(doc with-out-str)

12:27 clojurebot: "([& body]); Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any nested printing calls."

12:27 raek: you could use (do .... nil)

12:27 that way, you'll get nil instead of whatever the expression evaluates to

12:27 rrc7cz: tcrayford, raek: thanks, both are what I'm looking for

12:28 raek: with-out-str redirects printing, but i

12:28 lypanov: http://gist.github.com/297543

12:28 clojure is pwetty :D

12:28 raek: 'm not certain if the printing from the repl uses this

12:28 * lypanov needs to figure out 'for'

12:28 the-kenny: raek: you want to execute an expr, but *not* print the return value?

12:29 uhm.. I mean rrc7cz

12:29 sorry

12:29 lypanov: is there a common "square" idiom? or is (* % %) really just the way to go?

12:29 rrc7cz: the-kenny: correct. either for the side effect or in this case, just to time it

12:30 npoektop: how to generate a random symbol name for use in defmacro?

12:30 the-kenny: npoektop: #

12:30 tcrayford: ,(Math/pow 2 2)

12:30 clojurebot: 4.0

12:30 the-kenny: foo#

12:30 tcrayford: ,foo#

12:30 clojurebot: java.lang.Exception: Unable to resolve symbol: foo# in this context

12:30 the-kenny: ,`foo#

12:30 clojurebot: foo__5890__auto__

12:30 the-kenny: ,`foo#

12:30 clojurebot: foo__5894__auto__

12:30 the-kenny: ,`foo#

12:30 clojurebot: foo__5898__auto__

12:30 the-kenny: There you are :)

12:31 npoektop: the-kenny: thank you!

12:31 Raynes: How to ask questions in the form of an answer? :p

12:31 lypanov: lol

12:31 raek: rrc7cz: with-out-str still returns a value

12:31 that will be printed by the repl

12:32 however, the output of the print calls will not appear in the terminal

12:32 lypanov: damn it. why do all the project euler thingies involve a prime? i think i should start keeping my old solutions rather than keeping to my promise that i'll redo anything if its needed a second time..

12:33 or not, time to give the atkins sieve a try.

12:33 rrc7cz: raek: that's true, and your method is the most correct answer since it returns only nil. Both work for what I'm doing right now though: timing execution of large seq transformation functions. Their large return vals are dumping to the REPL.. having nil or "" is better

12:34 lypanov: just throw it in a Gist: http://gist.github.com/262465

12:35 lypanov: rrc7cz: oh goddd i saw your for impl of the above *cries*

12:35 * lypanov needs to learn for

12:35 rrc7cz: lypanov: i've found that by saving it and making it public, I'm more inclined to go back to previous solutions and improve them so I'm not _too_ embarrased

12:35 Raynes: ~def reverse

12:36 lypanov: rrc7cz: (my one - http://gist.github.com/297543)

12:36 (i like it, its pretty in the same way rails code is pretty, its all neat!)

12:36 (where neat == duplicated)

12:36 Raynes: lypanov: What trouble are you having with for?

12:37 lypanov: ELACKOFCOFFEE

12:37 Raynes: just had a really hard time getting my head around it with scala so scared to visit it now.

12:37 sure i'll be fine when i get around to it :)

12:38 the above laziness is way harder anyway tbh

12:39 Raynes: ,(for [x (range 1 4) y (range 4 8)] [x y])

12:39 clojurebot: ([1 4] [1 5] [1 6] [1 7] [2 4] [2 5] [2 6] [2 7] [3 4] [3 5] [3 6] [3 7])

12:40 lypanov: excellent. and it has :while. awesome.

12:41 thx for throwing it at me Raynes :)

12:41 rrc7cz: p11 is my embarrassing child. all my solutions are so tiny, then I have this monstrosity just hit you in the face

12:41 Raynes: It also has :when and :let.

12:41 No problem.

12:42 lypanov: rrc7cz: wow.

12:42 * lypanov is on 10, shall get to 11 shortly, first should do 8 though and he has no clue how strings work with clojure

12:44 tcrayford: strings in clojure are just java strings

12:44 if you've done any java

12:44 ,(.contains "foo" "foo")

12:44 clojurebot: true

12:44 tcrayford: but they're also sequable

12:44 ,(first "foo")

12:44 clojurebot: \f

12:45 tcrayford: ,(filter #(= \f %) "foo")

12:45 clojurebot: (\f)

12:45 tcrayford: ,(filter #(= \o %) "foo")

12:45 clojurebot: (\o \o)

12:45 tcrayford: to get back to a string from a seq of chars, you can use reduce

12:46 ,(reduce str (filter #(= \o %) "foo"))

12:46 clojurebot: "oo"

12:47 lypanov: ah

12:47 tcrayford: why reduce rather than apply? because of the laziness?

12:48 tcrayford: you can use apply as well

12:48 but lazy is usually better

12:48 ,(apply str (seq "foo"))

12:48 clojurebot: "foo"

12:57 Hali_303: what library should I use if I want to do in-memory XML editing?

12:57 traversing the tree and making modifications

12:57 tcrayford: look at clojure.zip

12:58 (though you shouldn't be thinking in terms of modifications for the most part in clojure)

12:58 Hali_303: ok, thanks

13:05 lypanov: tcrayford: thx :) http://gist.github.com/297565 it was easy in the end :D

13:05 more clojure-ish way to do the Integer/parseInt?

13:15 chouser: lypanov: nope that's it.

13:15 lypanov: you can try using read-string, but it's not really the same thing

13:15 Raynes: chouser: Is it preferred to use parseInt over read-string for that purpose?

13:28 Hali_303: (clojure.xml/parse "<a></a>") does not work, why?

13:28 the doc says it works on a string

13:28 Raynes: (doc clojure.xml/parse)

13:28 clojurebot: "([s] [s startparse]); Parses and loads the source s, which can be a File, InputStream or String naming a URI. Returns a tree of the xml/element struct-map, which has the keys :tag, :attrs, and :content. and accessor fns tag, attrs, and content. Other parsers can be supplied by passing startparse, a fn taking a source and a ContentHandler and returning a parser"

13:29 Raynes: String naming a URI <---

13:29 Hali_303: ahh, damn

13:29 thanks

13:30 Raynes: Hali_303: (parse (ByteArrayInputStream. (.getBytes "<a></a>" "UTF-8")))

13:30 Hali_303: thanks

13:30 Raynes: Do that if you want to use a string.

13:34 lypanov: eep. glad irssi doesn't allow big pastes..

14:04 avarus: hi

14:43 DeusExPikachu: for some reason, lein swank is giving "swank is not a task" even though its listed as a dev-dependency in project.clj and is in the lib directory, any ideas why?

14:44 raek: DeusExPikachu: you seem to be doing exactly what I'm doing now...

14:44 try "lein deps"

14:45 DeusExPikachu: nothing happens cause its in the lib directory

14:45 raek: what is?

14:45 DeusExPikachu: lein-swank

14:46 raek: are you running "lein swank" from the project root?

14:46 DeusExPikachu: lein-swank-1.1.0.jar to be exact

14:46 yeah

14:46 raek: or from the libs/ directory?

14:46 ok

14:47 DeusExPikachu: is the version, what version are you running?

14:48 @ raek,

14:48 raek: 1.1.0

14:48 DeusExPikachu: sorry, for leiningen

14:49 raek: i'm trying out leiningen too

14:49 DeusExPikachu: no, I mean, what version are you using (leiningen)

14:49 raek: "lein swank" sounds promising

14:49 I downloaded the lein script 1 hour ago

14:49 DeusExPikachu: it was working for me on another computer

14:55 raek: slime or swank-clojure crashes when I enter a non-ascii character

14:55 anyone know how to fix this?

15:00 ok, made it work...

15:00 DeusExPikachu: raek, which?

15:01 raek: my problems with swank crashing

15:02 lein said "swank is not a task" before I had run "lein deps"

15:02 but after that, it worked for me

15:03 DeusExPikachu: i'll try a lein clean then

15:05 nope, still doesn't work, "lein swank" gives "swank is not a task"

15:06 robwolfe: DeusExPikachu: do you use "lein" script symlinked from Leiningen checkout?

15:06 DeusExPikachu: yes

15:06 wait

15:06 robwolfe: don't do that

15:06 DeusExPikachu: no,

15:06 I downloaded the script from git per instructions

15:06 added it to my path

15:07 robwolfe: copy it to your "~/bin"

15:07 DeusExPikachu: installed leiningen via lein self-install

15:07 yeah did that

15:07 robwolfe: and make sure that you will use this one from "~/bin"

15:08 DeusExPikachu: yeah "which lein" returns "~/bin/lein"

15:08 robwolfe: ok, try "lein swank" now

15:08 DeusExPikachu: same error

15:08 robwolfe: try "DEBUG=1 lein swank"

15:09 and see if there is "lein-swank.jar"

15:09 DeusExPikachu: as a message, it prints the path to the leiningen-1.0.1-standalone.jar

15:09 no lein-swank jar

15:09 dnolen: DeusExPikachu: not sure if lein-swank really works with lein 1.0.X

15:09 DeusExPikachu: so what version do i need?

15:09 dnolen: you probably need it from source

15:09 instructions on github

15:09 robwolfe: when you run "lein deps" and you have dependency to lein-swank you need to have lein-swankjar in lib

15:10 DeusExPikachu: yeah I"ve installed from source on another machine... i'll do it on this one

15:10 problem is, git isn't on this new machine... grr more work

15:10 dnolen: I think with Lein 1.1.0, the lein-swank experience will be much better.

15:11 DeusExPikachu: they need to add server options for lein-swank

15:11 so I can pass the option ":dont-close true"

15:35 raek: DeusExPikachu: yes, that would be good

15:35 DeusExPikachu: its a simple fix really

15:35 raek: I need :encoding "utf-8" ass well.

15:36 DeusExPikachu: might be better to just roll your own

15:36 raek: without :dont-close true, you can only connect once, right?

15:36 DeusExPikachu: yeah, and if the connection dies for some reason, you can never reconnect

15:41 this is bizarre, lein swank still doesn't work

15:41 tcrayford: that's the thing that's been bugging me

15:41 the :dont-close true thing

15:41 it should be true by default under lein

15:41 imho

15:41 DeusExPikachu: I agree

15:42 raek: also, :encoding "utf-8"

15:43 it doesn't hurt anyone

15:50 robwolfe: DeusExPikachu: it's weird, what these commands show: "grep swank project.clj" and "ls lib | grep swank"?

15:51 DeusExPikachu: grep swank project.clj returns ":dev-dependencies [[leiningen/lein-swank "1.1.0"]])

15:52 and ls lib | grep swank returns "lein-swank-1.1.0.jar and swank-clojure-1.1.0.jar

15:52 robwolfe: and "lein help" does not show "swank" command?

15:52 DeusExPikachu: correct

15:53 robwolfe: with "DEBUG=1" do you see "lein-swank" in classpath?

15:53 DeusExPikachu: robwolfe, no

15:55 robwolfe: it's impossible unless you changed something in "lein script", because "lein" scripts build classpath taking jars from "lib"

15:56 DeusExPikachu: robwolfe, didn't change anything

15:58 robwolfe: so what do you see exactly with DEBUG=1 ?

15:58 DeusExPikachu: [bmillare@boh scratch]$ DEBUG=1 lein-stable swank

15:58 /home/bmillare/.m2/repository/leiningen/leiningen/1.0.1/leiningen-1.0.1-standalone.jar:

15:58 swank is not a task. Use "help" to list all tasks.

15:59 robwolfe: have you changed :library-path in project.clj?

15:59 DeusExPikachu: no, project.clj is very simple, it has a :dep on clojure, and a :dev-dep on lein-swank

16:01 tcrayford: I've had this a bunch

16:01 ended up just putting a lein swank jar file in /lib

16:01 wtetzner: is there a way to set which namespace an eval occurs in?

16:01 tcrayford: hacky, but it works

16:01 DeusExPikachu: but the lein-swank jar IS in /lib

16:01 tcrayford: weeeiiiird

16:02 robwolfe: DeusExPikachu: when you run "lein clean" is "lib" empty?

16:02 DeusExPikachu: I'm debugging the script atm, even though its from the git website link

16:02 yeah

16:02 robwolfe: DeusExPikachu: you don't use tehnomancy checkout?

16:02 DeusExPikachu: robwolfe, yeah

16:03 tcrayford: is there an easy way to filter out directories from file-seq?

16:03 I've tried (filter #(.isFile%) ...)

16:03 robwolfe: so please use "technomancy" version, this the current working version

16:03 tcrayford: I've tried (filter #(.isFile %) ...) even

16:04 DeusExPikachu: robwolfe, sorry, I thought you said "you use", yes I use techomancy version

16:06 robwolfe: DeusExPikachu: you 100% sure you don't use symlinked "lein" from somewhere?

16:06 DeusExPikachu: I already said "which lein" returns ~/bin/lein

16:06 ls -l ~/bin/lein is jsut a file

16:07 hmm this is interesting

16:07 tcrayford: it should be the shell script

16:07 DeusExPikachu: find -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:

16:07 in the project directory returns nothing

16:08 robwolfe: are you on Linux?

16:08 DeusExPikachu: the remote machine is running linux, yes

16:08 I suspect the machine is quirky, its not mine after all, and the other server works just find, without the checkout version too

16:09 *fine

16:10 $CLASSPATH is empty when I add an echo $CLASSPATH line to the script

16:10 I think the find command is borked on this machine

16:10 robwolfe: yep

16:11 see this: http://github.com/technomancy/leiningen/issues/closed#issue/14

16:12 DeusExPikachu: bam, it works now

16:12 robwolfe: "-follow" helped?

16:13 DeusExPikachu: yeah, that was the fix

16:13 robwolfe: great

16:15 DeusExPikachu: yeah, weird problem, I mean, I can read install instructions.... (also I"ve installed leiningen + lein-swank on other machines no problem before)

16:18 robwolfe: yeah, Leiningen still requires a lot of testing on different platforms

16:19 DeusExPikachu: ok, who wants to fork lein-swank and add option support?

16:22 looking at swank.clj in lein-swank, the line `(do (try (require '~'swank.swank) looks interesting, never seen '~'symbolname before

16:25 whats the difference between `('~'name) and `('name)? they both return the same lists?

16:26 technomancy: DeusExPikachu: it's a way of working around the fact that backquote automatically fully-qualifies all symbols

16:26 if you're in the leiningen.swank namespace, `('name) expands to `('leiningen.swank/name)

16:26 DeusExPikachu: technomancy, I see

16:26 technomancy: unless you quote/unquote it

16:27 it helps protect against a host of really difficult-to-debug symbol capture bugs that have plagued CL for decades

16:27 but requires a few workarounds when you really _do_ want a bare symbol (rare)

16:27 anyway, I'd love a patch to lein-swank for a little more flexibility

16:28 DeusExPikachu: technomancy, looking at the code, I think only the deeper function calls actually allow options

16:28 technomancy: DeusExPikachu: so it would require patches to swank-clojure too?

16:28 DeusExPikachu: so I'd have to modify the convenience swank-clojure code

16:28 yeah

16:30 hiredman: ,`~'foo

16:30 clojurebot: foo

16:30 hiredman: ,`'~'foo

16:30 clojurebot: (quote foo)

16:30 DeusExPikachu: its `'~'foo

16:30 ,`'~'foo

16:30 clojurebot: (quote foo)

17:02 turbo24prg: technomancy: installed slime and swank-clojure via ELPA and clojue is working fine, but SBCL won't start because .emacs.d/elpa/slime-20091016/swank-sbcl.lisp is missing, even when using your package.el and your repo

17:05 technomancy: turbo24prg: slime might have some silly built-in assumptions that the CL files are found in the same place as the elisp

17:05 turbo24prg: sorry, I haven't used CL in years

17:11 turbo24prg: technomancy: ok, thanks for the info

17:12 lypanov: ahhhh back :D coding time :D

17:22 DeusExPikachu: technomancy, when writing plugins, leiningen will pass only the project name to the function? how do you pass other args to the function?

17:25 hiredman: DeusExPikachu: I'm pretty sure passes everything from the project.clj

17:25 as a man

17:25 map

17:25 DeusExPikachu: sorry, I mean just project info, what about command line args

17:26 raek: (fyi, i added TagSoup (licensed under Apache 2.0) to Clojars: http://clojars.org/org.clojars.raek/tagsoup )

17:26 DeusExPikachu: how do you pass other coomand line args?

17:26 I guess from the architecture then, you shouldn't, instead define options in the project.clj file

17:28 hiredman: ,(doc *command-line-args*)

17:28 clojurebot: "; A sequence of the supplied command line arguments, or nil if none were supplied"

17:29 DeusExPikachu: actually, I don't know if that will be as useful, since lein is first a script, I'd have to modify the way the script massages the command line args

17:29 @ hiredman,

17:30 hiredman: ,(doc *command-line-args*)

17:30 clojurebot: "; A sequence of the supplied command line arguments, or nil if none were supplied"

17:30 hiredman: er

17:30 don't imagine problems that you don't know to exist

17:35 DeusExPikachu: hiredman, looks like it is a problem though, passing additional args to "lein swank foo" for example, raises an exception

17:37 technomancy: DeusExPikachu: it passes in the project as the first argument, then all command-line args as succeeding arguments

17:37 see leiningen/test.clj for an example

17:50 DeusExPikachu: ah, that explains the exception, ok

17:52 although, when you say command line args, you mean everything after the function name, like swank, cause swank is not included in values in *command-line-args*

17:57 wtetzner: is there way to set the namespace for evaled code?

18:02 DeusExPikachu: nm, seems that I'm confusing two separate environments, leiningen, and the projects

18:04 danlarkin: <3 clojurebot

18:10 technomancy: danlarkin: wow, nice job on clojure-json optimizations

18:10 2x is an awesome boost

18:10 danlarkin: I'm not sure if I did a bad job before, or a good job now :)

18:10 lypanov: good job both times? ;)

18:10 technomancy: or protocols are just awesome

18:11 danlarkin: definitely

18:11 technomancy: danlarkin: you better start getting serious about version numbers now though

18:11 since the rewrite won't work on pre-1.2

18:12 danlarkin: technomancy: yeahhhhhh :-/ I've been putting that off as long as possible

18:12 I think I'm going to mark the non-protocol version as 1.0, and this as 1.2

18:12 technomancy: makes sense

18:16 Raynes: duck_streams.clj got a namechange? Why didn't I get the memo? :o

18:16 danlarkin: unfortunately, adding in the ability to pretty-print slows it down like 30% or so

18:16 which bums me out, because it's a nice feature to have

18:17 technomancy: danlarkin: can you enable it on-demand with binding?

18:17 Raynes: What happened to duck-streams? :\

18:18 danlarkin: Raynes: see clojure-dev ML

18:20 technomancy: well it doesn't do any "work" if pretty-printing is turned off, but it has to check in a bunch of places

18:21 that's just my intuition, though. I'm not sure how to get real numbers

18:23 lypanov: is there a take-until?

18:23 as in, inclusive variant?

18:23 i need an inclusive variant of split-with, seems like i need to make my own.

18:23 technomancy: clojurebot: duck-streams?

18:23 clojurebot: Gabh mo leithscéal?

18:23 technomancy: clojurebot: duck-streams is now clojure.contrib.io

18:23 clojurebot: 'Sea, mhuise.

18:24 technomancy: danlarkin: I'm sure you could steal a perf-suite from another library

18:24 but it does sound like a lot of work

18:24 besides, you can always convert to clojure and then pretty-print that

18:24 that's what I do in elisp

18:27 hiredman: lypanov: what is the difference between take-while and take-until?

18:28 tcrayford: technomancy: so you print stuff from the clojure side of things, before sending it to elisp?

18:28 lypanov: hiredman: probably not explaining myself well enough.

18:29 hiredman: i'd like to split on the 3 in (1 2 3 4 5)

18:29 tcrayford: technomancy: I've been having problems with printing clojure code that has \ns in it, because that's also elisps newline char

18:29 lypanov: hiredman: but split-with pulls one too little.

18:29 s/little/few/

18:30 hiredman: lypanov: split on 4 then

18:30 lypanov: hiredman: wanted a generic solution. imagine if it wasn't a sorted set.

18:30 technomancy: tcrayford: I mean that's what I do when writing elisp code that interacts with json (not clojure-related at all)

18:30 tcrayford: ahh, k

18:30 technomancy: since json.el has no prettyprinting functionality

18:31 lypanov: hiredman: actual thing i want, split a list on its minimum.

18:31 tcrayford: fair nuff. My patch for clojure-test-mode is broken btw. Used a function without defining it (because its in my personal elisp). I'll throw up a new version at some point

18:31 lypanov: maybe there is a much better way to do it.

18:38 technomancy: tcrayford: yeah, I was looking at it the other day and meant to ping you about it

18:38 I fetched it but didn't merge it

18:41 tcrayford: I've already fixed that, think its in the latest version

18:41 the only bug I've found is that if you run tests repeatedly, the modeline will get stuck green/red

18:42 and you have to call your color-theme fn to get it back to normal

18:43 pull request sent

18:44 also having hooks that are run with the test output is useful for other stuff

18:49 lypanov: um. any one got a clue what a good generic and not way too complex way is to swap two numbers in a list?

18:49 tcrayford: use assoc with vectors?

18:49 maybe with seq-utils/indexed

19:15 Raynes: clojure-contrib 1.2.0-master-SNAPSHOT really needs to be updated on /snapshots. With the name changes and all.:|

19:31 tomoj: c.c.json.write has no print-json multimethod for BigIntegers

19:31 I figured doing (derive BigInteger ::pr) would work, but it doesn't

19:31 how do I add derivations so that multimethods in other people's code will see them?

19:33 oh, I see, ::pr means :clojure.contrib.json.write/pr

19:34 and that works :D

19:44 underdev: hi! i

19:44 ve watched the 10 part intro to clojure, and just finished the clojure for java programmers video

19:45 any recommendations to where i go now?

19:45 anxious to get coding :)

19:45 mquander: newbie q: i would like a small anonymous function that returns a map. i wrote: %(identity {:acct account-id :match (second %)})

19:46 obviously i could write it with the (fn) syntax instead of using the % syntax, but i like the %!

19:46 lypanov: underdev: i'm attempting to solve all the projecteuler.net problems in it.

19:46 mquander: is there some nice way to get rid of the identity? oh, i can probably use hash-map, can't i

19:46 underdev: nice

19:46 smart

19:46 lypanov: well. "all". actually i want to do just one level worth.

19:48 mquander: p.s. i made a typo above, but i make it all the time, why isn't the symbol to begin those functions % instead of # :X

19:58 underdev: okay, let me see if i can get an opinion on this, would you recommend diving into "Programming Clojure", or go through some intro tutorials such as the one by R. Mark Volkmann?

19:59 anyone read programming clojure?

20:01 mquander: do you learn by doing or learn by reading? i suggest just thinking of some moderately easy project and jumping in, looking at reference material and asking in here when you run into individual issues

20:01 one thing i found useful when i started just recently was screencasts on blip.tv introducing clojure and giving a rough overview of capabilities, syntax, philosophy

20:02 these ones http://clojure.blip.tv/

20:03 tomoj: hiredman: do I remember that you were doing stuff with clojure+facebook?

20:04 underdev: mquander: rt, i've watch al of those except the clojure for lisp programmers

20:04 hiredman: tomoj: yes, mostly I just have a function or two for calling the facebook api

20:09 tomoj: hiredman: cool, guess it's not too hard then

20:10 hiredman: http://gist.github.com/297803 the call function is the main one

20:11 line 75

20:11 tomoj: I thought I saw that in some google results, hadn't realized it was yours

20:12 hiredman: I think I had an earlier gist, but I couldn't find it

20:12 tomoj: well, thanks

20:12 hiredman: the java client (which used to be official supported by facebook) is horrible

20:12 tomoj: the facebook developer wiki has been down since yesterday, so this will serve as temporary documentation :D

20:24 Tcepsa: underdev: I got my start with "Programming Clojure". It was a bit dense, especially bootstrapping some of the concepts, but if you've already had some exposure to the basics then it could be useful.

20:25 (apologies if I've been spamming the channel with that; previous times, my client said that I could not send to the channel so I assumed it wasn't actually going through)

20:27 underdev: The other thing that helps with "Programming Clojure" is familiarity with Ant, as the major tying-it-all-together example throughout the book uses many Ant-related concepts and classes.

20:28 mquander: tcepsa: i only saw it once.

20:29 on a related note to that... is there any comprehensive page giving something like "guide to clojure for programmers who don't know anything at all about the java ecosystem"

20:30 i would love to see a tutorial for hooking up a profiler, builds (leningen?), debugger, bytecode poker-arounder, whatever else to emacs+clojure environment

20:31 underdev: Tcepsa: thanks! yeah, i think ive got the concepts down pretty well.

20:32 to the degree that they are abstract. I can't rattle off the special forms from memory or anything :)

20:34 Tcepsa: underdev: Hehe, sure. I'm not really familiar with Ant, so wasn't able to follow those examples really at all, and still found a lot there to like. I've looked back at it as a reference a few times.

20:35 underdev: I'm probably going to try to re-read it through again shortly; I think a lot more will make sense now that I have more of a mental network to hook the concepts up to and reinforce.

20:36 mquander: Ah, thanks; it's been about a decade since I used IRC regularly and I've forgotten about things like nick registration ~wry grin~

20:38 mquander: I don't know of any such tutorial, but that would be really fantastic...

21:59 underdev: i made a quick image for my clojure virtual desktop- it has some artifacts from converting the png to vectors, but i really like the "painted effect"

21:59 http://tcltk.nfshost.com/clojure-desktop-color.gif

22:00 if you want one for yourself

22:05 Tcepsa: underdev: Neat! Thanks for sharing ^_^

22:05 * Tcepsa wonders whether there's a way to set that as the background in Emacs...

22:07 underdev: np

22:07 gotta have a dedicated virtd for everything, puts me in the mood :)

22:49 * Raynes is playing with Ioke

23:00 technomancy: Raynes: having fun?

23:00 Raynes: technomancy: It's really cool.

23:00 Never heard of prototype-based OOP until today.

23:01 technomancy: really? it's quite popular these days

23:01 Raynes: I guess I've just never heard the term.

23:01 technomancy: I guess if you stay away from the web dev sphere it's easy to ignore javascript

23:03 Raynes: I'm pretty oblivious to web dev stuff.

23:05 technomancy: that's not necessarily a bad thing

23:05 it's been almost a year since my last web project, and I must say I don't miss the headaches

23:06 Raynes: I'd probably play with it more if I could grok Compojure. It's pretty much Latin to me.

23:06 underdev: freakin' a, the repl running out of the servlet- amazing

23:07 technomancy: sure, but you still have to think about things like cross-browser JS- and CSS- compatibility

23:07 that's where the real nightmares are

23:07 underdev: js compatibility is pretty much solved now

23:08 jquery/dojo/et. all

23:08 sorry, i didn't mean to interupt

23:08 technomancy: jQuery still had bugs that would take days to track down in IE6 when I was using it

23:08 but I guess now if Google's dropping IE6 you can get away with doing the same

23:09 "you kids have it easy; back in my day..."

23:09 or rather, IE6 still had bugs that jQuery couldn't shield you from

23:09 underdev: its just a coincidence that i added that statement, just watched the repl/servlet video on vimeo

23:09 Raynes: Ola Bini apparently really likes word-wrap: http://gist.github.com/297869

23:09 technomancy: Raynes: maybe he's got a 30-inch monitor

23:10 Raynes: Don't know. I think he broke his enter key.

23:15 One thing that makes my feet burn is the fact that the Ioke repl has no way to load files.

23:15 That's like, really really bad.

23:15 And it's something I might have to remedy before I do anything serious with it.

23:15 ohpauleez: what is the loke repl?

23:16 Raynes: IIk

23:16 technomancy: Raynes: if you use an Emacs mode that lets you send from a buffer to a subprocess it's not a big deal at all.

23:16 Raynes: ohpauleez: Nothing to do with Clojure.

23:16 technomancy: I mean, it's tacky, but it wouldn't be annoying

23:16 ohpauleez: ahh, ok. emacs issues, I'll step aside

23:16 Raynes: technomancy: What are you talking about? ;o

23:17 ohpauleez: Nothing to do with Emacs either. Ioke is a language. :p

23:17 ohpauleez: ohhh

23:17 technomancy: Raynes: for everyday usage, I never use any "load from file" commands in the repl

23:18 I just send it directly from an Emacs buffer to the repl subprocess

23:18 so I wouldn't miss the lack of such a command

23:18 Raynes: IIk seems pretty primitive in general, though. You apparently can't even paste multiline code in it.

23:18 ohpauleez: super influenced from io, looks cool

23:18 technomancy: oh, well that's more of a problem then

Logging service provided by n01se.net