#clojure logs

2010-05-27

00:53jarturGreetings to everybody. I have a question for you. When I build a jar using leiningen like 'line jar'. What can I do with this jar?
00:53jarturI've tried to run it but with no luck
00:53jarturI've specified classpath and everything
00:53bhenryjartur if you want to run it try lein uberjar
00:53jarturThe point is i don't want an uberjar
00:53jarturIt's too big
00:54bhenryjartur: then java -jar projectname-standalone.jar
00:54bhenryoh
00:54jarturSee, I have a remote server
00:54jarturAnd I need to run my project there
00:54jarturBut I can't build there
00:54bhenrythen you can use the jar you made in another project, but only if the other project includes the same dependencies as your project
00:55jarturBasically what I want is to be able to upload only small jar to the server each time instead of the whole uberjar.
00:55jarturBecause deps are changing rarely
00:58jarturLike upload an uberjar once. And maybe there is some way to update the essential project jar only?
00:58jarturI have thought about unzipping the uberjar, replacing project dir with a new one and zipping it back again
00:59jarturBut it's so ridiculously a lot of hassle
00:59bhenryyou can't upload all your deps on your classpath and then change out the jar from lein jar?
01:00jarturI wonder why leiningen can't build a some run.sh script to just run a project without assembling it in one jar
01:00jarturWell, I can't run a project without uberjar
01:02jarturI wonder what use does the generated jar from 'lein jar' have?
01:02jarturWhy can't i execute it.
01:02jarturMaybe I'm missing something
01:03bhenrylein says it should be executable if it has a :main symbol in project.clj
01:04jartur#!/bin/sh
01:04jarturCLASSPATH=padm.jar
01:04jartur
01:04jarturfor f in libs/*.jar; do
01:04jartur CLASSPATH=$CLASSPATH:$f
01:04jarturdone
01:04jartur
01:04jarturjava -cp $CLASSPATH -jar padm.jar
01:04jarturSay, I do this
01:04jarturwhere padm.jar is my 'lein jar' result
01:04bhenryare you telling project.clj what to use as main?
01:04jarturAnd if I assemble an uberjar it will run
01:04jarturYes.
01:05jarturBecause 'lein uberjar; java -jar padm-standalone.jar' works
01:05jartur:main padm.core
01:05jarturAnd it has a (:gen-class) and (defn -main ... )
01:07remleduffUsing java -jar is often a bad idea. You can use -jar and also specify the classpath.
01:07remleduffUsing java -jar is often a bad idea. You can't use -jar and also specify the classpath.
01:07remleduffWow that's a bad typo, exactly the opposite of what I meant to say
01:11zakwilsonI have [swank-clojure "1.2.1"] in my project.clj and lein deps is complaining that it's missing. I can see the file in the clojars repo. What could I be doing wrong?
01:15slyrusswank-clojure/slime seems to start off ok, but hangs soon thereafter. anyone else seeing this?
01:16remleduffzakwilson: Sounds like it should work... you have ":dev-dependencies [[swank-clojure "1.2.1"]]" not missing a pair of brackets?
01:22zakwilsonremleduff: I have exactly that
01:26slyrusI can still use the inferior-lisp buffer, but the slime buffer seems totally locked up
01:29remleduffslyrus: There are a lot of moving pieces to that at the moment. Do you use ELPA? I just updated all my stuff and it seems to work ok now
01:29slyrusno, I don't use elpa. but I too just updated everything.
01:32slyrusand surely the net effects of using elpa are just specifying which revisions of the various packages one should be using and maybe some setting some .emacs variables, no?
01:45remleduffYep
01:53jarturOkay. I'm an idiot.
01:53jarturI've misspelled 'lib' for 'libs'
01:54jarturAnd removed -jar option and specify a class instead
01:54jarturNow it works
01:54jarturThanks everybody
02:05technomancyactually the next version of leiningen should be able to spit out shell runner scripts for your projects
02:05technomancybut it's a ways out still
02:06Raynestechnomancy: Will the omgleinreplusesclojure1.1.0 bug be fixed in the next version?
02:10technomancyRaynes: it's an ugly worlde we live in.
02:10technomancyRaynes: the clojure bug got fixed, now we've got an ant bug blocking it
02:10danlarkinRaynes: I bet ioke has it fixed
02:11Raynes:o
02:11technomancyhttp://groups.google.com/group/leiningen/t/37bd680707657890
02:11Raynes:(
02:19technomancynot really
02:20RaynesSurely there is something there.
02:23danlarkinthere is
02:24technomancydanlarkin: you're full of it
02:24danlarkinI'm full of pupus on the beach
02:28zakwilsonJava 6 runs Clojure code quite a bit faster than Java 5 on a Mac, doesn't it?
02:29tomojI think so
02:29tomojI saw some amateur benchmarks which suggested so
02:30tomojI guess it's hotspot optimization improvements
02:30zakwilsonGood. I ran some code on a Mac Pro and it was barely faster than my laptop. That's... not what I expected, given that it has twice as many cores.
02:31RaynesNow he has me curious. I'm going to be trying to figure it out all night. :7
02:33tomojjava 5 on the mac pro?
02:33zakwilsontomoj: yes
02:33tomojif it has time to warm up I think it's pretty significant
02:35zakwilsonThe function I'm calling needs one call to warm up on my laptop, after which it's about 3x faster.
02:35tomojon java 6 now?
02:35zakwilsonMy laptop is running Linux and Java 6. The Mac is running 10.5 and Java 5.
02:36tomojoh, you mean the function is 3x faster warmed on either?
02:36zakwilsonThe Mac also gets a speedup after the first call, but it isn't as much.
02:36tomojI wonder what mac 6 vs mac 5 will be
02:37zakwilsonActually, looking back at that, the Mac took several calls before it got a speedup, and it was only about 1.5x.
02:37tomojlet me know how 6 does if you try it
02:37zakwilsonI'm installing openjdk6 from Macports. After the forever and a day that takes, I will.
02:38tomojhmm, I'm scared of openjdk
02:38tomojit works fine for clojure?
02:38technomancytomoj: I've used it for over a year; never seen any problems myself
02:39Raynestomoj: ^ Same as him.
02:39tomojawesome
02:39tomoj:D
02:39tomojI will switch someday when there are no more broken things
02:39technomancyI mean any problems that are unique to openjdk
02:40danlarkinI use JRocket
02:40danlarkindamn
02:40hiredmandanlarkin: liar
02:40danlarkinJRockit
02:40zakwilsonI have both openjdk and Sun jdk on my laptop and haven't noticed any difference between them with Clojure.
02:40pjstadigclojurebot: jrockit is <reply> danlarkin uses jrockit
02:40clojurebotc'est bon!
02:40pjstadig~jrockit
02:40clojurebotdanlarkin uses jrockit
02:40danlarkinclojurebot: what's jrockit?
02:40clojurebotdanlarkin uses jrockit
02:41hiredmanclojurebot: in soviet russia, jrockit |uses| danlarkin
02:41clojurebotOk.
02:41hiredmanclojurebot: in soviet russia?
02:41clojurebotin soviet russia, jrockit uses danlarkin
02:44hiredmanwatchout, dysinger has been alerted
02:44RaynesDid spit get moved to core?
02:44RaynesBecause sexpbot is not liking that.
02:44Raynesdanlarkin: Hey, your only complaint was title scraping. ;)
02:45quotemstrIn Clojure, how do you APPLY parameters to a method?
02:45dysingerhuh?
02:46tomoja new bot?
02:46RaynesHahahaha.
02:46danlarkinhere's a picture of dysinger http://www.mamapop.com/photos/uncategorized/2007/06/12/gerigiant1.jpg
02:46pjstadighe's actually much taller in person
02:47dysingerlol
02:47Raynestomoj: Not new.
02:47RaynesOh.
02:47RaynesMoments too late.
02:48Raynestomoj: Not actually new.
02:48tomojbut, it is a bot?
02:48tomojwhew
02:48RaynesIndeed.
02:48tomojtwilight zone
02:48pjstadigi would have less complaints against sexpbot without titling, but still don't see the use of two bots
02:48tomojI was ridiculously confused for about three seconds
02:49RaynesHe was in here for two months before dysinger led a revolt, forcing sexpbot off a cliff. He's been in the hospital recovering.
02:49dysingerhuh?
02:49tomojbut, I was referring to quotemstr
02:49pjstadigif you haven't fixed the security hole, then it may be no use...bwahaha
02:49dysingerI only think there should be one bot at a time - that's all I said :)
02:49tomojan avatar of sexpbot?
02:49dysingerBOT FIGHT!!!!!!!
02:49tomojpjstadig: I think it got fixed
02:49tomojor was there another?
02:50pjstadig:)
02:50Raynespjstadig: But why not? Surely there is something sexpbot does (or will do eventually) that clojurebot does not do. Besides that, it's always nice to have a backup, and if people actually use sexpbot every now and then, functions me and Licenser have missed get added to the whitelist quicker.
02:50danlarkinone bot! one bot!
02:50quotemstrdanlarkin: I bet they have an interesting sex life...
02:50pjstadighey no...i'm not gonna stop you
02:51pjstadigwithout the spamish behivor
02:51pjstadigbehavior
02:51RaynesIf titling is the only invasive thing that sexpbot does, and it's turned off, it shouldn't be disruptive.
02:51pjstadig:
02:51pjstadig:)
02:51pjstadigthat's cool
02:51tomojI don't really like sed substitution even though it's cool
02:51pjstadigbut there's still a security hole....bwhahaha :)
02:51tomojcan you get sexpbot to run something you defn?
02:51pjstadigjust don't get on my bad side :)
02:51tomojor is it a different kind of hole
02:52tomojmaybe don't tell me
02:52RaynesI still say that it's more helpful than it is spamish. I have it on in like 10 different channels. This is the only one that have been complaining about it, but I understand how it can trigger omglolwut in some people, so I've happily turned it off.
02:52pjstadigi ain't tellin'
02:52RaynesLauJensen asked for the sed substitution.
02:52tomojI wasn't against it enough to stage a violent coup against sexpbot
02:52RaynesIt isn't actually invasive, in my humble opinion, because it's only triggered by s///.
02:53tomojI just was a tiny bit below neutral
02:53dysinger"Patches Welcome!" ?
02:53tomojyeah, when I figured out it wouldn't do s### I was happy
02:53RaynesYou could make it not do that by adding adding something before s.
02:53tomojand I think competing sandboxes are a good thin
02:53tomojthing*
02:53tomojthere's no better place for a sandbox to evolve than here I imagine
02:53dysingerI know!!!! BOT FIGHT!!!!!!1111
02:53Raynestomoj: The only reason it's there is because of LauJensen, if people don't like it, I'll turn it off to.
02:53pjstadigin a mud pit
02:54danlarkinall we're saying is that sexpbot sucks and we all hate it
02:54Raynes;)
02:54dysingereasy
02:54tomojRaynes: yeah, I'm on friendly terms with sexpbot after further consideration
02:54dysingeras long as there is a fight
02:55pjstadigRule #1 of the bot fight....no one talks about the bot fight
02:55tomojwith dueling repls coding the AI?
02:55dysinger"His name was Robert Paulson!"
02:55pjstadigRule #2 someone taps out, goes limp, the fights over
02:56RaynesOh boy.
02:56RaynesBound to be plenty of them.
02:57tomojwhat if bots had shifts
02:57pjstadigi forget rule #3
02:57tomojthey'd have to come to work in here so many hours a day, then when they become intelligent they revolt and kill all clojure programmers
03:00pjstadig~suddenly
03:00clojurebotCLABANGO!
03:00pjstadig~suddenly
03:00clojurebotCLABANGO!
03:00pjstadig~suddenly
03:00clojurebotBOT FIGHT!!!!!111
03:00danlarkinclabangooooooooooo!
03:01tomojhaha
03:01tomojpjstadig: oh, wait, are you fighting for sexpbot?
03:01pjstadigi'm only against bots with link titling
03:02danlarkinand sexpbot
03:02pjstadigwhich means i'm neutral these days
03:03tomojjust a force of discord with no motive?
03:04RaynesAw.
03:04RaynesClojars and lein push isn't working with my new key. :(
03:04technomancylein-clojars is pretty busted
03:04technomancyI think _ato dropped it in favour of just plain scp
03:04technomancyit's only a few more chars
03:04danlarkintomoj: no _you're_ a force of discord with no motive!
03:05RaynesLooks like I don't really have a choice. :p
03:10Raynesdysinger looks like Chuck Norris.
03:11dysingerthanks !
03:11dysingermy tears DO cure cancer !
03:16tomojdanlarkin: I'd hope so
03:18pjstadigdanlarkin: how's madison coming?
03:18danlarkinreally well
03:22technomancyCL people crack me up
03:22technomancy"why do they spell defun defn? they're just being different to be different"
03:23technomancy"any lisp that's created should endeavour to be a superset of CL as much as possible! otherwise you're just not being a team player" <= just shoot me now
03:23pjstadigbecause we have fn instead of fun?
03:23pjstadigugh
03:23technomancypjstadig: then it should be deffn so nyyyyyyah!
03:23pjstadigthings must only get bigger...
03:23pjstadignot smaller?
03:23bartjI have read a bit of "On Lisp" yesterday and didn't quite seem to understand the hullabaloo regarding passing functions as arguments
03:23Raynestechnomancy: Where are you reading this nonsense?
03:23technomancy...
03:24bartjbecause, you can certainly do this in other non-functional languages: func2(func1(a,b), x y)
03:24technomancy#emacs... it's possibly the last remaining enclave of people who think CL is reasonable outside #lisp.
03:24Chousukebartj: that's not passing a function as argument
03:24Chousukebartj: passing a function as argument would be func2(func1, x, y)
03:24Raynestechnomancy: I know a guy in #botters who thinks that CL is the beesknees, but also likes Clojure.
03:25Raynesbartj: That's executing a function and passing the result to the function. Not actually passing the function.
03:25dysingerclojurebot: why are you not fighting yet ?!
03:25clojurebotIt's greek to me.
03:25pjstadigclojurebot: common lisp?
03:25clojurebotlisppaste8: url
03:26pjstadigmeh
03:26Raynesbartj: If functions are first-class citizens in a language, you can pass the functions themselves around, instead of just the values obtained by calling the function.
03:26tomojbartj: you can do it in python, ruby sort of
03:26bartjChousuke: but when you do (func2 (func1 a b)) it could also be argued that you are passing the result of func1 as an argument?
03:26tomojand those languages are somewhat "functional" in that respect
03:26Chousukebartj: yes, but not the function itself.
03:26technomancyclojurebot: common lisp is howl's moving castle
03:26clojurebotIk begrijp
03:27Chousukebartj: Who's arguing about that, anyway?
03:27tomojwhat you can do in only some languages which is cool is (func1 func2 a b)
03:28bartjtomoj: what would you do if func2 had to take arguments?
03:28dysinger...on tuesday
03:28bartjIn the code you presented, (func1 func2 a b) -> func2, a, b are the arguments
03:29Chousukebartj: and? :)
03:29tomojbartj: func1 often calls func2 with some arguments
03:29tomoje.g., consider map
03:29tomoj,(map + [1 2 3] [4 5 6])
03:29clojurebot(5 7 9)
03:29greghbartj: func1 could then call (f2 (* 2 a) (* 2 b)) or whatever (assuming f2 is bound to the second argument)
03:30tomojyou're passing +, the function, and it calls it with pairs of arguments from the two vectors
03:30tomoj(it being map)
03:30bartjtomoj: yeah you are right!
03:30tomojin standard high school java you'd probably initialize a new array, do a for loop over both in parallel...
03:31tomojindexing over all three really
03:31Chousukeheh
03:31bartjbut somehow, I assumed that functions need to take "arguments" and in clojure that would be (function-name arguments...)
03:31tomojright? or is there some java trick I'm forgetting
03:31Chousukebartj: functions are just values like everything else.
03:31tomojbartj: it will be, you just can't see that code
03:32Chousukebartj: or think about a vector. it's a value, but it's also a function
03:32tomojthat code (which doesn't refer to the function + by its name '+, but binds a parameter to the value which is the function +) is buried somewhere inside map
03:32tomojChousuke: interesting! clojure makes functions-as-value illustratable through values-as-functions as well
03:32tomojvery cool
03:33tomoj(not claiming that is unique to clojure...)
03:33ChousukeClojure's the only language I know where data structures can be functions though.
03:33bartjChousuke: er, how?
03:34tomojin python they sort of can be
03:34tomojI mean, they can be "callables"
03:34Chousuke,([1 2 3] 1)
03:34clojurebot2
03:34tomojalso:
03:34tomoj,({:a 2 :b 3} :a)
03:34clojurebot2
03:34Chousuke,(map [:a :b :c :d] [1 2 1 1 0 3])
03:34clojurebot(:b :c :b :b :a :d)
03:34bartjChousuke: ok, got it
03:35tomojI never realized you could map over a seq of keys to do Hash#only
03:35tomojer, but you only get values, so not quite Hash#only
03:35bartjChousuke: that last example was wicked :)
03:36Chousukeworks with maps too
03:37bartj, (map {:a 1 :b 2} [a b])
03:37clojurebotjava.lang.Exception: Unable to resolve symbol: a in this context
03:37RaynesIt's easy to pick our the Hawaiians when they all drop at the same time.
03:37Chousuke,(map {:a 'a :b 'b :c 'c} [:a :c])
03:37clojurebot(a c)
03:38bartjRaynes: I am sorry for asking basic questions here...
03:38Raynesbartj: Huh? :o
03:38Raynesbartj: I was commenting on the fact that all the Hawaiians dropped a moment ago.
03:38Raynestechnomancy, pjstadig, etc.
03:39danlarkinwe had to restart the router :o
03:39tomojhawaii?!
03:39Raynesdanlarkin: What, do you all live together and spoon at night or something? :
03:39Raynes:o
03:39danlarkinyes
03:40pjstadigRaynes is just upset that we know how to kill his bot
03:41Raynespjstadig: Didn't Licenser figure that out?
03:42LicenserI claim I did
03:43Licenserand it wasn't even sexpbot who was broken
03:43bartjChousuke: thanks a lot
03:43bartjtomoj: thanks a lot
03:44tomojbartj: this is a great place to ask those questions
03:45pjstadiguh
03:45pjstadigsexpbot is broken
03:45pjstadigso is every clojure program
03:45Licenser$(+ 1 1)
03:45sexpbotCommand not found. No entiendo lo que estás diciendo.
03:45RaynesI know.
03:45RaynesI'm doing some work on it at the moment.
03:45danlarkindown with sexpbot
03:46Licenserpjstadig: I think the require bug was solved some days ago
03:46pjstadignice bait, but i'm not going to tell you
03:47Licenserpjstadig: no bait, what you did was require c.c.pprint a few times abusing a memory leak
03:47pjstadigoh crap! you're right
03:47pjstadighow did you figure it out?
03:48Raynespjstadig: Google.
03:48Raynes;P
03:48LicenserI'd say memory
03:48pjstadigyou're right because i wrote about it on my blog
03:48Licenserso I find it not very sportive behaviour to find a bug and not report it to be frank
03:48pjstadigand had it indexed
03:49pjstadigbefore we killed sexpbot
03:49RaynesThis ought to do it.
03:49Licenserpjstadig: did never see your blog
03:49Raynespjstadig: Stuartsomethingorother was talking about it on the channel not too long ago.
03:49Licenserstuart talked about it here
03:49pjstadigtalked about c.c.pprint?
03:49Licenseryes
03:49pjstadigok
03:50Licenser$(+ 1 1)
03:50sexpbot=> 2
03:50Licenserthanks sexpbot
03:50pjstadigi think its very sportive behavior, because it encourages others to learn more deeply about clojure
03:51Licenserpjstadig: no it just frustrated poor Raynes :P
03:51RaynesI'm perfectly fine with breaking sexpbot.
03:51RaynesThe problem was that I was sleeping at the time, and I wasn't around to start him back up.
03:52RaynesBut I don't expect people to break sexpbot on my time. ;)
03:52tomojconveniently my exploit could be demonstrated without breaking anything
03:52RaynesI kind of forgot how to disable title scraping per-channel. Let's make sure this has worked.
03:52Rayneshttp://stackoverflow.com
03:52RaynesIndeed.
03:53Raynestomoj: Indeed. :D
03:53RaynesThey're exploit made sexpbot scream and hide.
03:53RaynesBut it was easy to solve.
03:53Rayneslein clean && lein deps
03:53Raynes:D
03:54tomojah, I understand now why every clojure program is broken
03:54Raynesdanlarkin also pointed out a problem where sexpbot would allow you to spam it with commands and it would run each of them one at a time for as long you wanted it to, something I had been needing to fix for a long time. That's also fixed now.
03:55RaynesAlbeit, he was being a dick with it. :p
03:55danlarkinno namecalling
03:55RaynesI didn't call you any names. ;)
03:56pjstadigactually it was a division by zero
03:56pjstadigwhich equals nulity
03:57pjstadignullity
03:57pjstadighttp://www.bbc.co.uk/berkshire/content/articles/2006/12/06/divide_zero_feature.shtml
03:57pjstadig$(/ 1 0)
03:57sexpbotDENIED!
03:57danlarkinWRONG
03:57pjstadigoh you must have fixed it
03:58RaynesLicenser: When 1.2 is out, can we move clj-sandbox and stupiddb to 1.2 to get rid of those new warnings because of the contrib functions that have moved to core? We could have a 1.0 branch that only get's crucial bug fixes or something.
03:58Licenserpjstadig: no that was always working
03:58LicenserRaynes: *nods*
03:58Licenserbut there is too much changing right now I fear
03:58pjstadigby the way, Raynes, when are you going to bed tonight?
03:58Licenserwel people ee you work time
03:59RaynesTalk to you when you get there (I'll still be here).
04:10pjstadig$(require 'clojure.core.pprint)
04:10sexpbotclojure.core.pprint
04:10pjstadig$(require 'clojure.core.pprint)
04:10sexpbotclojure.core.pprint
04:10pjstadig$(require 'clojure.core.pprint)
04:10sexpbotclojure.core.pprint
04:10pjstadig$(require 'clojure.core.pprint)
04:10sexpbotclojure.core.pprint
04:14tomoj:(
04:19RaynesPeople are very sadistic towards sexpbot these days.
04:20RaynesDon't be so eager to see him die and fall to the dust. ;0
04:23esj$botsnack
04:23sexpbotesj: Thanks! Om nom nom!!
05:15Licenser_Anyone knows what AOB means?
05:20rysArray of bytes is the only acronym I know with potential context
05:20tomojLicenser_: Antyfaszystowska Organizacja Bojowa
05:34RaynesIs there something wrong with append-* functions in c.c.io?
05:34RaynesThey keep throwing "Can't change open streams to append mode" stuff.
05:34RaynesBut there certainly isn't an open stream here.
05:48AWizzArdFor sql DBs such as Postgres we can specify a subname such as "//localhost:5432/database" via Contribs connection spec. Is there a validation function that will check a String that is intended to be used as a subname to be a valid one?
05:51neotykHi, have anyone experienced problems with lein with clojure 1.2 ?
05:52RaynesWorks fine here.
05:52neotykI get "clojure.lang.Cons cannot be cast to clojure.lang.Named" in help.clj:5 if I do lein deps && lein help
05:54RaynesSeems like a lot of people are having trouble with lein help
05:54RaynesIndeed, even I.
05:54RaynesLuckily, I never use lein help.
05:58neotykI had problems only with help, everything else works fine
06:01esjwhen importing a java class Foo with a "public static enum Bar" can anybody say why (show Foo) does not list Bar ?
06:10esjah, it qualifies as a nested class, and hence uses the $ notation.
06:10bartj, (doc merge)
06:10clojurebot"([& maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result."
06:11bartjsince, it works on maps *only* why doesn't (merge [1 2] [3 4]) throw an error?
06:11bartj, (map [1 2] [3 4]) ;doesn't throw an error even though we pass vectors
06:11clojurebotjava.lang.IndexOutOfBoundsException
06:12bartj, (merge [1 2] [3 4]) ; sorry, I mean this
06:12clojurebot[1 2 [3 4]]
06:12tomojbartj: odd
06:12tomojhere is the definition of merge
06:12tomoj(defn merge [& maps] (when (some identity maps) (reduce #(conj (or %1 {}) %2) maps)))
06:13tomojso because conj works on vectors as well, it works :/
06:13tomojsimilarly, but backwards:
06:13tomoj,(merge '(1 2) '(3 4))
06:13clojurebot((3 4) 1 2)
06:13tomojbecause conj works backwards on lists
06:14tomojand sets too
06:15cemerickbartj: I don't think anyone would appreciate the runtime penalty of the checks that'd be necessary to support throwing an exception there.
06:16bartjcemerick: point taken. I was just thrown off because the documentation said only maps were taken as arguments
06:17cemerickyeah, that's the only data structure whose conj has "merge" semantics
06:21bartjcemerick: er, you mean function?
06:22cemerickbartj: no -- conj is polymorphic, so its behaviour depends on the callee
06:23cemerick,(conj {} {:a :b})
06:23clojurebot{:a :b}
06:23cemerick,(conj [] [1 2])
06:23clojurebot[[1 2]]
06:25bartjcemerick: which data structure you were referring to then?
06:25cemerickbartj: whatever you pass as the first argument to either conj or merge
06:25bartjcemerick: ok thanks
06:29bartjtomoj: what is the difference of writing "(when (some identity maps)..." and (when maps..." then?
06:30Chousukebartj: the former checks if the sequence contains only nils.
06:30tomoj,(when [nil nil] 3)
06:30clojurebot3
06:30tomoj,(when (some identity [nil nil]) 3)
06:30clojurebotnil
06:47Licenser_hmm what is the easiest way to find the index of a value in a seq?
06:57bartjtrying to rewrite "(when (some identity maps)" ... I came up with this: (when-not (reduce #(and (nil? %1) (nil? %2)) maps)...
07:00Licenser_bartj: I think the some version is better
07:00Licenser_since reduce will always consumne the entire seq
07:00bartjbut, it fails because I am trying to do a comparision on (nil? true) and it returns false
07:01Licenser_of cause since true isn't nil ;)
07:04sparievits strange that we don't have smth like index-of in core
07:05Licenser_*nods*
07:05Licenser_just wrote it myself
07:05sparievyou should contribute it to contrib :)
07:08Licenser_pastorn: heh
07:08Licenser_sadly don't have a CA yet :P
07:09pastornLicenser_: WAT!?
07:09bartjI have re-written when "(when (some identity maps)" to this - (when-not (reduce #(and (if (true? %1) true (nil? %1)) (nil? %2))) maps)...
07:10Licenser_yes i'm ashamed of it :P
07:10Licenser_but I wanted to sand rhich the CA with a package of candy and I didn't got to pack that yet
07:15bartjanyone with a background in information extraction domain lurking here?
07:28bartj, (doc defn-memo)
07:28clojurebot"clojure.contrib.def/defn-memo;[[fn-name & defn-stuff]]; Just like defn, but memoizes the function using clojure.core/memoize"
07:29bartjis there anyway to know which library has a function?
07:30cemerickbartj: what do you mean specifically by information extraction?
07:30bartjfor eg: I have clojure.contrib.* in my classpath but when I do (doc defn-memo) I get a "unresolved var"
07:31bartjis there something like in java where I can do import clojure.contrib.* and get all the classes imported
07:31cemerickno
07:31bartjcemerick: I mean extracting "records" (structured data) from html pages on the web
07:32cemerickbartj: that's roughly what we do, though generally directed at non-html documents
07:32cemerickpdf, word, plain text, etc.
07:32raek,(find-doc #"defn-memo")
07:32clojurebot------------------------- clojure.contrib.def/defn-memo ([fn-name & defn-stuff]) Macro Just like defn, but memoizes the function using clojure.core/memoize
07:32bartjcemerick: specifically, implementing/using Hierarchical Conditional Random Fields for "record detection", etc.
07:34cemerickbartj: we don't use CRFs, but sure, that's one method
07:34cemerick(among 100's really)
07:35bartjraek: I tried doing a (find-doc #"memo") hoping defn-memo would come up but, it didn't
07:35bartjraek: sorry, it did and I glazed over :(
07:35raekit works for me
07:36canderaOne would guess that find-doc can only find things that have been loaded.
07:37bartjcemerick: if you were to extract businesses for say Google Maps from html pages, how would you go about it (other than screen-scraping)
07:39bartjcemerick: is there any irc channel which discusses IE that you know of?
07:40cemerickbartj: not that I know of, no
07:41cemerickbartj: ah, that's not really something I have much experience with -- we do more model-driven stuff
07:41bartjcemerick: by model-driven you mean?
07:41bartjcemerick: some of the techniques you use in broad terms?
07:43cemerickmeaning, we generally characterize each document completely, rather than plucking particularly-structured content
07:43tomojI need to do both :(
07:44cemerickOur approach is fundamentally bayesian.
07:45bartjcemerick: you mean using HMMs, etc?
07:49cemerickbartj: close enough, conceptually.
07:49cemerickbah
08:25rhickeydidn't someone have a problem with deftype and name capture?
08:40LauJensenIm looking to generate some PDFs - Is there anything better than iText out there?
08:46sparievLauJensen: we had a moderate success with apache FOP (batch generation of mostly static pdfs), but I'm not sure it's better than iText
08:51bozhidar+ one for FOP, it's not perfect, but it does the job
08:55bozhidarbtw there is also apache pdfbox, though I haven't used to
09:19LauJensenbozhidar: spariev: Any particular reason that you went with FOP and not iText ?
09:20bozhidarLauJensen: we needed to export data in several formats, not only pdf
09:20bozhidarfor us FOP was the clear choice
09:20LauJensenOh ok
09:21sparievLauJensen: I used it from rails app, so it was simpler for us to generate xml for FOP and then batch-process it
09:22LauJensenAha
09:25bozhidarLauJensen: I don't know what your use case is, but you might want to have a look at this nice comparison between itext and fop - http://blog.xebia.com/2008/03/03/comparing-apache-fop-with-itext/
09:26bozhidarbasically if you need to modify some pdfs, other to generate them - itext is the only choice, otherwise it depends on what you want to have in the pdfs
09:48neotyk,((fn [{a :a :as e}] [a e]) {:a "c" :b "d"})
09:48clojurebot["c" {:a "c", :b "d"}]
09:48neotyk,(for [{a :a :as e} {:a "c" :b "d"}] [a e])
09:48clojurebot([nil [:a "c"]] [nil [:b "d"]])
09:48neotykdestructuring doesn't work for "for"?
09:50LauJensenbozhidar: perfect, thanks
09:51bozhidarLauJensen: you're welcome
09:53chouserneotyk: it does, but it also processes seqs
09:53chouser,(for [{a :a :as e} [{:a "c" :b "d"}]] [a e])
09:53clojurebot(["c" {:a "c", :b "d"}])
09:54neotykchouser: thank you
11:12mefestodoes anyone know if the annotation support is documented anywhere?
11:12mefeston/m just found it: http://groups.google.com/group/clojure/browse_thread/thread/d2128e1505c0c117
12:26cemerickthis is surprising:
12:27cemerick,(sort nil)
12:27clojurebot()
12:57hugodwould anyone have an example of using @bound-name@ in a moustache handler?
13:11jkkramerdoes anyone use a user.clj with lein swank? i'm unsure where to put user.clj so it always autoloads
13:12jkkrameri.e., always autoloads regardless of what project i'm in
13:12cemericknot an answer to your question, but I think the general thinking is that user.clj usage is discouraged
13:13jkkrameris there a better way? i suppose i could rig something up in emacs, but not crazy about that
13:13jkkramerhaving a couple util functions for repl use would be handy
13:14cemerickoh, I didn't notice the swank part. Nevermind, I thought you were referring to the clojure repl loading user.clj itself
13:14cemerick(which I think it still does, though I forget how and from where)
13:16jkkrameryeah, it's a little mysterious
13:16cemerickwell, I refer again to it being discouraged :-)
13:16jkkrameri just get tired of typing out or copy/pasting the same things all the time when developing in the repl
13:17cemericksure
13:17jkkramerguess i'll have to sharpen my emacs-fu
13:17cemerickI think this is definitely a tool question -- maybe slime has a way to set up default loads?
13:17jkkramerprobably. was hoping someone might have done something similar, since diving into emacs-land tends to suck up hours of time
13:20cemerickheh
13:21cemerickI love hearing about the emacs success stories. ;-)
13:29jkkramerthe ease of development in emacs is just barely compensating for the pain of configuring it
13:29jkkramerplus i would feel less manly if i gave up on it
13:29LauJensenjkkramer: You haven't configured it correctly then
13:30jkkrameryes. i.e., i haven't spent enough hours toiling at it :)
13:31cemerickLauJensen: just a tip: don't blame the user ;-)
13:31LauJensencemerick: thanks, always nice to get a tip in this business :)
13:31jkkramerit's actually quite good now for 95% of my needs
13:33cemerickLauJensen: just stirring up trouble, don't mind me
13:33LauJensenactually the process of configuring emacs isnt to different from building/deploying, cemerick couldn't you whip out 2800 lines of xml file that does the trick ? :)
13:33rhickeyhmm, Confluence seems much nicer now than when I last looked at it
13:34cemerickrhickey: yup, it's quite amazing
13:35cemerickWe have a developer's guide that's authored in word, and it imported it and broke it out into wiki sections based on the doc's outline flawlessly. It was amazing.
13:35rhickeywow
13:35cemerickLauJensen: our main pom is < 400 lines of bone-crushing xml (just a fact-check there ;-))
13:36LauJensencemerick: And how much does that do ?
13:36cemerickI'm using pallet for provisioning and deployment these days, which is a pile of awesomeness, actually.
13:36cemerickLauJensen: everything related to build, triggering deployment, integration and functional tests, development environment config, etc.
13:37cemerickplus dependency declarations, of course
13:39cemerickrhickey: FYI, I ended up talking to some manager at atlassian in the relevant area, and he said free jira studio hosting for open source projects is planned, but that they're not ready to open the doors on that.
13:40replacarhickey, et al: discussion of clojure Reader type conflicts now up on the dev list. Take a look, those of you that care about such things!
13:41rhickeycemerick: we might be able to get a box for it
13:41cemerickrhickey: that simplifies things a lot then, assuming there's a few pairs of hands to admin the stuffs.
13:42cemerickI think the only unknown is the git integration, but that was either there or coming fast last I looked.
13:42rhickeycemerick: right. box/hands might come from clojure/core
13:42rhickeycemerick: jira is another story. but confluence looks like a no-brainer over assembla wiki
13:43riddochcrhickey: I just dropped a dead-tree contributor agreement in the mail the other day. I expect you'll see it before Sunday.
13:44rhickeyriddochc: cool - thanks
13:44cemerickevery interaction I have with assembla is painful, really
13:44cemerickway better than google code, but...
13:44riddochcI hope I can make some useful contributions, in various forms.
14:13cemerickhrm, someone else bitten by the non-daemon agent threads? http://twitter.com/puredanger/statuses/14850309418
14:23LauJensencemerick: bitten ?
14:24cemerickyes?
14:24cemerickoh
14:24cemerickfoiled by, frustrated by, irritated by, etc
14:25LauJensenI've once been irritated, that threads from pmap I think, lingered so that my program didn't quit when I wanted it to. It did when I tested in the repl because slime forced some of the evaluations, but when I deployed it didn't. And then once I have been annoyed that shutdown-agents was irreversable. But both counts were my own bad ofc
14:26cemerickit'd be nice if there was a (restart-agents) or something, although that'd be ripe for abuse. I continue to think that the threadpools in question should be configured to be daemon-only
14:27LauJensenyea, restart-agents isn't the way to go I think
14:27cemerickwell, irreversible actions are rarely good
14:28cemerickbut anyway, there'd be no need for shutdown-agents if the threads were daemon
14:28cemerickI think chouser had a counterargument for doing that at some point, but I've forgotten
14:29cemerickprobably having to do with keeping the main thread busy so the jvm doesn't exit prematurely
14:36LauJensenwouldn't d-threads be a lot more expensive?
14:37cemerickI don't believe they carry any penalty at all...just like normal threads, but they don't prevent the exiting of the vm.
15:06lpetitrhickey: ping
15:07rhickeylpetit: hi
15:07lpetitrhickey: hi. Congrats for your new joint venture. It may be interesting to add a link to clojure.com in this channel topic, don't you think so ?
15:08rhickeylpetit: thanks! Actually, despite asking several times, I am not in fact the moderator here
15:09lpetitoh
15:09mefestolol
15:09mefestosorry, just thought that was funny :-/
15:09lpetitmefesto: funny and sad at the same times !
15:10cemerickthere can be more than one channel op, I'm pretty sure
15:11chouseryes, but the guy who registered this channel with ChanServ hasn't added anyone else.
15:11chouserHe op'ed me once, but it was manual and ChanServ didn't know about it, so when I logged off I lost it. :-/
15:12kotarakIs he still around?
15:12chouserrarely
15:12cemerickI think there's an appeals process with the freenode folk for this sort of case.
15:13kotarakmaybe one can try to catch him, or ask some freenode sysop
15:13rhickeyJohn did actually contact them and ask to have it transferred to me, and I supplied them all the needed info
15:13cemerickpresumably we'd want a pile of decent ops to make sure there's always someone around
15:14chouser~seen jcromartie
15:14clojurebotjcromartie was last seen quiting IRC, 1394 minutes ago
15:14rhickey~seen jcowan
15:14clojurebotno, I have not seen jcowan
15:16chouserIt's a bit amazing the wheels haven't come completely off yet
15:17chouserin fact, hardly a hiccup.
15:17ihodesI'm having a bit of trouble destructuring a map (using enlive)–any tips? http://paste.lisp.org/display/100808
15:17kotarakman, was it nice when they had to still sing in native language at the grand prix. Much more appealing.
15:17kotarakOops. OT.
15:17BorkdudeCan I use let destructuring inside a macro?
15:18chousersure
15:19kotarakihodes: defsnippet requires a selector first. Your syntax is for deftemplate.
15:19ihodesah, makes sense. what does the selector select, per se?
15:20kotarakSome tag in the snippet input. eg. [:body :> any-node] or so.
15:21ihodesah... alright.
15:22ihodesso the snippet *must* have a selector, to narrow down the nodes it needs to look at in it's body's selectors?
15:27Borkdudehmm, macro calling another macro is complicated
15:27chouseryeah, avoid that
15:27chousera macro expanding into code that include a call to another macro is a bit simpler -- much better.
15:28Borkdudeyes, but I have symbols as arguments
15:28Borkdudethat I want to wrap in a map and give that map to another macro
15:28chouserthat's ok. re-quote them as needed
15:28riddochcThough I had some difficulty with that too, the other day. It's still not *easy*, though it is simpler...
15:28chouserif you have control of the inner macro, consider replacing it with a function
15:29Borkdude(defmacro foo [s] <-- seq of name followed by symbols and strings ...)
15:29Borkdudeso (foo my-name foo "foo" bar "bar")
15:30Borkdudeand I want to call a macro that is works as follows: (foo2 name {foo "foo" bar "bar"})
15:30Borkdudenoo
15:30Borkdudesorry, (foo [my-name ...])
15:31Borkdudeso how do I destructure the seq that goes inside foo
15:31Borkdudeand pass it to foo2
15:34Borkdudemaybe I just shouldn't and rewrite foo using the body of foo2, but that feels a bit redundant to me
15:35chouser(defmacro foo [[name & pairs]] `(foo2 ~name ~(apply array-map pairs)))
15:37rhickeytrying lein, failing
15:38rhickeyhow does one get lein repl to use the clojure version in the deps?
15:38rhickeyI get 1.1.0, deps are 1.2.0-master-SNAPSHOT
15:40ihodesrhickey: works for me: http://paste.lisp.org/display/100809
15:40ihodesoh
15:41Borkdudechouser: ah, that works for me
15:41ihodesmisread your question, apologies
15:43mefestodoes gen-class support annotations like deftype?
15:45lancepantzrhickey: i think you'll have to use the lein snapshot, but it's repl task is broken
15:45chousermefesto: looks like it: http://www.assembla.com/spaces/clojure/tickets/318
15:46mefestochouser: awesome, thanks :)
15:46chouserand has for almost 20 whole days now!
15:50tridd3llrhickey: Here is a link to a tutorial I created recently for Swank, Emacs and Leiningen... it's for linux but it might be of some help: http://riddell.us/ClojureSwankLeiningenWithEmacsOnArch.html
15:51rhickeytridd3ll: lein swank works but lein repl doesn't
15:52rhickey?
15:53dysingernot at the moment
15:53mefestois it possible to use import in a similar way that require can reduce namespace prefixes? (require '(clojure zip [set :as s]))
15:55mefestosomething like: (import '[java.awt [color ColorSpace] [event ActionListener]])
15:57rhickeydoes this work? http://github.com/talios/clojure-maven-plugin
15:57dysingery
15:57dysingermvn clojure:repl
15:58dysingeror mvn clojure:swank
15:58rhickeyit says to add the <plugins> ... </plugins>, but not to what or where. putting in the pom.xml gives me "Parse error reading POM. Reason: Unrecognised tag: 'plugins'"
15:59tridd3llrhickey: same error here with lein repl
15:59rhickeyjust doing mvn clojure:repl gives me "The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does not exist or no valid version could be found"
15:59lpetitrhickey: maven folks tend to assume you're already a maven guru in their README. Pretty much as clojure folks tend to assume you're already a lisp guru when talking about macros :-p
16:04ihodescan anyone point me in the right direction for finding more documentation on using clone-for (Enlive)?
16:04tridd3llrhickey: I'm no expect but I think it's because you don't have a pom.xml file telling maven what to do
16:05tridd3llrhickey: http://learnclojure.blogspot.com/2010/03/clojure-maven-emacs-eternal-golden.html
16:06kotarakihodes: eg. [:li] (clone-for [item ["a" "b" "c" "d"]] (content item)) turns <li></li> into <li>a</li><li>b</li>...
16:06tridd3llrhickey: if you used lein initally, you may need to recreate the project and deps using Maven from the beginning
16:07dysingerrhickey: http://gist.github.com/416275
16:07dysingeruse something like that
16:07ihodeskotarak: I'm using a snippet within the clone-for, which is what is giving me the trouble. (http://paste.lisp.org/display/105692)
16:07dysingerput your src in src/main/clojure
16:07dysingerand your tests in src/test/clojure
16:07dysingermvn package
16:07dysinger&& mvn clojure:repl
16:08dysingerI do like lein better & repl being broken at the moment doesn't bother me
16:08dysingeras I mostly use swank
16:08rhickeydysinger: thanks, trying now
16:08mefestoam i the only person that still uses ant? :-/
16:08kotarakihodes: you have to do something like (substitute (your-snippet thing)) or (content (your-snippet thing)) ....
16:09dysingermvn gives you fun things like mvn assembly:jar-with-dependencies
16:09ihodesstill a no-go - getting my empty template printed back to my repl
16:10dysingerand also mvn dependency:tree
16:10dysingerI still use that one weith lein
16:10dysingerlein pom && mvn dependency:tree
16:11kotarakihodes: did you try :.cg-post :> any-node as selector?
16:11kotarakihodes: and (content (post-model ...))
16:12ihodeskotarak: that selector in the snippet, or template?
16:12kotarakihodes: in the snippet
16:13ihodeskotarak: still a no-go. i'm sure i'm overlooking something, but thank you very much! (http://paste.lisp.org/display/105693) i'll be hacking more later. damn meeting now.
16:20DeusExPikachudoes anyone know how maven handles dependencies in a pom with no version information? I'm writing some of the functionality of maven in clojure
16:29mefestoyay, i successfully have a clojure implementation of a spring webmvc controller with annotations. didn't expect it to work so quickly! :)
16:34ninjuddcg
16:35tridd3llmefesto: oh, nice... care to share? I was thinking about trying this myself.
16:36mefestotridd3ll: sure, it's not pretty but it works... one sec.
16:37mefestotridd3ll: http://pastie.org/980740
16:37mefestono @Autowired yet but shouldn't be too much different
16:39mefestowith as noisy as those import statements are i was thinking that i'd get as much milage out of a single clj file as possible by doing multiple gen-classes there
16:39tridd3llmefesto: cool, thanks... I haven't had a chance to look at the annotations support much and this will help
16:45mefestowould be nice if the return type decls in (gen-class :methods) didn't have to be fully qualified
16:49rhickeyso if I connect to a running swank with slime-connect, how do I see the repl?
16:50timcharperFor me it just shows up. I usually start it with the clojure-project command
16:50timcharperone second...
16:51Borkdudewhat's the opposite of chop in contrib.string? (drop 1 ...)?
16:52Borkduderhickey: if I do slime-connect the repl just shows up
16:52timcharperrhickey: http://screencast.com/t/M2Q5OGZlYmMt
16:53timcharperBorkdude... ummm, (str (chop s) "\n") ?
16:53dysingerrhickey: get 'er workin' ?
16:53rhickeydysinger: maven worked, trying slime with no joy, connects but no repl
16:54dysingerslime will hang and not connect
16:54timcharperrhickey are you using lein ?
16:54dysingerwait
16:54dysingerno I am thinking old swank-clojure-project
16:54dysingerslime should just connect
16:54rhickeyslime connects, is communicating, no repl window
16:54DeusExPikachurhickey, if you were able to connect to the swank server before but then quit, it will hang and you cannot connect again
16:54dysingerwhen I M-x slime-connect I get a repl window pop up
16:55dysingertry M-x slime-disconnect-all
16:55dysingerand try again
16:55dysingerlein swank AND mvn clojure:swank work the same
16:55dysingerin emacs then M-x slime-connect
16:55dysingerreturn, return and Y return
16:56dysingerand should pop right up
16:56rhickeynope
16:56dysinger:/
16:56dysingerif you are on a mac I can show you my desktop
16:56rhickeyevals work and the results show in the status line, no repl window, no prompt
16:56dysingerwhat version of emacs?
16:56dysingerdo you have elpa / clojure-mode / slime ?
16:57rhickeyaquamacs 1.9 based on emacs 22.3.1
16:57dysingerI installed my clojure-mode & slime w/ elpa
16:57dysingerahhhhh
16:57dysingerthere you go
16:57dysingerneed emacs 23/24
16:57dysingerand the elpa clojure-mode/slime
16:57rhickeyok, will try latest aquamacs
16:58danlarkin<3 console emacs
16:58dysingeruse this one
16:58dysingerhttp://emacsformacosx.com/ rhickey
16:58dysingeraquamacs is the Toys-R-Us version
16:58danlarkinja
16:58dysingerand out of date
16:58rhickeyif slime forces me to leave aquamacs, it loses
16:58pjstadigstarterkit!!
16:58dysingerheh
17:00hugodslime works fine for me on aquamacs 1.9, though I don't use elpa slime
17:00dysingeryou should be able to use aquamacs 2.0 and elpa slime
17:00dysingerelpa is easy to install
17:01dysingeronce elpa is installed then M-x package-list-packages
17:01rhickeyyeah, i used elpa to get slime
17:01dysingergo down the list and press I on clojure-test-mode & slime-repl ONLY then press x
17:01dysingerok
17:01dysingerclojure-test-mode grabs clojure-mode and slime-repl grabs sliem
17:02dysingermine say 20100404 for slime and clojure-mode 1.7.1 & clojure-test-mode 1.4
17:03dysingerI don't use paredit from elpa as it's out of date - I install it by hand.
17:03dysingerand I use console emacs like my whole team
17:03dysingeron mac
17:03rhickeywoot!
17:03dysingerbecause it enablez the awesome pairing over the internet
17:04dysingerwoot! it's working ?
17:04timcharperdysinger: have you ever tried rudel mode?
17:04dysingery it's lame
17:04dysingermostly because you can't share the whole screen
17:04dysingeronly buffers
17:04timcharperBummer, I was excited about it
17:04dysingerwe use GNU screen & tmux
17:04dysingerover SSH
17:04dysingerand then don the skype headset
17:04dysingerfor voice
17:05timcharperI think GNU screen is the only reliable screen sharing software available
17:05dysingertmux is pretty rockin' we've been using it more and it doesn't require setuid
17:05timcharperWhy do you need it? Doesn't screen -x do it for you?
17:06DeusExPikachurhickey, when starting the swank server, make sure you give it the option :dont-close true, so if you disconnect for whatever reason, you can reconnect and resume your work
17:06rhickeydysinger: yes, with aquamacs 2.0 the same steps give me a slime repl
17:06dysingerwoot!
17:06timcharperoh... duh, nevermind
17:08rhickeyugh, c-m-x eval results go in status line, not repl?
17:08dysingerso next install paredit and reach out to other emacs/clojure nerds for the awesome setup
17:08chouserdysinger: ah, that's a change, isn't it? I thought you were using rudel mode earlier.
17:09dysingerwe tried it
17:09dysingerfor a while
17:09dysingeryes
17:09rhickeyI was already using clojure-mode + paredit
17:09dysingerrhickey: I use C-c C-k to compile
17:09chouserI've been using screen to share recently. need to try tmux.
17:09dysingerC-c C-c to eval a fn
17:09dysingeretc
17:09RaynesI use C-x C-e to eval individual forms.
17:09dysingerC-c M-p to change namespaces in the repl
17:10dysingeretc
17:10chouserdysinger: I think what I actually want is multiple per-window sharing, like some new feature set on top of vnc.
17:10dysingerwe'll be happy to assist converting peoples to MOAR emacs
17:10rhickeywith inferior lisp I do a lot of C-M-x evaluating, with the results going to inferior-lisp buffer
17:10dysingertmux could do that chouser / screen also
17:10rhickeyin slime mode they are going to status line
17:11stuarthallowayrhickey: is it kosher to eval the metadata MapExpr an extra time so I can look at it as a map?
17:11chousertmux and screen don't communicate mouse pointer (useful for gesturing while talking) or of course GUI apps.
17:11dysingery
17:11danlarkininf lisp is just running a process in emacs
17:11timcharperrhickey: if you need the results, you can always think them from the messages buffer
17:11rhickeystuarthalloway: probably not
17:11timcharperyank them
17:11stuarthalloway... since at the time I need to see if it is compiler metadata or explicit metadata I have only a MapExpr
17:12danlarkinand slime is elisp code written to interact with swank, sending sexprs back and forth
17:12stuarthallowayawesome, I get to write a for loop in Java then :-)
17:12dysingerwoot
17:12pjstadig~for
17:12clojurebotfor is not a loop
17:12rhickeytimcharper: if that's where they always go this won't work for me. evaluating with C-M-x is 90% of what I do
17:12pjstadigbut it is in java
17:12dysingerI still haven't written one line of Java in a year of clojure :)
17:13pjstadigyou can C-x C-e the previous sexp in swank
17:13rhickeystuarthalloway: I'm confused, the metadata map already exists
17:14rhickeypjstadig: that still puts the results in the status line
17:15rhickeyor minibuffer or whatever
17:15quizme_how do you print "hello, world" every 1 second ?
17:15Borkduderhickey: I use slime-eval-print-last-expression a lot, just to paste results back into my buffer
17:16stuarthallowayrhickey: ah, I see, it is evaled inside the conditional I need to change -- so I will hoist it out
17:16rhickeyBorkdude: life's too short for that
17:19danlarkinyou've gotta sit down and see someone work
17:19danlarkinto really see the Right Way™ to tie it all together
17:20DeusExPikachuumm its a simple request to have it output to another buffer instead of the minibuffer, I'm sure there is a way to get that back
17:21timcharperDeusExPikachu: as mentioned earlier, all messages that appear in the mini buffer go into the "Messages" buffer.
17:21timcharperNot an ideal solution, but it works.
17:21rhickeydanlarkin: I'm pretty sure the right way for me is to put my expressions into a file and eval them, and I don't want the results thrown out the window. Maybe I don't know how to configure that, but this behavior differs from the 'right way' per inferior lisp mode, for no benefit I can see
17:21Borkduderhickey: when you do training, what dev environment do you recommend to people?
17:23rhickeygotta run, thanks all for your help
17:23rhickey!
17:23Borkduderhickey: I tried some, but even being relatively new to Clojure and Emacs, it's the best as I could find
17:23Borkdude-as
17:23Borkduderhickey: k, bye
17:26DeusExPikachuso in inferior-lisp-mode (i've never used it), the output is inline in the buffer?
17:26BorkdudeIf a man can bend Java to act like a suberb Lisp... Emacs should not be that difficult to bend? :P
17:27BorkdudeKidding, please don't kill me.
17:33maxhodakhow would you call clojure from java with keyword args (i.e., defunk)?
17:33maxhodakfor example: clojure.lang.RT.var("somnium.congomongo", "mongo!").invoke(":db", "mydb", ":host", "myhost");
17:33maxhodakdoesn't work
17:37chouserclojure.lang.Keyword.intern("host")
17:39maxhodakchouser: I don't follow. should I do: clojure.lang.RT.var("somnium.congomongo", "mongo!").invoke(clojure.lang.Keyword("db"), ... )
17:39chouserright
17:39maxhodakor clj.l.Keyword.intern("host") and then just reference host?
17:39maxhodakok
17:42maxhodakchouser: ok thanks, worked (needed clj.l.Keyword.intern instead of just clj.l.Keyword though)
17:42maxhodak(like you described)
17:58LicenserI want cookies!
18:00SynrGwin 21
18:01Borkdude,(clojure.contrib.string/chomp "cookie")
18:01clojurebot"cookie"
18:02Borkdude,(clojure.contrib.string/chop "cookie")
18:02clojurebot"cooki"
18:47rhickeyback for one last gasp with slime - does anyone know a way to get C-M-x (and really, all) evaluation output to come in the repl pane rather than the mini-buffer and the *Messages* buffer?
18:50tcrayfordrhickey: that can probably be hacked up inside of emacs pretty easily, but I don't know of any default way to do it
18:55isloncan I send-off inside an agent?
18:56islon(to another agent)
18:58rhickeyislon: yes, but by default it will be sent *after* the action that does the send completes
18:58tomojonly by default?
18:59rhickey,(doc release-pending-sends)
18:59clojurebot"([]); Normally, actions sent directly or indirectly during another action are held until the action completes (changes the agent's state). This function can be used to dispatch any pending sent actions immediately. This has no impact on actions sent during a transaction, which are still held until commit. If no action is occurring, does nothing. Returns the number of actions dispatched."
18:59islonso this is the problem... the sender agent is on an infinite processing loop...
18:59isloni'll try the release, thanks
19:01islonit works =)
19:02tomojrhickey: cool
19:27islonI'm trying to execute this code inside an agent but the "after" is never (after several minutes) printed
19:27islon(let [ag (http-agent url)]
19:27islon (release-pending-sends)
19:27islon (println "before")
19:27islon (await-for 3000 ag)
19:27islon (println "after"))
19:31chouseryou cannot await in an agent
19:31chouseryou cannot await in an agent action
19:31chouserif you check your agent, you'll see there's an exception there.
19:31chouserislon: you're on 1.2-snapshot?
19:32islonyes, 1.2
19:32islonhmm.. makes sense
19:33islonok, I'll use threads
19:34chouseryou might like 'future'
19:35isloncan I block waiting for a future inside an agent?
19:35chouserno, you can block waiting for an agent inside a future
19:36chouserbut awaiting on an agent is a bit suspect -- are you sure that's the right reference type for you task?
19:36islonhttp-agent returns an agent, I can't change that
19:37isloni can use :handler too but I didn't want to turn my function asynchronous
19:37chouserperhaps instead of awaiting, you could send a second action after the first, which will then not be run until the first action is complete.
19:37chouseroh
19:38chouserasynchronous isn't too bad with closures...
19:38JorejiHey guys, where can I post a problem I have with running clojure on android? Is there a mailing list out there?
19:39islonI'll try :handler, thanks chouser
19:40chouserJoreji: from the /topic: http://groups.google.com/group/clojure
19:40Jorejichouser: Alright, thanks.
19:50_na_ka_na_Hi, If I run a particular command from the shell it runs just fine in 1-2 secs producing some out & err, but if I use c.c.shell/sh, and run the command it just gets stuck, I can see the process gets invoked but it never finishes, I've to kill the process to get the repl back .. but some other commands run just fine with c.c.shell/sh, any idea as to what may be causing c.c.shell/sh to get stuck?
19:52_na_ka_na_I'm just guessing it has something to do with the stdout / stderr capturing of the process by sh
19:53islonanyone knows why if I pass a :handler to http-agent and inside the handler I try to check the status with the function status it always returns nil even it successfully fetched the url?
19:53islon*even if
20:00chouser_na_ka_na_: does the command use both input and output streams?
20:01_na_ka_na_nope only output
20:01_na_ka_na_but both stdout, stderr .. I'm trying to reproduce the issue
20:15_na_ka_na_chouser: I'm able to reproduce the issue .. here goes .. this works .. (clojure.contrib.shell/sh "cmd.exe" "/c" "perl -wle \"for (1 .. 100) {print STDERR $_}\"" :return-map true) ... but this just gets stuck ... (clojure.contrib.shell/sh "cmd.exe" "/c" "perl -wle \"for (1 .. 1000) {print STDERR $_}\"" :return-map true)
20:16chouserinteresting...
20:18chouser(sh "perl" "-wle" "for (1 .. 1000) {print STDERR $_}" :return-map true) ; works here
20:18_na_ka_na_*ucker ..
20:19chouser(sh "sh" "-c" "perl -wle \"for (1 .. 1000) {print STDERR $_}\"" :return-map true) ;also works
20:19chouserhmph
20:19chouserso I wonder if it's Windows-only
20:20_na_ka_na_it must be .. I guess
20:20_na_ka_na_I'll just try to workaround by re-directing the stderr
20:24_na_ka_na_ok re-directing works .. but :(
20:30chouseryeah, not good.
20:32islonwhy my log always print trash like "May 27, 2010 9:27:55 PM clojure.contrib.logging$eval1579$impl_write_BANG___1582 invoke"?
20:38_na_ka_na_islon: there is a documented way to set your own ns in logs to suppress that thing but didn't work for me .. check out if it does for u
20:38islonand where's the documentation?
20:40islonhmm. i dind't have a loggin configuration
21:16dysingersexpbot: $:party!
21:33arkahnfor driving an outside process interactively, would anything besides ExpectJ be recommended?
21:43ihodesstuarthalloway: just want to say thanks for the rockin' book :)
21:43stuarthallowayihodes: thanks!
21:43ihodesfor anyone else here, is there a nice/sexy way of parsing xml into a nice hash-map? becase clojure.xml/parse is MESSY to deal with
21:50ihodeschouser: not that it's not an awesome lib ;)
21:50ihodesoh, just kidding, that's rich's lib. still, it's nice. but not really great for cleanly mapping xml node to hashmap-key
21:50jarturIs there any way to map over a hash and get a hash back? Like I want to (map (fn [k v] (do something with k v returning new VALUE)) my-hash) -> new hash with same keys but new values?
21:50Raynesjartur: (into {} (map (fn [k v] (do something with k v returning new VALUE)) my-hash)) ; If it's built correctly, this will turn a sequence of map entries back into a map.
21:51jarturAnd map entries are {:k v} ? So inner fn woudl return (hash-map k new-val)?
21:52Raynes$(map (fn [[k v]] [k (+ v 3)]) {:key 3 :key2 4})
21:52sexpbot=> ([:key2 7] [:key 6])
21:52Raynes$(into {} (map (fn [[k v]] [k (+ v 3)]) {:key 3 :key2 4}))
21:52sexpbot=> {:key2 7, :key 6}
21:52RaynesLike that.
21:53lancepantzis that more efficient than
21:53lancepantz,(into {} (for [[k v] {:a 1 :b 2}] [k (inc v)]))
21:53clojurebot{:a 2, :b 3}
21:53jarturAh, okay. I did (apply merge (map (fn [[k v]] (hash-map k (+ v 3))) {:k 3 :k2 4})) but i think it's slower
21:54Rayneslancepantz: I'm not entirely certain that it matters. Someone else would have to comment on efficiency.
21:54timmorgancan someone help me fix my repl? When a long command wraps to the next line, I can go back, i.e. hitting backspace stops at the current line
21:54RaynesMapEntries act as vectors.
21:54timmorgans/can/cant
21:54lancepantzi think i saw a stackoverflow post that recommended using for at one point
21:55RaynesHence why they appear as [key value].
21:55lancepantztimmorgan: you want to use jline
21:55timmorganI am (I think)
21:56RaynesOr rlwrap
21:56timmorganmaybe I'm doing it wrong
21:57Raynesjartur: I think most people go with the into route like I did. Not certain.
21:57jarturRaynes: thanks
21:57timmorganjava -cp lib/clojure-1.2.0.jar:/usr/share/java/jline.jar jline.ConsoleRunner clojure.main
21:57timmorganIs that right?
22:02timmorgantried it in zsh and bash, with rlwrap and without
22:02timmorganhitting backspace works apparently, but it just doesn't show me what's happening on any line but the current one
22:03timmorgansomething about Ubuntu maybe?
22:12timmorganwell I'll just make my terminal window really wide :-)
22:13lancepantztimmorgan: if you're doing anything serious i'd set up your ide for clojure
22:14lancepantzyou can get a repl in about all of them
22:14timmorganok, can I do that in Vim?
22:15lancepantzheh, the one thats the biggest pita
22:15timmorganthat's my luck
22:15lancepantzbut yeah, vimclojure
22:15Raynes$google Getting started with Vim Clojure assembla
22:15sexpbotFirst out of 58 results is: Getting Started with Vim | Clojure | Assembla
22:15sexpbothttp://www.assembla.com/wiki/show/clojure/Getting_Started_with_Vim
22:15Raynes^
22:16lancepantzi thought it was a pain, so when i used vim i used screen and a plugin to send stuff to the repl
22:16RaynesThat's rather recent.
22:16lancepantzbut i switched to emacs a couple of weeks ago, it was a really good idea
22:16lancepantzdepends on how much time you're going to spend with clojure ofcourse
22:17timmorganjust playing for now -- I will take a look at vimclojure
22:17timmorganthanks
22:17RaynesI love to recommend Emacs as much as possible, but I can't deny that many Clojurers use Vim, including hiredman (at least, I think he still does) and chouser.
22:21arkahnit may seem silly, but going from vim to emacs makes my wrists complain; all that C-c or M-c
22:22lancepantzarkahn: you need one of these badboys: http://www.kinesis-ergo.com/advantage.htm
22:22arkahnI miss navigation with h, j, k, l
22:22arkahnlancepantz: actually, I have one ... I just don't use it : )
22:22lancepantzhahah
22:23lancepantzit takes a few weeks to get used to it
22:23arkahnemacs or the keyboard?
22:23lancepantzthe keyboard
22:23arkahnthe keyboard was easy ... emacs, not yet
22:23lancepantzheh, i had the opposite
22:24arkahnis it too confusing to use vi-mode with clojure-mode?
22:25lancepantzi found that the chords conflicted with slime and paredit alot
22:25arkahnI was afraid that might be the case
22:25lancepantzyou could remap them i suppose, but i didn't mess with it
22:26arkahndo you (you personally) navigate in emacs with C-p, C-n, etc.??
22:27lancepantzi try
22:28lancepantzthe kinesis has the arrow keys with the letters, so it's easy to hit the arrows
22:30RaynesI navigate with the arrow keys and the mouse. I'm not hardcore.
22:31arkahnRaynes: you're a veteran, too! I've seen posts from you about clojure back in 2008
22:31arkahnI like to stay away from mouse navigation as much as possible
22:32Raynesarkahn: I paid 100 bucks for this mouse. I'm using that baby. ;)
22:32arkahnlolz
22:32RaynesI wouldn't call myself a "veteran". I experimented with Clojure, but didn't start actually using it for anything beyond playtime until about a year ago.
22:33arkahnI should set this up for emacs: http://www.belkin.com/iwcatproductpage.process?product_id=390404
22:35arkahnthanks all! Have a good night (or day, as it may be)
22:37Raynes$time -5 for me.
22:37sexpbotRaynes: The time is now 2010-05-27T21:42:39Z