#clojure logs

2011-08-04

00:00st3faninteresting
00:00amalloy*boggle* what is this (:use [clojure.contrib]) thing? i don't think clojure.contrib exists as a namespace, does it?
00:00fmwI'm having trouble importing a module from Google Closure (goog.history.Html5History). For some reason it says goog.history is undefined when my script loads, but later it does exist: http://paste.pocoo.org/show/452339/
00:01amalloyoh, you have [except] in there
00:01fmwany idea how to fix this?
00:01amalloyclojurebot: thunk?
00:01clojurebotGabh mo leithscéal?
00:01amalloydang. anyone got something pithy and useful to teach clojurebot about thunks?
00:02st3fanamalloy: i took the sql code as an example .. do you know why they do code like with-client and with-client* ?
00:02st3fani assume i can merge the two pretty easily
00:03amalloyst3fan: i don't know about sql in particular
00:03st3fanmaybe it is to do as less possible in the macro
00:03amalloybut in your code one is a macro and one isn't. the macro is easier to write in simple cases, and the function is easier to combine with other code
00:04st3fanyeah the sql code is all like that .. one line macros that call a function
00:04amalloythat's one common use of the foo/foo* distinction. see, for example, in clojure.core: binding, with-bindings, and with-bindings*
00:05fmwhmm, if I change the order of my imports with (:require [...]) it says some other module is undefined
00:05st3fani see
00:09st3fanok time to sleep
00:09st3fanthanks for all the help and hints :)
01:02PupenoAny clojars people in here away? technomancy?
01:02technomancyPupeno: not for much longer, but go ahead
01:03Pupenotechnomancy: did you mention wanting to switch databases for something java based, not sqltie? or did someone did it already?
01:03technomancyPupeno: I think hiredman was talking about derby.
01:03technomancyI don't know what _ato thinks.
01:04technomancyI think derby makes more sense than sqlite, but I don't know if it's worth messing with something that works.
01:04PupenoI was recently recommended H2 on Stack Overflow.
01:04PupenoOk then.
01:04technomancyone thing that's a definite win would be moving the search functionality off sqlite to lucene
01:05technomancyapparently we already have indices being generated
01:05technomancythen again, the indices might not include description, I'm not clear on that
01:06_atowhat would be the benefit of derby over sqlite? to me it just seems to make things harder. sqlite has a very nice command-line tool
01:06Pupeno_ato: the advantage would be no extra non-java dependency to install… not a huge advantage for clojars.
01:07technomancyI think with the repl the CLI tool isn't a big deal, but I don't feel strongly either way.
01:07Pupenotechnomancy: is vagrant supposed to set up some kind of port forwarding or something so I can access clojars with a browser from my real machine.
01:08technomancyPupeno: yes, see the Vagrantfile; localhost:8088 should work
01:08_atosqlite doesn't need to be installed (except if you want the command-line tool). The sqlite jar file is fully self-contained and runs everywhere
01:08technomancy_ato: oh, I didn't realize that. in that case they're really functionally identical.
01:08Pupeno_ato: it is? I didn't know that… cool!
01:09Pupenotechnomancy: yay! it's working! :)
01:09technomancyI also thought that we would need to run mirrors by now, so what do I know about databases. =)
01:09technomancyPupeno: nice!
01:09PupenoOk… I'll try to upload a jar and see how it goes… should I try switching to the packaged nailgun?
01:10_atoyeah, the jar includes native code for most common platforms and some kind of magical "convert a mips binary to JVM bytecode" so even if there isn't a native version for that platform it can still run (but with some performance overhead)
01:10technomancyPupeno: I'd hold off on that since it may become irrelevant with the mina sshd branch
01:10technomancy_ato: aha; nestedvm. I'd heard about that but it sounded crazy =)
01:11_atoyeah, I think it is crazy. It's crazy that works though. :-)
01:12Pupenotechnomancy: is there another port for ssh/scp?
01:12technomancyshould be 2222
01:12technomancythat's vagrant's default
01:13PupenoI'll add this to the docs.
01:13technomancyPupeno: the #1 feature I would like to see added is having it not require the pom file to be scp'd along with the jar if the jar contains the pom
01:13technomancythat would be very convenient
01:14Pupenotechnomancy: if I can get the uploading a jar part working, I'll try to look into that.
01:14technomancyshowing more metadata on the jar pages is probably second on my list
01:15PupenoWhere's the password for the vagrant user?
01:15technomancyit's just "vagrant"
01:16Pupenook.
01:16technomancywould be good to have that documented too
01:16technomancyPupeno: man, you are like the fifth person I've tried to rope into helping out, but the first who's actually done anything. this is great. =)
01:17PupenoI wrote the info in the README.md… I'll turn it into sentences later.
01:17PupenoI do want something in return… I'm very new to Clojure, so any feedback on what I'm doing wrong and how to improve my code is very appreciated.
01:19PupenoThe Joy of Clojure should arrive today :)
01:20PupenoI used to do some scheme and cl a few years ago but I'm really writing Java with Clojure syntax and not Clojure (well, Java, Ruby, whatever)
01:20Pupenoruby-1.8.7-p334 pupeno@picard:~/Temporary/foobar$ scp -P 2222 foobar-1.0.0-SNAPSHOT.jar pom.xml clojars@localhost:
01:20PupenoWelcome to Clojars, pupeno!
01:20PupenoIt's taking a long time.
01:21PupenoThe vm seems to be iddle.
01:22technomancyyou can check the log in /var/log/clojars/
01:22technomancyI'm heading off though; sorry
01:22lazybotjava.lang.Exception: EOF while reading
01:23PupenoIt seems not to be doing anything.
01:25PupenoOk… nailgun exception: https://gist.github.com/1124552
02:11_atoPupeno: http://groups.google.com/group/clojars-maintainers/browse_thread/thread/fbc233186c497751
02:56Cozey:-)
04:01Pupeno_ato: how do you deploy clojars?
04:04_atouberjar it, stick an upstart job in that runs two instances of it with java -jar. Put nginx in front to deliver the static files (like the jars themselves). Use balance for failover of the ssh port
04:04PupenoI meant… do you copy the jars manually?
04:05_atothere's a git checkout in /home/clojars/prod. I have a shell script that does a git pull && lein uberjar && restart clojars
04:05Pupenook.
04:06_atosome more details here (you've probably seen this therad): https://groups.google.com/group/clojars-maintainers/browse_thread/thread/d4149ec96316d5b1
04:11Pupeno_ato: the proper way to get nailgun would be to download 0.7.1, apply that patch and compile, right?
04:12PupenoThis patch: http://mail.martiansoftware.com/pipermail/nailgun-users_martiansoftware.com/2009-November/000009.html
04:12_atoright. just for development testing vanilla 0.7.1 is fine. But I wouldn't want to run in production without that
04:13PupenoAh, ok… then just the package then.
04:19Generic_DumbassI'm a noob, forgive a dumb question: how complete is the conversion of SICP to Clojure?
04:23wunkiGeneric_Dumbass: http://sicpinclojure.com/content/current-status
04:24Generic_DumbassRight, I was hoping someone had something a bit clearer.
04:24kumarshantanuThere are few SICP solutions on GitHub too
04:24Generic_DumbassThanks though.
04:24Generic_DumbassOk, I'll check that as well
04:24Generic_DumbassI saw Github converted Practical Common Lisp too, so yeah
04:24kumarshantanuI guess it should be a bit collaborative to get it complete faster
04:25wunkiI just ordered SICP today, is it doable to convert to Clojure yourself while reading? Without the page above.
05:18Pupeno_As far as I know SICP require very little language features, so it shouldn't be that hard to do it in another language.
05:20opqdonutI guess the biggest difference between scheme and clojure is tail recursion
05:20opqdonutand maybe some macro stuff
05:20Pupeno_opqdonut: yes... tail recursion... that's an important one.
05:20Pupeno_opqdonut: I don't remember any macros from SICP. I haven't read it all though.
05:21opqdonutI'm not sure either whether it had any
05:31raek...and the different approach to mutability
05:39opqdonutoh yeah
05:41Pupeno_I would go through SICP with Scheme or a language I know already.
06:39jsoftwWhats a good gui library which has windows looking like the normal windows from the guest os?
07:10thorwilis it possible to construct a function call using a construct like (symbol (str 'f "-bar)) within a function?
07:12_atothorwil: http://clojuredocs.org/clojure_core/clojure.core/resolve
07:12Bronsa[B[B[B[B[B[B[B[B[B[B[B[B[B[B[Bbailey ] [ SecretAgent ] [ xiaolongxia ]
07:12Bronsaops
07:12Bronsasorry, mouse broken
07:13thorwil_ato: ah, thanks!
07:21jsoftw:
07:21jsoftw:(
07:22Chousukethorwil: are you sure you want to do that though. sounds super hacky :P
07:22jsoftwlein repl / test gives a bunch of bollocks exception trace, with the most meaningfull error being 'incompatable type on stack'. Any ideas?
07:23Pupeno_jsoftw: paste the whole thing? (gist.githum.cob.
07:23Pupeno_com).
07:24jsoftwgit://gist.github.com/1124991.git
07:24thorwilChousuke: actually not 100% sure. it's nice to get rid of repetition easily, but not being bale to search for all symbols in use is bad
07:24thorwilable, even
07:24jsoftwhttps://gist.github.com/1124991 <--
07:25jsoftwThis is the stuff I fear :(
07:25jsoftwJava coming back to haunt me
07:27manutterjsoftw: that looks like either a corrupted jar file or (perhaps more likely) conflicting jar files in the same classpath
07:28jsoftwriight.
07:28jsoftw:(
07:28manutterDoes it do that for all "lein new" projects, or is there perhaps something magical about lein new TEST"?
07:28jsoftwall new projects.
07:29manutterThe first thing I'd try would be "lein upgrade" to see if that cleans up anything
07:30jsoftwI might just get the proper java.
07:30_atowhat java are you running? gcj or something?
07:31jsoftwI did not realize debian installed some bodgy 'GNU' java.
07:31jsoftwYeah gcj.
07:31jsoftwWhich I shall remove promptly.
07:32jcromartieIn Compojure, should I explicitly pass things like the current user to my views?
07:32jcromartieor would that be better for earmuffs
07:32_atoah yep, that's likely the problem. one of the first things I do on a debian box is install the openjdk-6-jdk package
07:32jcromartiesince the currently logged-in user is a lot like *in* or *out* frankly
07:35raek"lein new test" is known to be "magical"
07:35thorwiljcromartie: you could have different views depending on role
07:35jcromartiehm
07:35raekthorwil: to get rid of repetition of names, macros can be used
07:36thorwiljcromartie: and those could actually be specializations of more generic views
07:36jsoftwAhh there we go.
07:37jsoftwGood riddance
07:37thorwilraek: as i do in several cases. but it doesn't matter whether i assemble symbols in macros or functions, the effect is in both cases to have no direct reference in the source
07:37jcromartiethorwil: the problem I have is that I am pulling the user out with every request
07:37jcromartieI mean I could assoc it with the request, too
07:38jcromartieand that would make destructuring simple
07:38jcromartiebut if I am pulling out the user and passing it to the view with every single request (and I am, because some parts of the page which are always rendered depend on the user)
07:39jcromartieI dunno this is my first full-blown compojure app
07:39thorwiljcromartie: i think passing the user along with the request is sensible, too. only using globals seems unnecessary
07:39jcromartieyeah
07:39jcromartiealthough it does kind of make sense for things that are basically bound to the life of the request
07:39jcromartielike, I have *session* and *flash*
07:40_atoA middleware thing that enhances the request map with the user data sounds good to me too. Generally I find dynamic vars always come back at bite me eventually (eg threads)
07:40thorwiljcromartie: i currently switch views based on user, as that makes it relatively easily to have a single conditional in the controler and none in the views
07:41jcromartiehm... so how about rendering things like the currently-logged-in user name? or other bits like that?
07:41jsoftwProblem fixed :) once proper java was in there, its all go.
07:41jcromartiedo you just always pass the values needed for the view?
07:41jcromartienot that I'm really opposed to that... it just seems more convenient to use bindings
07:42thorwiljcromartie: i would add things like user name into the request map (currently it's just admin or not admin, here)
07:43jcromartieand you pass the whole request map to the view?
07:44jcromartieI could see the view arglists getting quite large
07:44thorwili think it's worthwhile to strive for having the controller pass all required info to the view, and each view thus having a single "point of entry"
07:49jcromartieyeah
07:50jcromartiewhat about having a "main" view
07:50jcromartielike, I have one called "layout"
07:50jcromartiewhich renders common stuff, and then the content view
07:50jcromartieright now most view functions call layout themselves
07:51jcromartiebut if the controller used it like (view/layout user (view/specific-page stuff))
07:52jcromartiethat requires the controller to be a little more involved, but makes the view pretty simple, I guess
07:53thorwili prefer to assemble things within views, so controllers only call a single "interface" function from views. seems easier to read
07:57jcromartiehm
07:58jcromartieso how does that actually look?
08:01thorwilyou just define a view functions in views.clj that only take arguments as provided by the controlers and whose job is to pass those args to a series of functions and to assemble the result
08:03thorwilafter ending up with a bit of a mess doing that ad-hoc, i switched to an approach where each view comps a number of functions, passing a map through all of them
08:03Chousukethorwil: usually macros are used to get rid of repetition
08:03jcromartiethorwil: ah, so a map of the info you need
08:03jcromartieinstead of individual args
08:03jcromartie?
08:04jcromartiemakes sense
08:04thorwilyes
08:04jsoftwHoooray, slime repl to clojure working! :)
08:05thorwilChousuke: this just looked like a case where a fn might have been sufficient. i try to use macros only where i have to. but i actually can't get the resolve and symbol combo to work, outside of a simpliefied example on the repl
08:05Chousukethorwil: if you end up using resolve or eval chances are you are better off using a macro or even rethinking your approach completely
08:05thorwilyeah, seems so
08:05Chousukewhat exactly are you trying to do? why do you need to construct a function name at runtime?
08:05jcromartiethorwil: that makes sense. so the controller basically turns the request into a map of useful model data
08:08thorwilChousuke: i have pairs of views like "foo" and "foo-for-admin", so i want to use "foo" as sole arg and generate the "-for-admin". i do know how to do it with a macro
08:09thorwili'd switch to using an optional argument instead, but the way i currently build the views doesn't make that trivial
08:18jcromartiehmm
08:19jcromartieI am of the opinion that it's bad form for a macro to silently define vars with anything other than supplied names
08:19jcromartieaka "secret defs"
08:19raekthorwil: if you need to choose something from some set of alternatives, why not put the alternatives in a data structure? (e.g. a map)
08:19jcromartieor, actually
08:19jcromartie"surprise defs"
08:20raekyou can make a macro later do make the code look prettier
08:21raekI feel reluctant to the idea of using a namespace and naming conventions to "magically" choose the right var
08:24raekyou could perhaps use multimethods to define views for different combinations of page + role, like (defmethod render ["foo" :admin] ...) (defmethod render ["foo" :user] ...)
08:25thorwili have my problems coming up with a way to handle this that will not require additional conditionals
08:25raekif you put the view functions as values in a map, you could use ["foo" :admin] as the key
08:26thorwilbut of course ... i have to try that later on
08:27thorwilty. apparently it's still hard for me to see some of the possibilities even in the basics :)
08:30malkomalkowhat's the easiest way to add the values of two maps together? { "a" { "foo" 1 } }, { "a" { "foo" 2 } "b" { "bar" 3 } } => { "a" { "foo" 3 } "b" { "bar" 3 } }
08:31Chousukemalkomalko: merge
08:31Chousukeor merge-with in this case I guess
08:35malkomalkodoesn't seem to work with nested maps
08:37lobotomy,(merge-with (partial merge-with +) {:a {:foo 1}} {:a {:foo 2} :b {:bar 4}})
08:37clojurebot{:b {:bar 4}, :a {:foo 3}}
08:38malkomalkoahh I see why
08:39malkomalkothat'll do it
08:40malkomalkolooking at the docs lobotomy, I don't understand how that partial is working
08:40jsoftwHow common is it for people (ie, normal, non geeks) to have the jvm on their computers?
08:41manutterI think the jvm is pretty standard on Mac and Windows
08:41MasseRjsoftw: I'd say that it's common enough to be counted as a pro argument
08:42jsoftwhmmm
08:43jsoftwSo is it fairly straight forward to learn how to use the java libraries? Ive never coded java before
08:44lobotomymalkomalko, ##((partial merge-with +) {:foo 1} {:foo 2})
08:44lazybot⇒ {:foo 3}
08:44malkomalkoreading this now: http://christophermaier.name/2011/07/07/writing-elegant-clojure-code-using-higher-order-functions.html
08:44malkomalkopretty nice blog post going over partial
08:45MasseRlobotomy: What does the ## do? Signal the bot to run?
08:45MasseR*eval
08:45lobotomyapparently yeah :]
08:47raekjsoftw: if you have some experience with object oriented programming languages in generelar it shouldn't be
08:48mdrogalis,(partition 2 1 [1 2 3 4 5 6])
08:48clojurebot((1 2) (2 3) (3 4) (4 5) (5 6))
08:48raek*in general, it shouldn't be too hard
08:49mdrogalis,(partition 3 2 [1 2 3 4 5 6])
08:49clojurebot((1 2 3) (3 4 5))
08:50lobotomyhahah, (partition 2 -1 [1 2 3 4 5 6]) produced a funny result
08:50jsoftwExcellent.
08:50lobotomy(not giving that to the bots)
08:50raekjsoftw: what you do need to learn is how the java interop looks like for the different cases. (e.g. class methods vs instance methods, nested classes, etc)
08:50lobotomy(partition 2 0 [1 2 3 4 5 6]) seems to do likewise
08:51jsoftwraek: I see
08:51raekand how to go from something you find in the javadoc of the lib to clojure interop code
08:51raekonce you learn those rules, it's pretty simple
08:52jsoftwGood
08:52jsoftwI think this is the business
08:52jsoftwA lisp with a bazillion libraries, good threading/etc, and nicely portable!
08:52jsoftwwi.
08:52jsoftwwin.
08:53jsoftwLook forward to playing over the next month or two
08:54raekthe libs that are harder to use from clojure are those that require you to define a class with special naming, annotations, etc
08:55mattmitchellanyone know if it's possible to connect a new repl to an existing swank server?
08:55raekbasically those where the library uses reflection on your class, instead of just accepting an object that implements an interface (which is much more simple for clojure)
08:59malkomalkothanks for the help lobotomy, I understand now
09:00raekmattmitchell: if you have two separate instances of emacs, you can slime-connect to the same swank server with both
09:01raekbut i don't know if the one emacs - two repl buffers case is possible
09:02mattmitchellraek: ok that's good to know. what about using "lein repl" to connect to one?
09:02mattmitchellthat probably doesn't make sense, hmm.
09:03raekmattmitchell: lein repl actually starts a repl socket server (it prints the port number when you start the command)
09:04raekmattmitchell: you can use the telnet command to connect to it: telnet localhost <port>
09:04mattmitchellraek: ahh telnet, let me try that
09:04raekbut then you don't get emacs integration etc
09:04mattmitchelltrue yes
09:04raekjust a plain terminal repl
09:10MasseROh yeah. Is a better repl in the comings?
10:08flazzanyone know if the free ebook included with the print copy of "joy of clojure" can be in formats other than pdf?
10:22lobotomyflazz, they sent me a link to versions in pdf, epub and mobi
10:22lobotomynot sure if that's a permanent thing though or some kind of limited offer
10:23flazzlobotomy: that sounds perfect, i'd love to read it on my kindle. have you tried it on a kindle?
10:29lobotomynope, don't have a kindle
10:50jcromartieso here's how I'm thinking about MVC in Compojure now:
10:51jcromartieRoutes live at the controller level, and the controller's job is to turn HTTP input into "view model" objects, to pass to the actual view rendering layer.
10:51jcromartietake HTTP input, reach into the model layer, and use raw model data to produce view-model data
10:51jcromartiehow about that
10:53jcromartieMVVM
10:53mefestoI'm not familiar with compojure but that sounds like the same approach that java's spring web mvc takes
10:54jcromartiethe traditional MVC puts a lot of stuff in the views... MVVM seems more in line with FP
10:54gtrakclassic MVC is controller changes the model and view observes the model
10:55jcromartieI guess web MVC is not really classic MVC
10:55jcromartieseems like you can only really get MVC in a web app with client-side UI
10:55jcromartiewhich is where I'd like to be headed, actually
10:55mefestomost web mvc frameworks frown on logic in the views
10:56jcromartieBackbone.js
10:56gtrakmartin fowler has good articles on that stuff: http://martinfowler.com/eaaDev/uiArchs.html
10:56jcromartiemefesto: how do you handle things like: (if logged-in logout-link login-link)
10:57mefestoClojureScript is on my list. Just got the G Closure the definitive guide book earlier this week
10:57gtrakjcromartie, make a session map that you pass around
10:57mefestothe jdoc type hint chapter is one boring read :-\
10:58jcromartiethanks gtrak
10:58jcromartiegtrak: you mean like, pass a map to the view layer
10:58mefestojcromartie: a conditional in the view
10:59mefestojcromartie: perhaps with some sort of helper to keep it as clean and reusable as possible but still boils down to a conditional
11:00jcromartiegtrak: and do you really mean the session map, or just a map of data that the view needs?
11:01jcromartieI'm all sold on the view only relying on data passed to it
11:01jcromartiebecause my session is pretty light-weight right now (just the user ID and locale)
11:01gtrakjcromartie, it's probably simpler to segregate session-data, you can either use two maps or a single map with a :session key, I don't know if compojure has something built in for that
11:02jcromartiegtrak: I have a stateful session middleware for getting/associng things in the session itself
11:02jcromartiebut so far the view doesn't actually use the session
11:02jcromartieonly the controller
11:03gtrakit should be easy to add stuff to the session and use it from the view
11:14Cozeyi'm trying to run swank-cdt, but it can't find tools.jar - i have this file in javas home directory- how can i add this path to lein?
11:16malkomalkowhen running a reduce function, is it possible to get the current index?
11:17chousermalkomalko: if the current index is included in the input sequence, then sure!
11:18malkomalkoaight, that's what I figured
11:20hugodCozey: there are some suggestions for how to do that under "Sun/Oracle JDK and OpenJDK" here https://github.com/pallet/ritz
11:20flazzdoes anyone have a working link for the vimclojure nailgun jar?
11:23mefestois ring-jetty-adapter suitable for a production app or is it meant only for development?
11:23mefestorunning a few ab tests against it and it seems pretty capable
11:26Cozeyhugod: thanks! I knew i'll get this kind of arcane knowledge here :-)
11:27gtrakis there a way to keep multiple repl buffers in emacs?
11:29gtrakah, I see slime has this functionality
11:31dnolenchouser: why couldn't you web app routing with regular pattern matching? (just thinking out loud here)
11:31dnolen"you do" I mean
11:32chouserdnolen: people do it all the time, I suspect. But wouldn't open be better. automatically "pluggable" web apps
11:35dnolenchouser: yeah that would be doable once we upgrade pattern matching to predicate dispatch. sadly core.logic wouldn't support in its current form, its pattern matching logic is very simple (no optimized decision tree) and closed.
11:36chouseryou've done some work on open optimized decision tree, haven't you?
11:36dnolenchouser: yes, it's coming along nicely. I dare say ... it is awesome.
11:36kumarshantanuIs any forthcoming book going to cover core.logic (and core.unify)?
11:36chouserI believe it. :-)
11:37dnolenkumarshantanu: not from me :)
11:38chouserhm, though I think Rails routing provides a way to generate a path string that will take you to a given branch (ie. the inverse of routing). Delivering that feature might be pretty tricky.
11:41dnolenchouser: The open bit is quite tricky. We could use eval initially, but I'd like to figure out a solution using a high perf DAG via Java arrays.
11:42dnolenchouser: I assuming that reversing has realistic limitations, you have to give precise information
11:44chouseryes, in rails you give precise details for each "slot", and since the rules it allows are pretty simple it ends up working out (most of the time)
11:45chouserit may be that it's not actually appropriate to pack all that into the same mechanism
11:47chouserI think the goal (or at least the one I care about) would be to have a module that can generate HTML links and forms that then trigger its own handlers again, all without restricting the specific path or route that an application "installs" that module at.
11:48chouserso perhaps it would be better, when installing such a module, to provide a route to trigger it as well as a function to build such a route.
11:49dnolenchouser: yes that would be quite cool.
11:56dnolenhuh, in Scala/Haskell can you pattern hashmaps? If so anyone got a link?
11:56dnolens/pattern/patternmatch
11:56lazybot<dnolen> huh, in Scala/Haskell can you patternmatch hashmaps? If so anyone got a link?
12:47gtrakhmm, I've got a problem, clj-http is pulling in apache httpclient 4.0.3, is there a version of it that uses 4.1.1?
12:49edwgtrak's problem just reminded me: What happens when a module is built against 1.2.0 but one's project depends on 1.2.1? I try not to think about this too much.
12:50chouseryou should be able to override the version demanded
12:51chouseras long as they're still compatible, you'll be okay.
12:51gtrakI'll try that
13:04AWizzArdgtrak: and of course it always depends on what you want to do. If you just want to do a basic request then you could also just use java.net.HttpURLConnection
13:04AWizzArdThat way your projct would not suddenly require 5 new dependencies.
13:06gtrakAWizzArd, our stuff is doing some complex hackery, trying to drop clj-http in favor of clj-apache-https for secure stuff
13:06gtrakin particular PKI and client auth doesn't seem simple
13:07AWizzArdYes oki. I just wanted to mention it, because several people download a complex http lib for just doing 2-3 posts. Not all know about j.n.HUC
13:07gtrakyes, I wish that was the problem :-)
13:09AWizzArdbtw, Netty also comes with an http client, and Aleph makes it usable.
13:09AWizzArdAlso currently Aleph has an unnecessary dependency on clj-http, but I already informed Zach about it, and he will probably drop that in the next release.
13:10dnolenRacket peeps have pattern matching on hash-tables, neat
13:10gtrakAWizzArd, been looking at: https://github.com/diamondap/clj-apache-http
13:10gtrakit's a special fork that adds security stuff
13:10AWizzArdk
13:14dnolenyummy, yummy, Pattern Matching For Object Oriented Languages - http://www.hpi.uni-potsdam.de/hirschfeld/publications/media/GellerHirschfeldBracha_2010_PatternMatchingForAnObjectOrientedAndDynamicallyTypedProgrammingLanguage_HPI36.pdf
13:20hiredmanfancy
13:22mattmitchell,(concat [1 2] 1)
13:22clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
13:22mattmitchell,(concat [1 2] [1])
13:22clojurebot(1 2 1)
13:22mattmitchell,(conj [1 2] 3)
13:22clojurebot[1 2 3]
13:23mattmitchell,(#{"US"} "US")
13:23clojurebot"US"
13:23mattmitchell,(#{"US" "CA"} "US")
13:23clojurebot"US"
13:23mattmitchell,(#{"US" "CA"} "CA")
13:23clojurebot"CA"
13:24Scriptorclojurebot also works in pm :)
13:25cemerickIt looks like leiningen does not use repository credentials in settings.xml?
13:25mattmitchellScriptor: hey now, what are you trying to say? :)
13:25mattmitchellScriptor: just pm myself?
13:26mattmitchelloh duh, ok got it :)
13:27mattmitchellvery cool
13:27mattmitchellwho the hell wrote clojurebot? seriously, too clever.
13:28cemerickugh, I guess not: http://groups.google.com/group/leiningen/browse_frm/thread/dbe8536846143947
13:33dnolenthat pattern matching for Newspeak is pretty interesting tho of course their claim about the extensibility via dynamism fails to address the work in Racket, you don't need access to the compiler there. Macros FTW.
13:35hugodcemerick: I think that should be easier to support once lein moves to using aether
13:36cemerickhugod: Sure — I can imagine dealing with the master password and hooking things up just so is probably a PITA.
13:36AWizzArdhugod: aether link?
13:37cemerickMy first real attempt at using lein in a serious project is a casualty, tho. That was quick :-P
13:37hugodAWizzArd: http://aether.sonatype.org/
13:37cemerickhugod: how's the zi experiment going?
13:38hugodcemerick: maturing - I'm using it for my clj-ssh rewrite that I'm doing
13:40hugodcemerick: I'm thinking of adding a feature to the ritz/swank goals to allow you to run on the parent project of a multi-module setup (and include the source paths and dependencies of all the modules)
13:42cemerickSee, I've always considered that an editor/IDE feature; modules / checkout dependencies are evident given a "workspace" concept and dependency coordinates. Having that leak into the build tool chafes for me.
13:42cemerickOn a conceptual level, that is — of course, I don't need to use those features.
13:43technomancycemerick: sounds like you're just asking all the editors and other tools to reimplement features rather than having a single canonical source for the classpath.
13:44hugodthe swank goal is the link bettween the build tool and the ide
13:45Scriptorwhich file are all the cljs data structures source located in?
13:46cemericktechnomancy: I'm not asking for anything from anybody. :-)
13:47chouserScriptor: src/cljs/cljs/core.cljs
13:47cemerickI just don't think I should have to get project clones arranged in particular ways on disk in order to get my REPL's classpath to be "right".
13:47Scriptorchouser: thanks
13:48cemerickOr, said more precisely: the classpath is a very crude and narrow pipe to control what (IMO) is easier to manage at higher levels.
13:49technomancythere'd be more wiggle room if runtime classpath modification didn't have big red scary warning klaxxons
13:52chouserI wonder how long until someone writes a lein or coke competitor in ClojureScript.
13:53hiredmanclojurebot: coke is a solid fuel made by heating coal in the absence of air so that the volatile components are driven off.
13:53clojurebotc'est bon!
13:53cemerickcoke?
13:53clojurebotcoke is a solid fuel made by heating coal in the absence of air so that the volatile components are driven off.
13:53cemerickoh, cake
13:57chouseroh, sorry. yes, cake.
14:00technomancychouser: did you mean to say competitor or port?
14:01edwtechnomancy: Yeah, I was wondering what would preclude a port.
14:01hiredmanwhy a port?
14:01hiredmancljs requires the jvm to run anyway
14:02hiredmanmight as well just have a plugin that builds cljs
14:02edwTo compile, not run.
14:02technomancyto take advantage of the rich set of libraries available under the node package manager? =P
14:02hiredmanedw: lein is a build tool, not a tool for running code
14:03chouserI meant competitor because I assumed anyone happy with lein would use it as is.
14:03cemericktechnomancy: I assume that's heavy with sarcasm, but I've never even downloaded node.js so I can't tell.
14:03edwI was saying that cljs doesn't need to the jvm to run. I know that lein exits to build (and also run) code.
14:04edwIt just occured to me that you could write a cljvm compile in cljs...
14:04edws/compile/compiler/
14:04lazybot<edw> It just occured to me that you could write a cljvm compiler in cljs...
14:04chouserpeople were jsut talking about classpath management. It is exteremely common for Java apps to have non-JVM scripts to set up their classpath, env, cwd, etc. before starting the jvm.
14:04cemericknode is presumably a better quick launcher for a Clojure build tool than ruby — beyond that, you still need to have a JVM somewhere, both for dependency resolution and compmilation.
14:04dnolenso I guess you can't match maps in Erlang, Scala or Haskell...
14:05dnolens/match/pattern match
14:05lazybot<dnolen> so I guess you can't pattern match maps in Erlang, Scala or Haskell...
14:05chousercake uses ruby for this, IIUC. Doesn't lein use bash?
14:05chouseranyway, a compiled cljs script could fulfill that role. And probably will for someone at a some point.
14:06hiredmanso now you need nodejs installed to launch the javascript process which launches the jvm?
14:06edwcemerick: Don't worry, I'm not disputing that, though I wasn't thinking about the ramifications of that -- long build times are here to stay -- when I originally wrote.
14:06hiredman:|
14:06technomancyyeah, ruby is bad enough as a dependency; node would be a huge stretch.
14:06chouserhiredman: yep. Or you could launch a JVM to launch a JVM, paying its startup cost twice.
14:06technomancy"here, go compile this big pile of C, then you'll be ready to use clojure"
14:07chouseror you could use just one JVM and fiddle with the classpath at runtime, klaxons notwithstanding.
14:07hiredmano'caml?
14:08technomancyhiredman: the irish port of objective caml
14:08hiredmanthe famous ira sharpshooter?
14:08kumarshantanuJark 0.4 client is coming in OCaml
14:09dnolenkumarshantanu: nice
14:09PupenoHello te.
14:09PupenoHello technomancy.
14:09cemericklink for those that want to peek: https://github.com/icylisper/jark-client
14:11kumarshantanutechnomancy: Did anybody toy with the idea of having Lein split into a lein-server and lein-client (probably version independent)?
14:11bultersgday. anyone here was a pointer to an article describing how to set up emacs for clojure?
14:12hiredman~swank
14:12clojurebotswank is try the readme. seriously.
14:12technomancykumarshantanu: not yet; I think it could be built on jark.
14:13hiredmantechnomancy: you may want to add a link to clojure-mode from the swank-clojure readme
14:13kumarshantanubulters: want to try this? http://charsequence.blogspot.com/2010/07/setup-emacs-for-development-with.html
14:13hiredmanno no
14:13hiredman~blog
14:13clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
14:13hiredmanerh
14:13hiredmannever read blog posts
14:14hiredmanthey are always outdated and the source of 60-70% of problems people have
14:14edwI gave up coffee and Hacker News on Sunday and I've been quite happy since.
14:16bulterskumarshantanu: one sec...; i've been looking for an up to date 'manual' for a few days now
14:18kumarshantanubulters: I guess this is a better thing to red - https://github.com/technomancy/swank-clojure
14:20bulterskumarshantanu: I've been trying to stay away from 'the starter kit' up till now; but I'll give it a try
14:20bultersguess i can always 'roll my own' when i'm a grown up (emacs user)
14:21kumarshantanubulters: starter-kit is a non-invasive way to ramp up on Emacs, in my experience
14:21kumarshantanuYMMV
14:22bulterskumarshantanu: cloning right now :P
14:23Pupenotechnomancy: there seem to be some important patches in Alex's master branch; are you planning on merging or rebasing the vagrant branch?
14:33bulterskumarshantanu: at least it workds out of the box on my linux machine :P
14:36Pupenotechnomancy: vagrant+ato's master: https://github.com/pupeno/clojars-web/tree/vagrant2
14:37kumarshantanubulters: neat!
14:49Pupeno_ato: can you share your deploy script for clojars, or should I write my own?
14:59chouserI really hate that Google named their JS toolkit "Closure"
14:59chouserIt makes me a little bit angry.
15:00kumarshantanuchouser: am sure many would second that
15:00scgilardiEdge.js :)
15:01Pupenochouser: totally… and a language go… geez… these people seem not to know of google.
15:01dnolenimplementing pattern matching on maps is gonna fun. might not be too much work to make the whole system user extensible...
15:01chouserboth are lousy for googling. "closure" is horrible even for just talking or writing about.
15:01ibdknoxchouser: their documentation is equally infuriating
15:02ibdknoxchouser: yeah, it's particularly ironic that one of the least googlable API's I've ever worked with is one of google's own.
15:02bulterschouser: you have any seo experts in mind to suggest to google?
15:02kumarshantanuthey only make sense when explicitly prefixed with "Google ", as in "Google Closure" and "Google Go"
15:02bultersmaybe they can up their searchability a bit
15:07PupenoYay! Clojars working!
15:08PupenoIs there anything like capistrano that you'd use in a Clojure project?
15:09hiredmanpallet maybe?
15:10hugodI'ld be happy to help with a pallet configuration for clojars
15:11Pupenohugod: well, I'm about to give it a try.
15:12Pupenohugod: are you familiar with pallet?
15:12hugodPupeno: more or less ;)
15:14PupenoAre you familiar with Clojars?
15:15hugodPupeno: as a user, yes - never looked at the code base
15:15Pupenohugod: ok… if you want to give it a try, let me know and I can try to help you get setup with it… it took me a while.
15:15thorwildoes Closure even have *anything* to do with closures?
15:16ibdknoxthorwil: no more so than being on top of JS
15:16hugodPupeno: are the (system level) dependencies documented?
15:17Pupenohugod: there's a branch call vagrant that uses vagrant to set up a running VM with all dependencies and everything. It's pretty sweet, but the way it deploys Clojure is broken, so I want to fix it.
15:18Pupenohugod: basically it checkouts technomancy's vagrant branch, which at the moment doesn't work. Checking out my vagrant2 branch works, but it should just deploy your local version, whatever it is.
15:18bultersshouldn't it be possible to set up a git after commit hook, which analyzes the commit for all changes; connects to a running process (via swank?) and updates all changes in the running process?
15:19Pupenohugod: other than that you can checkout the project, run lein deps, lein ring server and you should have it running it on your machine.
15:19Pupenohugod: but you won't be able to push jars to it.
15:22hugodPupeno: I'm in #pallet if you have pallet specific questions
15:23amalloybulters: certainly it's possible - you have any number of turing machines at your disposal. but it's probably not practical, and i'm not convinced it would be desirable
15:25bultersamalloy: just a dream about rolling deployments ;-)
15:27jcromartiesometimes you just gotta restart the app
15:27jcromartiebut yeah
15:27Pupenohugod: I'll have questions soon ;)
15:27PupenoErlang makes it possible and beautiful to do rolling deployments…. updating the code while the app is running, it's great.
15:27bultersjcromartie: it's the same as back in the winME days, sometimes you just have to restart your machine, or it stops working
15:28jcromartiePupeno: I wonder if there's anything preventing Erlang-style deployment with Clojure, barring new jars of course
15:28amalloyi don't think that's it. but if you try to mechanically reload "whatever changed", you'll do things you didn't mean to. like, say someone changes the initial value for some mutable counter
15:28jcromartiebut even with new jars, a dynamic classloader should be able to do it
15:29amalloyyou don't want to re-def back to the initial value in the running app
15:29jcromartieamalloy: you have to design for it
15:29jcromartiedefonce, etc.
15:29Pupenojcromartie: I don't know… it's just that Erlang is prepared for that, you even have functions for switching the in-memory data structures from the old version to the new version. I suppose nothing prevents you from doing a similar thing in Clojure.
15:39jcromartieexactly, Pupeno
15:39CozeyHello. If I have some lazy expression inside try catch block, and the lazy expression when evaluated, can produce an exception - then it is possible that the exception will escape the try catch block - am I thinking right?
15:39hiredmanyes
15:40Cozeyscary.
15:40Cozeyhow can I secure myself from this kind of situation?
15:40Cozeywrap everything in doall ?
15:40Cozey(i'm not using exceptions in clojure myself - but interacting with java, which likes to use exceptions as part of an api for example)
15:42dnolenCozey: doall will works as long as the lazy sequence doesn't have lazy sequences inside of it.
15:42Cozeyi suppose
15:42Cozeyso nothing can be done here except being extremely careful?
15:42Cozeyit's a huge gotcha!
15:43jcromartiewell
15:43jcromartieyou can handle the exception in the code that generates the elements of the sequence
15:43dnolenCozey: perhap catch the exception in the lazy sequence where it'll happen is another way.
15:43jcromartiefor instance, if you're using map: (map #(try ...) coll)
15:43Cozeymhm
15:44jcromartieI know I've run into this before. Lazy seqs are a double-edged sword.
15:46Cozeyyes lazies produce the strangest bugs
15:46kumarshantanuCan anybody pass on a tip - how to comment out a block of Clojure code in Emacs?
15:47amalloykumarshantanu: just put #_ in front of it?
15:47amalloyof if you want to do something super-fine-grained, mark it and use M-;
15:48kumarshantanuamalloy: how does #_ work? I tried and don't think it actually commented it out
15:48amalloy&(let [x #_(inc 1) (dec 1)] x)
15:48lazybot⇒ 0
15:49amalloyso i think you are wrong :P
15:50kumarshantanuamalloy: oh it works! Emacs gave me no visual cue though
15:50amalloywell, emacs doesn't know that #_ is a comment indicator. i'm not sure how you would go about teaching it, as i'm not sure CL has a similar construct
15:51kumarshantanuthis is a bug on clojure-mode then?
15:51amalloyuh
15:51amalloyi would call it a "feature request"
15:53amalloyemacs doesn't recognize (comment foo bar) as a comment either. neither of them are technically comments, so that's hardly a bug
15:55morphlingamalloy: you'd use #+(or) or #-(and) in CL for what you do with #_ in clojure. but i don't think emacs recognises those either
15:55jcromartieI use (comment ...) for comments where I want full clojure-mode
15:56amalloyjcromartie: ##(let [x 1 (comment as per ticket 32432)] (inc x))
15:56lazybotjava.lang.IllegalArgumentException: let requires an even number of forms in binding vector
15:56amalloymorphling: i only used CL for a month or so; what are those?
15:58amalloyhah. the second result on google for "list of common lisp dispatch macros" is the clojure reader
15:59morphlingamalloy: those reader macros conditionally include or ignore the next sexp. (or) and (and) are the conditions and evaluate to T and NIL respectively
16:00thorwilwhat can be better done instead of (into (into foo bar) baz)?
16:00amalloyah
16:00amalloy(reduce into foo [bar baz])?
16:01jcromartie(reduce into [foo bar baz])
16:01jcromartie##(reduce into ["hi" "bye" "foo"])
16:01lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection
16:01amalloy(into foo (concat bar baz))
16:01jcromartieherp
16:02jcromartie##(reduce into (map seq ["hi" "bye" "foo"]))
16:02lazybot⇒ (\o \o \f \e \y \b \h \i)
16:02thorwil... ok :)
16:03gtrakanyway to get like a call/reference graph from slime/swank?
16:03amalloyyou could use slime to write an email to the guy who wrote the code, and ask him for a graph
16:04lobotomyhey guys, i managed to code up this monstrosity: http://pastebin.com/zg3tH3T1
16:04lobotomyhow to clean it up? :D
16:04gtrakamalloy, ha, I guess that means nope
16:04lobotomywhat's a good way of formatting stuff into strings anyway? can do it no prob with my limited skills, but the resulting code isn't pretty, haha
16:05amalloywhat...what are you even trying to do?
16:06lobotomyto print the field thing
16:06lobotomyprettily
16:06amalloyturn that matrix-y thing into "z|.|.\n.|b|c\nq|r|."?
16:06lobotomyyeap
16:06chouserfor the sake of brevity in writing, I'm going to shorten Google Closure to gc
16:06chousershoot, that looks like garbage collection.
16:06chouseroh, Google Closure Compiler -> gcc
16:06amalloychouser: i like the implication
16:06chouseroh, dear
16:07jolyno luck :P
16:07dnolenlobotomy: clojure.pprint has cl-format if you are not afraid.
16:07amalloy"gc throws away all the code you're not using, while the gc throws away the data you're not using"
16:08jolymakes sense since code is data
16:10lobotomyooh, pprint. just need to figure out how to install that...
16:10lobotomyhmm, can i just say "lein install pprint" or something?
16:11gtrakthey should just change it to google bung
16:11amalloy,(println (clojure.string/join "\n" (for [row '[[z nil nil] [nil b c] [q r nil]]] (clojure.string/join "|" (for [col row] (if (nil? col) "." (name col)))))))
16:11clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string>
16:11amalloy,(use 'clojure.string)
16:11clojurebot#<IllegalStateException java.lang.IllegalStateException: join already refers to: #'clojure.set/join in namespace: sandbox>
16:11amalloywtf
16:11amalloy,(println (clojure.string/join "\n" (for [row '[[z nil nil] [nil b c] [q r nil]]] (clojure.string/join "|" (for [col row] (if (nil? col) "." (name col)))))))
16:11clojurebotz|.|.
16:11clojurebot.|b|c
16:11clojurebotq|r|.
16:12arohnercond really needs special indentation, especially when your clause is long enough for one line
16:12amalloyfor/join is substantially clearer than that mess of nested maps with anonymous functions
16:13amalloyarohner: i wrote a cond+ that lets you optionally wrap the test/expr clause in a vector
16:13arohneramalloy: link?
16:13arohneror is it not public?
16:13amalloyhttps://github.com/amalloy/amalloy-utils/blob/master/src/amalloy/utils/core.clj
16:16amalloyfair warning, i never actually use it. tested that it works, but can't really excuse using something non-standard like that just for the sake of some minor readability
16:16arohneramalloy: yeah. I'd be happy with just consensus on identing the normal one properly
16:17arohnerI like lazy-loop though
16:17amalloyarohner: yes, lazy-loop is much more handy
16:17amalloyone of my favorites
16:17arohnerI need to make my own utils lib.
16:17amalloyarohner: i encourage that! everyone should have their own
16:17arohneror, publish it. I keep copy-pasting between my projects
16:17amalloyheh. i wrote a blog post about the evils of doing that
16:18lobotomyarrgh, how do i reset my namespace in emacs
16:18lobotomyguess i better sleep since things are for some reason getting difficult :D
16:19amalloyarohner: the best parts of amalloy-utils have been ported to https://github.com/flatland/useful now, which is the repo seeing active maintenance/development - amalloy-utils is kinda old, and i only linked it because i didn't port cond+ to useful
16:19dnolen,(require '[clojure.pprint :as pp])
16:19clojurebotnil
16:20tomojamalloy: aww, I got excited when I saw "unrestful"
16:21lobotomytrying to evaluate (ns myns) and it throws that illegalstateexception, "replace already refers to: <thisandthat> in ns myns"
16:21arohnerone util that really needs to take off is 'fold', map:for :: reduce:fold
16:21amalloyarohner: huh? fold *is* reduce
16:22amalloy,(doc remove-ns)
16:22clojurebot"([sym]); Removes the namespace named by the symbol. Use with caution. Cannot be used to remove the clojure namespace."
16:22arohneramalloy: how for is a 'nicer' version of map, there needs to be that, but for reduce
16:22arohnerI call mine fold
16:22amalloyarohner: link? i'm curious what a nicer version would look like
16:22amalloyand i've toyed with integrating a reduce functionality into for, but that seemed evil
16:22lobotomyis there a way to obliterate a namespace? i'm looking for something that could let me forget about the current state of the namespace and re-evaluate
16:22lobotomywithout having to kill swank, restart it etc
16:22amalloylobotomy: plz see above
16:23arohneramalloy: https://gist.github.com/1126155
16:23lobotomyah right
16:23vijaykiranall -- I got a small compojure question - how can I add two routes with /abc and /abc/id and use the same method ?
16:24lobotomy(remove-ns 'myns) ;; yay
16:25kjeldahl_Here's a tip; don't make your own user.clj handling the user namespace. Leiningen doesn't like it very much...
16:25vijaykiranI'm using : https://gist.github.com/1126158 but both the URLs call the same method ..
16:26amalloyarohner: https://gist.github.com/1126157 is a little less repetitive, incidentally
16:26arohneramalloy: yeah, it still needs more polish, but that idea needs to go in core
16:26arohnerI use it all the time
16:26amalloyalso, it seems like a complete lie that binding can take any arguments supported by for? it can't take :let, :when, or :while
16:27arohneramalloy: right. that's the quick&dirty version
16:27amalloyyou're planning to expand it?
16:27arohnernot immediately
16:27arohnerif you're interested, go for i
16:27arohnerfor it
16:28arohnerI wrote it quick & dirty to see if it was worthwhile, it was, and then I didn't end up using the 'for 'features
16:30amalloynah, i'm not really interested. it doesn't seem like a big win over reduce to me. i can see how it would be a little more clear sometimes, but like cond+ i don't think i'd actually use it
16:50mefestoanyone using c.j.jdbc with oracle?
16:54seancorfieldhaving problems? i haven't had a chance to test c.j.j with oracle yet
16:55seancorfieldit's been a while since i've had a local install of oracle... used to have it set up on my old mac desktop but haven't needed it since i got the new one two years ago
16:56mefestoseancorfield: ah the man himself :) yeah I'm getting the following when doing an insert-record: "SQLException: error occurred during batching: batch must be either executed or cleared"
16:56mefestolemme put together a small test to make sure it's not something else
17:05mefestoseancorfield: https://gist.github.com/1126283
17:10mefestoupdated with backtrace
17:12Cozeywhat's this? https://gist.github.com/1126299 (exception in at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222))
17:12Cozeyit's related to derefing a future
17:15hiredmanCozey: http://download.oracle.com/javase/1,5.0/docs/api/java/util/concurrent/ExecutionException.html
17:17Cozeyof course. i need sleep.
17:17Cozeysorry for a dumb question
17:39amalloyis there something like swap!/alter that works on vars? i want something like (with-altered-binding [*myvar* vary-meta assoc :foo bar] (...use new var bindings...))
17:40amalloysince it's not as readable to do like (binding [*myvar* (vary-meta *my-var* assoc :foo bar)] ...)
17:42hiredmanuh
17:42hiredmanmetadata on vars isn't threadlocal
17:51arohnersometimes at the repl, swank will give me an error that looks like "error in process filter: Wrong number of arguments: nil, 0"
17:51arohnerwhat causes that, and how can I see the stacktrace?
17:52hiredmanarohner: what emacs version?
17:52arohnerhiredman: 23.1.90.1, OSX
17:52hiredmanthere was a bug in 24 a few weeks ago
17:52hiredmanah, dunno
17:53arohnerwhere was that bug? this seems like a swank-only issue
17:56hiredmanit was in 24, with how hex numbers were formatted, and the slime protocol prefixes messages with the byte count as a hex number
17:56hiredmanbut it should not be in 23
17:57arohnerhuh. This seems to be related to exceptions being thrown while evaluating lazy-seqs. Putting a try/catch in the general area is a workaround
17:57mefestoseancorfield: fyi, oracle insert-record issue resolved in [org.clojure/java.jdbc "0.0.6-SNAPSHOT"]
17:58seancorfieldah, cool
17:58amalloyhiredman: i don't want to set metadata on the var itself, but on the value the var references
17:58seancorfieldyes, that was a problem with apache derby too
17:58mefestohad to do with internal/do-prepared-return-keys*
17:58seancorfieldi rewrote the do-prepared... stuff in 0.0.6
17:59Bronsae che cazzo
17:59amalloyperhaps vary-meta was a misleading example for that reason; instead imagine (with-altered-bindings [counter inc])
17:59Bronsaops
17:59Bronsawrong channel
17:59mefestoseancorfield: just curious but when do you think you'll push a 0.0.6 release?
18:00seancorfieldi was just holding off until that snapshot had more testing on different DBs
18:00seancorfieldsounds like it's ready :)
18:01mefestoheh well i'll put it through the paces here and let you know if anything comes up
18:01mefestothat is... regarding oracle 11g support
18:03seancorfieldthanx
18:04seancorfieldgiven that the batch / update problem seems to affect several DBs and is fixed, i might as well cut 0.0.6 and if you hit other problems, open issues in JIRA and I'll see what i can do for 0.0.7
18:04mefestosounds good
18:06seancorfieldat least the build now has a fairly full set of tests for HSQLDB and Derby - and locally i also test against mysql
18:06seancorfieldsoon we'll have postgresql and mysql available to build.clojure.org so it should be easy to automate tests against those too
18:06seancorfieldthen i need to try sql server on a local VM and maybe oracle too
18:07mefestowow that's some nice coverage :)
18:07seancorfieldok, 0.0.6 has been cut and should show up in maven central some when...
18:11seancorfieldjava interop question: if i have a method that takes List<Foo>, is it possible to type hint that in Clojure?
18:11mefestoi think ^java.util.List is good enough
18:11brehautseancorfield: i think type erasure means that its just a List once the java computer is finished with it
18:11hiredmancompiler
18:12seancorfield'k i'll try that (i'm working on congomongo with multiple host connections right now)
18:13brehauterr yeah.
18:18amalloyarohner: just stumbled upon my blog post about publishing your own utils library, if you're interested: http://hubpages.com/hub/Build-your-own-Clojure-toolkit
18:24arohneramalloy: thanks
18:25dnolensweet http://engineering.twitter.com/2011/08/storm-is-coming-more-details-and-plans.html
18:40seancorfieldthank you brehaut hiredman - ^java.utill.List did what i needed!
18:47brehautis backtype/twitter's storm a hadoop replacement?
18:48chouserno
18:48amalloybrehaut: my understanding is that they have cascalog, written on top of hadoop, and storm is a message queue
18:48brehautchouser, amalloy thanks
18:56_atoPupeno: my deploy script is in that email I linked you from the Clojars list
18:59Pupeno_ato: ah, ok… thanks.
19:00_atoPupeno: http://groups.google.com/group/clojars-maintainers/browse_thread/thread/d4149ec96316d5b1
19:00_atosearch for ato@clojars:~/bin$ cat deploy-clojars
19:00PupenoI have it bookmarked.
19:00Pupeno:)
19:04_atoBy the way, if you know of ways to make the deploy simpler/easier/more-reliable let me know. I won't promise to agree with all of them, but it's been a while since I've heavily worked on a Clojure webapp and there's a lot more tools these days. lein wasn't released when I started clojars, let alone nice plugins like lein-ring. ;-)
19:06lpetitHello
19:06lpetitis clojure 1.3 a minimum for running ClojureScript, or will it work with clojure 1.2 too ?
19:11Scriptorif you run the installer that comes with it, doesn't it get clojure for you?
19:12ibdknoxlpetit: I'm fairly certain it requires 1.3
19:13ibdknoxlpetit: I can't remember what part of 1.3 it depends on
19:13lpetit*shrug*
19:13lpetitMy bet on ^:keyword reader addition
19:22ibdknoxalright guys, hope to see many of you at the Bay Area Clojure group tonight!
19:22amalloysf, la, and seattle all have their meetups on the same day. seems a bit weird; what's so special about the first thursday of the month?
19:23amalloy(and i'm sure someone from a city i've never been to will get upset that i didn't mention they have their clojure meetup today too)
19:23technomancytuesday is ruby group; wednesday is beer&&code
19:24amalloytechnomancy: but it could be like...third thursday, to split things up a bit
19:24amalloylike, who wants to come to a clojure meetup with a head full of ruby and hangover?
19:24technomancyI guess it's just easier to remember
19:24technomancyheh; actually those two are weekly
19:25amalloyah
20:00flazz(class 4) => java.lang.Integer; Integer/SIZE => 32; (.SIZE (class 4)) => IllegalArgumentException, is there a way to get the .SIZE attribute of a non literal class?
20:00amalloyi think it needs reflection?
20:01amalloyor if you actually do know the types at compile time, it's just not convenient to specify them as literals, you can macro your way around it
20:03flazzhmm, ultimately i'd like to convert primitives to byte vectors, do you know of a better way?
20:04hiredmanflazz: http://download.oracle.com/javase/6/docs/api/java/io/ObjectOutputStream.html
20:06hiredmanbyte vectors or byte arrays?
20:16amalloyflazz: use a DataOutputStream on a ByteArrayOutputStream?
20:16flazzhiredman: vectors of numbers lte 255
20:17RaynesWhat about a ByteArrayDataOutputStream? :D
20:17Raynesamalloy: What is the longest Java classname in the official Java APIs?
20:17flazzRaynes: looking ...
20:19RaynesTransformerFactoryConfigurationError is a big one.
20:21hiredmanflazz: like clojure vectors?
20:22flazzhiredman: yep, clojure vectors
20:22flazzi'm only doing it with longs and its pretty easy, i guess i'm trying to be too abstract
20:23hiredmanyou are aware that the max value of a byte is 127 on the jvm?
20:24hiredman(the jvm has signed bytes for some reason)
20:24amalloy128 values should be enough for anyone
20:30amalloyRaynes: Container.AccessibleAWTContainer.AccessibleContainerHandler is a good contender
20:36hypercube32anyone here help me out trying to get maven working with clojure?
20:38hiredmanis maven a requirement? have you checked out lein?
21:15Generic_DumbassSo, going through SICP like a noob:
21:15Generic_Dumbass(def (square x) (* x x)) doesn't work in Clojure. How should it be written?
21:15amalloy(defn square [x] (* x x))
21:15amalloyand i think that doesn't work in scheme either? it uses define, not def
21:15Scriptorscheme is just a *leetle* different from clojure
21:16Generic_Dumbassright, i switched out define // def
21:16Generic_Dumbassthanks
21:16amalloyor (def square (comp (partial apply *) (juxt identity identity))))...
21:17Raynesamalloy: You'll scare him away!
21:17Scriptorlooks legit
21:17amalloyScriptor: it was a trap, though. i put in too many )s
21:18amalloybecause as we all know, lisp is about counting parens
21:18Generic_DumbassNo scaring away. Thanks
21:19Generic_DumbassI actually already went through Little Schemer a year or so ago, so, it's not foreign
21:19Generic_Dumbasslol on the trap
21:19technomancyamalloy: (add-hook 'erc-mode-hook (lambda () (paredit-mode t))) ; bro
21:20amalloytechnomancy: one of these days you'll convince me to use erc. but that day is not today
21:20technomancyamalloy: avoid embarrassing paren mismatches! switch channels with ido! all your abbrevs available.
21:20amalloyor, for a more trolly response: i tried that but mirc gives a error code
21:21technomancyso I was told that rms's .emacs file is mostly a bunch of predefined abbrevs for stuff that he types all the time.
21:21ScriptorI love how I get paren matching in erc
21:21amalloytechnomancy: i preferred to fix lazybot to guess what my maladjusted parens are supposed to be
21:21technomancy"Perhaps you mean GNU/Linux?" "Please don't use the term \"Intellectual Property\" as it is semantically meaningless and confusing." "Using vi is a penance, not a sin."
21:21technomancy&c
21:21lazybotjava.lang.Exception: Unable to resolve symbol: c in this context
21:21technomancydang it
21:21amalloyhah
21:23hiredmanclojurebot: & is <reply> fg #who
21:23clojurebotAlles klar
21:23hiredman,&
21:23clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: & in this context, compiling:(NO_SOURCE_PATH:0)>
21:24hiredman~&
21:24clojurebotfg hiredman
21:43paul_I have a method that takes a java.io.Reader and returns the first line. I was hoping to make a sequence of lines using (repeatedly (fn [] (read-line reader))), but that seems to return the first line each time
21:44hiredman,(doc read-lines)
21:44clojurebotIt's greek to me.
21:44hiredman,(doc line-seq)
21:44clojurebot"([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."
21:45paul_i have a non-buffered reader, and i was hoping not to wrap it
21:50Generic_Dumbassso what is the origin of juxt? new to Clojure or is there some origin from Scheme / CL?
21:52danlarkinjuxt is hiredman's favorite function
21:53hiredmanyes, and that is why I had rich add it
21:53chouserLOL
21:53Generic_Dumbass:)
21:54hiredman(it's funny, because everything I suggest on the mailing list gets shot down)
21:54technomancyit doesn't happen often, but when I find a justifiable use of juxt at work, I call it a good day
21:55Scriptorhiredman: for a moment I thought you were Ken
21:55chouserIt's funny because nobody has Rich add anything. Ever.
21:55hiredmanScriptor: shot down and ignored are not the same thing
22:01Generic_Dumbassok, so, no idea where juxt came from then? lol
22:04Scriptorheh, the docstring still says the name is subject to change
22:10ataggartis anyone using the lastest clojurescript? I'm getting lots of errors.
22:54amalloymy understanding is that haskell has something similar to juxt named (and i'm not making this up) ***
23:14amalloypaul_: why would you "hope not to wrap it"? that's like...you have the strings "1" and "2", and you hope to add them together, but you hope not to use integers at any point. you can do it all with strings, but why would you go to that trouble?
23:40scottjclj-arrow has ***
23:50flazzhow does one test equality for records? .equals seems to work where = and == do not