#clojure logs

2010-02-15

00:01arkrostHi! Can anyone show me code example with using with-bindings* macro?
00:09arkrostIs anuone here?
00:09arkrost*anyone
00:37qbgOkay
00:38qbg,(let [f (fn [] *warn-on-reflection*)] (with-bindings* {#'*warn-on-reflection* true} f))
00:38clojurebottrue
01:39qed'lo 'lo
03:08LauJensenMorning gents
03:09RaynesMorning.
03:12RaynesLauJensen: What are you up to this morning?
03:13LauJensenSo far I'm ready for morning coffee, you? :)
03:15RaynesLauJensen: I've been awake since 1:00pm yesterday, and it's 2:17AM at the moment, and I don't intend to sleep anytime soon.
03:15RaynesI'm trying to learn Factor, even though my attention span is nil.
03:15RaynesSo, I'm good.
03:15RaynesAnd it's snowing. I think.
03:16RaynesYeah. It's snowing.
03:16RaynesActually, it might be finished snowing.
03:16RaynesTends to not last long in Alabama.
03:24LauJensenNormally we would say the same here, but it has been subzero C for months now
03:30sunkencityWhy do I need to make an inline function like #(.equals %1 %2) when using map rather than just .equals?
03:30LauJensenbecause its a java-fn
03:32sunkencityok. so java functions always need their own parens?
03:33Chousukeit's a method. Methods don't implement the needed interfaces
03:33sunkencityok. now I get it. tnx
03:33Chousukebasically you're creating a function that calls a method on its parameters
03:36sunkencityIs there some nice syntactic sugar to guard against nullpointers like (.equals nil nil), should I use maybe monad maybe or is there something simpler?
03:36Chousukeno syntactic sugar, but you can use (or foo default)
03:37Chousukeor other solutions, depending on what you need. :P
03:37sunkencitybut then I get an exception
03:38Chousukeyou need to check for nils if whatever you pass them to is not expecting them :/
03:39sunkencityI've programmed too much ruby, I prefer nil to be an object :)
03:40LauJensen(map #(.fn %1 %2) (filter identify sequence))
03:40Chousukeidentity :P
03:41Chousukealso note -?> and -?>> in contrib which short-circuit on nil
03:56TheBusbywhat are -?> and -?>> under in contrib (google really hates those...)
03:56TheBusby?
03:58LauJensen~source -?>
03:59LauJensenThere u go TheBusby
04:05TheBusbyLauJensen: Thanks,
05:22zabHi. I'm trying to get a dev environment set up for running Clojure in App Engine. I followed this: http://www.hackers-with-attitude.com/2009/08/intertactive-programming-with-clojure.html but I cannot get the App Engine decorator described to work.
05:22zabDoes anyone know what this mean? java.lang.IllegalAccessError: class clojure.proxy.com.google.appengine.tools.development.ApiProxyLocalImpl cannot access its superclass com.google.appengine.tools.development.Ap
05:22zabiProxyLocalImpl (start.clj:44) at clojure.lang.Compiler.analyzeSeq(Compiler.java:4503)
06:28tomoj#clojure has not been active enough this morning to satiate my desire to procrastinate :(
08:16powr-tocis there a function like select-keys that does the opposite and returns all the keys not in the supplied seq?
08:17powr-tocI mean one that returns a map of all the keys (to values) that are not in the supplied seq
08:19ulfsteryou can use the set-function
08:20chouserpowr-toc: dissoc, I think.
08:25ulfster,(clojure.set/difference (set (keys {:a 1 :b 2})) (set (keys {:b 3})))
08:25clojurebot#{:a}
08:25chouser,(dissoc {:a 1 :b 2} :b)
08:25clojurebot{:a 1}
08:25powr-tocchouser: dissoc's exactly what I want
08:39chousercgrand: yes, I don't see why we shouldn't lobby for a 'swap' that returns the old value.
08:39chouseras long as you're using pure functions with 'swap!', you can always calculate the new value from the old for yourself, but the reverse is not true.
08:41cgrandchouser: or that returns both values
08:41chouseryes
08:41rhickeycgrand: what's the use case? (I just arrived)
08:42cgrandchouser: what was your latest use case?
08:42chousermy use case is a map of request-id's to callbacks
08:43rhickeyplease explain
08:43chouserthe requests can arrive on any thread. Usually each id will arrive only once, but if one arrives twice I want to be absolutely sure I only call the callback once
08:44chouserthe map is already in an atom.
08:44rhickeyanother use case for cells
08:45rhickeycells can serialize activity, atoms only data
08:51chouserWhen a cell holds a transient, you send it mutating fns? And it has hooks to call both transient and persistent! as needed?
08:52rhickeychouser: could be mutating or not, yes, calls transient/persistent, which become protocols
08:52chouserbut "send" is the wrong word because it's synchronous -- closer to 'alter'?
08:52rhickeyyes, more like alter
08:53chouserdo I have to indicate when I alter whether the call is mutating or not so it knows which of the transient/persistent hooks it needs to use?
08:54rhickeyno, the fn will always be applied to the transient component
08:55rhickeyif there is no transient component, it will be created
08:55chouserthe fns are serialized via locks
08:55rhickeydepends - the access control policy is actually independent
08:55rhickeye.g. the single threaded policy uses no locks
08:57chouserI have this other (ab)use of atoms that I'm trying to think if cells could replace.
08:57bosiei don't understeand how iterate nows when to stop the infinite loop ? like here: https://gist.github.com/27254bbcf1555202882e
08:57chouserstill not sure -- my thinking is so fuzzy. :-/
08:58chouserbosie: 'iterate' and 'map' are lazy, so no work is done until something that's using the seq returned by 'index' asks for the first or next item.
08:58chouserbosie: and then only one step is done until something asks for the next item after that. And so on...
08:59bosiemeaning (println) asks for more and never stops asking?
08:59chouseryes. oh, but 'map' in that case is given two seqs. It stops asking when either of the seqs runs out of items.
09:00bosieok
09:00bosiethanks chouser
09:02chouserhuh. Perhaps I should be using refs instead of atoms for this other case.
09:02chouseryeah, that's it. hmph.
09:03chouseractually, both cases.
09:05rhickeyin general, if you feel you are trying to build a higher-level construct out of atoms, you might want to look at one of the other ref types
09:05rhickeyexcept when you are trying to build a queue, then j.u.c.
09:07chouserI think I passed over refs initially because I need to call this potentially inpure callback. But if I just have my transaction return a flag indicating if it should be called or not, I can do the actual call outside the transaction.
09:12bosierhickey: does the green '2010 funding progress' mean you have almost met your goal of being able to work on it full time?
09:12rhickeybosie: almost, yes
09:13AWizzArdIf it continues to go well we can fund 1-2 more full time devs :)
09:14bosielet's hope so, don't want to learn a language which will become obsolete in half a year ;)
09:15AWizzArdbosie: highly unlikely.
09:16AWizzArdClojure already has very many users, and even if it would not continue to develop from now on (which is unlikely) it already is a greta platform for development and offers a rich feature set.
09:19chousernot just many users, demonstrably sufficient users with sufficient committment to fund a year's worth of development.
09:19chouserThat arguably puts Clojure's ongoing development on a better footing most open-source projects.
09:21bosiechouser: iff it pulls in the same amount (more due to inflation) next year though
09:21chouserbosie: sure, but the people donating this time did so with the understanding they were only covering one year.
09:23chouserAnd what's more likely, that a significant number of people will pull their funding or than some corporate sponser (I'm thinking Red Hat or Ubuntu's Canonical) falls on hard times and disbands?
09:23chouserMy point isn't which is more likely, actually, but that it's not obvious to me that one is on substantially better ground than the other.
09:24bosiethat's true about the corporate sponsors
09:47underdevhi! im working my way through programming clojure
09:47bosieunderdev: me too
09:47underdeva simple operation isn't working as described
09:47underdev(def inventors {"Lisp" "McCarthy" "Clojure" "Hicky"})
09:47underdevduh
09:48bosieworks fine here
09:48underdevi was using the value and not the key
09:48underdevnm :)
09:54chouseris it any less efficient or correct to deref a ref a couple times in a dosync rather than deref once and store in a local?
09:57Chousukechouser: I think it might be a bit race-prone to deref a ref multiple times :/
09:58rhickeychouser: I think it is good practice to deref as few times as possible
10:00Chousukewill the result a deref change if some other transaction modifies the ref and commits in the mean time?
10:01rhickeyhrm, JavaOne topic areas include Java and "scripting languages", but not alternative languages - https://www28.cplan.com/cfp_prod/CFPLogin.jsp?wId=268225
10:01rhickeyChousuke: no!
10:01Chousukeright.
10:01rhickeythat's the (I)solated of ACI_
10:02rhickeyare Clojure and Scala scripting languages?
10:02Chousukeso it's safe to do multiple derefs, but you need ensure if you want to restart in case something else commits a modification to the ensured ref? Am I getting this right?
10:03rpdillonRe: few times as possible - potential error, or just good style?
10:03rhickeyChousuke: if you aren't changing a ref but your transaction being correct relies upon it not changing, you must ensure it
10:04rhickeythat doesn't mean you will see it change in-transaction
10:06ChousukeI'm finding it somewhat difficult for some reason to keep the semantics of in-transaction deref and ensure in my head :P
10:09rhickeyChousuke: start with the snapshot model of a transaction - your transaction will see the world as-of a point in time. Don't lose that while you incorporate that ensure is about the state of the world when your transaction commits - ensured refs won't be different than what you saw
10:09Chousukeright
10:10rhickeyand rely on the STM's ACI to completely free you from thinking about actions of other threads - if they cause conflicts you will retry
10:11rhickeythat's why I'm concerned about http://java.ociweb.com/mark/stm/article.html - too much emphasis on implementation and too little on semantics, the latter being much simpler
10:12cemerickdoes anyone do *any* scripting with either clojure or scala?
10:13underdevwhy would you script with jvm langs? Esp when there is tcl.
10:13underdev;)
10:14cemerickI tend to think that, if you're scripting, especially around jvm-based apps, you're doing it wrong.
10:14_fogus_rhickey: Which is also why Chouser and I want to focus on the latter. IMO the semantics are much more important
10:14ChousukeHmm. So you're supposed to make a decision based on a snapshot, and if your decision is based on things that are no longer true when you finish, you get to retry. And commute is a way of saying "I don't actually care what the state of this thing is, do X to it"
10:14rhickey_fogus_: yes, please
10:15rhickeyChousuke: the best way to think about it is - should some promise not be possible to make, your transaction didn't happen. Thus you only need to concern yourself with the semantics of successful transactions
10:16_fogus_cemerick: "you're doing it wrong"... care to elaborate?
10:18cemerick_fogus_: scripts are generally fragile and platform-dependent. If you have the opportunity, eliminating/minimizing "scripting" as a deployment/administration methodology is almost always for the better.
10:19Chousukecemerick: hmmh, that's a pessimistic view of scripting :P
10:19_fogus_cemerick: I would follow with, if your scripts are platform dependent, then you're doing it wrong.
10:19Chousukecemerick: most OSes are full of scripts that work just fine :)
10:19_fogus_naturally platform independence is not 100% achievable, but it could be minimized
10:20underdevby tcl
10:20underdevsorry, i'll stop
10:21underdevi must admit, after listening to all those theoretical talks on functional langs, most of my tcl code looks stupid to me now.
10:21cemerickeh, I dread ever having to write or modify a script, of any sort. The time spent is almost always in dealing with absurd minutiae that I always feel like I shouldn't have to bother with.
10:21chouserI wonder if there's sufficient meaning in the word "script" to support any discussion like this.
10:21_fogus_chouser: +1
10:24underdevousterhout and wall have written interesting things about that
10:24rhickeychouser: and yet, there is something to Oracle's consistent use of the qualifier, I think
10:24underdevlevel of abstraction, mostly
10:24underdevi think
10:25underdevbut where you draw the line is definitely up for debate
10:25rhickeyJava + scripting languages is less of a threat to Java than Java +/vs alternative general purpose JVM langs
10:25cemerickrhickey: insofar as their entire product line is keyed toward java as the chosen "application development language", they have to have the qualifier
10:25cemerickor, what you just said :-/
10:26chouserSo the relevent question is what exactly *Oracle* means by a scripting language.
10:26rhickeythey explicitly list Python, Ruby and JavaFX
10:27chouserdo they mean "slow"? :-)
10:27_fogus_I see a topic category, "The Java Frontier". That sounds like alt langs to me
10:28underdevthat article about why i love everything you hate about java was interesting
10:28rhickey_fogus_: yeah, the wild west
10:28underdevreminds me of what is said about c++ and other "system languages"
10:28chouserunderdev: did you see the response as well?
10:29underdevi don't know to which you refer.
10:29chouserhttp://romanroe.blogspot.com/2010/02/why-i-hate-everything-you-love-about.html
10:29_fogus_rhickey: Question is, are you more like Wyatt Earp or Billy the Kid? ;-)
10:30rhickeye.g. people thinking - add closures to Java and why do you need Scala?
10:31underdevsaved in diigo as unread, it's awfully long
10:31underdevlooks very interesting though
10:31_fogus_underdev: Well, it's definitely longer than 140 chars, but worth the time. :-)
10:31underdevlol
10:32_fogus_rhickey: Push-back from whom?
10:32rhickey_fogus_: Oracle
10:32_fogus_ahhhh
10:32underdevhere's where the rubber meets the road. I was a SCPJ, wrote a huge system in java for a call center. Someone mentioned perl to me. I rewrote in under 1000 lines of code. NEVER LOOKED BACK.
10:32rhickeyClojure, being so different, is off the radar I think
10:33cemerickScala's objectives seem entirely at odds with Oracle's. Intriguing / confusing type system experiments don't sell anything.
10:33_fogus_It would be interesting to see how Oracle might present such an argument, especially given that there is a general view (be it wrong or not) that "normal" Java developers could never understand closures
10:34rhickey_fogus_: then they'll certainly never understand Scala
10:34noidiregarding long blog posts, this really helps to read them :) http://lab.arc90.com/experiments/readability/
10:35cemerickThe morts don't want closures, they want more and better tools, and that's where the money is.
10:35_fogus_rhickey: Maybe that is the approach. Present Scala as indecipherable
10:35rhickeyI just hink the Sun folks were incredibly open-minded and now I expect less of that. As the owner of Java and JavaFX I expect Oracle to consider Scala and Groovy(++) as threats and or dilution of their story
10:36underdevi for one, love reading in depth pieces. Just can't do it at an arbitrary time.
10:36rhickeyI'm not trying to argue against Scala (Clojure is in the same or worse boat, but never had pretensions of replacing Java in the mainstream)
10:36_fogus_rhickey: I for one understand your stance on Scala and did not presume anything of the sort
10:36rhickeyBut the wording of things like the call for papers *might* have been carefully considered. I mean, leaving Clojure and Scala guessing as to which track they might fit?
10:38_fogus_Frontier is definitely a loaded term
10:38chouserI wonder if Python and Ruby are less threatening because the JVM versions are seen as secondary, or because of their speed, or dynamism, or ... what?
10:38chousersecondary to each's C implementation I mean
10:38rhickeychouser: well, it was interesting to see then listed as Python and Rucy, not Jython and JRuby
10:38rhickeyer, Ruby
10:38chouserhm.
10:38cemerickchouser: they're not less threatening, there's more money to be had in them.
10:39bosierhickey: in which time zone are you ?
10:39rhickeybosie: NY
10:40chousercemerick: more money to be had by Oracle? how?
10:41rhickeyof course, this could all be unwarranted speculation. After all, last year the keepers of the lingo changed every reference to the JVM in every talk to the "JVM Machine"
10:41chouserheh
10:41Chousuke:/
10:41rhickeymaking us all seem like idiots from the department of redundancy department
10:41ohpauleezhaha
10:41ohpauleezreally? that's so funny
10:42noidimaybe this year it'll be the Java JVM Machine to leverage the brand ;)
10:42chouseramazing. I went to college near a town that had a building labeled "The City of Gas City City Hall"
10:42Chousukeredundancy in terminology isn't that uncommon but why would they change it like that.
10:43cemerickchouser: (a) even if people aren't using jython or jruby, oracle's got a pile of other tech they'd like to sell to people using those languages, so they want to be language-agnostic enough to support that pitch, (b) if people do use jython or jruby, they benefit from those folks needing more iron, (c) insofar as people who use jython and jruby use netbeans, they'll be more likely to buy oracle kit in general.
10:43cemerickall of those are only made possible by a certain critical mass in the size of those language's communities, of course.
10:43_fogus_chouser: That sounds like Buffalo buffalo buffalo...
10:45chousercemerick: so all Clojure needs to be included is critical mass?
10:45cemerickchouser: if there were suddenly X clojure programmers that represented Y dollars in spending authority / recommendations, I guarantee you that Oracle would list it next to python and ruby.
10:45chouser:-) fair enough
10:46cemerickThe great thing about oracle is that their objectives and motivations are rarely hard to figure out. Far less capricious than Sun, certainly.
10:47rhickeycemerick: I think it is a completely different game - Python and Ruby devs represent potential new clients not in the fold. Clojure will come from the other side, as they discover existing clients already using it, esp in analytics to start.
10:49chouserdid you expect a Clojure to find a niche in analytics as it has. I for whan have been completely surprised.
10:50cemerickYeah, very different userbases. The shared independent variable is purchase authority, tho.
10:50rhickeyOT - has anyone ever used the xvid quicktime plugin for OS X? There's a talk I want to watch in this format, but the plugin is old and alpha
10:50rhickeycemerick: true
10:51Chousukerhickey: Install Perian
10:52rhickeychouser: I never foresaw what has happened with Clojure at all :/
10:53drewrrhickey: http://www.videolan.org/
10:53cemerickrhickey: irritated at what it's being used for, or that you didn't see it coming?
10:53rhickeycemerick: I'm not irritated at all, just bemused
10:55eyerisIs there a std contains function? Similar to python's in operator?
10:55eyerise.g. (contains 1 [1 2 3]) -> true
10:55stuartsierraeyeris: idiom is (some #{1} [1 2 3])
10:56stuartsierraWorks in O(n) time.
10:56chousereyeris: any reason you can't use a set instead of a vector for that collection?
10:56eyerisI can.
10:56chouserI mean, don't convert to a set just for the contains op, but if you're mainly using it for that kind of lookup, well that's exactly what sets are for.
10:57chouseryou can do (#{1 2 3} 2) in nearly constant time.
10:58eyerisI am just categorizing a database record and I want to avoid (or (= (:code row) 2112) (= (:code row) 2660) ...) for 6-7 more code values
10:58eyerisSo I would have to convert the field to a set, but the set of values is static, so it would be just fine to use a set on that side.
10:59chouserso a constant set of values. Yeah, a literal set should work perfectly.
11:00chouser(if (-> row :code #{2112 2660 ...}) ...)
11:00chouseror whatever
11:01rhickeydrewr: works - thanks!
11:02rrc7czhas anyone else seen the seq returned by iterator-seq not stopping correctly? In other words, calling .next when .hasNext is false?
11:02Chousukechouser: I think that borders on abuse of -> :P
11:03noidihowcome?
11:03chousercould be. I only lurched that direction to avoid ((
11:03eyerisI went with: (some (set (:code case-row)) #{2260 2310 2320})
11:03chouser(#{2112 2660 ...} (:code row)) ...oh, nm.
11:03chousereyeris: that's still O(n).
11:04eyerisOh?
11:04chouser"some" is O(n). Perhaps: (get #{2260 2310 2320} (:code case-row))
11:04noidiI think chouser's first version reads nicely; "if the row's code is in [set], do something"
11:04eyerisI see
11:05Chousukenoidi: (<set> item) is the clojure idiom, and -> kind of obscures that
11:06ChousukeI tend to read -> as a "pipeline" so the set doesn't quite fit
11:07chouser->> is the pipeline op :-)
11:07noidiIMHO that's no more unclear than (-> foobar :looking :up :values :in :nested :maps)
11:08ChousukeWell, I can't tell you to think otherwise, but I disagree :P
11:08noidihehe
11:09ChousukeBut I think people are perhaps overusing -> sometimes
11:10noidinow that I think of it, I would've placed the set first, too
11:11hiredmanpffft
11:12ChousukeMaybe it's some subconscious trauma from when I found a monster from clojurebot's code that was something like (-> foo ((partial map quux)) ((partial filter blah)) ((?!?? ??F?S?D?F)) :foo :bar .toUpperCase)
11:12hiredman:P
11:12Chousukeexcept with more partials and functions.
11:12noidibecause the check against the set doesn't "modify" the value, like I imagine a pipeline to do
11:13hiredmanChousuke: that could be any line in any file of clojurebot, could you be more specific :P
11:14Chousukesadly I've forgotten which file it was in :/
11:14ChousukeMy brain has blocked the specifics; they're too gruesome
12:03ordnungswidrigI still fight binding and bound-fn...
12:03ordnungswidrigi there a decent example in the web out there?
12:04eyerisWhat don't you understand about them?
12:04ordnungswidrigeyeris: "it doesn't work".
12:05eyerisI've never used bound-fn because I have to stick to 1.0, but it seems like the difference is that binding lets you establish new bindings in the middle of a function where you need both bindings, at different times.
12:05eyerisordnungswidrig: do you have a paste?
12:06ordnungswidrigeyeris: paste is a little difficult - i try to extract the exact problem. A little context first:
12:07ordnungswidrigI define a compojure handler and at this time some configuration is avaiable, say db settings. The compojure handler uses another libs with-xxx macro which expands to a (binding [conn …] …) form. The problem is that this handler is executed in a different thread and doesn't have the binding.
12:09eyerisSo your issue is then not with the binding macro but instead with the outer bindings
12:10eyerisYou basically have two choices. You can def conn globally or you can pass it to the handler that spawns the new thread.
12:11eyerisThere may be another option, but I'd have to see the code.
12:12hiredmanman, passing values to functions? that's crazy
12:13ordnungswidrigpasie
12:13ordnungswidriglisppaste8: url?
12:13hiredmanlisppaste8 seems to have been dead for a while now
12:14eyerispatebin.ca (my fav) has been dog slow for months too
12:16ordnungswidrighttp://paste.lisp.org/display/94993
12:17hiredmanbleh
12:17Chousukeordnungswidrig: I don't think that's how you use binding :/
12:17hiredmanusing with-foo like that over the global routs seems horrible
12:18ordnungswidrighiredman: I tried all kind of location
12:18Chousukeordnungswidrig: if you changed "binding" to let that would work :P
12:18eyerisDamnit Chousuke, you beat me to it!
12:18eyerisI had that half-typed out :)
12:18Chousukebut of course you would be unable to affect teh value of *foo* afterwards
12:20ordnungswidrigChousuke: actually the library which defines with-foo is under my control. Isn't it best practice to provide a macro like that to keep around a db connection?
12:20Chousukeordnungswidrig: the problem with that is that the route is defined to use the value *foo*, and the value of *foo* _is_ "FOO" when the route is defined, but not after the definition.
12:20ordnungswidrigdb connection as an example.
12:20ordnungswidrigChousuke: I see.
12:21Chousukeoh wait, it extends to start-server as well. never mind
12:21ordnungswidrigChousuke: internally compojure generates and throws around a lot of (fn [])
12:21Chousukethere you hit the thread-locality of var binding :)
12:21hiredmanordnungswidrig: just because the only way to fit a knife between someone's ribs is to turn it so the blade is horizontal doesn't mean you should go around stabing people
12:21ordnungswidrigyes, I extended it over start-server intentionally.
12:21Chousukeif start-server starts the server in another thread, the dynamic binding is no longer effective there
12:22hiredman(just because that is the only place binding works, it doesn't mean you should use a binding there)
12:22hiredmanyou should just pass whatever it is around
12:22cemerickhuh, interesting that private vars can be rebound without a #'
12:23ordnungswidrighiredman: that is an option. But this means tha I cannot make use of something with a with-xxx macro then in a threaded context?
12:23hiredmanordnungswidrig: there are various things like bound-fn, etc, but I think passing it around is the best solution
12:24ordnungswidrighiredman: so even when I bind within the handler it would not see the binding due to running in a different thread?!
12:26Chousukeordnungswidrig: it doesn't matter where in code the binding happens. If you bind within a different *thread* then other threads will not see the change
12:26Chousukewhere you put the binding in code only influences that indirectly :P
12:27hiredmanordnungswidrig: I have no idea, I am discussing a particular threading/execution model of a particular environment (compojure), I am saying the application of functions to arguments is a good model and should be promoted over models that make use of implicit arguments passed via binding
12:27Chousukeie. you might pass around a function that does dynamic binding to a helper which executes it in multiple threads, thus creating multiple dynamic bindings
12:27ordnungswidrighiredman: I'm totally on your side.
12:28Chousukeordnungswidrig: is test-server a function?
12:28ordnungswidrigbound-fn will expose the complete environment to the body, right?
12:28ordnungswidrigChousuke: a java instance
12:28Chousukemeh
12:28ordnungswidrigorg.mortbay.jetty.Server
12:29Chousukeif it were a function you could have done (start-server (bound-fn* test-server)) :)
12:30ordnungswidrighttp://paste.lisp.org/display/94993#1
12:30Chousukeordnungswidrig: you can use bound-fn* instead of bound-fn there.
12:31ordnungswidrigI guess the usage of bound-fn in this case is fine. Or do you see any side effects?
12:31ordnungswidrigChousuke: bound-fn*?
12:31Chousukeordnungswidrig: just (bound-fn* handler)
12:31Chousukeit takes a function and returns another which sets up the proper dynamic environment prior to calling the original function
12:31ordnungswidrigChousuke: ok, I'll try in my "real" application
12:32Chousukebound-fn is a convenience macro for (bound-fn* (fn [args] (blah args)))
12:33ordnungswidrigsilly me. I actually tried (boundfn [] (with-foo (…))
12:33Chousukeheheh
12:43ordnungswidrig…and finally it works
12:43ordnungswidrigthanks guys
13:15triyoanyone try congomongo (clojure mongodb driver) with clojure-1.2-master (intrim)? Getting clojure.lang.RestFn.<init>(I)V [Thrown class java.lang.NoSuchMethodError] with swank-clojure.
13:15triyohowever if I run with "lein repl" then it works. But here *clojure-verion* -> 1.1-master
13:19triyoguess congomongo 0.1.1 doesn'r work with clojure {:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"} yet.
13:20triyowhich prob makes sense.
13:22triyoI see the relevant "new" branch under congomongo.
14:06LauJensenDoes anyone have an idea of how the Oracle acquisition will affect clojure-land ?
14:06rsynnottwell, Java is unlikely to go away...
14:12drewrLauJensen: that was being discussed earlier
14:12drewrcheck out the logs for today
14:13LauJensenthanks
14:13LauJensen~log
14:13clojurebotsee logs
14:13LauJensen~logs
14:13clojurebotlogs is http://clojure-log.n01se.net/
14:14IntertricityI know this is a simple question but- would clojure be a good alternative to C# for developing a game server?
14:14Intertricityor even stackless python
14:16rsynnottIntertricity: probably, yes, depending on the type of game
14:16ChousukeWell, If python is fast enough for you, Clojure probably is too, and the concurrency features might be attractive for a server.
14:16AWizzArdClojure would be a good choice for this.
14:16Intertricityrsynnott, say a virtual world that served up models, stored user uploaded modelers, etc.
14:16rsynnottStackless python more or less exists for that reason; most development is done by that Icelandic company that runs Eve Online
14:16rsynnottbut yep, clojure's concurrency model would seem to be quite suitable
14:16Intertricity*models
14:17Intertricityyeah I was thinking about stackless python, but I wanted to play with a lisp
14:17Intertricitybut I wanted to know if I'd be digging myself a hole or not, using it for something it wouldn't have been suited for or not
14:17IntertricityI wonder if clojure would be faster than stackless :P
14:18rsynnottprobably depends on how you use it
14:18rsynnottall else being equal, it probably should be; better garbage collection and all that
14:19LauJensenDoes the licensing around the JVM guarantee that there will always be a free JVM around ?
14:19ChousukeLauJensen: there's a GPL'd version of the JVM available, so yes.
14:19Chousukeyou can't un-GPL it :/
14:19Intertricityrsynnott, thanks for the help ^^
14:20chouseralso, clojure may not always depend on a JVM
14:20LauJensenchouser: I know, but in a certain regard we do depend on libraries
14:20Chousukethough Oracle may cut of support for it... Which would rather foolish of them :)
14:20Chousuke+be
14:20rsynnottLauJensen: I believe so, yes
14:21rsynnottChousuke: oracle have a history of maintaining open source stuff, as long as it's dual-licensed with a commercial license and a highly restrictive open-source one (such as the GPL)
14:21rsynnottSleepycat BDB is the obvious example
14:22Chousuke"highly restrictive" :P
14:22ChousukeI guess it is, relatively speaking
14:23hiredmansomeone at the seattle meatup suggested we might see a split, jrocket as the "enterprise" jvm and openjdk as the free one, which I think matches up with this comment: http://www.theserverside.com/news/thread.tss?thread_id=59317#332147
14:24rsynnottChousuke: in that it requires release of modifications, and is effectively transmissible
14:24ChousukeI suppose Oracle might even open up the JVM development process more than Sun did.
14:24rsynnott(if one bit of GPL touches your product, it ends up GPLd)
14:24rsynnotthopefully, a clisp-like situation does not arise :)
14:25rsynnott(clisp's FAQ claims that applications which use a part of clisp which is not part of the Common Lisp standard, such as the FFI, are themselves subject to the GPL)
14:25rsynnottthough it's uncertain whether this is actually, whne it comes down to it, true
14:26Chousukewell, one could consider it a GPL library
14:26Chousukelinking against a GPL'd library means your program needs to be GPL as well, as far as I know
14:26rsynnottyep
14:27ChousukeAlso don't macros cause more problems with the GPL, as you're basically including the library's code in your own product.
14:27ChousukeAt least I've seen a (L)GPL exception specifically adressing this
14:27rsynnottChousuke: LLGPL?
14:28hiredmanLOLGPL
14:28Chousuke:P
14:28rsynnottAFAIR it more addresses the issues brought up by the LGPL for languages which don't use proper dynamic linking
14:28hiredman*snort*
14:29rsynnott(you're allowed distribute an LLGPL library as part of your common lisp system without infection, but not an LGPL one)
14:29hiredmanblaming legal issues on technology and the reverse is very silly
14:30rsynnottLGPL certainly feels like it was designed in the context of C-like languages on UNIX-adjacent things
14:37LauJensenI'm speaking at http://opensourcedays.org/2010/ - Be there or be square
14:38tomoj"We could not calculate directions between Austin, TX and Copenhagen, Denmark."
14:38tomojsorry
14:41LauJensen(just kidding, I know you'll find a way here)
14:44tomojhighly doubtful :(
14:52texodusthe EPL and GPL are incompatible, correct?
14:53texodusso there's no way to license a clojure project that depends on contrib and a GPL licensed lib?
14:54rhickeyEPL doesn't limit licenses with which it is combined, but GPL does
14:54chouserIt's GPL not LGPL?
14:54texodusyes ... LGPL would be compatible though, yes?
14:55chouserI would think so.
14:55chouserLots of Java GPL libs have a "class path exception" or something which may make a difference.
14:57texodusclass path exception? So, if I add it to my classpath but don't modify the source, I can license my code under whatever (assuming the library in question has this clause)?
14:58chouserYou'd have to check the actual clause, but that's my vague understanding.
14:58texodusinteresting
14:59texodusthanks
15:03chouserif I want to insert the value of a reference object into a syntax-quote, I guess I can't use ~@my-ref
15:03Chousukeheh
15:04chouserhm. that should have been a pop quiz
15:05ChousukeWhat kind of macro do you have that needs refs? :|
15:06chouserI broke clojure.contrib.trace/dotrace, and now I'm trying to fix it
15:06chouserwell, did fix it.
15:07chouserso it was vars not refs
15:26Licenserhmm what deos this: http://gist.github.com/304958 tell me?
15:27ordnungswidrigLicenser: macro-expansion time?
15:27Licenserno run time
15:27ordnungswidrigLicenser: does the inferior-lisp buffer tell you something or the other slime buffers?
15:28chouser(.foo nil)
15:28chouser,(.foo nil)
15:28clojurebotjava.lang.NullPointerException
15:28ordnungswidrig,(nil nil)
15:28clojurebotjava.lang.IllegalArgumentException: Can't call nil
15:28chouser,(let [x nil] (x))
15:28clojurebotjava.lang.NullPointerException
15:29Licenserordnungswidrig: not really
15:29ordnungswidrigLicenser: I remember having the same "stackless" NPE the other day.
15:29ordnungswidrigLicenser: do you have other SLDB buffer open?
15:30chouseroh, there's no "cause"?
15:30Licenser__problem is that I just get' nullpointer exceptiopj' nothing helpful at all no where no message even
15:31rhickeynaming time. Need names for cells, their access policy thingies, their 'alter' equivalent, the peek op
15:31rhickeyideas procs, ??, >>, <<
15:31hiredmancouldn't the peek op just be deref?
15:32rhickeyno, still have deref
15:32chouserderef can trigger hooks, peek cannot?
15:32rhickeypeek is used to look at part of the transient
15:33rhickeye.g. to get the count of a transient collection being built
15:33bosieanyone in here has the peepcode clojure screencast?
15:33rhickeyalso TBD - should procs have different arg order from other refs? (>> op aproc) vs (alter aref op)
15:34rhickeyeases procifying
15:34Licenserany ideas how to get more information out fo clojure what went wrong?
15:35bosieor anyone know about phil hagelberg and/or the quality he normally delivers? :)
15:35chouserwould peek be useful for anything other than transients?
15:36rhickeychouser: ideally one wouldn't know if a true transient was held, and would want to use a proc correctly in any case
15:37rhickeyalso, without it you must deref which might cause value to be produced
15:37chouserbut doesn't peek start to get into implementation details? more than just deref/alter do.
15:37chouserI mean, if the cell isn't holding a transient, what would peek return?
15:38rhickeypeek takes an accessor fn, it is not a deref of the entire thing
15:38rhickeyso peek returns what that fn returns, e.g. count
15:38rhickey(<< count aproc)
15:38chouseroh, (peek a-cell count) ?
15:38chouserok
15:38rhickeyat not point are transients released to outside world in this model
15:38rhickeyno point
15:39chouserok. But count operates on the transient directly?
15:39rhickeythere are some open qs about how much a transient might/not conform to the value's api.
15:39chouserok
15:39rhickeye.g. String and StringBuilder
15:40Chousukehm, I really want alphanumeric names for those functions, but I can't think of anything suitable :/
15:40rhickeychouser: yes, peek/<< acts on transient
15:41Chousukeall good names are so overloaded.
15:41lpetitI had the "mental image" for "cell" in place. I don't understand why "proc" ?
15:41rhickeyI'm not sure I will put it in the first pass, but think peek is unavoidable
15:41rhickeylpetit: proc(ess)
15:41Chousukeor too long :P
15:41rhickeylpetit: still might end up cell, thus this discussion
15:41chouserproc isn't too pad. proc-hook for the access policy thingies?
15:42chouserproc-peek
15:42chouser...aaaand proc-alter. There, done! :-)
15:42rhickeyIn my first go-round, cells had locks. Now they have access policies that might or might not involve locks, so cell/lock doesn't quite work
15:42chouseroh, access policy != hook
15:42Chousukeproc-apply if the op goes first. :/
15:42lpetitso what exactly will an access policy look like ?
15:43Chousukebut that's a bit long for something you would be doing continuously.
15:43rhickey(make-single-hreaded-proc-access-policy)
15:43Chousukeor perhaps you can do (proc-apply (comp foo bar) x)
15:43rhickey(make-multi-threaded-proc-access-policy)
15:44rhickey(make-proc apolicy aval)
15:44lpetitI like "jail". Not overloaded, easy to remember metaphore.
15:45rhickeyjails are punitive
15:45lpetitwell, "not overloaded" ...
15:46abrooksRather than worrying about overloaded terms I think language designers should just create their own vocabulary for off-the-beaten-path functions/interfaces/etc.: qwub, blurf, voop...
15:46abrooksProvide a glossary and Bob's your uncle!
15:46Chousuke!
15:46Chousukedon't make all my example code executable all of a sudden!
15:47rhickeyone possible name for the access policy is 'sentry'
15:47abrooksHehe!
15:47rhickeythen cell+sentry still works
15:47lpetit"jail is punitive": yeah, all the point of clojure is to punish "he who uses mutable states" :-)
15:47hiredmancellar
15:48lpetitjust kidding
15:48Licenserhmm how can it happen that there is no backtrace?
15:48ordnungswidrig1in unix speak there is chroot
15:48rhickeylpetit: kidding aside, I wonder if that is really Clojure's point. Clojure is more about making the state model correct and safe, never has been about avoiding it
15:49lpetitrhickey: yes, I regretted the kidding words at the exact second I hit Enter
15:49chouserI think if you wanted to punish the use of state you would invent something more like a monad.
15:49rhickeychouser: exactly
15:49lpetitchouser : rofl
15:50abrookschouser: I thought C++ had automatic punishment for using state...
15:50lpetitok, so indeed, the notion of punishing is to be avoided
15:50ChousukeI think process fits pretty well as a name, especially if there are to be policies as well.
15:50chouserC++ includes punishment for being a programmer.
15:50rhickeyalso, these things are decidedly multi-threading oriented, whereas monads...
15:50ChousukeI doubt anyone will confuse it with OS processes :/
15:50chouserChousuke: yes, I agree.
15:51lpetitfridge ? :-p
15:51rhickeya key feature of cells will be supporting multiple effectors of a single process
15:51chouseras long as no proc-policy will support actual simultaneous updates to the value(s)...
15:52rhickeywhat is a simultaneous update?
15:52hiredmancord
15:53Chousukerhickey: a coordination failure? :)
15:54chouseran object with multiple mutable fields?
15:55chousermy point being if the operations on the cell aren't completely serialized, the calling it a "process" starts to feel wrong.
15:56rhickeychouser: it can get grey esp when you consider the use of a j.u.c.collection as the transient
15:57rhickeyas much serialization as is needed for consistency is used, but not necessarily totally serial
15:58rhickeynesting is also an interesting question. Right now, the sentries act as factories for cells and sentries are passed to the transient fn, so the transient could created nested cells controlled by the same sentry
15:58hiredmancord: a line made of twisted fibers or threads; "the bundle was tied with a cord"
15:59rhickeyhiredman: but a single-threaded cord doesn't quite fit
16:00hiredmanbut it's not single threaded, as you said "as much serialization as is needed"
16:00rhickeychouser: but yes, in general the cells ensure serialized access, although multiple threads can participate in the creation of the 'next' value
16:00rhickeyhiredman: there will be single threaded sentries
16:01neotykwhere I can read about cell/fridge/proc/... ?
16:01chouserneotyk: IRC logs. :-]
16:01neotykcan't scroll that far :-o
16:02neotykclojurebot: where is log
16:02clojurebot'Sea, mhuise.
16:02hiredmanclojurebot: logs?
16:02clojurebotlogs is http://clojure-log.n01se.net/
16:02neotykhiredman: thanks
16:02Chousukerhickey: so are these things going to completely replace transients as they exist now?
16:02rhickeyas far as >>/<<, I want something that makes cell-ification of existing functional code easy and relatively transparent
16:02rhickeyChousuke: yes
16:04rhickeyso, we I something short, and need some feedback on arg order
16:04arohnerrhickey: my only opinion on naming is to use words rather than symbols. I greatly prefer a word over << or >>. Or if the symbols are present, make them optional, like deref/@
16:04rhickeyarohner: ok, needs to be short and to get out of the way
16:05arohnerrhickey: sure. I don't know enough about the feature you're working on to propose a good name. :-)
16:05lpetitif you follow the cell/sentry metaphor, what would be the word for peek ?
16:05rhickeyyou'll have code like (assoc m k v) (count m) becoming => (cell-alter assoc m k v) (cell-peek count m)
16:05Chousukeyou can peek into a cell I suppose
16:05chouserto look into the cell without changing it in any way
16:06Chousuke"observe" is perhaps too long :/
16:06rhickeypeek already defined for stacks
16:06jasappI'm out of the loop, are transients not working well in their current state?
16:06jasappor rather, what's the reason for the change?
16:06rhickeyjasapp: they can be better, and will be soon
16:06lpetitand also, you don't do it by yourself, you ask the sentry to get some data about the cell's content for you
16:07jasappgotcha
16:07rhickeylpetit: but the sentry is embedded in the cell, not an argument to these
16:07Chousuke"query" might be good but I don't think you can take that name :P
16:07rhickeylpetit: but true, internally these requests go through the sentry
16:07chouserI like cell-alter. I think if a synonym of >> was provided, people would eventually settle on cell-alter anyway.
16:07lpetitrhickey: yes I was just thinking about the metaphore
16:08rhickeychouser: really? would be an interesting experiment :)
16:08lpetitlook-for
16:08chouserthough maybe "alter" isn't so good considerting the (good, I think) different arg order.
16:08lpetitwhat is the verb you english natives use when a you tell your dog to go find and get back the bone/wood ?
16:08chouser"fetch"
16:08rhickeychouser: one key reason not to use alter or any variant thereof is the semantics here are different. alter takes a pure fn of val-to-val
16:09rhickeycells can take arbitrary side-effecting fns, and will ensure once-only semantics
16:09ChousukeI think cell-apply might be okay then
16:09lpetitso could fetch be the name for "peek" ?
16:10Chousukethough hm, it would be subtly different from plain apply :(
16:10opqdonutcan somebody give me a one-line description of cells?
16:10chouseropqdonut: probably not. I'll see if I can get you a log link
16:12opqdonuthow long ago would that be?
16:12lpetitopqdonut: a controlled place (cell) in which one will be able to mutate things at will in order to finally produce a new (immutable) value. Access to the cell will have controlled semantics (one thread at a time, ...) ... but that's certainly incomplete / partially wrong
16:12chouseropqdonut: http://clojure-log.n01se.net/date/2010-01-22.html#09:22a
16:12Licensergar
16:13rhickeya cell is a new reference type that arbitrates the possibly multi-step/multi-threaded process of producing a new value
16:13lpetitcell-alter -> "shape" ? "mould" ? "mold" ?
16:13rhickeybecause it is process aware, it can leverage transients
16:14rhickeywhat about cell-> and cell-< ?
16:14neotykhiredman:
16:14rhickey(cell-> assoc m k v) (cell-< count m)
16:14hiredmanneotyk:
16:14Chousukeif you're going to do that, I suggest cell>> and cell<<
16:14lpetitneotyk, hiredman:
16:14Chousukethe -< looks kind of ugly :/
16:14chouserso... cell-> is for chaning the value *in* a cell, and cell-< is for getting the value out? seems ... backwards
16:15chouser<<cell and cell>> ?
16:15stuartsierraWhat's wrong with put/get?
16:15chouserer
16:15chousersorry, I meant: <<cell and >>cell for apply and peek
16:15rhickeystuartsierra: without prefixes?
16:16chouserwrong again. <<cell for peek and >>cell for apply
16:16rhickeychouser: I don't see it
16:16rhickeyah
16:16chousersorry. reduces the weight of my argument if I can't even get it right. :-P
16:17chouserthose will look like bit-shift to many
16:17rhickeychouser: true
16:17stuartsierraget-cell, put-cell, whatever, just something English
16:17opqdonutlpetit: ah yes, I see
16:17opqdonutkinda like haskell's ST
16:17ordnungswidrig1in/out
16:17stuartsierraBut I'm way behind on this whole cells conversation anyway
16:18lpetitopqdonut: please also refer to rich's more precise def he just wrote above
16:19opqdonutwhat about transients?
16:19Chousukeopqdonut: they will be replaced
16:20opqdonutok
16:20opqdonutso we'll have vars, refs, atoms and cells or will some of those be subsumed?
16:20kotaraktransients? replaced?
16:20rhickeyI would almost go for 'in' if the arg order was same as other references (in acell assoc k v)
16:21rhickeykotarak: transients will be used only inside cells
16:21rhickeykotarak: but such use will be automatic, safer, potentially multithreaded etc
16:21kotarakAh. Something new. Clojure sure is moving fast. I'm loosing track..... :/
16:22opqdonutindeed
16:22rhickeymy biggest concern with these names is the conversion of proper functional code. The transient story was very good here, and cells should strive to be as good
16:22rhickeytransients -> add transient/persistent! and some !s
16:23rhickeyif the cells story is add cell-this/cell-that to every call, and possibly change arg order...
16:23rhickeybleh
16:24qedis it possible to install the jvm, ant or maven, in a user's $HOME dir without root?
16:24opqdonutthe jvm, sure
16:24opqdonutjust extract the archive
16:24opqdonutyou have to use the JAVA_HOME environment variable or whatever it was though
16:25chouserrhickey: the arg order story is important. is that part of why puncutation feels better to you than a name like the other ref types?
16:25lpetitqed: sure
16:25rhickeychouser: I guess
16:25qedah, cool -- any suggestions for a skinny jvm?
16:25stuartsierraqed: It's like installing any package locally: unpack, compile, modify some environment variables like $PATH and $JAVA_HOME
16:25qeder rather, recommendations
16:25stuartsierraqed: There's no such thing as a skinny JVM.
16:25rhickeychouser: but I'd be amenable to a good short name
16:25qedstuartsierra: had to ask :)
16:26jkkramerso using cells would be something like (>> conj v i) instead of (conj! v i) ?
16:26chouserplain punctuation seems too "universal" to have meaning only with a specific reference type.
16:26stuartsierraqed: Some are lighter than Sun's, but they lack the same level of features & optimizations.
16:26rhickeyjkkramer: right
16:26chouser(>>cell conj v i)
16:26chousereh. :-/
16:27Chousuke(in-cell conj v i)
16:28rhickeychouser: no, v is the cell
16:28chouseryes. what did I say?
16:29Chousukeso (in-cell v conj i)? :P
16:29chouseroh, I meant (defn >>cell [v i] ...)
16:29rhickeyheh, you're right, I saw >>cell as 2 words :)
16:29chouserbut I agree it's confusing. hence "eh. :-/"
16:29kotarak(conj-cell v i)
16:29hiredmanyou could just use !
16:29hiredman(! conj v i)
16:30rhickeyhiredman: if we go pure non-words, >> and << will win out
16:30rhickeyso we're looking for words
16:30Chousukehiredman: But that won't actually destroy anything visible to you.
16:30LauJensenI wonder how much harder it is to dive into Clojure today, with the heavy use of -> ->> -?> -?>> and so on
16:30ordnungswidrig>> is very c++ for me. (which I do not consider a good thing)
16:30rhickeynote that mt-cells will have all of their calls inside an (inside [cell1 cell2...] ...) block
16:31ordnungswidrigLauJensen: as a relative clojure newbie I find it confusing.
16:31qedblast -- C-s is broken in emacs inside a screen session -- was just working.. hmm
16:31LauJensenordnungswidrig: What I figured, we're slowly becoming the lispy perl version
16:31rhickeyLauJensen: that's the fault of -?> and -?>> - ick
16:31ordnungswidrigpeople complain about lisp having all that parenthesis.
16:32lpetitordnungswidrig: is it he who is named 'ordnungswidrig' which says -> is confusing ? :-p
16:32LauJensenrhickey: I just saw ! proposed as an fn right? It doesnt get more obscure than that
16:32ordnungswidrigpeople will complain about clojure having all kinds of parenthesis: () [] {} <>
16:32Chousukerhickey: Will calls to a cell return a new cell object to be used in later calls? Or are you going to allow imperative style mods?
16:32lpetitwoops
16:33rhickeyChousuke: imperative style will be supported just like for all reference types
16:33lpetitbut -?> is not very visible at first when coming to clojure
16:33rhickeycell-do ?
16:33rhickeydo-cell ?
16:33qedhow about (.oO cell conj v i) ;)
16:33ordnungswidrigthere are sill parenthesis left for cell in/out: «»〔〕‹›⎡⎦
16:33lpetitit's not the cell you're altering
16:34kotarakin-cell!
16:34opqdonutinsel :)
16:34ordnungswidrigic
16:34kotarakfreitag!
16:34jkkramer(cell-call conj v i), (cellify conj v i)
16:34kotarakcell!
16:34qed(chamber conj v i)
16:34rhickey(inside [c] (in-cell! assoc c k v)), not quite right
16:35qed(dungeon conj v i)
16:35ordnungswidrigwithin
16:35Chousuke(prison-break! cell conj i) :P
16:35qedhaha
16:35rhickeyordnungswidrig: in and within better with different arg order
16:35qed(cytoplasm conj v i)
16:35stuartsierracellish
16:36qed(cellize
16:36LauJensenrhickey: I might need to look at the log, but isnt there a way to simply use the same names as on transients, like assoc!, and then have that fn test what its been used on ?
16:36kotarak(inside [c] (cellic assoc) c k v)
16:36rhickeyLauJensen: no
16:37jkkramer(inside [c foobar] (foobar assoc k v))
16:37ordnungswidrigrhickey: I said the other day clojure would not be developer by voting. I never would have thought I was developed my collective irc brainstorming ;-)
16:37ordnungswidrigjkkramer: making it customizable?
16:37jkkrameroops, (foobar assoc c k v)
16:38rhickeyordnungswidrig: I like to get input on names, the design has taken me weeks
16:38Chousukeusing the cell itself as a function might be interesting
16:38Chousukebut that's different from the other ref types :/
16:38qedrhickey: whether you actually want a name or not please ask -- it's always fun to talk about these sorts of things. you do all the work, and we name it! ;)
16:38rhickeypass/fetch ?
16:39rhickey(pass assoc mcell k v)
16:39rhickey(fetch count mcell)
16:39ordnungswidrigqed: hehe. It's like other getting a baby and making fun naming suggestions
16:39Chousukethat sounds okay
16:39chouserthat's not bad
16:39Chousukepass is perhaps not optimal but better than anything so far :)
16:40rhickeyChousuke: pass has a lot of matching connotations
16:40qed"give" "take" ?
16:40lpetit(inside [c] (pass assoc c k v) (fetch count c))
16:40rhickeylpetit: right
16:40lpetitqed: no, "take" conveys the meaning of removing smthing
16:40rhickeysingle-threaded code won't have inside
16:41lpetitrhickey: oh
16:41qedlpetit: give/grab?
16:41kotaraklift/retrieve
16:41qedkotarak: not so hot on retrieve, but i like lift
16:42stuartsierraentomb/exhume
16:42qedgrab/grope? heh
16:42rhickeyI don't understand lift
16:42qederr give/grope rather
16:42Chousukeqed: that sounds monadic :P
16:43chousera very earthy language with words like slurp, spit, and grope
16:43qedrhickey: i liked lift in the second position, as in grab, fetch, exhume, etc.
16:43stuartsierraCLU used up/down, albeit for different purpose
16:43Chousukecells kind of remind me of the "container" explanation of monads.
16:43ordnungswidrighave peek and poke already been mentioned?
16:43stuartsierraalready used
16:44stuartsierraor they imply stacks
16:44chouser'peek' is already for stacks and queues
16:44stuartsierrapeep/prod?
16:44qedchouser: wait til 'fondle' is added
16:44rhickeyok, please make serious counterproposals to cell/sentry/pass/fetch/inside
16:44stuartsierrathose are fine
16:44lpetitwrap/unwrap .. ?
16:44opqdonuthmm, why isn't http://clojure.org/transients linked to the menu on the left side?
16:45chouserinside is dynamic scope, not liexical?
16:45opqdonutbecause they're somewhat experimental?
16:45rhickeychouser: yes
16:45opqdonutanyway, I wasn't even aware of them before this discussion... :(
16:45chouserthen perhaps with-cells instead?
16:45rhickeywithin-cells?
16:45chouseryes
16:46rhickeycell/sentry/pass/fetch/within-cells
16:47chouserwith << and >> as synonmys to see what wins out?
16:47rhickeychouser: nah
16:47opqdonutabout transients: is (do (conj! v 0) (conj! v 1)) an error, undefined behaviour, or something else?
16:47qedi dont love pass/fetch, but that's just me
16:47lpetitcell/sentry/feed/fetch/within-cells
16:48rhickeyqed: how do you get something to someone in a cell?
16:48lpetitopqdonut: an error
16:48qedyou give it to them
16:48opqdonutrun-time?
16:48clojurebotwhat time \is it? is TIME TO GIT BUSY!
16:48rhickeyqed: but there's a sentry
16:48chouseropqdonut: incorrect code. I guess you could say "undefined" in that no exception is thrown and behvior depends on other things.
16:48qedtoss?
16:49opqdonutchouser: that's kinda bad, as that's an easy error to make
16:49rhickeyin-cells?
16:49clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
16:49opqdonutbut I see the implementation angle, too :)
16:50qedrhickey: as opposed to within-cells?
16:50rhickeya sentry has to let you pass, you pass things to people
16:50rhickeyqed: right
16:50lpetitrhickey: are we really in the cell or just in the corridor ?
16:50chouserisn't a collection of multiple cells a jail? in-jail
16:50rhickeylpetit: really, it turns the cells into a temporary cell-block
16:51chouserin-prison
16:51lpetitok, must leave, cu guys
16:51chousersorry. being silly again. "in-cells" is ok, better than "inside"
16:51kotarakpanopticum
16:51rhickeythings pass through cell membranes, if you take the biology metaphor
16:52rhickeycell/sentry/pass/fetch/in-cells
16:52qedrhickey: a sentry lets you pass, but you are accessing a cell
16:52kotarakdiffuse
16:52qedaccess?
16:52Chousukereach?
16:52chouserI like the arg-order with "pass", where the direct object is the fn and the indirect object the cell
16:53Chousukethat's closer to fetch I guess :/
16:53rhickeychouser: right
16:53qedaccess/visit?
16:53kotarakosmose
16:53chouserfetch. fetch what? (fetch count ...)
16:53Chousukesend would be excellent but it's taken... :P
16:53kotarakreverse-osmose
16:54rhickeyChousuke: send not better than pass IMO
16:54qedcell/sentry/access/visit/in-cells
16:54rhickeylet's try to keep the S/N ratio high, please :)
16:55rhickeylooking now only for things better than fetch, perhaps touching on the smuggling out nature of these reads
16:55rhickeybiab
16:57kotarakrun
16:57qedno good
16:57kotarakbootleg
16:58kotarakqed: why is run no good?
16:58qedit means too many different things
16:58kotarakcall
16:58qedsynonyms of smuggle are not ideal *(at least from your osx dictionary ;)
16:58kotarak(call count cell)
17:00qedsmuggle means both to import or export, or to 'convey or introduce cladestinely' -- in that sense i dont think it suggests what is going on. are we smuggling in, or smuggling out?
17:00jkkramerpeer?
17:00qedspy?
17:00ordnungswidrigbeam?
17:01kotarakqed: I would suspect smuggling out
17:01qedkotarak: not a heroin mule, eh?
17:01qedhow about "scout"?
17:01qedi like that a lot
17:05Chousukespy would be fun :P
17:12technomancywhy aren't namespaces Named?
17:12chouserhardly anything is named. just symbols and keywords I think. :-/
17:12technomancyI see
17:12chouserI wish Vars and namespaces were
17:13kotarakns-name is also a symbol, no? Not a string.
17:13stuartsierrakotarak: correct
17:13hiredmanvars may or may not be named, so making them Named was felt to be odd
17:13kotarakchouser: not every var has a name. eg. Compile/LINE or so.
17:14chousernot every symbol has a namespace, but 'namespace' still works
17:14technomancyhiredman: ah, good point. but can you have anonymous namespaces?
17:14hiredmantechnomancy: I would say no, but I haven't looked at Namespace.java
17:14kotarak(doc create-namespace)
17:14clojurebotExcuse me?
17:14kotarak(doc create-ns)
17:14clojurebot"([sym]); Create a new namespace named by the symbol if one doesn't already exist, returns it or the already-existing namespace of the same name."
17:15hiredmanchouser: true
17:15technomancykotarak: looks pretty named to me. =)
17:15kotaraktechnomancy: but with a symbol not a string
17:16hiredman,(doc ns-name)
17:16clojurebot"([ns]); Returns the name of the namespace, a symbol."
17:16hiredmanhmm
17:16technomancyno reason why namedness shouldn't be transitive in that case
17:16kotaraktechnomancy: or why namespaces should be named by a symbol instead of a string...
17:17hiredmankotarak: or namespaces could be named by a symbol and return that symbol's name
17:18technomancyit's pretty nit-picky, but it would be convenient
17:18lpetitrhickey: on the "beast" theme - powerful thing but to be used with care : cage/tamer/[feed|nurture|fill]/[inspect|control]/within-cages
17:19kotarakrefer-clojure does not support :as? pff...
17:20hiredmankotarak: as is alias, refer is use
17:20kotarakhiredman: use supports :as.
17:20jkkramerthere's rename
17:21jkkramer(ns foo.bar (:refer-clojure :rename {print core-print}))
17:22kotarakjkkramer: (ns foo (:refer-clojure :exclude (...)) (:alias core clojure.core)) works
17:24hiredmanwhy does use support :as?
17:25kotarakdunno, but it's useful.
17:25hiredmanhow?
17:25clojurebotwith style and grace
17:25rhickeyI'm back, any brilliant alternatives to fetch?
17:26kotarak(ns foo (:use [bar :only (defbar) :as b]))
17:26brennancI'm trying to get slime working with clojure. I get the REPL but the modeline says "*inferior-lisp*" and it doesn't do the function parameter hinting like I've seen in the slime screencasts)
17:26hiredmankotarak: and what does that do?
17:26kotarakhiredman: It "uses" defbar and defines an alias b.
17:27brennancthe modeline in the screencast I am watching shows "*slime-repl clojure*" so it looks like I'm not doing something right
17:30technomancybrennanc: inferior-lisp just means you have a CLI repl running in a subprocess; it doesn't mean you're using slime at all.
17:31brennancI did M-x slime and it seemed to do something
17:31brennancI get the user=> prompt
17:31brennancwhat am I doing wrong?
17:32brennancI followed the instructions on http://riddell.us/tutorial/slime_swank/slime_swank.html
17:32technomancybrennanc: those instructions are really out of date; try the instructions in the swank-clojure readme
17:32jkkramerrhickey: report? view?
17:32technomancythat page just won't die. =\
17:32ska2342brennanc: sorry for being late, what problem do you have?
17:33brennancno kidding, I had the same problem with common lisp and none of the stuff I googled working. lol
17:33kotarakrhickey: call
17:33brennancI'll check out the readme, thanks
17:33jkkramer"spy" was also mentioned
17:33kotarakand scout
17:33technomancybrennanc: swank-clojure is actually really easy to install, it's just that there's an abundance of bad instructions out there.
17:36brennanchmm seems like it fails on the Contrib compiling
17:36brennancBuildfile: build.xml does not exist!
17:36brennancBuild failed
17:37brennancbut I already have all the clojure stuff good to go
17:37technomancybrennanc: you don't need to compile contrib
17:37technomancypretty much ever
17:37brennancfollowing the docs in swank-clojure README
17:38brennancI ran M-x clojure-install and then it downloaded clojure and then looks like it failed on the build
17:38xp_prgI require mentorship
17:38brennancif I can just set it up with my current clojure environment that would be much better but I don't see anything that tells me how to do that
17:38technomancybrennanc: http://github.com/technomancy/swank-clojure is the correct source
17:38technomancyjochu's fork is abandoned. =\
17:39dysingerclojurebot: is hiredman around?
17:39clojurebotTitim gan éirí ort.
17:39abrenktechnomancy: I just wonderd why in src/leiningen/jar.clj: :path (format "meta-inf/maven/%s/%s/pom.xml" it is not META-INF?
17:42hiredmandysinger: in and out
17:42ska2342Can anybody tell me why *print-meta* is only observed by pr and prn but not by print and println? It took me quite a while to find out why my examples didn't work.
17:44ska2342is it the distinction between "print ... for human consumption" and "print in a way ... can be read by the reader"?
17:45guridosulany special reason why "alter" names the function parameters as "fun" while others I've seen so far (map, apply...) names it as "f"?
17:46guridosuluser=> (doc alter) ------------------------- clojure.core/alter ([ref fun & args])
17:46guridosuluser=> (doc map) ------------------------- clojure.core/map ([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])
17:47brehauthi all
17:49brennanctechnomancy: I followed he instructions on the link you gave me but when I run M-x slime it still gives me inferior-lisp
17:49hoeckska2342: exactly
17:50hoeckbrennanc: have you tried m-x slime-repl?
17:50ska2342hoeck: it might deserve some honorable mentioon in the docs, but anyway... :-)
17:50brennancit can't find it
17:50brennanc"no match"
17:51brennancpackage-list-packages says that slime-repl is installed
17:53hoeckbrennanc: I have (slime-setup '(slime-fancy slime-repl)) in my .emacs.d
17:53dysingerhiredman: yo
17:53dysingeraround?
17:54hoeckbrennanc: at some point, slime devs decided to make the slime-repl optional
17:54brennancI'm deleting everything and going to try again, maybe some old config is messing something up
17:54hoeckbrennanc: try m-x slime-interactive-eval, and then type some clojure code
17:55brennancshould I install slime and slime-repl before installing the swank-clojure package?
17:58brennancI'm getting an error: swank-clojure.el:48:1:Error: Cannot open load file: clojure-mode
17:58brennancbut when I look in the package list it says it is installed
18:00brennanctheres also this error when I type M-x slime
18:00brennancDebugger entered: (("Error in timer" slime-attempt-connection (#<process inferior-lisp> nil 2) (file-error "make client process failed" "Co$
18:00brennanc byte-code("\303\304\305^H \nF\"\207" [fun args data debug nil "Error in timer"] 6)
18:00hoeckbrennanc: that means emacs cannot find the clojure-mode.el file
18:01hoeckbrennanc: wich in turn means that something with the package-manager wrent wrong
18:01brennancwhere are the docs to install all this manually, the ELPA route is buggy and doesn't seem to work
18:06hoeckbrennanc: there is http://github.com/technomancy/swank-clojure/blob/master/README.md, "installing from source"
18:11hiredmandysinger: yes
18:26iceyI'm messing around with Compojure, and I'm doing something wrong that I can't seem to figure out. I'm doing: (alter session assoc :name username)
18:26iceyI'm getting clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Ref
18:26iceyas a result
18:27hiredmanicey: I don't think session is a ref
18:27hiredmanyou have to use some special session-assoc function
18:28iceyahh, i was wondering about that. I saw some funky thing about that but was hoping I could do it the old-fashioned way that all the documentation out there currently uses
18:32brennancswank-clojure seems to work in emacs 22 on my mac, but not emacs 23 on gentoo linux
18:32iceyhiredman: thanks, that looks like what it was
18:32brennanccan't figure out why
18:32qbgbrennanc: Doesn't work how?
18:33brennancwhen I run M-x slime it gives the following errors:
18:33brennancDebugger entered: (("Error in timer" slime-attempt-connection (#<process inferior-lisp> nil 2) (file-error "make client process failed" "Co$
18:33brennanc byte-code("\303\304\305^H \nF\"\207" [fun args data debug nil "Error in timer"] 6)
18:33brennanc slime-timer-call(slime-attempt-connection #<process inferior-lisp> nil 2)
18:33brennanc apply(slime-timer-call (slime-attempt-connection #<process inferior-lisp> nil 2))
18:33brennanc byte-code("\301^H\302H^H\303H\"\207" [timer apply 5 6] 4)
18:33brennanc timer-event-handler([t 19321 55542 468739 0.3 slime-timer-call (slime-attempt-connection #<process inferior-lisp> nil 2) nil])
18:33brennancI don't see that on OS X
18:35qbgThat doesn't look like a swank-clojure error to me
18:36qbgYou can run Clojure normally, correct?
18:36hiredmanbrennanc: is the jvm being started?
18:37brennancwhere does swank-clojure install clojure to? I deleted my install because I was trying to start fresh because nothing else was working
18:37brennancare there other steps I need to do before or after that aren't document in swank-clojure
18:37brennancam I missing something else?
18:38qbgTake a look in ~/.swank-clojure
18:38brennancqbg: I see the jars and can bring up the repl from the command line with java -cp ... clojure.main
18:39qbgPost your .emacs somewhere
18:39japowlI'm wrapping some javalibs that return HashMaps, and I want them converted to clojure hash-maps. Right now I do (#(zipmap (map keyword (.keySet %)) (.values %)) javaHashMap) which works fine, but I wonder if theres a more ideomatic way or even some contrib lib I might be missing?
18:40brennanchttp://brennancheung.com/.emacs
18:41qbgWhat does (swank-clojure-cmd) evaluate to?
18:42tomoj,(let [hm (doto (java.util.HashMap.) (.put :foo "bar"))] (into {} hm))
18:42clojurebot{:foo "bar"}
18:42tomojjapowl: ^
18:42hiredmanbrennanc: in ps output can you see the jvm that swank launches?
18:42brennancqbg: java.lang.Exception: Unable to resolve symbol: swank-clojure-cmd in this context (NO_SOURCE_FILE:7)
18:42qbgInside emacs
18:43brennanchiredman: ps output?
18:43brennanchiredman: I don't see anything about JVM messages when I try to run slime from emacs
18:43hiredmanbrennanc: ps auxwww
18:43japowltomoj: hahaha, thanks! man, I was so sure I had tried exactly that
18:44hiredmanbrennanc: right, so it sounds like it launches the jvm but fails to connect and a timeout happens and you get an error
18:44tomojof course,
18:44tomoj,(class (let [hm (doto (java.util.HashMap.) (.put :foo "bar"))] (into {} hm)))
18:44clojurebotclojure.lang.PersistentArrayMap
18:44hiredmanbut I won't to check and see if it is actually starting the jvm
18:44tomojbut I didn't figure you really cared whether it was a hash-map
18:44hiredmanwant to
18:44brennanclooks like it is launching the sun-jdk-1.6
18:45brennanclet me paste it online
18:46brennanchttp://brennancheung.com/temp.txt
18:46japowltomoj: no that's exactly what I wanted, but didn't the obvious ways to work and ended up with the hideous zipmap-version.
18:46hiredmanbrennanc: can you see the java process listening on a port?
18:46hiredmansocket, whatever
18:47brennancnot sure, how can I check?
18:47hiredmandoes linux have a sockstat command?
18:48brennancdoesn't look like it, not that I can find
18:49brennancI don't see anything under netstat
18:49brennancI can get the inferior-lisp and it does let me run some things, but it isn't the full clojure environment
18:50brennancwhat's this timer it is mentioning?
18:51brennancI added it to http://brennancheung.com/temp.txt so you can see the full error easier
18:52hiredmanI imagine there is same time out if the elisp part of swank doesn't connect to the clojure part of swank in X seconds it throws a wobly
18:53qbgIf you start swank-clojure separately, can you connect to it?
18:55hiredmanI wonder why it doesn't show up in net/sock/etcstat
18:55qbgWell, it looks like it is never getting to the point of launching the swank server
18:56brennancI can type clojure and it runs it, so it is doing something
18:57brennancso I'm not sure what exactly I'm running
18:58brennancwhat is the difference between the jochu and technomancy versions?
18:58brennancare the the same?
18:58qbgUse technomancy's
18:58hiredmanjochu's is way old
18:59brennancwhat about these instructions?
18:59brennanchttp://lifeofaprogrammergeek.blogspot.com/2009/03/learning-clojure-and-emacs.html
19:00hiredmanoh
19:00hiredmanthose were old in 2008
19:00hiredmandunno how those could be instructions for 2009, let alone 2010
19:01hiredmanclojure used to be in svn at google code, and kevinoneill had a git mirror on github, but clojure long ago moved to github
19:02hiredmanclojurebot: github?
19:02clojurebothttp://github.com/richhickey/clojure/tree/master
19:02hiredman^-
19:02qbgYou could take a look at these instructions: http://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/
19:02hiredmanhttp://github.com/technomancy/swank-clojure <-- or the ones here
19:03Raynesjava.lang.String cannot be cast to clojure.lang.IFn
19:03RaynesOh boy, and only 200 lines of code to dig through to find the source.
19:03qbgRaynes: This is why you have stack traces
19:03Raynesqbg: Yeah, they aren't helpful here.
19:04qbgLazy sequences getting in the way?
19:04RaynesNo, they're just completely gibberish.
19:05brennancI've been through both sets of those instructions before I even started asking around here. no luck
19:05boojum,(apply str (rest (str :foo)))
19:05clojurebot"foo"
19:06hiredman,(name :foo)
19:06clojurebot"foo"
19:06boojumhiredman, thanks!
19:14brennancI put together a screenshot of the problem I am having getting swank-clojure up and running. maybe someone will be able to spot the problem easier because something might have been lost in translation earlier.
19:14brennanchttp://brennancheung.com/swank.gif
19:14brennancyou can see some of the stuff runs but stuff like C-c I doesn't bring up the inspector
19:14qbgTry M-x slime-connect
19:15qbgThe port swank is running on is weird
19:15brennancconnection refused if I try the defaults
19:15brennancmake client process failed: Connection refused, :name, SLIME Lisp, :buffer, nil, :host, 127.0.0.1, :service, 4005
19:15qbgChoose 59226 as the port
19:16brennancqbg: same
19:17brennanchow can I start the server component by itself?
19:18qbgIf you run swank.swank, it should bring up the connection
19:18qbgOf course you are going to need to set the classpath correctly
19:19brennancis that a java class or M-x command?
19:19qbgjava class
19:19qbgJust edit the first line of your http://brennancheung.com/temp.txt
19:19qbgRemove the "clojure.main --repl" and replace with "swank.swank"
19:20qbgOr if you have Leiningen, just configure a project to support lein swank
19:21brennancclass not found
19:21qbgswank-clojure is on the classpath?
19:21brennancwhen I open up the swank-clojure.jar I don't see a single .class or .java file in there
19:22qbgWeird
19:22brennancyes, it's in the classpath
19:23brennancis there some custom class-loader that loads the .clj files, because otherwise I don't see any way adding the swank.jar would do anything
19:23brennancthere's no java class files in there
19:24hiredmanqbg: are you sure swank.swank is a java class?
19:24qbgI can launch swank.swank
19:25hiredman*shrug*
19:25qbgIf you could try building swank-clojure yourself as an uberjar
19:25qbgThen just run the jar
19:26qbgWell, I have to go
19:30RaynesI just fixed that bug I mentioned earlier by accident. I still don't know what was wrong. >:|
19:34Raynes"Java is one of the most popular up-and-rising languages that is currently out there."
19:34jeldhello, I seem to be having problem with duck-streams, are they renamed in the current version?
19:36Raynesjeld: It's io now.
19:37RaynesIt would be nice to have a new contrib 1.2.0 master build up there, since it's pointless to write code using the old names now.
19:38jeldRaynes: thanks
19:47brennanchmm, anybody else running swank-clojure on gentoo?
19:48brennancI've tried it on both os x and centos and they seem to install/run fine, but gentoo doesn't seem to work
20:43abrenkbrennanc: I'm runnig gentoo. Everythings fine.
20:43brennancabrenk: are you running the sun-jdk or the virtual/jdk?
20:44abrenkbrennanc: sun-jdk-1.6
20:44brennanchmm, weird, I can't figure out what the problem is
20:44brennancthe error message doesn't seem to make much sense
20:44abrenkI've installed using ELPA and didn't have any problems.
20:44brennancyup, same here
20:44brennanchttp://brennancheung.com/swank.gif
20:44brennancthat's the error I'm getting
20:45brennancI get a repl, and it's kinda slime but a lot of the other features don't work
20:46abrenkThe error looks strange.
20:47brennancagreed, don't know where to start looking with it
20:49abrenkMy REPLs buffer is called *slime-repl clojure*. The *inferior-lisp* one's missing some features.
20:50abrenkI mostly work using "lein swank" and "M-x slime-connect". Have you tried that?
20:51abrenkI fear I can't really tell you more than the other guys already did...
20:51abrenk...just wanted to mention that I'm also running gentoo.
21:10fusssis there a clojure library for "SOAP"? something that consumes a WSDL and makes calls in a functional/OOP manner?
21:11fusssjava has a boatload of them, and I am sure you boys and girls have found a way to use them in a lispy manner. dish. spill the beans. pass the joint. etc.
21:11Raynesfusss: I was looking for one earlier.
21:12RaynesNothing to be found, as far as I can tell.
21:12RaynesAnd I'm not about to try to use Axis.
21:12RaynesSo, I gave up on that.
21:12fusssthere is one for Common Lisp and it's broken
21:12RaynesLike much of everything for Common Lisp /subjective
21:12Raynes:D
21:12fusssI could try the Schemers but I don't they even know what SOAP is
21:13fusssdont _think_
21:13fusssoh well, back to work then
21:14fussswould love to try clj ASAP, as soon as I have time to grok the java underpinnings
21:15tomojis SOAP ever a good thing?
21:15tomojI'm genuinely curious
21:16tomojin my mind it's always just been some mysterious old shit that I didn't want to touch
21:16tomojbut I imagine I am mistaken
21:28iceyis there a good compojure example site out there somewhere? (github or elsewhere?)
21:31fanaticoicey: LauJensen has a few good examples http://www.bestinclass.dk/index.php/tag/compojure/.
21:32iceyfanatico: yeah, it seems like all his examples are the most recent. they don't seem to do things in the "compojure" way though - they avoid using sessions and for whatever reason the way he's using static files isn't working form e
21:33icey(but thank you :D)
21:34fanaticothe reddit example doesn't, but the first two do, if I remember correctly.
21:34fanaticonp
21:34iceyahh maybe I didn't look through enough of them
21:35fanaticobeating the arc challenge is another good example http://www.bestinclass.dk/index.php/2009/12/beating-the-arc-challenge-in-clojure/
21:42iceythat's a good one too
21:43tomojI think we need more
21:43tomojsomeone was talking about this before
21:43tomojI wonder what a good example app would be
21:43tomojNOT a blog :P
21:43iceyit would be really nice to have a canonical example out there that showed how to do basic stuff like sessions, static files, etc
21:43iceytwitter clones work surprisingly well for example apps
21:44tomojstatic files annoyed the hell out of me
21:44iceyi've been dicking around with static files for the past 2 hours
21:44tomojhttps://gist.github.com/1d20d755c9cb5f24f630
21:44tomojthat's what I ended up using, didn't like it
21:44iceyuntil I realized that for some godforsaken reason it was looking in /Users/icey/Public instead of /Users/icey/prj/mycompojureapp/public
21:45tomojyou also need good mimetypes
21:45tomojthe with-mimetypes middleware helps
21:45tomojwhat I did was put my static files in mycompojureapp/resources/
21:45tomojer, mycompojureapp/resources/public/
21:46tomojlein-swank automatically puts resources/ on the classpath
21:46iceyahhh
21:46iceygonna try that right now :D
21:46tomojand then you can grab the file reference with the clojure classloader
21:46tomojbut I wonder if there is a nicer way
21:46tomojif they're really static files, like images or something, they should probably be served by the web server, not compojure
21:46tomojin my case I wanted to grab html files to transform with enlive
22:20jeldwhat is wrong with this statement? (use 'clojure.contrib.http.agent :only '(http-agent string))
22:23jeldsomehow this doesn't work and (require 'clojure.contrib.http.agent) (refer 'clojure.contrib.http.agent :only '(http-agent string)) works... :(
22:24_mstI think you want: (use '[clojure.contrib.http.agent :only [http-agent string]])
22:29jeld_mst: thanks, that was somehow non-obvious
22:32jeldanother question, (println (string (http-agent "http://www.google.com/&quot;))) from REPL returns immediately, but from a script it takes prints almost immediately, but then takes some 30-45 seconds to exit. Any idea why?
22:33_mstI'd guess that it's using agents behind the scenes
22:33jeldand as far as I can tell it is the call to http-agent that makes script slow to exit
22:33_mstif you add (shutdown-agents) to the end of your script does that sort it out?
22:33jeldheh
22:33jeldcool
22:40RaynesGuess it's time for me to learn about databases.
23:19BrandonWis it safe to assume that any time a keyword exists immediately after an open paren, that it will function similar to the ns macro, where indentation would be similar to a function call?
23:19BrandonWfor example: http://github.com/technomancy/leiningen/blob/master/src/leiningen/compile.clj
23:20Raynes: echo-cmd ( -- ) command-line get " " join print ; ! I R l33t concatenative purrrrrrrsun
23:20BrandonWthe (:use [clojure.contrib...] [clojure.contrib...] -- each vector is indented the same amount, as if they were arguments to a :use function
23:21BrandonWthat seems to me like it is idiomatic clojure, but i am not sure... perhaps it could be used in a different manner where you would not wants the tokens after the keyword to be indented in that way?
23:35BrandonWah, breaks down when you use a keyword as a function into a collection that you define ad-hoc across multiple lines
23:36BrandonWno nevermind, it doesn't