#clojure logs

2010-02-07

00:28fulletsHow do I make leiningen use the version of clojure I already have installed rather than its own version downloaded from somewhere?
00:30tomojput your version into your maven repo, I guess
00:30tomojhttp://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html is what I use
00:30tomojmaybe use a different artifact id so you can be sure you're getting your custom version?
00:31fulletsOh dear maven is terrifying :(
00:32tomojyeah, I was just wondering whether a lein plugin could do that
00:32tomojlein-install-jar maybe?
00:34fulletsI 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
01:28joschui have a weird problem: it seems that clojure slime isn't respecting the println's i put in my clojure code
01:28joschuthe output isn't getting printed at the repl
01:29joschuso i put in (println "blah") and nothing happens. then i put in (/ 1 0) and i get an ArithmeticError exception
01:32hiredmancheck the inferior lisp buffer
01:35joschuyep, it's there!
01:35hiredmanare you using agents at all?
01:35joschuno
01:36joschuthis is some really simple single-thread code
01:36hiredmanswank-clojure binds *out* thread locally to something that prints to the slime repl
01:36hiredmanoutside of that binding it prints to the inferior lisp buffer
01:36hiredmanso your binding is broken somehow
01:36hiredman*shrug*
01:36joschuactually the weird thing is, in *inferior-lisp*, the println result comes AFTER the exception
01:39hiredmanmaybe a buffer flushing issue
01:39zaphyryeah, won't the exception print on System.err?
01:39zaphyrso there's no telling who comes out first
01:40joschuoh so maybe slime looks for the exception and thus it misses the last printlns
01:41zaphyrhmm, it shouldn't 'miss' printlns, just there's no promise that exceptions won't be printed in the same order as stuff to *out*
02:00joschui can't figure out how to start up a repl and load my source file
02:00hiredmanjava -jar clojure.jar -i file.clj -r
02:02joschuthanks that works
02:02joschui don't get jline though
02:02hiredmanjava -cp clojurestuff:jlinestuff jline.some.class clojure.main …
02:06joschuok 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
02:06joschu(ns user (:use paip))
02:06hiredmandon't use Repl
02:06hiredmanclojure.main
02:07hiredmanRepl and Script have been superseded by clojure.main for almost forever
02:08joschuok
02:10joschunow i'm trying to "import" my source files into the namespace
02:10joschumy file is called called paip.clj
02:10hiredmanwell import is only for java classes
02:10joschui'm using (use paip) or (ns user (:use paip))
02:11hiredmanyou definitely don't want the latter
02:11hiredmanthe user namespace already exists
02:11joschui just want to load all the names so i can call the functions on the repl
02:11hiredmandoes paip have a proper namespace declaration?
02:12hiredmanjoschu: I would just use load-file
02:12hiredmanif you just want to load-file then forget about all the namespace stuff
02:12joschuaha that works
02:12joschuthanks a lot
02:13joschunow i don't have the weird println problems
02:46tomojI want a peepcode clone for clojure :)
03:00LauJensenMorning team
04:16piccolinoIs there some way you can declare the return value of a function with a type hint?
04:18hiredman(defn #^SomeType f [x] ...)
04:19piccolinoAh, thank you.
04:19piccolinoSo obvious in hindsight.
04:23hiredmanI don't know if that actually helps
04:24hiredmanI wonder if that is not actually it
04:26piccolinoAh.
04:26piccolinoOh well.
04:27piccolinoIf 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?
04:28hiredmanmy guess is it still would use reflection
04:28piccolinoYeah, that's what I figured.
04:29hiredman*warn-on-reflection* should tell you
04:29piccolinoI haven't been able to ever get that to give me a warning.
04:29piccolinoSo I don't know.
04:30hiredmanit's a compile time thing
04:30piccolinoOooh.
04:30hiredmanyou don't set it when you are running the code
04:30hiredmanyou set it when you are evaluating/compiling it
04:30piccolinoWell, I've been using Slime.
04:31piccolinoSo I thought that if I C-c C-k'd it, it would warn me.
04:31hiredmanit might print the warnings to the inferior lisp buffer
04:31piccolinoNope
04:31hiredman*shrug*
04:32piccolinoAh, I just added it to the source file iteslf and now it does something.
04:35piccolinoAh, OK, on the command line it works.
04:35piccolinoThanks.
04:38piccolinoWell, at least now we know that when there's only one option, it still does reflection.
05:55lypanovmorning
06:07lypanovum...
06:20lypanovis there an equiv of ffilter? as in, (first (filter pred coll))?
06:26lypanovah, when-first is what i actually needed. very cute.
06:34lypanovhttp://gist.github.com/297384
07:18lypanovum. mutually recursive infinite prime list gen is making my head go boom.
07:38lpetithi there
07:38lpetitany heavy paredit user in the room ?
07:44NikelandjeloI'm new to clojure and trying to generate list of primes numbers, but I have some bug: http://pastebin.com/m34ed8d81 Can anybody help?
07:49qedlpetit: i dont know if i qualify as heavy -- i mean, i use the mode for everything practically, but...
07:50lpetitqed: I would like feedback concerning paredit design of a particular command
07:50qedwhich command
07:50lpetitforward delete (well, just hitting the delete key)
07:51lpetitgiven the following "text spec" (where the pip symbol symbolizes the cursor place) :
07:51lpetit"(a (b |(c d) e) f)"
07:51lpetithere is how paredit works:
07:52lypanovNikelandjelo: i'm doing something similar also at the moment while playing with projecteuler. taking a look at your code.
07:52lpetit"(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)"
07:52Hali_303is there something like M-( in paredit, but not for ( instead [ ?
07:53lpetitqed: first, do we agree on paredit's behaviour, did I correctly describe it ?
07:53tomojHali_303: paredit-wrap-square
07:53Hali_303tomoj: what's the shortcut for that?
07:53lpetitHali_303: what is M-( please ?
07:53tomojthere isn't one
07:53Hali_303tomoj: ahh, that's why it is not working
07:53tomojHali_303: add this to your init.el or whatever https://gist.github.com/44a2bd1b704d8b81ca9c
07:53Hali_303lpetit: http://mumble.net/~campbell/emacs/paredit.html
07:54tomojyou also get curlies :)
07:54lpetitthx
07:54tomojmaybe someday clojure-mode will add this for us
07:54Hali_303tomoj: thx
07:55lpetitqed: ?
07:56lpetittomoj: do you like the behavior of using the delete commande in paredit ?
07:56qedlpetit: it works the same to me as delete, just in reverse
07:57tomojsometimes I find it a bit strange
07:57qederr backspace
07:57tomojbut I have not yet achieved paredit nirvana
07:57tomojwhat is an alternative behavior?
07:57lpetittomoj: if it were "(a |(b c d) e)" -> delete -> "(a |b c d e)" instead, how would you like it ?
07:57tomojhmm
07:57lpetittomoj: deleting a paren would also delete the corresponding one
07:57qedlpetit: i actually really like that
07:58tomojI don't think I've run into that path enough to have a valid opinion
07:58Hali_303tomoj: where's the init.el that I should add these lines?
07:58tomojI would now use splice to do that
07:58tomojHali_303: do you have a .emacs?
07:58Hali_303yes
07:58lpetitqed, tomoj: I'm currently porting paredit to eclipse, and arguing with cgrand to see where we could fork from paredit's behavior
07:58tomojput it there
07:58Hali_303tomoj: I did that, but emacs gave an error than (variable is void or something like that)
07:58tomojand I believe you need to require paredit before you add those shortcuts in order for that to work
07:58tomojyeah..
07:59lpetittomoj: ok, splice is a separate paredit command, then ?
07:59tomoj(require 'paredit) before that
07:59tomojHali_303: ^
07:59tomojlpetit: yeah, M-s
07:59Hali_303tomoj: thx, I'll try that
07:59tomoj(a (|b c d) e) -> splice -> (a b c d e)
08:00qed^this is why i like lpetit's idea
08:00qedusually i have to move one direction or the other to use splice
08:00tomojI think part of paredit's philosophy is to treat parens as if they don't exist
08:00lpetittomoj: ok. And if delete in the front of a sexpr called splice automatically, would you consider this a wrong default ?
08:00qedwith a forward delete like petit's i wouldnt need to
08:00tomojso when you try to delete a paren, it just say, "whoops! that doesn't exist, instead I'll move past it"
08:01tomojlpetit: I don't know, I don't feel qualified to answer that :)
08:01lpetittomoj: but if you "(|)" -> delete then you get "|", that is paredit does something on the paren :-)
08:01tomojah, yeah
08:01tomojwhoops! you tried to delete nothing, guess you meant you wanted to get rid of this sexp
08:01lpetittomoj: 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
08:02tomojexperiment away, I say
08:02qedlpetit: to be honest with you i think experimentation is key
08:02tomojbut as I said I am not a paredit buddha
08:02qedlpetit: i actually wouldnt mind a sort of "looking forward at the sexp"
08:02qedversus "looking backward at the sexp" approach
08:02qedversus "im inside"
08:02qedi think they're three sub-modes
08:03qedif that makes sense?
08:03tomojI do relatively often find myself doing a bunch of forward deletes that leave empty forms behind until I delete them
08:03qedtomoj: same here
08:03tomojI feel that your idea might solve that problem
08:03tomojbut don't know if it would introduce others
08:04tomojI guess the question now is, how would you implement that idea?
08:05qedim guessing he'd use "code" ;)
08:05lpetityeah, 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
08:05tomojhmm, yeah
08:05tomojsplicing does radically change the meaning
08:05qedlpetit: i think like everything else users should be able to choose to a certain degree as well
08:05tomojif you have (a (b c d) e), (a b c d e) rarely makes any sense, I think
08:06qedgive me a checkbox for magic parens
08:06lpetittomoj: the idea is currently implemented there : "(a (b c d) e)"
08:06lpetitwhoops
08:06lpetitthere http://github.com/laurentpetit/paredit.clj
08:06lpetitbut don't look at it too closely, it's a WIP
08:06qedtomoj: why wouldn't that make sense rarely?
08:07qederr double negative
08:07lpetitbut still, a working WIP (with just a handful of paredit commands ported, currently)
08:07tomoj'C-h k C-d' describes the current behavior explicitly
08:07tomojwhich makes me think at least someone has thought about it
08:07qedtomoj: how hard is anyone's guess
08:07tomoj'C-h f paredit-forward-delete' specifically
08:08tomojqed: in (a (b c d) e), b is being called as a function with c and d as arguments
08:08tomojswitching to (a b c d e) radically changes the meaning
08:08qedtomoj: what if it was (a [b c d] e)
08:08tomojnow you're passing b, a function, along with the other arguments you were passing to b originally, and whatever was after, all to a
08:08lpetittomoj: how do you change a set into a vector with paredit ?
08:09lpetit"( a [b c d e] f)" -> "( a #{b c d e} f)" ?
08:09tomojhmm
08:09Hali_303how 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?
08:11tomoj(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)
08:12tomojI feel like I use the trick of first wrapping, then splicing the inner sexp
08:12tomojin order to transform one sexp type to another
08:12tomojs/use/often use/
08:12qedyeah i place a #{} before the [], slurp, M-s
08:13tomojhmm
08:13qedim not fit to call myself a paredit user
08:13qedi dont even have working curlies
08:14tomojin any case I am pretty interested in plumbing the depths of paredit usage
08:14tomojI kind of want to rig up some kind of monitoring thing that will report statistics to me about my paredit usage
08:14qedtomoj: cool idea
08:14tomojor find common patterns of keystrokes that can be abstracted away
08:15qedi am always C-b C-f'ing my way into sexps to M-s, etc.
08:15qedthat's why i like lpetit's idea
08:15tomojyeah
08:16tomojI don't understand my current usage well enough to know whether I expect C-d to do what it does now
08:16tomoje.g. maybe I never really want C-d to step through a parens, I don't have a fuckin clue
08:16tomojneed 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
08:16qedlol
08:16qedM-x doctor
08:17lpetit:)
08:19tomojhmm
08:19tomojan editing session is a sequence of keystrokes
08:19tomojthe problem is to find subsequences which are repeated often
08:19tomojbut fuzzily matching
08:19tomojNP-complete?
08:20tomojnah, as long as you restrict the length of the subsequences to search, it should be feasible, right?
08:20tomojthen all you have to do is log every keystroke into a data file you can process later
08:21qedyou also need to know about what each keystroke produced, though -- do you not?
08:21tomojwell, to figure out the right thing to do, maybe
08:22tomojbut just having a list of the most common groups of nearly-identical sequences would be useful, wouldn't it?
08:22lpetitok, must leave now, time to eat smth, thanks for the chat, and cu guys
08:22qedtomoj: 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
08:22tomojlike if you're always doing 'M-[ C-f M-s'
08:23qedyes but the keystrokes after it could be further cleaning up what you created with that sequence
08:23tomojthat sequence would have a higher count and you could know that optimizing that process would maybe be valuable
08:23tomojah, yeah
08:23tomojwell, if the cleanup is similar in most cases...
08:23tomojif not, then yeah
08:24qedtomoj: i think it depends on how you approach the recording of this data
08:24qedlet's say you start with the clojure.core src and pay keen attention at random points in random sexps throughout the src
08:25qedi 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
08:26tomojhmm
08:26qedthe other thing might be to just run some sort of evolutionary algorithm or something on large ((()(()))()((()))) structures
08:27tomojhow 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
08:27qedand determine how to get out
08:27qedor in
08:27qedtomoj: i like that
08:28tomojthen, in cases where you're wasting keystrokes, the n-gram model should have low perplexity for a the overused sequence of keystrokes
08:28tomojand can automatically jump to the end result
08:29qedi 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.
08:30qedcall it "grappling", or something -- now you have some way of measuring keystrokes against a specific action, and could just brute force it
08:31tomojI think an n-gram model might be able to do that
08:31qedyou could automatically generate situations like that with sexps of any length
08:31tomojif you pick the right contexts to stick in there
08:31somniumM-x paredit-obstacle-course
08:31qed:D
08:31tomojI don't think automatic stuff is feasible
08:31tomojI think you would need to learn by observing real usage on real code
08:31tomojbut I am just talking out of my ass
08:32qedthat'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
08:32tomojso the goal is to get to the answer with the fewest number of keystrokes?
08:32qedit places them at some random point and gives them a task
08:32qedyes
08:33somniumlike those japanese typing games, but editing sexps
08:33somniumvery niche market
08:34tomojcan we have emacs log every keystroke with a context window around point without making it crawl?
08:35tomojI don't even have any clue how you'd implement that without having to rebind every single keystroke
08:35qed"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?"
08:35somnium:p
08:36somniumlogging to another buffer would probably be easier
08:36somniumsomething like this: http://en.wikipedia.org/wiki/The_Typing_of_the_Dead to train people in the ways of paredit
08:36qed"You're facing a right paren. To your left there is a single argument to a function."
08:36qedheh
08:37qedsomnium: that's cool
08:37qedidk -- i play typeracer sometimes -- I actually would rather edit sexps
08:38lypanovwtf did my gist go from last night...
08:38somniumqed: cant be that much harder to port to emacs than tetris :)
08:42qedheh -- i read an interesting comment -- someone said "how is tetris 25 years old?"
08:42qedreply: "in some asians countries they use base-1 to determine age"
08:47qedi need to setup emacs to turn my lol's and idk's into "ha!" and "i don't know" respectively
08:48qedemacs can make me appear 3-4 years older!
08:48somniumhmm, may exist. I get a fair amount of use from wtf-mode
08:49tomojqed: erc?
08:49qedtomoj: it has that built in?
08:49tomojno, just wondering if you're using it
08:49tomojif so, presumably easy to do what you want
08:49tomojthough I still haven't hacked erc yet
08:49qedim in an irssi shell atm due to some init.el restructuring
08:50tomojI was thinking that, if you're doing some kind of obstacle course, the examples should be real
08:50qedtomoj: that's why i suggested the core source
08:50tomojlike, you should record actual code and the final result after some changes
08:50tomojcore source?
08:50qedclojure's source
08:51tomojah
08:51tomojand what, look at git diffs?
08:52qedi was thinking you'd randomly choose a sexp
08:52tomojI think you probably want finer-grained than git commits
08:52qedand then depending on how difficult it is for people to traverse, you give it a rating
08:52tomojok, but how do you pick the target?
08:52qedyou'd need some initial training
08:52tomoja random mutation of the sexp is probably not indicative of actual use
08:52tomojhmm
08:53rrc7czhow 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?
08:53qedtomoj: here's an idea...
08:53qedyou 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
08:54tomojrrc7cz: for is a macro, so.. :/
08:54rrc7cztomoj: so I'd have to make a macro to expand the collections myself
08:54tomojqed: you mean like, generate a bunch of random mutations and check for ones that compile successfully? maybe I'm not following
08:55tomoj(if you start trying to do machine learning in your editor, have you simply gone off the deep end? :D)
08:55qed(a (a b [c d e] [f g] #{:x :y :z} (+ {42}) (h _) :g) :x)
08:55qedlet's assume that's real clojure source
08:56qedi tell you: give me: (a #{:x :y :z} :g)
08:56qedit doesnt matter if that actually compiles
08:56tomojrrc7cz: hmm, I'm not sure. that doesn't sound wrong to me
08:56tomojyou're looking for the cartesian product, yes?
08:57rrc7czcorrect
08:57tomojc.c.contrib has cartesian-product
08:57rrc7czi'll take a look, thanks
08:57tomojso (cartesian-product (vals the-map))
08:57rrc7czperfect
08:57qedwhat's the cartesian product?
08:58tomojbut then how do you get the bindings?
08:58tomojyou would need to know at code-time how many vals the map has
08:58tomojlike (for [[a b] (cartesian-product (vals the-map))] ...)
08:58tomojno?
08:58clojurebotda da king of the road
08:58rrc7czqed: think join in a RDBMS
08:59rrc7czpart of relational algebra
08:59rrc7czbasically a join though
08:59qedi looked it up :)
08:59tomojclojurebot: trailers for sale or rent?
08:59clojurebotamespaces 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
08:59rrc7cztomoj: not sure, gotta think about this one
08:59qedtomoj: what do you think of the above idea
09:00somniumrrc7cz: not this? (map (fn [coll] (for ...)) maps), what output do you want?
09:00tomojqed: the problem is, how do you decide what to tell me what to give you?
09:00tomojer, how do you decide what to tell me to give you
09:01tomoje.g., where'd you get "(a #{:x :y :z} :g)" from
09:01rrc7czdesired output from my example: [{:numbers 1 :letters \a} {:numbers 1 :letters \b} {:numbers 1 :letters \c} ... ]
09:01qedtomoj: from the first sexp
09:01tomojrrc7cz: oh, that's a nice idea
09:01qed(a (a b [c d e] [f g] #{:x :y :z} (+ {42}) (h _) :g) :x) becomes (a #{:x :y :z} :g)
09:01tomojthen you can use the keys binding to not care about how many sets your taking the product of
09:02tomojqed: I don't follow
09:02tomojhow do you get from one to the other automatically?
09:02qedtomoj: you start at a point in the first expression, you're asked to simplify the first sexp
09:02qedto make it become the second
09:02tomojyeah
09:02tomojbut how do you decide what the second is when you're making up the exercize?
09:03qedyou just randomly select pieces of the first
09:03tomojif 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
09:03tomojthat's my concern
09:04tomojmaybe that won't matter in practice
09:04qedi thought about that -- two things: 1. you're being asked to look at real code in the first instance
09:04somniumyou could weight complexity by nesting, number of elements, and sexp types?
09:04qedi can't help but think that when im thinking out how i'll solve it
09:04tomojbut I'm guessing you need to care about actual common transformations rather than just random transformations (even random transformations of real code)
09:04tomojagain, talking out of my ass and have no evidence or argument for that
09:05qedyeah same here, it's fun to think about though
09:05tomojfor just learning to effectively use a fixed set of commands, I think that'd be great
09:05somniumI wonder if some people's answer to paredit would be 'syntax'
09:06tomojhuh?!
09:06somniumI bet being able to tear through gnarly random sexps would benefit every day use of paredit anyway
09:06tomojyeah, I bet it would too
09:06somniumah, I was thinking of the potential difficulties in marketing this product :)
09:06qedtomoj: what if the left over pieces of the first sexp had to be reconstructed in the 2nd half of a 2 part question?
09:07tomojI was thinking of trying to automatically identify places where you'd benefit from a new command
09:07npoektophi! can't find with google what -> means.
09:07qedtomoj: what if like tetris you were given pieces to assemble
09:07tomojsomnium: like, "why should I learn to be better at paredit, I'll just use a language that has more syntax?"
09:08somniumsomething like that
09:08tomoj,(doc ->)
09:08clojurebot"([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."
09:08tomojsomnium: I bet some people would probably think that indeed
09:08npoektoptomoj: thank you
09:08tomojbut it seems... backwards
09:09qedthey're two equally valid ways of thinking
09:10qedthe minimalist in me prefers one way -- but syntax has its merits
09:10somniumwell, (most) haskell code looks pretty clean
09:10tomojlike?
09:10clojurebotnamespaces 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
09:10tomojreadability or something?
09:10tomojif we're talking about editing power I can't imagine an argument _for_ syntax
09:11qedtomoj: style?
09:11tomojwhich is why saying "paredit? psh, syntax" makes no sense to me—paredit is designed for editing power
09:12tomojah, yeah
09:12qedi mean it cannot be denied that editing power is still in some regard an aesthetic choice
09:12tomojI've talked to some people who say that they just cannot see sexps as pretty
09:12tomojhmm
09:12somniumI tend to organize sexps into tables more than is probably called for
09:13qedit'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."
09:13tomojI would admit that it's an aesthetic choice if I could conceive of a benefit for editing power from syntax
09:13tomojbut i can't
09:13somniumovercompensation for the 'amoeba effect'
09:13tomojI guess this is just because my aesthetics are different?
09:13qedsomnium: hahahahahahaha
09:13qedtomoj: i can appreciate picasso and the mona lisa equally for different reasons
09:14tomojright, but I can't even think of a single reason :(
09:14somniumtomoj: to apprecate mona lisa or picasso?
09:14tomojif you always write the correct code the very first time, maybe
09:14tomojsomnium: to appreciate syntax as it relates to "editing power"
09:15qedsomnium: bahaha im tired, cut me some slack
09:15somniumscala makes me feel ill, but f# and haskell are clean
09:15tomojbut in haskell I hit tab and it cycles through various options for the indentation of this line
09:15somniumI need to setup mono sometime to play with f# in earnest
09:15tomojand if I wrote the wrong code (which I always do), there are no sexps :(
09:16somniumtomoj: well, you can bend emacs to your will
09:16tomojso I have to work at a lower level while I'm reworking the code
09:16tomoj(admittedly I haven't done a lot of haskell in emacs, maybe I underestimate it)
09:16tomojbut that's the thing
09:17tomojemacs simply can't know which indentation I want, I believe
09:17somniumI havent written anything significant in haskell so its purely aesthetics in my case (most of my haskell use has been monad tutorials)
09:17tomojwhereas with sexps there are only some small corner cases where it might get it wrong
09:17tomoj(and even if it does the code will still work :D)
09:18qedtomoj: good point
09:18tomojI guess what I'm wondering is, what could possibly make haskell easier to edit than clojure
09:18tomojI'm willing to admit that haskell might be prettier
09:18somniumhmm, liskell?
09:18qedtomoj: 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 ;
09:19tomojlike the kidnapped come to sympathize with the kidnappers?
09:19tomoj:P
09:20tomojguess I'm just too narrow-minded
09:21qedsome people *enjoy* bloated masses of ketchup-laden hamburger, so much that you might literally throw up if you eat the whole thing
09:21tomoj"Hostages who develop Stockholm syndrome often view the perpetrator as giving life by simply not taking it."
09:22tomoj"look at what I'm _not_ doing!"
09:22somnium:)
09:22qedpeople like bloated, disgusting things
09:22qedand they look at other people's things and they say "wow that is disgusting."
09:22tomojhmm, what was the actual quote
09:23somniumI was stolen from my parens at birth by c++ and now I cant love them
09:24tomojah, "look at all the things I'm _not_ doing"
09:24RaynesMy great great grandfather's parentheses were passed down to me at birth. My first toy was a closing paren.
09:26qedI 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."
09:26tomojqed: yep, and we focus on the things which our easy in our favorite
09:26tomojloving it for that while ignoring the crap it forces us to do elsewhere
09:27qedlike use paredit-mode! :)
09:27tomojs/our easy/are easy/
09:27tomojcrap? blasphemy!
09:27tomojyou are hereby excommunicated from the church of paredit
09:27qedwell 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?
09:27qed;)
09:28tomojthat's exactly the backwardness I can't seem to understand :(
09:29qedtomoj: 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.
09:29tomojit'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?"
09:29qedIt's all just extra crap you have to carry around to express yourself
09:29somniumI wonder if more syntax highlighting might create more visual information
09:29tomojok, yeah, having to buy gas sucks, but I need to get to work
09:30qedwhen it's a neural interface will the ( be a picture of a pony and ) is a rainbow
09:30tomojI remember seeing something where they hid all parens and instead colored sexps according to nesting level
09:30tomojbah
09:30somniumI guess in would always break in macros
09:30qedtomoj: i was *just* imagining setting my parens to match the background
09:30tomojpictures will be outmoded
09:30somniumqed sounds like a smilisp dialect
09:31clojurebotI will hold the money!
09:31tomojI have them slightly lighter so they sorta fade out a bit
09:31tomojI don't think I would want to go fully invisible or have a bunch of different background colors for nesting levels, though.. /shrug
09:32somniumhmm, what about 3d effect in shades of gray
09:32tomojhow about stereoscopic code?
09:32somniumdeeper nesting looks higher/lower?
09:32somnium:D
09:33qedi like that
09:33tomojcrossing my eyes gives me a headache though
09:33somniumlisp hacking with 3d glasses
09:33tomojah, 3d glasses would be better
09:33qedwhat if you can only see the surrounding ()'s and below no matter where you are
09:33somniumId like to see someone explain why he needs --that-- to his boss
09:34tomojmy boss would take a toke and say "duuude awesome idea!"
09:35qed"im sick of coding in 2 dimensions"
09:35tomojwell, I think the neural interface stuff will be interesting if it happens in our lifetime
09:35qedyeah -- i really hope it does
09:35tomojspatial dimensions will be outmoded as well I think
09:36tomojinstead you can just experience lambda expressions directly, no need for an intermediate spatial representation
09:36Chousukeyou only need a reader for human thought patterns
09:36qedis that all
09:37qedi think i have a git repo laying around somewhere with one of those
09:37tomojhmm, I was thinking of starting at the other end
09:38tomojbut that would be more effective and even more fantastical
09:38tomojjust sit down and think of what you want and it shows up in code
09:38qedit might be harder than it seems
09:38tomojyeah, that doesn't work so easily I think
09:38qedi think a lot of stupid things
09:39somniumif you could install a prosthetic keyboard on your arm would you still need paredit and auto-complete?
09:39qedim thinking some right now
09:39tomojexactly
09:39tomojwe don't write bad code because of the languages, but because we're idiots
09:39tomojof course in this fantasy we will just hack our brains so that we aren't idiots anymore, I guess
09:39qedid have to disagree with that for the simple fact that I am, in fact, an idiot
09:40somniumwhat was the original set of self describing lisp expressions?
09:40tomojsomnium: how would moving the keyboard to your arm help?
09:40lypanovhttp://lib.store.yahoo.net/lib/paulgraham/jmc.lisp
09:40lypanov; Assumes only quote, atom, eq, cons, car, cdr, cond.
09:41somniumtomoj: more controlling it with your nerves, like those new replacement hands
09:41somniumah, atom == symbol, hmm
09:42somniumdoes that handle arithmetic too?
09:42tomojsomnium: ooh, I see
09:42tomojstill, I'd rather manipulate sexps than characters
09:43tomojbeing able to do so faster would just make paredit that much better :)
09:43qedwhat if the characters were cooler?
09:43qedlike some really great UTF8 looking thing that made you feel like an alien?
09:43tomojhmm
09:44tomojI think you still need something analogous to paredit
09:44qedyou could inject meaning into them like "be-gin trans-mis-sion" ∆do∂
09:44somniumhttp://www.gnu.org/software/emacs/its-cover.png
09:44tomojyou 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
09:45tomojand then you need to be able to manipulate those structures as structures rather than as sequences of characters
09:45qedtomoj: you could make the whole language about the affects of those characters on the structure, so the characters become the structure
09:45tomoj(of course if you can get rid of characters, there is no need for this, but...)
09:46tomojhmm
09:46arkrosthi! I have a problem with emacs, slime and classpath. Can anyone help?
09:47tomojI 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
09:47somniumwhen the level of abstractions moves beyond category theory 3d images might come in handy
09:47tomojarkrost: just tell us the problem, maybe someone can
09:51arkrostI examine that the classpath was set to the ~/.libs by the comand in slime: (System/getProperty "java.class.path")
09:54tomojarkrost: you set that classpath manually by hacking on swank-clojure, or..?
09:56tomojif 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
09:56qedBIRMINGHAM, 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.
09:56tomojand then use M-x swank-clojure-project
09:56tomoj(and I'd use leiningen to help with the jars)
09:57arkrostIn .emacs I have (setq swank-clojure-jar-path "~/.clojure/clojure.jar"
09:57arkrost swank-clojure-extra-classpaths (list "~/.libs/" "~/.libs/*" "~/.clojure/clojure-contrib.jar"))
09:57tomojyeah, that's pretty odd
09:58tomojany specific reason you want to use the same classpath for everything you work on?
10:01tomojif 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:12ag90Question. 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:13Chousuke-e (-main)?
10:13ag90Didn't seem to work. I'll try again, just to be sure.
10:13ChousukeI guess it might need at least one parameter.
10:14lypanovNikelandjelo: i have a new one :)
10:15ag90Oh great it worked. Just needed to place the -e after the file name. So - java clojure.main file-with-main.clj -e '(-main)'
10:15ag90Thanks
10:43wtetzner,(withmeta (fn [x] (* 2 x)) {:type :doubler})
10:43clojurebotjava.lang.Exception: Unable to resolve symbol: withmeta in this context
10:43wtetzner,(with-meta (fn [x] (* 2 x)) {:type :doubler})
10:43clojurebotjava.lang.UnsupportedOperationException
10:44wtetzneris there a reason you can't have metadata on fn's?
10:46the-kennywtetzner: I think metadata on functions will be in the next version or so
10:46wtetzneroh
10:46wtetznerok
11:56RaynesGithub is down. :|
11:57cp2:<
11:57RaynesAnd here I was all excited about cloning the Ioke repo and such. :|
12:02mengu_and i was gonna check compojure.
12:02technomancyusually the web interface is pretty decoupled from the repo serving
12:02technomancyso if you know the URL you're fine
12:04lypanovits sooo pweeeeeeety
12:05ag90It's back up.
12:06RaynesI'm already cloning the mirror repo. :p
12:07lypanovlaziness is really quite hard to get your head around at first.
12:11somniumplaying with lazy-seqs in javascript is interesting
12:12lypanovdamn. got it working.
12:12lypanov*brain splat*
12:16ska2342hi. 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:18raekmap?
12:18clojurebotmap 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:20ska2342I 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:20raek,(let [ks [:a :b :c]] (into {} (zip ks (map name ks))))
12:20clojurebotjava.lang.Exception: Unable to resolve symbol: zip in this context
12:21raekah
12:21raek,(let [ks [:a :b :c]] (into {} (zipmap ks (map name ks))))
12:21clojurebot{:c "c", :b "b", :a "a"}
12:21raeksomething like this?
12:21ska2342hmm. maybe "into" is, what I am really looking for. Thanks for the pointer, will try that later.
12:21ag90ska2342: (zipmap (map func vals) vals) ?
12:22somnium,(into {} (map (fn [k] [k (str "v--> " k )]) [:zonk :42 :bulldozer]))
12:22ag90Where vals contains all the values and func is the function that gets the key for the value.
12:22clojurebot{:zonk "v--> :zonk", :42 "v--> :42", :bulldozer "v--> :bulldozer"}
12:23raekzipmap is nice for making key-value-pairs of a sequence of keys and a sequence of values
12:24raekbut, as somnium points out, you could make the key-value-pair in your function instead
12:25ska2342I 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:26rrc7czhow can you evaluate an expression at the REPL, but supress printing out the return value?
12:26tcrayforduse with-out-str?
12:27tcrayford,(doc with-out-str)
12:27clojurebot"([& 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:27raekyou could use (do .... nil)
12:27raekthat way, you'll get nil instead of whatever the expression evaluates to
12:27rrc7cztcrayford, raek: thanks, both are what I'm looking for
12:28raekwith-out-str redirects printing, but i
12:28lypanovhttp://gist.github.com/297543
12:28lypanovclojure is pwetty :D
12:28raek'm not certain if the printing from the repl uses this
12:28the-kennyraek: you want to execute an expr, but *not* print the return value?
12:29the-kennyuhm.. I mean rrc7cz
12:29the-kennysorry
12:29lypanovis there a common "square" idiom? or is (* % %) really just the way to go?
12:29rrc7czthe-kenny: correct. either for the side effect or in this case, just to time it
12:30npoektophow to generate a random symbol name for use in defmacro?
12:30the-kennynpoektop: #
12:30tcrayford,(Math/pow 2 2)
12:30clojurebot4.0
12:30the-kennyfoo#
12:30tcrayford,foo#
12:30clojurebotjava.lang.Exception: Unable to resolve symbol: foo# in this context
12:30the-kenny,`foo#
12:30clojurebotfoo__5890__auto__
12:30the-kenny,`foo#
12:30clojurebotfoo__5894__auto__
12:30the-kenny,`foo#
12:30clojurebotfoo__5898__auto__
12:30the-kennyThere you are :)
12:31npoektopthe-kenny: thank you!
12:31RaynesHow to ask questions in the form of an answer? :p
12:31lypanovlol
12:31raekrrc7cz: with-out-str still returns a value
12:31raekthat will be printed by the repl
12:32raekhowever, the output of the print calls will not appear in the terminal
12:32lypanovdamn 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:33lypanovor not, time to give the atkins sieve a try.
12:33rrc7czraek: 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:34rrc7czlypanov: just throw it in a Gist: http://gist.github.com/262465
12:35lypanovrrc7cz: oh goddd i saw your for impl of the above *cries*
12:35rrc7czlypanov: 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:35Raynes~def reverse
12:36lypanovrrc7cz: (my one - http://gist.github.com/297543)
12:36lypanov(i like it, its pretty in the same way rails code is pretty, its all neat!)
12:36lypanov(where neat == duplicated)
12:36Rayneslypanov: What trouble are you having with for?
12:37lypanovELACKOFCOFFEE
12:37lypanovRaynes: just had a really hard time getting my head around it with scala so scared to visit it now.
12:37lypanovsure i'll be fine when i get around to it :)
12:38lypanovthe above laziness is way harder anyway tbh
12:39Raynes,(for [x (range 1 4) y (range 4 8)] [x y])
12:39clojurebot([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:40lypanovexcellent. and it has :while. awesome.
12:41lypanovthx for throwing it at me Raynes :)
12:41rrc7czp11 is my embarrassing child. all my solutions are so tiny, then I have this monstrosity just hit you in the face
12:41RaynesIt also has :when and :let.
12:41RaynesNo problem.
12:42lypanovrrc7cz: wow.
12:44tcrayfordstrings in clojure are just java strings
12:44tcrayfordif you've done any java
12:44tcrayford,(.contains "foo" "foo")
12:44clojurebottrue
12:44tcrayfordbut they're also sequable
12:44tcrayford,(first "foo")
12:44clojurebot\f
12:45tcrayford,(filter #(= \f %) "foo")
12:45clojurebot(\f)
12:45tcrayford,(filter #(= \o %) "foo")
12:45clojurebot(\o \o)
12:45tcrayfordto get back to a string from a seq of chars, you can use reduce
12:46tcrayford,(reduce str (filter #(= \o %) "foo"))
12:46clojurebot"oo"
12:47lypanovah
12:47lypanovtcrayford: why reduce rather than apply? because of the laziness?
12:48tcrayfordyou can use apply as well
12:48tcrayfordbut lazy is usually better
12:48tcrayford,(apply str (seq "foo"))
12:48clojurebot"foo"
12:57Hali_303what library should I use if I want to do in-memory XML editing?
12:57Hali_303traversing the tree and making modifications
12:57tcrayfordlook at clojure.zip
12:58tcrayford(though you shouldn't be thinking in terms of modifications for the most part in clojure)
12:58Hali_303ok, thanks
13:05lypanovtcrayford: thx :) http://gist.github.com/297565 it was easy in the end :D
13:05lypanovmore clojure-ish way to do the Integer/parseInt?
13:15chouserlypanov: nope that's it.
13:15chouserlypanov: you can try using read-string, but it's not really the same thing
13:15Rayneschouser: Is it preferred to use parseInt over read-string for that purpose?
13:28Hali_303(clojure.xml/parse "<a></a>") does not work, why?
13:28Hali_303the doc says it works on a string
13:28Raynes(doc clojure.xml/parse)
13:28clojurebot"([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:29RaynesString naming a URI <---
13:29Hali_303ahh, damn
13:29Hali_303thanks
13:30RaynesHali_303: (parse (ByteArrayInputStream. (.getBytes "<a></a>" "UTF-8")))
13:30Hali_303thanks
13:30RaynesDo that if you want to use a string.
13:34lypanoveep. glad irssi doesn't allow big pastes..
14:04avarushi
14:43DeusExPikachufor 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:44raekDeusExPikachu: you seem to be doing exactly what I'm doing now...
14:44raektry "lein deps"
14:45DeusExPikachunothing happens cause its in the lib directory
14:45raekwhat is?
14:45DeusExPikachulein-swank
14:46raekare you running "lein swank" from the project root?
14:46DeusExPikachulein-swank-1.1.0.jar to be exact
14:46DeusExPikachuyeah
14:46raekor from the libs/ directory?
14:46raekok
14:47DeusExPikachuis the version, what version are you running?
14:48DeusExPikachu@ raek,
14:48raek1.1.0
14:48DeusExPikachusorry, for leiningen
14:49raeki'm trying out leiningen too
14:49DeusExPikachuno, I mean, what version are you using (leiningen)
14:49raek"lein swank" sounds promising
14:49raekI downloaded the lein script 1 hour ago
14:49DeusExPikachuit was working for me on another computer
14:55raekslime or swank-clojure crashes when I enter a non-ascii character
14:55raekanyone know how to fix this?
15:00raekok, made it work...
15:00DeusExPikachuraek, which?
15:01raekmy problems with swank crashing
15:02raeklein said "swank is not a task" before I had run "lein deps"
15:02raekbut after that, it worked for me
15:03DeusExPikachui'll try a lein clean then
15:05DeusExPikachunope, still doesn't work, "lein swank" gives "swank is not a task"
15:06robwolfeDeusExPikachu: do you use "lein" script symlinked from Leiningen checkout?
15:06DeusExPikachuyes
15:06DeusExPikachuwait
15:06robwolfedon't do that
15:06DeusExPikachuno,
15:06DeusExPikachuI downloaded the script from git per instructions
15:06DeusExPikachuadded it to my path
15:07robwolfecopy it to your "~/bin"
15:07DeusExPikachuinstalled leiningen via lein self-install
15:07DeusExPikachuyeah did that
15:07robwolfeand make sure that you will use this one from "~/bin"
15:08DeusExPikachuyeah "which lein" returns "~/bin/lein"
15:08robwolfeok, try "lein swank" now
15:08DeusExPikachusame error
15:08robwolfetry "DEBUG=1 lein swank"
15:09robwolfeand see if there is "lein-swank.jar"
15:09DeusExPikachuas a message, it prints the path to the leiningen-1.0.1-standalone.jar
15:09DeusExPikachuno lein-swank jar
15:09dnolenDeusExPikachu: not sure if lein-swank really works with lein 1.0.X
15:09DeusExPikachuso what version do i need?
15:09dnolenyou probably need it from source
15:09dnoleninstructions on github
15:09robwolfewhen you run "lein deps" and you have dependency to lein-swank you need to have lein-swankjar in lib
15:10DeusExPikachuyeah I"ve installed from source on another machine... i'll do it on this one
15:10DeusExPikachuproblem is, git isn't on this new machine... grr more work
15:10dnolenI think with Lein 1.1.0, the lein-swank experience will be much better.
15:11DeusExPikachuthey need to add server options for lein-swank
15:11DeusExPikachuso I can pass the option ":dont-close true"
15:35raekDeusExPikachu: yes, that would be good
15:35DeusExPikachuits a simple fix really
15:35raekI need :encoding "utf-8" ass well.
15:36DeusExPikachumight be better to just roll your own
15:36raekwithout :dont-close true, you can only connect once, right?
15:36DeusExPikachuyeah, and if the connection dies for some reason, you can never reconnect
15:41DeusExPikachuthis is bizarre, lein swank still doesn't work
15:41tcrayfordthat's the thing that's been bugging me
15:41tcrayfordthe :dont-close true thing
15:41tcrayfordit should be true by default under lein
15:41tcrayfordimho
15:41DeusExPikachuI agree
15:42raekalso, :encoding "utf-8"
15:43raekit doesn't hurt anyone
15:50robwolfeDeusExPikachu: it's weird, what these commands show: "grep swank project.clj" and "ls lib | grep swank"?
15:51DeusExPikachugrep swank project.clj returns ":dev-dependencies [[leiningen/lein-swank "1.1.0"]])
15:52DeusExPikachuand ls lib | grep swank returns "lein-swank-1.1.0.jar and swank-clojure-1.1.0.jar
15:52robwolfeand "lein help" does not show "swank" command?
15:52DeusExPikachucorrect
15:53robwolfewith "DEBUG=1" do you see "lein-swank" in classpath?
15:53DeusExPikachurobwolfe, no
15:55robwolfeit's impossible unless you changed something in "lein script", because "lein" scripts build classpath taking jars from "lib"
15:56DeusExPikachurobwolfe, didn't change anything
15:58robwolfeso what do you see exactly with DEBUG=1 ?
15:58DeusExPikachu[bmillare@boh scratch]$ DEBUG=1 lein-stable swank
15:58DeusExPikachu/home/bmillare/.m2/repository/leiningen/leiningen/1.0.1/leiningen-1.0.1-standalone.jar:
15:58DeusExPikachuswank is not a task. Use "help" to list all tasks.
15:59robwolfehave you changed :library-path in project.clj?
15:59DeusExPikachuno, project.clj is very simple, it has a :dep on clojure, and a :dev-dep on lein-swank
16:01tcrayfordI've had this a bunch
16:01tcrayfordended up just putting a lein swank jar file in /lib
16:01wtetzneris there a way to set which namespace an eval occurs in?
16:01tcrayfordhacky, but it works
16:01DeusExPikachubut the lein-swank jar IS in /lib
16:01tcrayfordweeeiiiird
16:02robwolfeDeusExPikachu: when you run "lein clean" is "lib" empty?
16:02DeusExPikachuI'm debugging the script atm, even though its from the git website link
16:02DeusExPikachuyeah
16:02robwolfeDeusExPikachu: you don't use tehnomancy checkout?
16:02DeusExPikachurobwolfe, yeah
16:03tcrayfordis there an easy way to filter out directories from file-seq?
16:03tcrayfordI've tried (filter #(.isFile%) ...)
16:03robwolfeso please use "technomancy" version, this the current working version
16:03tcrayfordI've tried (filter #(.isFile %) ...) even
16:04DeusExPikachurobwolfe, sorry, I thought you said "you use", yes I use techomancy version
16:06robwolfeDeusExPikachu: you 100% sure you don't use symlinked "lein" from somewhere?
16:06DeusExPikachuI already said "which lein" returns ~/bin/lein
16:06DeusExPikachuls -l ~/bin/lein is jsut a file
16:07DeusExPikachuhmm this is interesting
16:07tcrayfordit should be the shell script
16:07DeusExPikachufind -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:
16:07DeusExPikachuin the project directory returns nothing
16:08robwolfeare you on Linux?
16:08DeusExPikachuthe remote machine is running linux, yes
16:08DeusExPikachuI suspect the machine is quirky, its not mine after all, and the other server works just find, without the checkout version too
16:09DeusExPikachu*fine
16:10DeusExPikachu$CLASSPATH is empty when I add an echo $CLASSPATH line to the script
16:10DeusExPikachuI think the find command is borked on this machine
16:10robwolfeyep
16:11robwolfesee this: http://github.com/technomancy/leiningen/issues/closed#issue/14
16:12DeusExPikachubam, it works now
16:12robwolfe"-follow" helped?
16:13DeusExPikachuyeah, that was the fix
16:13robwolfegreat
16:15DeusExPikachuyeah, weird problem, I mean, I can read install instructions.... (also I"ve installed leiningen + lein-swank on other machines no problem before)
16:18robwolfeyeah, Leiningen still requires a lot of testing on different platforms
16:19DeusExPikachuok, who wants to fork lein-swank and add option support?
16:22DeusExPikachulooking at swank.clj in lein-swank, the line `(do (try (require '~'swank.swank) looks interesting, never seen '~'symbolname before
16:25DeusExPikachuwhats the difference between `('~'name) and `('name)? they both return the same lists?
16:26technomancyDeusExPikachu: it's a way of working around the fact that backquote automatically fully-qualifies all symbols
16:26technomancyif you're in the leiningen.swank namespace, `('name) expands to `('leiningen.swank/name)
16:26DeusExPikachutechnomancy, I see
16:26technomancyunless you quote/unquote it
16:27technomancyit helps protect against a host of really difficult-to-debug symbol capture bugs that have plagued CL for decades
16:27technomancybut requires a few workarounds when you really _do_ want a bare symbol (rare)
16:27technomancyanyway, I'd love a patch to lein-swank for a little more flexibility
16:28DeusExPikachutechnomancy, looking at the code, I think only the deeper function calls actually allow options
16:28technomancyDeusExPikachu: so it would require patches to swank-clojure too?
16:28DeusExPikachuso I'd have to modify the convenience swank-clojure code
16:28DeusExPikachuyeah
16:30hiredman,`~'foo
16:30clojurebotfoo
16:30hiredman,`'~'foo
16:30clojurebot(quote foo)
16:30DeusExPikachuits `'~'foo
16:30DeusExPikachu,`'~'foo
16:30clojurebot(quote foo)
17:02turbo24prgtechnomancy: 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:05technomancyturbo24prg: slime might have some silly built-in assumptions that the CL files are found in the same place as the elisp
17:05technomancyturbo24prg: sorry, I haven't used CL in years
17:11turbo24prgtechnomancy: ok, thanks for the info
17:12lypanovahhhh back :D coding time :D
17:22DeusExPikachutechnomancy, when writing plugins, leiningen will pass only the project name to the function? how do you pass other args to the function?
17:25hiredmanDeusExPikachu: I'm pretty sure passes everything from the project.clj
17:25hiredmanas a man
17:25hiredmanmap
17:25DeusExPikachusorry, I mean just project info, what about command line args
17:26raek(fyi, i added TagSoup (licensed under Apache 2.0) to Clojars: http://clojars.org/org.clojars.raek/tagsoup )
17:26DeusExPikachuhow do you pass other coomand line args?
17:26DeusExPikachuI guess from the architecture then, you shouldn't, instead define options in the project.clj file
17:28hiredman,(doc *command-line-args*)
17:28clojurebot"; A sequence of the supplied command line arguments, or nil if none were supplied"
17:29DeusExPikachuactually, 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:29DeusExPikachu@ hiredman,
17:30hiredman,(doc *command-line-args*)
17:30clojurebot"; A sequence of the supplied command line arguments, or nil if none were supplied"
17:30hiredmaner
17:30hiredmandon't imagine problems that you don't know to exist
17:35DeusExPikachuhiredman, looks like it is a problem though, passing additional args to "lein swank foo" for example, raises an exception
17:37technomancyDeusExPikachu: it passes in the project as the first argument, then all command-line args as succeeding arguments
17:37technomancysee leiningen/test.clj for an example
17:50DeusExPikachuah, that explains the exception, ok
17:52DeusExPikachualthough, 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:57wtetzneris there way to set the namespace for evaled code?
18:02DeusExPikachunm, seems that I'm confusing two separate environments, leiningen, and the projects
18:04danlarkin<3 clojurebot
18:10technomancydanlarkin: wow, nice job on clojure-json optimizations
18:10technomancy2x is an awesome boost
18:10danlarkinI'm not sure if I did a bad job before, or a good job now :)
18:10lypanovgood job both times? ;)
18:10technomancyor protocols are just awesome
18:11danlarkindefinitely
18:11technomancydanlarkin: you better start getting serious about version numbers now though
18:11technomancysince the rewrite won't work on pre-1.2
18:12danlarkintechnomancy: yeahhhhhh :-/ I've been putting that off as long as possible
18:12danlarkinI think I'm going to mark the non-protocol version as 1.0, and this as 1.2
18:12technomancymakes sense
18:16Raynesduck_streams.clj got a namechange? Why didn't I get the memo? :o
18:16danlarkinunfortunately, adding in the ability to pretty-print slows it down like 30% or so
18:16danlarkinwhich bums me out, because it's a nice feature to have
18:17technomancydanlarkin: can you enable it on-demand with binding?
18:17RaynesWhat happened to duck-streams? :\
18:18danlarkinRaynes: see clojure-dev ML
18:20danlarkintechnomancy: well it doesn't do any "work" if pretty-printing is turned off, but it has to check in a bunch of places
18:21danlarkinthat's just my intuition, though. I'm not sure how to get real numbers
18:23lypanovis there a take-until?
18:23lypanovas in, inclusive variant?
18:23lypanovi need an inclusive variant of split-with, seems like i need to make my own.
18:23technomancyclojurebot: duck-streams?
18:23clojurebotGabh mo leithscéal?
18:23technomancyclojurebot: duck-streams is now clojure.contrib.io
18:23clojurebot'Sea, mhuise.
18:24technomancydanlarkin: I'm sure you could steal a perf-suite from another library
18:24technomancybut it does sound like a lot of work
18:24technomancybesides, you can always convert to clojure and then pretty-print that
18:24technomancythat's what I do in elisp
18:27hiredmanlypanov: what is the difference between take-while and take-until?
18:28tcrayfordtechnomancy: so you print stuff from the clojure side of things, before sending it to elisp?
18:28lypanovhiredman: probably not explaining myself well enough.
18:29lypanovhiredman: i'd like to split on the 3 in (1 2 3 4 5)
18:29tcrayfordtechnomancy: I've been having problems with printing clojure code that has \ns in it, because that's also elisps newline char
18:29lypanovhiredman: but split-with pulls one too little.
18:29lypanovs/little/few/
18:30hiredmanlypanov: split on 4 then
18:30lypanovhiredman: wanted a generic solution. imagine if it wasn't a sorted set.
18:30technomancytcrayford: I mean that's what I do when writing elisp code that interacts with json (not clojure-related at all)
18:30tcrayfordahh, k
18:30technomancysince json.el has no prettyprinting functionality
18:31lypanovhiredman: actual thing i want, split a list on its minimum.
18:31tcrayfordfair 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:31lypanovmaybe there is a much better way to do it.
18:38technomancytcrayford: yeah, I was looking at it the other day and meant to ping you about it
18:38technomancyI fetched it but didn't merge it
18:41tcrayfordI've already fixed that, think its in the latest version
18:41tcrayfordthe only bug I've found is that if you run tests repeatedly, the modeline will get stuck green/red
18:42tcrayfordand you have to call your color-theme fn to get it back to normal
18:43tcrayfordpull request sent
18:44tcrayfordalso having hooks that are run with the test output is useful for other stuff
18:49lypanovum. any one got a clue what a good generic and not way too complex way is to swap two numbers in a list?
18:49tcrayforduse assoc with vectors?
18:49tcrayfordmaybe with seq-utils/indexed
19:15Raynesclojure-contrib 1.2.0-master-SNAPSHOT really needs to be updated on /snapshots. With the name changes and all.:|
19:31tomojc.c.json.write has no print-json multimethod for BigIntegers
19:31tomojI figured doing (derive BigInteger ::pr) would work, but it doesn't
19:31tomojhow do I add derivations so that multimethods in other people's code will see them?
19:33tomojoh, I see, ::pr means :clojure.contrib.json.write/pr
19:34tomojand that works :D
19:44underdevhi! i
19:44underdevve watched the 10 part intro to clojure, and just finished the clojure for java programmers video
19:45underdevany recommendations to where i go now?
19:45underdevanxious to get coding :)
19:45mquandernewbie q: i would like a small anonymous function that returns a map. i wrote: %(identity {:acct account-id :match (second %)})
19:46mquanderobviously i could write it with the (fn) syntax instead of using the % syntax, but i like the %!
19:46lypanovunderdev: i'm attempting to solve all the projecteuler.net problems in it.
19:46mquanderis there some nice way to get rid of the identity? oh, i can probably use hash-map, can't i
19:46underdevnice
19:46underdevsmart
19:46lypanovwell. "all". actually i want to do just one level worth.
19:48mquanderp.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:58underdevokay, 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:59underdevanyone read programming clojure?
20:01mquanderdo 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:01mquanderone 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:02mquanderthese ones http://clojure.blip.tv/
20:03tomojhiredman: do I remember that you were doing stuff with clojure+facebook?
20:04underdevmquander: rt, i've watch al of those except the clojure for lisp programmers
20:04hiredmantomoj: yes, mostly I just have a function or two for calling the facebook api
20:09tomojhiredman: cool, guess it's not too hard then
20:10hiredmanhttp://gist.github.com/297803 the call function is the main one
20:11hiredmanline 75
20:11tomojI thought I saw that in some google results, hadn't realized it was yours
20:12hiredmanI think I had an earlier gist, but I couldn't find it
20:12tomojwell, thanks
20:12hiredmanthe java client (which used to be official supported by facebook) is horrible
20:12tomojthe facebook developer wiki has been down since yesterday, so this will serve as temporary documentation :D
20:24Tcepsaunderdev: 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:25Tcepsa(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:27Tcepsaunderdev: 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:28mquandertcepsa: i only saw it once.
20:29mquanderon 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:30mquanderi would love to see a tutorial for hooking up a profiler, builds (leningen?), debugger, bytecode poker-arounder, whatever else to emacs+clojure environment
20:31underdevTcepsa: thanks! yeah, i think ive got the concepts down pretty well.
20:32underdevto the degree that they are abstract. I can't rattle off the special forms from memory or anything :)
20:34Tcepsaunderdev: 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:35Tcepsaunderdev: 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:36Tcepsamquander: 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:38Tcepsamquander: I don't know of any such tutorial, but that would be really fantastic...
21:59underdevi 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:59underdevhttp://tcltk.nfshost.com/clojure-desktop-color.gif
22:00underdevif you want one for yourself
22:05Tcepsaunderdev: Neat! Thanks for sharing ^_^
22:07underdevnp
22:07underdevgotta have a dedicated virtd for everything, puts me in the mood :)
23:00technomancyRaynes: having fun?
23:00Raynestechnomancy: It's really cool.
23:00RaynesNever heard of prototype-based OOP until today.
23:01technomancyreally? it's quite popular these days
23:01RaynesI guess I've just never heard the term.
23:01technomancyI guess if you stay away from the web dev sphere it's easy to ignore javascript
23:03RaynesI'm pretty oblivious to web dev stuff.
23:05technomancythat's not necessarily a bad thing
23:05technomancyit's been almost a year since my last web project, and I must say I don't miss the headaches
23:06RaynesI'd probably play with it more if I could grok Compojure. It's pretty much Latin to me.
23:06underdevfreakin' a, the repl running out of the servlet- amazing
23:07technomancysure, but you still have to think about things like cross-browser JS- and CSS- compatibility
23:07technomancythat's where the real nightmares are
23:07underdevjs compatibility is pretty much solved now
23:08underdevjquery/dojo/et. all
23:08underdevsorry, i didn't mean to interupt
23:08technomancyjQuery still had bugs that would take days to track down in IE6 when I was using it
23:08technomancybut I guess now if Google's dropping IE6 you can get away with doing the same
23:09technomancy"you kids have it easy; back in my day..."
23:09technomancyor rather, IE6 still had bugs that jQuery couldn't shield you from
23:09underdevits just a coincidence that i added that statement, just watched the repl/servlet video on vimeo
23:09RaynesOla Bini apparently really likes word-wrap: http://gist.github.com/297869
23:09technomancyRaynes: maybe he's got a 30-inch monitor
23:10RaynesDon't know. I think he broke his enter key.
23:15RaynesOne thing that makes my feet burn is the fact that the Ioke repl has no way to load files.
23:15RaynesThat's like, really really bad.
23:15RaynesAnd it's something I might have to remedy before I do anything serious with it.
23:15ohpauleezwhat is the loke repl?
23:16RaynesIIk
23:16technomancyRaynes: 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:16Raynesohpauleez: Nothing to do with Clojure.
23:16technomancyI mean, it's tacky, but it wouldn't be annoying
23:16ohpauleezahh, ok. emacs issues, I'll step aside
23:16Raynestechnomancy: What are you talking about? ;o
23:17Raynesohpauleez: Nothing to do with Emacs either. Ioke is a language. :p
23:17ohpauleezohhh
23:17technomancyRaynes: for everyday usage, I never use any "load from file" commands in the repl
23:18technomancyI just send it directly from an Emacs buffer to the repl subprocess
23:18technomancyso I wouldn't miss the lack of such a command
23:18RaynesIIk seems pretty primitive in general, though. You apparently can't even paste multiline code in it.
23:18ohpauleezsuper influenced from io, looks cool
23:18technomancyoh, well that's more of a problem then