#clojure logs

2012-04-25

00:44jedahuany users of clutch about?
00:46sritchiejedahu: yeah, I've been using it a bit
00:46sritchiewhat's up?
00:47jedahuhow do you go about saving design documents so your views aren't recalculated from scratch each time your server restarts?
00:48jedahuI'm considering writing a save-versioned-view function
00:48jedahubut want to see if there's something I'm missing first :)
00:51jedahusritchie: just wondering what the usual practise is
00:51sritchieah
00:51sritchiejedahu: yeah, I've just been putting them in a namespace and running them myself when I want to create them
00:51sritchierather than leaving it as a bare form in the code or something
00:52sritchiecreate a "populate-views" function
00:52sritchiejedahu: are you writing your views in clojure or clojurescript?
00:53jedahuclojurescript and javascript
00:53jedahusritchie: I'll be writing that function then
00:53sritchiejedahu: I've been using the cljs views as well
00:53sritchieyeah, same thing with view destruction, I think
00:54sritchieI do all of that stuff from the repl, rather than hooking it up to some web trigger
00:54jedahusritchie: I want something a little less prone to catastrophe when I inevitably forget to update views before running new code
00:55sritchiejedahu: yeah, I hear you -- I'm just not sure how to check if the view's actually changed or not
00:56sritchieyou could check the actual string of code itself, but that'll change every time you change the cljs dependency
00:56jedahusritchie: I'm assuming one can add a "code-version" field to the design doc and check that?
00:56sritchieyeah, probably
00:56sritchieyou could wrap the "create-view" function to modify that design doc entry as well
00:57sritchieI don't think couchdb cares about extra fields in those docs
01:06jedahusritchie: save-design-document merges the old document with the new; seems like an odd thing to do
01:07sritchiemaybe in case you added other fields, like that version you mentioned?
01:07sritchieoh
01:07sritchiedesign docs can have lots of views
01:07sritchiea merge would bump out an old version,or add on a new
01:07sritchiehere's an idea --
01:08sritchieyou could generate a view-query function that automatically appends a version onto the end of a view name
01:08sritchieand then have a save-view function that runs on server startup, but ONLY saves a view if it doesn't exist in the design doc yet
01:09sritchiejedahu: so you go change all your code, then bump some global variable with a version and everyone gets saved again
01:09sritchienot quite perfect, but it's an idea :)
01:10jedahusritchie: thanks, but I think I'll pursue the extra field implementation for now
01:10sritchiecool
02:35robertstuttafordanyone with knowledge of clojurescript in?
02:44emezeskerobertstuttaford: I have some such knowledge
02:48robertstuttafordi'm completely new to clj and cljs. been reading the new programming clojure book.
02:49robertstuttafordi do already use google closure lib+compiler with advanced mode compilation.
02:49robertstuttafordmy question: does cljs use type annotations when producing js for the gclosure compiler?
02:50robertstuttafordi've been checking ClojureScript One out, and i notice that although the app is trivial, the mainp.js output file is rather large
02:52emezeskerobertstuttaford: To my knowledge, it does not
02:52emezeskerobertstuttaford: I just checked an intermediate js file, and I don't see any
02:53robertstuttafordthat's a pity. type annotations certainly help the compiler to produce tighter code.
02:53robertstuttafordhow long have you been using cljs, emezeske?
02:53emezeskeHmm, I've been using it seriously for a few months, unseriously for a little longer
02:54robertstuttafordso it's capable of producing production ready apps?
02:54emezeskeOh, definitely. The language itself works great, I think most of the pain is in lack of documentation, examples, etc
02:54emezeskeAnd the tooling still has a ways to go
02:55robertstuttafordsuper! i'm guessing that all of that is steadily improving, though, as more folks start using it
02:56robertstuttafordi'm very interested in cljs because right now, the JS i'm writing (so that i get really small, performant JS on mobile web) is incredibly verbose and painstaking to write
02:56emezeskeYeah, for sure.
02:57emezeskeWell, cljs is great for not being verbose. I can't speak too much to the performance, other than to say that recently there has been a lot of progress in the compiler to make the persistent data structures perform better.
02:57robertstuttafordaside from clojurescript one, can you recommend any other resources that are particularly useful
02:57emezeskeI'm a bit biased toward recommending https://github.com/emezeske/lein-cljsbuild
02:57robertstuttafordah, that's you!
02:58emezeske:)
02:58robertstuttafordcame across that last night
02:58RaynesYeah, surprised me too. All those phoney emezeskes out there.
02:58robertstuttafordso this is an alternative to cljs-one
02:58emezeskeI wish there were more examples of full apps that I could point to
02:58Raynescljs-one is something that everybody seems to think is something it isn't.
02:59emezeskeYeah, although I still totally recommend cljs-one as a piece of documentation
02:59Raynescljsbuild is something entirely different from cljs-one
02:59robertstuttafordi like c-one's repl <=> browser mechanic
03:00robertstuttafordlein-cljsbuild is like guard from ruby
03:00emezeskeRaynes: Yeah, that is true
03:00robertstuttafordwatch for changes and build stuff when they occur
03:00emezeskerobertstuttaford: Yeah, although it has support for browser REPLs and testing and some other stuff
03:01emezeskeBut the rebuild-on-change is the main thing
03:01emezeskeAre you planning to write your backend in clojure?
03:03robertstuttafordit's a definite possibility
03:03emezeskeI'd recommend taking a look at cljs-template then
03:03robertstuttaforddoes cljs support real-time stuff, like socket.io from node.js?
03:03robertstuttafordor has no one gotten there yet
03:04emezeskeI don't know about that. I know there is goog.net.WebSocket, but maybe that's lower level than what you're talking about?
03:05robertstuttafordit is. socket.io is a node lib for websockets, with code for both client and server. i'm guessing it wouldn't be too difficult to do with clj/cljs
03:06emezeskeI wouldn't be surprised if someone's working on that, but I also haven't heard anything
03:06robertstuttafordback to lein-cljsbuild: so repl-launch is the one that gives you the repl-into-browser situation that cljs-one has
03:07emezeskeYeah, repl-launch, or the lower-level repl-listen
03:09robertstuttafordwell, i've a long way to go. still need to learn the fundamentals of clj itself. very exciting. i've done so much OO style code, this whizzbang FP thing is like a breath of fresh air
03:10emezeskeYeah, I hear you there! I've been having a blast with it so far.
03:10robertstuttafordafter watching a couple of rhickey's talks, i'm very eager to learn to thinking in FP and immutable types. so tired of fixing the same old OO spaghetti bugs
03:11emezeskeHe's a damn good speaker.
03:11emezeskeBy which I mean that he is a good thinker :)
03:12robertstuttafordhe is. i've tried to get into FP before, but i've only usually found the dry, academic, first-do-5-years-of-CS-at-university type stuff. this new Programming Clojure book is superb because it leaves all that alone and just deals with the practicalities
03:16robertstuttaforddoes repl-launch work with chrome, too? i notice firefox is mentioned
03:16robertstuttafordi use chrome canary for its excellent dev tools
03:17emezeskeActually, I don't think so (unfortunately)
03:19emezeskeThe REPL stuff is actually part of the clojurescript compiler package, and lein-cljsbuild just provides a frontend to it
03:20emezeskeI doubt it would be hard to make it work on chrome... Maybe I'll take a look at that sometime (I favor chrome as well).
03:20emezeskeIn case you're curious, here's the browser repl implementation: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/repl/browser.clj
03:20robertstuttafordwhen you develop cljs, are you using such a repl?
03:20emezeskeOn and off
03:21emezeskePersonally, with the auto-build-on-modify feature, I tend to not need it much
03:21robertstuttafordoh, that code is still a little beyond me :-) only yesterday did i learn how to def and fn and defn. no clue about how macros or atoms work yet
03:21emezeskeHeh, you'll understand it soon!
03:22robertstuttafordgot a 5 day long weekend starting Friday. i will consume that book by the end of it!
03:22emezeskeNice.
03:22emezeskeWell, I'm out of here, good luck with your cljs adventure!
03:22robertstuttafordthanks. sleep well
04:17McMass0ud&(str (symbol "str"))
04:17lazybot⇒ "str"
04:17McMass0ud&(str (symbol "I worship his shadow"))
04:17lazybot⇒ "I worship his shadow"
04:17McMass0udWell, that was sort of to be expected
04:17McMass0ud&(str (symbol [1 2 3 4]))
04:17lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.String
04:24angermandoes clojure 1.4 allow to simply print "YYYY-MM-DD HH:SS" from a java.util.Date. (or java.util.sql) ?
05:32gavilanc`I would like to use the latest lein-newnew in lein2, but I can't seem to ge lein2 to use the setting in my profiles.clj.
05:32gavilanc`s/ge/get/
06:07Borkdudewhy does deftest not take a docstring
06:08BorkdudeI did smth like this: (deftest foo "this test blablabla" (is …))
06:09Borkdudeit runs perfectly but that's just because the string expression is evaluated and ignored ;)
06:27Borkdudeis there smth to pretty-print html generated by hiccup?
06:50ambrosebsis there an "update-meta" function?
06:52clgvambrosebs: vary-meta
06:52ambrosebsclgv: cheers!
07:08Borkdudehmm, defpartial doesn't support dispatch on arity...
07:10dmi3yprobably a dumb question, but does anyone know what font is used in recently published 'Clojure Programming' book for code examples ?
07:12cemerickdmi3y: Just Courier New AFAIK
07:14laurusHow does one do docstrings in defn?
07:15dmi3ycemerick: thanks
07:15laurusAh, finally it worked.
07:20progoit's not Courier New.
07:21progocan't put my finger on it but it looks like the traditional O'Reilly fixed width font
07:24laurusIs there any way to convert a map into a sorted-map?
07:25vijaykirandmi3y: my What Font plugin says it is Ubuntu Mono
07:26vijaykiranhttp://cl.ly/2n1J0d2E2l3l1W0O3U1f
07:28laurusAre people still working on and/or using Incanter? It seems to have had no updates for a while.
07:31vijaykiranlaurus: I think should be possible using sorted-map-by
07:31laurusvijaykiran, thanks
07:32dmi3yvijaykiran: ah, cool, thanks a lot
07:36clgvlaurus: there was an incanter release with clojure 1.3 support in the last 30 days
07:42laurusclgv, wow, okay!
07:43laurusBy the way, is there a better way to read a file in than slurp?
07:43clgvlaurus: what do you want to do?
07:43laurusclgv: (clojure-csv.core/parse-csv myfile)
07:59clgvlaurus: there is no slurp in it...
07:59clgvwhat's the limitation with slurp in your opinion?
07:59gfredericksnot lazy?
08:00vijaykiranlaurus: you should use buffered reader, if the file is too big
08:00vijaykirans/should/can
08:01laurusvijaykiran, ok. That works better :)
08:01laurusclgv, for big files it seems to hang
08:01laurusWow, that laziness really works.
08:02clgvgfredericks: there is no lazy file reading function in clojure afaik.
08:13babilenclgv: It's relatively easy to accomplish with line-seq + java.io.reader (cf. http://clojuredocs.org/clojure_core/clojure.core/line-seq)
08:13clgvbabilen: but you can only define it lazily if you know that you will read it all - otherwise you will never know when to close the resource
08:27BorkdudeI have a project.clj with these two dependencies:
08:27Borkdude[org.clojure/clojure "1.2.0"]
08:27Borkdude [noir "1.2.0"]
08:27Borkdudethen why the … does it download clojure 1.2.1? not really a problem, but just wondering why
08:34clgvBorkdude: maybe it's a dependency of noir
08:34Borkdudeclgv: how does it work when there are conflicting dependencies?
08:34clgvBorkdude: you can define :exclusions
09:04the-kenny(= (netwars.aw-map/coord 1 1) nil) works fine while (= nil (netwars.aw-map/coord 1 1)) throws an error in Clojurescript. (coord is a function returning a Coordinate, defined by defrecord). Is this intended behavior?!
09:09fliebelthe-kenny: Is the only difference the order? I'd say that's a bug...
09:18fliebelthe-kenny: What is the error?
09:20FullmoonHow would I go about keeping per-connection state in a network server? Keeping a socket connection id <-> data map somewhere? Any ideas?
09:23fliebelFullmoon: There is a Ring middleware for sessions, which you could have a look at.
09:24fliebelFullmoon: I think the connection ID map sounds okay. Another idea would be to store the data with the connection?
09:25fliebel(defrecord conn [c d])
09:38bhenrywhy? http://i.imgur.com/oT7xz.png
09:40vijaykiran, (doc coll?)
09:41clojurebot"([x]); Returns true if x implements IPersistentCollection"
09:41vijaykiranprobably Array isn't one
09:41bhenryyeah.
09:41vijaykiranand [] is literal for vector
09:41vijaykiranwhich is IPersistentCollection
09:42the-kennyfliebel: Yup, the only difference is the order of arguments. Let me get the backtrace.
09:42the-kennyfliebel: https://gist.github.com/2489503
09:43bhenryibdknox: i used a remote on a (jayq/val $elem) but there is an array in there and i can only see that as the cause for the Unreadable form error, but i can't figure out how to change it.
09:45bhenrythis freezes my cljs repl: http://i.imgur.com/YjLhY.png
09:46the-kennyfliebel: The generated code is simply missing a nil check
09:46the-kennyAh, forgot to mention: This is clojurescript HEAD
09:50fliebelweird...
09:51the-kennyI'll file a bug. It's wasy to reproduce
09:59dnolenthe-kenny: a nil check where?
10:03the-kennyin IEquiv _equiv generated for defrecords in Clojurescript
10:03the-kennyThere might be a better solution for it
10:03the-kennydnolen: (= (netwars.aw-map/coord 1 1) nil) works fine while (= nil (netwars.aw-map/coord 1 1)) throws an error in Clojurescript. (coord is a function returning a Coordinate, defined by defrecord). Is this intended behavior?!
10:06the-kennyThis is also reproducible if you add a test for comparision with nil to the clojurescript test suite
10:12dnolenthe-kenny: huh, what error for the second case?
10:12the-kennydnolen: See here: https://gist.github.com/2489503
10:13dnolenthe-kenny: oh you mean the first case throws an error
10:14the-kennydnolen: You can also add the following around line 1122 to core_tests.cljs: (assert (= false (= fred nil))) (assert (= false (= nil fred)))
10:14the-kennydnolen: Huh, I might have confused both, yes.
10:15the-kennyBut shouldn't = be transitive in Clojure & Clojurescript?
10:17pasgI have a wierd problem regarding protocols. I can't seem to impement a method with more than one argument (this) when the protocol is another ns than the implementing record. Anyone know why this is?
10:19dnolenthe-kenny: fixed in master thx.
10:19the-kennydnolen: awesome, thanks :)
10:20pasgwhen i try to implement a method with more than the this argument, i am given this message: CompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: doStuff
10:21pasgstrangely i can implement that method (which has 3 arguments) with just this instead.
10:21huangjsi need to do some html parsing, what library would you recommend?
10:31timvishercan anyone point me to :repository specification documentation for lein2?
10:44timvisherah, it's not actually changed to a vector. mind the question mark.
10:52pasgI have a wierd problem regarding protocols. I can't seem to impement a method with more than one argument (this) when the protocol is another namespace than the implementing record. Anyone know why this is?
10:57ngwis there a way to call js code from clojure?
10:57ngwshould I use rhino, for example?
10:57fliebelpasg: You mean... (foo [this] ...) works, but (bar [this args argd] ...) does not?
10:58fliebelngw: yea, rhino should work. Or maybe you can do something fancy with a cljs browser repl?
10:58ngwfliebel: I'm a noob, no fancy for me, just learning :p
10:59ngwI want to call less.js from clojure and make it easy to use from webnoir and compojure apps
10:59ngwto have those css static, less.js is kind of slow if not made static
10:59pasgfliebel: yes indeed. Say to have (defprotocol prot (foo [this one two three]) defined in ns1, if i then try to make a record in ns2 implementing prot like so: (defrecord rec [] prot (foo [this one two three]...)) i get an error
11:00fliebelngw: This might give you some ideas: http://briancarper.net/blog/415/
11:00pasgfliebel: strange thing is that i can implement foo with just this as an arg without error
11:01pasgfliebel: (defrecord rec [] prot (foo [this]...)) that is
11:01ngwfliebel I wish to port less.js after reading the same blog
11:01ngwthanks I will start from there
11:02fliebelpasg: Have you tried getting the namespace out of the equation? Just copy the protocol over and see if it still breaks.
11:02fliebelalso, what is the error?
11:03pasgfliebel: yeah that works fine if the protocol and record is in the same ns
11:03pasgCompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: doStuff
11:04pasgfliebel: that's the error i get, so it isn't finding the right method in the protocol for some reason
11:04fliebelpasg: are you importing the interface or the protocol?
11:05pasgfliebel: i am just using the ns with the protocol in it. Dunno if that is the correct way tbh, but importing it like a class (or record) doesn't work
11:06pasgfliebel: any chance you could try one your end? Just seem so wierd i must be doing something wrong.
11:06Lajjla(= .toString str)
11:06Lajjla&(= .toString str)
11:06lazybotjava.lang.RuntimeException: Unable to resolve symbol: .toString in this context
11:06pasg*on
11:06fliebelpasg: sure. have some code?
11:06LajjlaWell that's apparently not how it works
11:06pasgfliebel: yeah one sec
11:07fliebelpasg: have you tried rebooting your computer? :D
11:09pasgfliebel: i'll try that if this works on your end :P
11:09pasgfliebel: in one ns do this: (defprotocol IStep (execute [this uuid order data]))
11:10pasgfliebel: in another do this: (defrecord testrec [] IStep (execute [this uuid order data] (prn "args" this)))
11:10pasgrequire the first ns in the second :)
11:11pasgfliebel: also, try this in the second: (defrecord testrec [] IStep (execute [this] (prn "args" this)))
11:11pasgfliebel: it shouldn't work because the function has wrong arity, but it does :S
11:13fliebelpasg: yea, breaks, but works when I add the args.
11:13pasgfliebel: which one works?
11:14fliebelhttps://gist.github.com/87ca4283c1813e426f51
11:18pasgfliebel: hmm, yeah that works for me too, but not when i have them in separate files :/
11:22fliebelpasg: So I would say your require/use statement is to blame.
11:22fliebelAre you using, or requiring?
11:23pasgfliebel: i am using, does that make a difference?
11:23pasgfliebel: basicly i get the error when i use the second ns with the record
11:24fliebelpasg: Try require, use adds extra magic.
11:25pasgfliebel: just tried, require doesn't make a difference either
11:26fliebelpasg: I'm out of ideas...
11:26pasgfliebel: i'll just try to create a new project, so see if mine is broken
11:26pasgfliebel: yeah, i understand, thanks for your time though :)
11:26fliebelyou could maybe print the protocol, to see if its the same thing in both namespaces
11:31pasgfliebel: yeah, it's the same: {:on-interface order.flow.IStep, :on order.flow.IStep, :sigs {:execute {:doc nil, :arglists ([this uuid order data]), :name execute}}, :var #'order.flow/IStep, :method-map {:execute :execute}, :method-builders {#'order.flow/execute #<flow$eval168$fn__169 order.flow$eval168$fn__169@cd2192>}}
11:31fliebelweird...
11:31pasgfliebel: even prints the arglist
11:32pasgfliebel: yeah, very
11:32pasgfliebel: i'll have to look at it again tomorrow with fresh eyes i think. Thanks again for your time
11:47@rhickeydnolen: here
11:48dnolenrhickey: what do you think about emitting JS primitive arithmetic ops only under *unchecked-math* ? we add math protocols - then we can do Ratio, BigInt, throw in NaN, Infinity etc.
11:48dnolenthrow on
11:50@rhickeydnolen: seems ok, would be nice to have all the semantics. I'd pay attention to the double dispatch mechanisms used by Clojure - protocols are single dispatch (as are the interfaces used in clojure.lang.Numbers) so you'd have to do something similar
11:52@rhickeydnolen: but you don't want math to suck by default either
11:52dnolen@rhickey: suck as in performance?
11:52@rhickey@dnolen yes
11:53@rhickeymight want to make sure ^double hint works
11:53TimMcMaybe have *unchecked-math* default to true?
11:54dnolenrhickey: yeah, it would be much slower - albeit safer. I'm not convinced common JS applications need fast math - if they do they can use *unchecked-math* like we do internally.
11:54dnolenrhickey: yes, will make sure ^double works.
11:54@rhickey@dnolen it's not quite the same as all the types are present with or without unchecked math
11:55@rhickeyare you proposing to switch between 1 = someLongType and 1 = double with *unchecked-math* ?
11:55@rhickey"I'm not convinced common JS applications need fast math" is a very dangerous way to think
11:56@rhickeyPeople building cool libs like C2 might care quite a bit
11:56dnolenrhickey: of course, and we provide something reasonable for those libs.
11:56@rhickeyIt's something that needs careful thought
11:56dnolenrhickey: again we could just move forward with what we have, but now seems like a good time to decide.
11:57@rhickeyYou need to have a set of objectives
11:57@rhickeysafety, perf, richer semantics etc
11:57@rhickeycompatbility
11:58dnolenrhickey: yeah compatibility is a big one, people will have have to convert when interacting with JS libs.
11:58dnolenwhich is pretty yucky
11:59@rhickeyand you need to carefully define what the semantics of *unchecked-math* would be
11:59@rhickeyI'm not sure it's the same flag at all
11:59dnolenrhickey: agreed.
11:59@rhickeylet's call it math-flag for the moment
12:00@rhickeywill math-flag toggle the integer/double interpretation of 42?
12:00@rhickeythe result type of ops?
12:00@rhickeyIt has a lot less to do with the js primitiveness at some level
12:00dnolenrhickey: k one more question - opinion about the other less ambitious approach I took? Just inline numeric checks like we do w/ truth. that is check if number, check not NaN not Infinity.
12:01dnolenJS numeric perf is about 2-3X slower, but not horrible, good interop story. Get rid of nasty JS edge cases.
12:01dnolen(+ "1" 1)
12:01dnolenstuff like that.
12:01@rhickeyYou are hurting good code to protect bad
12:02@rhickeyDon't do (+ "1" 1)
12:02dnolenrhickey: makes sense.
12:02@rhickeyProtecting people from themselves while hurting people who are writing correct programs is not the Clojure way
12:03dnolenrhickey: jumping back a bit - I didn't really think about enforcing long / double semantics, since I don't see how that could be done w/o slowing things down a lot.
12:03@rhickeydnolen: Google Clojure has a Long API, which has been carefully thought out afaict
12:04@rhickeyClosure
12:04@rhickeyhttp://closure-library.googlecode.com/svn/docs/class_goog_math_Long.html
12:04@rhickeylots of attention to perf details
12:05@rhickeyWe could adopt as default for 42 and say fastest cljs code uses doubles, e.g. write 42.0
12:05@rhickeythen less semantic mismatch with Clojure code
12:06dnolenrhickey: yes, looks comprehensive like it but still it would be quite slow compared to what we're currently doing.
12:06@rhickeynot slow compared to 42.0
12:06Lajjla##(+ "1" 1) actually works?
12:06lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
12:06Fossiin cljs i guess
12:06@rhickeydnolen: again, what are the objectives?
12:06Fossiin javascript that "works"
12:07dnolenrhickey: yes - was mostly wondering how important it is to get Ratio, BigInt in there. Though that could be handled by libs.
12:08dnolenrhickey: if it's not important - then I think what we have is OK.
12:09@rhickeydnolen: I think it is worth considering, but the objectives have to be clear, and the tradeoffs too - only then could an approach be assessed
12:09eggsbyI've been hesistant about cljs, that synonyms page was kind of a smack in the face/wake up call, however.
12:09dnoleneggsby: good to hear!
12:10dnolenrhickey: k thanks for your time.
12:10eggsbyhttp://himera.herokuapp.com/synonym.html for those who haven't yet seen it
12:10@rhickeydnolen: yes, and the most impressive parts of the synonyms are the ones only supported due to Clojure semantics
12:11felideonthat's always nice.
12:11@rhickeyso one thought experiment is - how can we support Clojure numerics semantics (which we've punted on so far), and then, how do we get back perf?
12:11ben_mDoes anyone have experience with Parenscript? If so, how does Cljs compare to it?
12:12dnolenben_m: Parenscript is quite a bit less ambitious
12:12S11001001ben_m: not really alike at all. parenscript is sugar with macros for JS
12:12felideonben_m: it's completely different.
12:13ben_mNow I feel stupid for asking :D
12:14felideonben_m: nah, I didn't 'get it' at first either.
12:16felideonben_m: "ParenScript (or CoffeeScript) is not the same as ClojureScript. ParenScript "transforms" a subset of CL to JS, while ClojureScript is a full-fledged target runtime for Clojure."
12:17felideon^ someone said to me once
12:28ben_mfelideon, I was aware of that but temporarily forgot that it would make comparisons hard to make. :)
12:30felideonben_m: and in any case, to answer your question more directly, a lot of (common) lispers just write javascript anyway
12:31felideonthat i know of at least.
12:40nDuff.getURLs on clojure.lang.DynamicClassLoader is just returning nils; is there a way to see the classpath?
12:41technomancynDuff: IIRC you need to traverse the parents' as well
12:42technomancy(apply concat (map (memfn getURLs) (take-while identity (iterate (memfn getParent) (.getContextClassLoader (Thread/currentThread))))))
12:42daniel_I'm trying to create bitboards for a chess program, I get an error use (Integer. "00000000...") what number type do I want here?
12:42daniel_here's my function https://gist.github.com/2491133
12:43daniel_(vct->bb [\p \p \- \-] \p) gives -> 1100
12:43daniel_but length 64 is obviously too big for Int
12:44raeknDuff: if you are in a leiningen project, `lein classpath` might be enough
12:44technomancydaniel_: numbers beginning with zero get interpreted by the reader as being octal; not sure if the Integer constructor feels the same way
12:44AimHerePrefix it with '2r' and you'll get it in binary
12:46AimHerealso, the 'read-string' function will shove your number into an appropriate type, as long as your string is formatted properly
12:56pandeirodoes clojure.pprint have anything that can just produce a formatted string instead of actual output?
12:57mknoszligpandeiro: you could wrap it in with-out-str
12:57TimMcpandeiro: Use with-out-str.
13:01pandeirothanks, useful macro that
13:04ben_mI'm on Windows and since upgrading lein, I get ^M in the swank REPL. Probably an encoding issue, but I don't know how to get rid of it :/
13:37technomancyabout to wipe the insecure password hashes on clojars; log in to re-hash if you haven't already
13:40nDuffHmm.
13:40nDuffclojure.lang.DynamicClassLoader.getURLs() is always coming up empty for me, even after I do an addURL() call (and can, in practice, import classes from the added jar)
13:40nDufftechnomancy: *nod*, I am traversing the parents...
13:41nDufftechnomancy: ...but I'd expect the addURL to be to the immediate classloader, rather than to its parent.
13:41nDuffraek: a leiningen project would be much easier -- I'm actually escaping from an OSGi sandbox.
14:15beffbernardThis is a noir/compojure question. How do you handle a variable number of form inputs on a post?
14:15beffbernardI tried using the same :name and :value *hoping* they would come back in a list
14:18ben_mI'm on Windows and since upgrading lein, I get ^M in the swank REPL. Probably an encoding issue, but I don't know how to get rid of it. Asked this before, but that was over an hour ago, so I hope it's okay if I ask again.
14:23ibdknoxbeffbernard: name="somename[]"
14:24fliebelibdknox: Cool. I always wondered whether that was a PHP-ism or a HTML/HTTP thing.
14:25dnolen`fogus: nice post!
14:25metajackIs there an easy way in compojure to map two routes to the same function? Aside from simply copying the function (or factoring it out and still having two routes point to the factored version)?
14:26S11001001it's a phpism
14:26beffbernardibdknow: worked like a charm
14:27beffbernardibdknox: ^
14:29jsabeaudryDoes it matter openjdk6 or openjdk7 with clojure?
14:29dnolenjsabeaudry: should not
14:31ibdknoxdnolen: to your knowledge is anyone de-JSing the CLJS analyzer?
14:32dnolenibdknox: a necessary step for pluggability, so should fall out of GSoC
14:32dnolenibdknox: that said, I don't think the analyzer has too many JS specific bits.
14:32ibdknoxdnolen: not particularly, no :)
14:33ibdknoxdnolen: any idea when and where that'd happen?
14:33ibdknoxI'll likely need it in not too long
14:33ibdknoxand I don't want to have two efforts for the same thing :)
14:33dnolenibdknox: Raphael Amiard is starting to look into the compiler so in the near future.
14:34dnolenibdknox: but if you know what bits you'd like to see changed now, bring it up.
14:34ibdknoxdnolen: haven't looked too hard at it yet. I'll probably know more later in the week
14:34jonasendnolen: is there a repo on github that Raphael is using for his work?
14:34dnolenjonasen: he just has his own fork.
14:34dnolenibdknox: cool
14:35jonasendnolen: found it. Thanks
14:35muhoois there an imagemagick-like java library that will work on cloudy things like heroku?
14:35muhooall i want to do is resize profile pics after people upload them :-(
14:35ibdknoxjonasen: link?
14:36jonasenhttps://github.com/raph-amiard/clojurescript
14:36ibdknoxthanks
14:36fliebelS11001001: But then, it is a PHP-ism shared by noir/compojure?
14:36ibdknoxfliebel: most of the industry picked it up
14:36ibdknoxI actually thought it originally came from perl
14:37muhoojmagick appears to just be a JNI interface to the c library
14:37ibdknoxbut I might be making that up :)
14:39muhoohmm, nevermind: http://briancarper.net/blog/465/
14:40muhoo:-)
14:41daniel_AimHere: technomancy thanks for your answers earlier...i had to dash off
14:42muhooit's so sad when i find the simple easy answer to what i need to do, and the answer is "use clojure.contrib"
14:42muhooin this case i think i can go around it tho
14:45solussd_trying to use something of the form (defmacro blah [arg1 arg2 & {:keys [a b c] :or {a 1 b 2 c 3}] …) if I pass a, b, or c in a map as the last arg I get this error: "No value supplied for key <the map I tried to pass>". ideas?
14:45daniel_AimHere: your binary suggestion, how would i add the prefix 2r to make it binary?
14:45amalloymacros only take literal map objects. you can't do (let [m {:a 1}] (blah m))
14:46solussd_amalloy: I am passing it a map literal
14:46amalloyoh. then drop the & from your signature
14:46solussd_but the map is optional. :/
14:46ibdknoxor do & [{...}]
14:46solussd_ok
14:48daniel_can anyone tell me how i can convert a string of number "0010101010111110000" into binary representation?
14:48solussd_ibdknox: & [{..}] didn't work. here's the code, it's for my noir usage. https://gist.github.com/422e9bcefc4102527b96
14:49ibdknoxsolussd_: I don't see the vector around it
14:49solussd_i took it out. :)
14:49solussd_doesn't work with it though
14:50jsabeaudrydaniel_, parseLong(String s, int radix)
14:50jsabeaudrydaniel_, in your case the radix is 2
14:50daniel_thanks jsabeaudry
14:51daniel_,(parseLong. "100011" 2)
14:51clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: parseLong, compiling:(NO_SOURCE_PATH:0)>
14:51ibdknoxsolussd_: works just fine for me with the change I suggested
14:51daniel_,(.parseLong "100011" 2)
14:51clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: parseLong for class java.lang.String>
14:51jsabeaudry,(java.lang.Long/parseLong "0110" 2)
14:51clojurebot6
14:51solussd_ibdknox: … wtf. ill try again I guess!
14:51daniel_ah ;)
14:52ibdknoxsolussd_: I simplified your case, but here's what the params look like: https://refheap.com/paste/2352
14:52solussd_ibdknox: i did this: https://gist.github.com/513d360c15bb1f15827a
14:53daniel_jsabeaudry: ends up looking like 71776119061217280, how do i see it in 1's and 0's?
14:54jsabeaudrydaniel_, you want to print it or you want to parse it?
14:54daniel_both :D
14:54daniel_i want to do bitwise operations on them and also print them
14:55jsabeaudry,(.toBinaryString 44)
14:55clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: toBinaryString for class java.lang.Long>
14:55jsabeaudry,(toBinaryString 44)
14:55clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: toBinaryString in this context, compiling:(NO_SOURCE_PATH:0)>
14:55ibdknoxsolussd_: your exact code works for me. How are you calling it?
14:56daniel_,(toBinaryString. 44)
14:56clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: toBinaryString, compiling:(NO_SOURCE_PATH:0)>
14:56jsabeaudry,(java.lang.Long/toBinaryString 44)
14:56clojurebot"101100"
14:56daniel_oh yay
14:56ibdknoxsolussd_: do you only have one form for your body?
14:57ibdknoxsolussd_: also are you sure you picked up the code changes?
14:57solussd_ibdknox: here's how i'm calling it: https://gist.github.com/513d360c15bb1f15827a
14:58solussd_ibdknox: changed code and ran lein run
14:58timvisheranyone know if it's possible to tell leiningen about hosts it shouldn't run through the proxy?
14:59ibdknoxsolussd_: you invocation works for me too
14:59ibdknoxyour*
15:00ibdknoxsolussd_: maybe you didn't save the file or something?
15:00solussd_ibdknox: saved. :) so confused.. lein clean
15:00solussd_ibdknox: im runing clojure 1.3, if that matters
15:01ibdknoxme too
15:04timvisherhmm... leiningen 2 fails to create a new project? https://gist.github.com/2492242
15:05technomancytimvisher: standard "download bin/lein" install, or are you running from a checkout?
15:05AimHeredaniel_, Something like (read-string (apply str (cons "2r" (map #(if (= % piece) 1 0) vct))))) seems to do what I think you want
15:06timvishertechnomancy: standard
15:06technomancytimvisher: any profiles active?
15:06timvishergot yesterday i think, so i should be after the bugs here https://encrypted.google.com/search?hl=en&amp;q=%22java.lang.IllegalArgumentException%3A%20No%20implementation%20of%20method%3A%20%3Amake-reader%20of%20protocol%3A%20%23%27clojure.java.io%2FIOFactory%20found%20for%20class%3A%20nil%22
15:07pandeirois there some kind of order-keys fn to convert a hash-map to a sorted-map?
15:07technomancytimvisher: oh, yeah if you're on windows you might need a newer lein-newnew
15:07technomancytry putting 0.2.7 in :plugins in the :user profile
15:09timvisher_technomancy: sorry, got kicked or something
15:09fliebelpandeiro: you could do (apply sorted-map m) I think.
15:09timvisher_newer newnew?
15:09carllercheis it possible to get a 3rd party java class to behave like a fn?
15:09technomancytimvisher_: try putting [lein-newnew "0.2.7"] in :plugins in the :user profile
15:09fliebelno...
15:10Vinzentcarllerche, I think you can implement clojure.lang.IFn or something
15:10carllercheVinzent: Yeah… which unfortunately only works if i have control of the class :-/
15:10amalloynot a 3rd-party class
15:12Vinzentcarllerche, ah, yeah, only if you proxy it. Too bad it's not a protocol
15:12timvisher_is it possible to specify ntlm authentication using lein2?
15:18di-csuehsIs there a more appropriate idiom for def'ing a connection to a service such that the service need not be available at compile time other than (delay... ?
15:19gfredericksdi-csuehs: someone said the other day you can do (when-not *compile-files* ...)
15:20hiredmandi-csuehs: I really recommend against making that kind of thing a global
15:20di-csuehsgfred: ;) yeah.
15:20di-csuehshiredman: I'm all ears...
15:21daniel_thanks AimHere
15:21di-csuehshireman: this kind of issue around configuration and instanciation of collaborative service connections is going to be a theme in the work I do.
15:21hiredmandi-csuehs: hmmm?
15:21solussd__ibdknox: you'll never guess what was wrong………. I was ssh'd into another machine w/ the same repo checked out. I was running 'lein run' on the other machine while editing the code in another window in emacs on my local machine. I feel dumb…. :D
15:22hiredmandi-csuehs: so, to run a program you have some entry function, right? main or whatever
15:22di-csuehshiredman: yes.
15:22hiredmanmain or whatever can create a connection and pass it to the functions it calls
15:23hiredmanI know, it's kind of nuts, and out there
15:24di-csuehshiredman: I've considered it. I'll end up having several services I am passing in.
15:24hiredmansounds good
15:25di-csuehshiredman really seems to ugly up the code
15:25hiredmanhave you decided what you are going to do when the a global component fails?
15:25TimMcsolussd__: That's quite a special case of "forgetting to save the buffer". :-)
15:25TimMcwell, rather "editing the wrong file"
15:25solussd__TimMc: ;)
15:26di-csuehshiredman: so far, 2 of 3 have a pooling mechanism, but one is subject to failure.
15:26TimMcI've definitely edited the wrong project.clj before. 20 minutes down the drain...
15:26hiredmandi-csuehs: pooling doesn't protect against all possible failures
15:26di-csuehshiredman: I've had other projects that only had pooled db connections. but I know this will not be the case most of the time.
15:27hiredmanwhat if your machine's network hiccups for some reason, and the network connection to the pooled resources is unreliable?
15:27di-csuehshiredman: sure, but it allowed me to be lazy and not address it because it was good enough for now. I no longer have that luxury, so...I feel a "functional programming inspired mind shift" coming.
15:28hiredman(someone fat fingers a iptables rule in chef or whatever)
15:28timvisher_don't mean to spam, but has anyone configured authentication for a proxy in leiningen 2?
15:29di-csuehshiredman: I'm sold on the idea of improving the mechanism, just not sure which way to go yet.
15:29di-csuehshiredman: I (think) I don't want to re-establish the connection each call.
15:29hiredmandi-csuehs: one way to go that is sort of a middle ground is using binding
15:30hiredmandi-csuehs: but you connection pooling
15:30hiredmanhave
15:31di-csuehshiredman: sure...but let's say I don't...because that is also representative of services I expect to use in the future.
15:32zamateriantimvisher_, I have made some changes to pomegrante - that enables it to use proxy authentication - but that part is not implemented in lein2.
15:32hiredmandi-csuehs: what kind of app is this?
15:32di-csuehshiredman: it seems like there should be a well-known functional programming pattern for working with a service that may need to be initialized. I'm just not realizing what to look for OR I am bringing OO baggage and not thinking about it the right way.
15:33timvisher_zamaterian: ah...
15:33hiredmandi-csuehs: this isn't about functional programming, it's about building reliable systems
15:33di-csuehshiredman: this one is a RESTful api.
15:33hiredmanyou need to isolate components to isloate failure
15:33yoklovI know this is a weird question, but is there any way I can use macros to unbox a vector/array/any representation of 3 numbers at compile time? (specifically in clojurescript, though i dont see why the answer would be cljs-specific)
15:34hiredmanglobals are not isolated
15:34di-csuehshiredman: sure...they are shared, allowing failure to affect all threads and collaborations.
15:34hiredmandi-csuehs: put a queue between access to the resource and the web requests
15:34di-csuehshiredman: interesting.
15:35zamateriantimvisher_, see https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L131 and https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/classpath.clj#L82
15:35hiredmanwhatever processes the queue will need to know how to handle connection failures, etc, but the webrequest doesn't need to care
15:35dnolenyoklov: do you mean generate the code to extract the fields?
15:36yoklovdnolen: I guess, though I know destructuring is very doable. Right now the boxing and unboxing around function calls is a big slowdown
15:36yoklovthough that's with records
15:37di-csuehshiredman: so establishment and release of the connection is managed by the queue processor...it could drop it when it sees fit and start it up when it needs it.
15:38hiredmanright
15:38di-csuehshiredman: the web request might call code that eventually depends on a promise or a future, etc. ?
15:38hiredmanunfortunately I don't know of a nice way to avoid making the queue global
15:38hiredmandi-csuehs: right
15:38yoklovdnolen: hm. basically my question is whether or not there's a way for me to say something like (point-add p1 p2), and have in the code it deal with 3 variables instead of some type
15:38hiredmandi-csuehs: and can include a timeout
15:39hiredmanthe global queue thing is sort of an artifact of existing clojure web stuff
15:39hiredmannot a limitation of the design
15:39yoklovdnolen: or do you think i wouldn't have a noticable performance difference between 3-element js arrays and unboxed values
15:40hiredmannone of them (that I know of) let you specify an init function and then pass the value of that init function to handlers
15:40timvisher_zamaterian: interesting behavior. if i specify a user name and empty password, i seem to get in through the proxy, but now i'm back to the original problem i had with no proper implementation of :make-reader
15:40hiredmanthat might be an interesting addition to defroutes
15:40timvisher_but progress, nonetheless! ^_^
15:40hiredman"compute this once, and pass it to everything under this route"
15:42di-csuehshiredman: It seems like there should be some idioms around such services (even if they never go out of process/machine).
15:42dnolenyoklov: if you want absolute speed you could write an interesting macro DSL like i said before. (vec-add2 p1 p2) could be a macro.
15:42yoklovdnolen: yeah, that's what i'm doing
15:42dnolenyoklov: oh, k. so what's the issue then?
15:43dnolenyoklov: arrays and defrecord should be equivalent in perf as long as you not doing keyword lookup and using field access instead with .-
15:43dnolenyou're not
15:43yoklovdnolen: how to store the points internally, mostly
15:44yoklovwould arrays be slow?
15:44di-csuehshiredman: Thank you, very much. That's been helpful. If I recode this, I'll have to sanitize it and post it.
15:44yoklovprobably not
15:44dnolenyoklov: I don't think so, but I think types/record w/ field access would be faster.
15:44yoklovhuh, really?
15:44dnolenyoklov: I think so, can't know for sure w/o benching tho.
15:45dnolenyoklov: V8 I know optimized array of fixed sizes, I don't think the other engines do.
15:45dnolenoptimizes
15:53dnolenyoklov: I did a quick test, deftype/record seem to have an edge on V8 and JavaScriptCore
15:53yoklovdnolen: wow, really? that is extremely surprising
15:56dnolenyoklov: https://gist.github.com/2492799
15:57dnolenyoklov: that's with simple optimizations - with advanced optimizations GClosure just eliminates the type perf test :P
15:59dnolenyoklov: did you get that gist?
15:59yoklovdnolen: yeah
15:59amalloyhey TimMc, remember a year ago when you referred me to a story re: turkish dotless-i localization? it came up in conversation today, but i can't find any credible sources for it. do you know if it's an actual true story?
15:59yoklovdnolen: http://jsperf.com/array-vs-obj-vs-unboxed
16:00yoklovthough, to be fair those are mutable
16:01amalloy(original conversation at http://lazybot.org/logs/#clojure/2011-04-12 for reference)
16:01arohneramalloy: http://www.moserware.com/2008/02/does-your-code-pass-turkey-test.html?
16:01yoklovdnolen: i'm assuming the cljs gets compiled to something similar.
16:01amalloyso far i've found the story republished on gizmodo, dailymail, and the inquirer. not very encouraging
16:03dnolenyoklov: my macro suggestion was to unbox and not create intermediate values, and only construct a value at the very end.
16:04yoklovdnolen: okay, yeah, that sounds fast
16:04yoklovhm.
16:04dnolenyoklov: and being a macro it would be portable to Clojure - it's also interesting enough for a pretty cool blog post I think :)
16:05yoklovdnolen: haha, it would be.
16:05daniel_,(bit-shift-right 2r001110 2)
16:05clojurebot3
16:06amalloyarohner: that looks like a reasonable article on the things you have to do to be really i18n correct, but i was currently looking for confirmation of http://gizmodo.com/382026/a-cellphones-missing-dot-kills-two-people-puts-three-more-in-jail, which would be a more compelling argument that it's important to be i18n correct
16:06daniel_,(java.lang.Long/toBinaryString (bit-shift-right 2r001110 2))
16:06clojurebot"11"
16:06daniel_hmmmmm
16:07daniel_how can i get from 001110 to 000011? thats what i was trying above
16:07dnolenyoklov: another option would thinking about transients I could imagine - (persistent! (unit (mul (add (transient v1) v2) 2.5))
16:07daniel_,(java.lang.Long/toBinaryString (bit-shift-right 001110 2))
16:07clojurebot"10010010"
16:08amalloyyou want...padding with zeroes, daniel_?
16:08daniel_yeah, and for it to remain the same length
16:09daniel_its for a chess bitboard, so i can shift 8 for a pawn move (for example)
16:09yoklovdnolen: transients are still probably not as fast as native arrays though
16:09amalloy*shrug* write padding yourself. it's not very surprising that no built-ins do this, because they deal with actual numbers, and you care about the particular textual representation
16:09daniel_the c++ implementation i saw was very simple
16:09daniel_00010110 << 2 something like that
16:09beffbernardso what piece are you tring to move daniel_?
16:09beffbernardpawn?
16:10beffbernardand which is a1 and h8 in your bitboard?
16:10daniel_beffbernard: thats not the issue at the moment, i just want to shift a 64-bit binary number a certain number of bits left and right
16:10daniel_and pad with 0's and if something goes off the end its lost forever
16:10dnolenyoklov: transient are just mutable types, I don't see how they would be any slower than a mutable type.
16:10daniel_2 secs, brb
16:10amalloystoring a chess board as a bitstring sounds like a severe case of premature optimization
16:10hiredmandaniel_: there are no unsigned numbers on the jvm
16:11hiredmanamalloy: I don't believe he wants it as a string
16:11beffbernardamalloy: it's conceptually simple
16:11hiredmanI believe he wants it unsigned and he was demonstrating the signed nature by converting it to a string
16:11beffbernardhe just wants a long.. doesn't matter if it's signed
16:11hiredmanhard to say, some times people are weird
16:11yoklovdnolen: oh, I though you could only have transient collections, not transient types from deftype
16:12amalloyhiredman: no, i realize he wants an N-bit integer
16:12amalloya bitmask instead of a bitstring, might be better in my sentence
16:12hiredmanbeffbernard: oh, right, because they are unsigned shifting operations
16:12hiredmanthere
16:12hiredmanso the number being signed or not doesn't matter
16:13beffbernardhiredman: you got it
16:13dnolenyoklov: it's just a protocol. Though of coursed unboxed everything would probably win.
16:14dnolenyoklov: this is definitely an interesting approach in the context of games - and it seems like more than a couple of people are interesting in doing games w/ Clojure/Script ;)
16:14hiredmanbeffbernard: so what's his problem then?
16:14beffbernardso a pawn move is bit-shift-left 8 for that bit the pawn is on
16:15yoklovdnolen: i wouldnt really know how to go about unboxed everything, to be honest. protocols carry a performance overhead that i'd want to avoid in the inner part of of a rendering loop
16:16yoklovdnolen: arrays might allow me to swap out easily with Float32Array for potentially(?) increased performance
16:16dnolenyoklov: gotta run, if I find some time I'll write down how I think this can be done.
16:16beffbernard,(java.lang.Long/toBinaryString (bit-shift-left 1 8))
16:17clojurebot"100000000"
16:17yoklovdnolen: cool, I'll see if I can do it with just arrays. I think I'd know how to go about that
16:17beffbernardit's moved from "1"
16:18hiredman,(count (.getBytes "c4"))
16:18clojurebot2
16:22daniel_beffbernard: thats what im doing, and it causes there to be 0's added or removed from the right
16:22daniel_which is not exactly what i want, i need 64 bits at all times to represent the board
16:22beffbernarddaniel_: are you using a long to represent your bitboard?
16:23beffbernardor some sort of string representation?
16:23daniel_i havent decided yet, whatever works
16:23daniel_i have it in string form atm and am converting to binary
16:24beffbernardI wrote a bitboard chess engine when I was in uni and I store it in a long
16:24beffbernard0 implies each position is empty
16:25daniel_yeah, a long would work
16:25daniel_but then how can i do the bitshift
16:25beffbernardwith start bitwise operations
16:26beffbernardstandard*
16:26beffbernardso it's easy to test whether a move is legal
16:26beffbernardI store my board like this.. it was in java at the time
16:27beffbernardfor each piece.. pawn, rook, knight, etc.. I had a bitboard… then I had a board for each color.. which was simply all the pieces and'ed
16:27daniel_yep, thats what i plan on doing, i think thats the idea of a bitboard
16:27daniel_12 different boards
16:28beffbernardI added two more.. one for each color
16:28beffbernardmakes it slightly more convenient
16:29daniel_a board for each piece of each colour = 12 boards
16:30beffbernardYes you're correct.. but I also added all the black occupied spaces and white occupied spaces
16:32daniel_ah, ok
16:33daniel_i suppose if it was Java they were all mutable, how would you keep the state in clojure?
16:33daniel_and did you store the bitboards in a size 14 array?
16:33beffbernardthey can stil be immutable...
16:33beffbernardyup
16:34daniel_i guess i will have to use an atom to record the current state of the game
16:34beffbernard(let world (atom []))
16:34daniel_ja
16:34beffbernardyeah
16:35beffbernard(let [world (atom [])] …) is what i wanted to type
16:35daniel_ok, i'll try changing my code to use Longs and see if the bit-shift works as i need
16:36daniel_i get this java.lang.NumberFormatException: For input string: "0000000011111111000000000000000000000000000000000000000000000000" (NO_SOURCE_FILE:0)
16:37daniel_unless i do (java.lang.Long/parseLong bitboard 2)
16:37beffbernardI wouldn't use any string representation unless it was to print the board
16:37daniel_then i lose the 0's at the start
16:37daniel_beffbernard: im using longs and then java.lang.Long/getBinaryString to print
16:38daniel_beffbernard: im using longs and then java.lang.Long/toBinaryString* to print
16:39patchworkHow do I change the directory from within a lein plugin?
16:39patchworkI want it to run a command in the context of a subproject
16:40daniel_how can i evaluate the type of something? (typeOf. 2) for example
16:40patchworkdaniel_: (class 2)
16:40technomancypatchwork: in lein2 you can rebind *dir* in leiningen.core.eval
16:40Raynesibdknox: You're dangerously close to your target. It would be real sad to see it fail at this point.
16:40technomancypatchwork: but that only works for new subprocesses; you can't change the JVM's current directory
16:41daniel_thanks patchwork
16:41Raynesibdknox: Who can we solicit to tweet about it? I'll see if I can find Bill Gate's phone number.
16:41patchworktechnomancy: So I am starting a jetty server from the context of the subproject, does that count as a subprocess?
16:41technomancypatchwork: if you're changing the dir in leiningen and running the code in eval-in-project it should work
16:42patchworktechnomancy: Cool thanks!
16:42patchworkI'll give that a shot
17:06solussdcan I capture a gensym in a macrolet'd macro?
17:07technomancymacrolet?
17:08solussdclojure.tools.macro/macrolet
17:09solussd:D
17:12amalloytechnomancy: macrolet is fab
17:13amalloysolussd: you can do anything in macrolet you could do in a defmacro
17:13Raynesmacrolet is pretty cool.
17:13RaynesNever had occasion to use it though.
17:13RaynesBut I don't really ever use macros anymore either.
17:14solussdamalloy: i've only played with in in the context of LOL; wondering, can I capture a gensym from within my defmacro within a syntax quote in my macrolet'd macro?
17:14felideonwait till you hear about symbol-macrolet
17:14felideon(not really)
17:15amalloysolussd: foo# gensyms are specific to the syntax-quote they're in
17:15zakwilsonI have actually used symbol-macrolet in real code.
17:15felideonzakwilson: me too. i regret it though. :)
17:15amalloythis is entirely unrelated to macrolet though
17:15zakwilsonI don't. It did what I wanted.
17:16felideonzakwilson: ah cool
17:16amalloyindeed, i stole a cool use of symbol-macrolet from chouser
17:16amalloyhttps://github.com/flatland/useful/blob/develop/src/useful/utils.clj#L201
17:16zakwilsonI'm trying to remember exactly what I used it for or find the code.
17:20RaynesTo whom it my concern: I just graduated high school.
17:20cshellcongrats:)
17:20rhcRaynes: congrats
17:20pipelinedefinitely preferable to the alternative
17:20RaynesHeh
17:20jodaroi'm concerned
17:20jodarocongrats
17:20dnolenRaynes: congrats!
17:21zakwilsonhttp://pastebin.com/cW4XBZwR <-- found it. Not only did I use symbol-macrolet, but I used it inside a macro. Enough meta?
17:21zakwilsonRaynes: proof that on the internet, nobody knows you're a dog!
17:21metellusa dog graduating high school would be pretty impressive
17:22RaynesIndeed.
17:22jodarosounds like a good basis for a disney movie
17:22jodaroHigh School Spot
17:22RaynesAirBud Goes To High School
17:22Wild_Catthey already made a dozen Air Bud movie, why not this one? :p
17:22amalloyzakwilson: symbol-macrolet is primitive enough that you'd almost-always use it from a macro
17:22amalloyit's more of a building-block than a real tool
17:23zakwilsonI *thought* I had used it in something higher-level. I haven't done any CL in ages.
17:24amalloyzakwilson: well, tools.macro adds symbol-macrolet as well as macrolet
17:24amalloyso it doesn't have to be in CL
17:25zakwilsonYou just HAD to tell me that. Now I'm going to end up using it. In production code.
17:26solussdit's in my production code. being the only *lisp programmer at your company has its perks- no one will ever ask me wtf it is
17:27zakwilsonWell, my projects tend to be freelance with just me as a programmer, or personal projects that are entirely mine.
17:28dnolenibdknox: light table kickstarter is just rolling along now it seems
17:32cshelldid it get 200K?
17:34metajack114k right now. almost broke 1k $15 backers too
17:35cshellwow, crazy
17:35jodarohopefully ibdknox will blow some of it on a 'got funded' party
17:35cshellit looks like it could be pretty cool
17:35cshelllol
17:42solussdnoir question- why can't I have a page route of /blah/:id and /blah/search/ (that takes a query string)? the first route eats everything that should go to the second too. :/
17:43amalloydon't put them in that order
17:44solussdamalloy order? I actually swapped their location in the source file, no effect.
17:44amalloythe whole idea of compojure routes is that the first one that returns a non-nil response is the correct handler, and they're consulted in order
17:44amalloyi guess i don't know how noir orders things for you
17:44aaelonyme too, thanks to template-cljs
17:44mefestonot sure if im reading out-dated docs but is it true that google closure doesn't want you to use a document ready event?
17:45amalloybut if you were using compojure this would be a simple ordering problem
17:45amalloymefesto: they really don't
17:47mefestoi guess i'll have to change my ways
17:52mefestoi'm used to jquery and how a lot of the event handling is wired together in the document ready event. is this an "acceptable" way using clojurescript? https://refheap.com/paste/2360
17:52mefestoi'd like to avoid sprinkling script tags all throughout the html
17:53arohneramalloy: re: your turkey question. My sister-in-law lived in turkey, and she found the language mixup plausible
17:54dnolenmefesto: GClosure actually considers it an anti-pattern as it affects page load time. but really you can put your script tag wherever you want as long as you're outputting a single source file.
17:55dnolenmefesto: that does make it somewhat harder to debug. Hopefully this will be moot point soon - source mapping.
17:57mefestoyeah i was reading their reasoning which makes perfect sense but it just goes against what i've become so accustomed to doing.
17:57dnolenmefesto: nothing prevents you from continuing to do it the jQuery way - jayq makes it even easier
17:58mefestowell if im going to go this route i'd like to follow it's idioms ... its. just. hard. :)
17:59amalloyarohner: thanks!
18:01dnolenmefesto: fwiw - I don't think it's important to fret over page load times the way that Google does - unless your Google size.
18:01dnolenmefesto: best to just do whatever feels most comfortable.
18:02mefestodnolen: true. i tend to get caught up in "the way" too much when switching to new tools :-\
18:02mefestoi.e. the right way (for this tool)
18:02mefestoto which most reply, there is no "one, right" way :)
18:05redwireDoes someone know for a good guide for setting up clojure on OS X 10.7? I've been having a hard time setting up 1.4.0 to work, clojure-contrib included (I'm new at clojure, too). clj works after a macports install, but using it to try to build clojure-contrib fails.
18:06technomancyclojurebot: macports?
18:06clojurebotExcuse me?
18:06technomancy=(
18:06dnolenredwire: don't use macports - don't use brew. Just install leiningen.
18:06technomancyclojurebot: installing clojure?
18:06clojurebotClojure isn't like most languages in that it doesn't need to be installed; it's just a library. Once you have a JVM, you can set up a project with something like Leiningen (http://j.mp/leiningen), which will pull Clojure in for you.
18:06technomancyaha; that's the one
18:06dnolenredwire: and don't bother with clojure-contrib it's deprecated.
18:08redwireI thought all sorts of things used clojure contrib? I see it all the time when I'm looking for particular function, it always seems to pop up.
18:08amalloythe web is a medium with a high rate of decay. two years ago, using all of contrib was very common
18:08hiredman:(
18:09amalloyand you're finding blog posts that are from that era
18:09redwireThis is true.
18:09redwireI want technomancy's leiningen?
18:09amalloyyeah, accept no substitutes
18:10redwireAye
18:10mdeboardredwire: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
18:10solussdI <3 leiningen- makes clojure the most convenient language to build in (out of what I use anyway)
18:11redwireWow that's saying a lot.
18:17redwireI like this leiningen so far. Thank you, everyone.
18:18technomancyyay =)
18:18redwireOh hi technomancy. o.O
18:22gfrederickstechnomancy: :D
18:22ibdknoxtechnomancy: I'm happy to serve as a henchman and wait outside their apartments/scaring the neighbors as appropriate
18:23gfredericksVietnamese Leiningen Peddlers would be a good name for a group of some kind
18:23ibdknoxespecially if Nerf guns might be involved.
18:24technomancyhttp://fuckyeahfingerguns.tumblr.com/
18:24Wild_Catsounds like a good name for a punk band
18:24ibdknoxtechnomancy: hahah well done :p
18:26zakwilsonThere was something I used in one project from contrib that still doesn't appear to have been replaced.
18:26zakwilsonThough I can't remember what it is now.
18:26gfredericksunder "archive" it shows technomancy riding atop the dalai lama
18:27gfredericksI think that is window-size-sensitive though
18:39ipostelnikwhat's a good way to debug why "lein deps" is slow
18:40technomancyipostelnik: two things: 0) are you on 1.7.1, and 1) do you actually need to run lein deps? (probably not)
18:40ipostelniktechnomancy, I'm on 1.7.0
18:40ipostelnikI'll upgrade
18:41technomancystep 2: stop running lein deps =)
18:41ipostelnikeven when I don't run it, lein uberjar does
18:41ipostelnikwhat's the alternative to lein deps?
18:41fmancinelliHi everybody... Just to announce that I've written a little plugin for Leiningen for compiling Less CSS files. You can find it here: https://github.com/fmancinelli/lein-lesscss - Comments are welcome. (FYI it's my first Clojure project)
18:41technomancyipostelnik: just let lein fetch the deps when it decides it needs to
18:41technomancybut 1.7.1 will fix the uberjar issue
18:41ipostelnikI have a "main" project and a "library" project that I'm working on
18:42ipostelnikoften I need to fix or extend the "library" project, then build "main" project
18:43technomancyhave you tried using the checkouts/ directory?
18:43ipostelniknoidi, I'm not familiar with this feature
18:44ipostelnik uberjar is definitely the bigger issue though, I'm glag simple upgrade to 1.7.1 helps
18:52ipostelnikcheckouts directory is awesome!
19:41nDuffHmm.
19:42nDuffI get a very different context classloader attached to my thread when using swank-clojure as opposed to nrepl
19:54RoxxiIs there a clojure idiom for zip? (e.g. (zip '(a b c) '(1 2 3)) => '((a 1) (b 2) (c 3)))
19:54brehautroxxi: map
19:54Roxxiehst
19:54technomancyclojurebot: zip?
19:54clojurebotzip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))
19:55Roxxierr
19:55Roxxiah
19:55Roxxiawesome
19:59meiji11is there a way to use recur in a function that takes a variable number of arguments?
20:00meiji11writing (apply fn-name arg-list) works, of course, but I'd prefer not to consume the stack.
20:03metellushave it take a list or vector instead, maybe
20:05meiji11yeah, I could just introduce a small wrapper function.. that will work. thanks.
20:06technomancymeiji11: recur interacts in very surprising ways with destructuring and rest args
20:06technomancythe details of which escape me at the moment
20:08meiji11it seems that way. shouldn't that be documented somewhere?
20:09technomancy=(
20:11zanesmeiji11: s/documented somewhere/fixed/
20:13hiredmangiven the implementation of recur and the implementation of varargs fixing it would be very tricky
20:13technomancyalso re-applying destructuring might slow things down
20:13technomancyconsidering most loop/recur usage is in tight loops
20:14hiredmantechnomancy: I don't think there is an issue with destructuring, just rest args
20:15hiredmanif you recur, you jump to the top of the function, and the destructuring has a change to be applied
20:15hiredmanbut for rest args the top of the function is already too late
20:16technomancyah, sure. been a while since I ran into this.
20:17hiredmanyeah, me too
20:17hiredmannot something I deal with on a regular basis
20:17technomancythankfully
20:17hiredmanYes
20:28nDuffipostelnik: howdy!
21:09anierohmm, when will clojuredocs.org be updated?
21:13bhenryaniero: when you update it.
21:13anierofor 1.4.0?
21:14anieroi'm ok with a "PDI" response, i just don't know how the site is operated/managed
21:14bhenryi'm just giving you a hard time. i don't think community has the capabilities to change the layout of a version, just the docs themselves for what's there.
21:16anierohmm, looks like the docs analyzer requires a manual update in order to handle the next version
22:22devn,((every-pred odd? number?) (range 0 10))
22:22clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Argument must be an integer: clojure.lang.LazySeq@9ebadac6>
22:22devn,((every-pred odd? number?) 1 3 5 7 9)
22:22clojurebottrue
22:22devn^-cool. never knew about that fn.
22:23ibdknoxdnolen: Got off the phone with the MITx guys - very neat experience :)
22:25kovasbibdknox: cool. did the daring fireball post explode your inbox again?
22:25ibdknoxnot really
22:25ibdknoxinterestingly enough
22:26ibdknoxI wonder if most of those folks had already seen it through HN or Reddit
22:26kovasbyeah thats funny. likely true
22:26devnlol. found this in the #clojure archives...
22:26devn,(letfn[(!-?>[&$ &!](if(>,&!,1)(!-?>@(->>,&$,(*,&!)ref)(->,&!,dec))&$))](!-?>,1,5))
22:26kovasbstill, the audience is so huge
22:26clojurebot120
22:26kovasbdid see the kickstarter got a a kick tho :)
22:27ibdknoxabsolutely, UncleBobMartin and him helped a lot there
22:27Raynesibdknox: Why were you talking to MITx?
22:27ibdknoxRaynes: they wanted to talk to me
22:27RaynesAbout?
22:27ibdknoxLight Table has a lot of potential as a teaching tool and they're building a teaching platform :)
22:28RaynesTell them GIVE ME YOUR MONIES
22:28kovasbcall it "consulting"
22:28ibdknoxhaha :)
22:28muhoomitch resnick and those guys have been going towards something like this for a long time, but haven't quite got there yet
22:29ibdknoxmuhoo: I'm surprised I didn't hear from one of them to be honest
22:29devnRaynes: no one wants dirty grant money
22:29kovasbyeah, you don't know what they had to do to get it
22:30devnyeah...like...write grants
22:30devnewwww
22:30devn;)
22:30kovasbdeal with committees
22:31kovasbgetting money out of academia has to be worse than enterprise sales
22:31kovasbbut i digress
22:31ibdknoxI dunno about that.. enterprise sales is soul sucking
22:31muhoosussman, wow
22:32ibdknoxYeah, it was cool
22:32ibdknoxvery down to earth and a lot of fun to talk to
22:44devn115k and counting
22:44devnshouldn't be long now...
22:44muhooi'm so ready to take my chances on cljs now, after having to write stuff like this: https://refheap.com/paste/2363
22:45devnheh
22:45ibdknoxmuhoo: what's wrong with that? ;)
22:45anieromuhoo: i'd love to see the cljs version of that
22:45ibdknoxit's probably not that much better
22:45ibdknoxfunction will be fn though
22:45devn^-i was thinking that but didnt want to say it
22:45ibdknoxwhich is nice :)
22:46muhooor #(
22:46ibdknoxyou can't nest those
22:46muhooreader macro, ah
22:46devn(map #(... #(...)) ...) => kaboom
22:46ibdknoxreally though the difference comes from the way CLJS suggests you should code
22:46ibdknoxit will cause you to write that differently
22:47ibdknoxand *that* will be better
22:47devnyeah, it's all about strongly suggesting idioms where none exist
22:47muhoothe thing that annoys me is this crap: }); }});});
22:47devnerr convention is i think what i meant
22:48muhoolike a winking bearded dude
22:48yoklovmuhoo: i mean, versus )))))))?
22:48devnmuhoo: http://www.afterhysteria.com/wp-content/uploads/2011/12/zoidberg.png
22:48devnlike that?
22:48devn:)
22:49muhooyeah, at least they're consistent and easier to match up. krusty the parens.
22:49yoklovhaha
22:49yoklovi like the parens better too
22:49yoklovmore comfortable
22:49muhooand there's comp and (-> and such too. anyway, my complaint quota is up for today :-)
22:50devnmuhoo: it's not complaint. it's a style thing
22:50ibdknoxI was writing some python today
22:50devnthat can be wildly superficial, but it can also be legitimate
22:50muhooi am having so much fun with clojure/noir now, i'm not going to let js harsh my buzz
22:50devnthere's room for style in any language
22:50anieromuhoo: use coffeescript ;)
22:50ibdknoxand I realized exactly how much clojure has ruined all other languages for me
22:50mbriggsanyone have any resources on how to structure larger sized functional apps? (books/papers/blog posts/whatever)
22:50muhooheheee
22:51devnmbriggs: like...code organization?
22:51mbriggsi can think of a half dozen books on how to do it with oo, but there is a serious lack of talking about it in fp
22:51mbriggsdevn: yeah
22:51devnmbriggs: be careful with code organization. it can be a trap.
22:51anierombriggs: the oreilly clojure book has some info
22:51devnin the sense that it is largely not as necessary as you think it probably is
22:52anierobut i'm still on "hello world" so i'm not going to worry about it yet
22:52devni came from ruby where i needed to look at 10 files to figure out the call chain
22:52devnclojure doesnt have that problem
22:52mbriggsyeah
22:52mbriggsbut like
22:52devnid rather have a few big files honestly
22:52anieroi'm getting the impression that a lot of things can end up as very compact bits of code
22:53mbriggswhen you hit 3-400k loc, things usually need to look dramatically different then a few thousand
22:53anierombriggs: but take a look at the basic leiningen project skeleton
22:53mbriggsi was wondering what that would look like in clojure
22:53anierowhen you've written 300kloc of clojure, you'll have already figured out how to organize it!
22:53mbriggshaha
22:53devnmbriggs: that's seriously true
22:54ibdknox300kloc is an OS
22:54devnhere's what i see happening:
22:54devnyou write 3k lines of code in one file.
22:54devnsince clojure depends on the order of declaration and definition
22:54devnyou end up with logical chunks of functions which could be their own files
22:54devnso you do that when you need to
22:54mbriggsright
22:54devndoing it prematurely gives you problems
22:55brehautibdknox: or hello world in java
22:55ibdknox~rimshot
22:55clojurebotBadum, *tish*
22:55devnhe'll be here all week, ladies and gentlemen!
22:55mbriggshaha
22:55brehauttry the veal
22:55muhooHelloHelperFactory
22:56devnStaticIntMainVoidFactory
22:56tmciverHow do I kill a running jetty (ring) that I started from the repl?
22:56muhoothat's FInalStaticIntMainVoidFactory to you, buddy
22:57devntmciver: with fire
22:57devnmuhoo: PublicStaticIntMainVoidFactory
22:57tmciverdevn: how do I get fire?
22:57tmciver;)
22:57muhoohaha
22:57brehauttmciver: you hold on to the server that is returned and the call .stop or something
22:57muhootmciver: keep a reference to it laying around after you start it
22:57devntmciver: two sticks. rub them together vigorously.
22:57muhoo(def srv (server/start...))
22:57muhoothen (.stop srv)
22:58devntmciver: what muhoo said. i keep a (comment "start and stop server" ...) block to do that
22:58LuminousMonkeyI have a namespace of utility functions that I found somewhere and shamelessly copied.
22:58tmcivermuhoo: so if I didn't grab a ref, I'm screwed?
22:58muhootmciver: afaict, yes
22:59muhoothere may be a way to fish it out of something you do have a handle on, though
22:59devntmciver: is this in production or?
22:59tmcivernah
22:59muhoo(-> something .parent .otherthing .server .stop) , etc
22:59tmcivera toy
22:59devnokay...so sticks...
22:59devn;)
23:00brehauttmciver: http://brehaut.net/blog/2011/ring_introduction > Servers and Adapters
23:00muhookillall -9 java
23:00brehautbut yeah, you are probably hosed
23:00LuminousMonkeyhttps://gist.github.com/2495345
23:00tmcivermuhoo: that will kill my swank too
23:00devnis anyone else bothered by people doing this in their clojure code: [ 1 2 3 ]
23:01devnor \n})))
23:01devnit's driving me slightly crazy
23:01muhooLuminousMonkey: an atom, good call
23:01devnit looks ugly as sin
23:01devnLuminousMonkey: yeah, that's cool. i like that.
23:02devni just "liked this" on github
23:02LuminousMonkeyWish I could claim credit, but I just found it somewhere.
23:02muhooseriously, github is facebook? aieee.
23:02devnLuminousMonkey: that's how good code moves about
23:02brehautLuminousMonkey: why not just varquote and not worry about restarting?
23:02lancepantzdevn: that's old school perl style
23:03lancepantznever did it with lisp
23:03devnlancepantz: the newline stuff and the spaces around it?
23:03lancepantzthe spaces
23:03devnit's ruby parlance in some cases as well
23:03lancepantzi used to do it with ruby until ninjudd kept yelling at me
23:03devnbut...well, perl
23:04devnlol. i feel like a nazi, but i think a lot of my pull requests have been really nice versions of: "this is what people expect in your library"
23:04devncamelCase => camel-case, no more \n})))), and no more [ [1 2] [3 4] ]
23:04LuminousMonkeybrehaut: I'll have to just profess ignorance. Still new to Clojure, et al.
23:04devnalso, this craziness with lining up things so they're readable. i think it makes more trouble than it's worth
23:04devnyou find these definitions that are like:
23:05brehautLuminousMonkey: right. thats an entirely valid reason :)
23:05devn{:foo [bar]
23:05LuminousMonkeyThat's horrible.
23:05muhooi saw that, and thought it was someone's editor trying to be cute
23:05devnGOTTA LINE EM UP! GOTTA CATCH EM ALL!
23:05mefestolol
23:05muhooOCD is a terrible disease
23:06lancepantzoh dude, the arguments we have in the office about that
23:06devni go to edit it and i rename something. the name is longer than the longest name in their map
23:06devnso i spend 10 minutes realigning their code
23:06devnits like wtf
23:06lancepantzthat's something ninjudd is religous about doing
23:06lancepantzbut it annoys the shit out of me and amalloy
23:06devni cant stand it
23:06devni want to program, not align code
23:06lancepantzwhat's bad about it is that you end up editing lines you didn't really touch on commits
23:06devnlancepantz: exactly
23:07mbriggsm-x align-regexp :)
23:07lancepantzmbriggs: doesn't work in lisp
23:07devnmbriggs: i use that if i know the author is hardcore about alignment
23:07lancepantzyou don't have an '=' to align on
23:07mbriggstrue
23:07devnbut in general i just make it messy by refusing to align
23:07emezeskeMore to the point, you end up un-aligning code without realizing it when you do a regex search+replace
23:08devnlancepantz: you can dedent the whole thing and then align on \s* or something
23:08brehautLuminousMonkey: replace (wrap-stacktrace routes/app-routes) with (wrap-stacktrace #'routes/app-routes) and i think it should be good
23:08devnlancepantz: but either way, yes, it's ridiculous in my opinion
23:08mbriggsimo you should align things together that are the same things. all the values of your bindings aren't really related
23:08devnit's just crazy OCD
23:09lancepantzright
23:09devnif you need to align things to make it clear, i think you are probably failing to extract some stuff
23:09muhoomy vote for best homepage layout has to go to: http://flatland.org/ though
23:09devni see this in case and cond statements
23:09devnpeople align these (fn [])s
23:09devnand it's like: dude, just make a new fn, name it
23:09lancepantzmuhoo: what?
23:10lancepantzmuhoo: thanks, but it's specifically an example of what we're bitching about!
23:10LuminousMonkeybrehaut: What's the difference?
23:10devnlol lancepantz
23:10brehautLuminousMonkey: that #' is a varquote; its equivalent to going (var routes/app-routes)
23:10devn"must...make all...strings..align"
23:11devnmefesto: i usually do it, and then i undo it
23:11devnbecause it's a pain in the ass
23:11brehautLuminousMonkey: instead of indirecting though the var immediately, it holds that var and later indirects through it each time the handler is called
23:11devnmefesto: i add something and it's like "great, now time to realign the entire cond"
23:11mefestodevn: i tend to put the expr under the test
23:11LuminousMonkeyOh?! Hey, thanks!
23:11brehautLuminousMonkey: it results in your jetty picking up the redef'd handler automatically, rather than you needing to manually restart the jetty
23:11muhoowhat do you put in the commit comment for that change though?
23:11LuminousMonkeyThat is useful.
23:11devnmuhoo: me?
23:12LuminousMonkeybrehaut: I was too lazy to figure out how to avoid doing that.
23:12brehautLuminousMonkey: yes :) it makes a world of difference for quickly developping a site with ring
23:12devnmuhoo: i put "*grumble grumble*"
23:12brehautLuminousMonkey: i didnt figure it out either; someone showed me
23:13devnlancepantz: so you mean to tell me ninjudd is all hardcore about [ 1 2 3 ], but aligns all of his code?
23:14devnlancepantz: that's OCD^2 ;)
23:14mefestodevn: this is what my ocd makes me do https://gist.github.com/2495393
23:14brehautno problem
23:14devnmefesto: why not inline it?
23:15brehautwhoops. wrong window
23:15mefestodevn: i wish i could rationally explain it :)
23:15wkmanireHowdy folks.
23:15muhooi have to admit i wrote this and jackhammer that key combination obsessively: https://refheap.com/paste/2365
23:15mefestodevn: it much of a problem with that example but when the tests are more staggard it triggers my ocd
23:15devnmefesto: that's how i feel about that: https://gist.github.com/2495395
23:16devnmefesto: or if you're committed to newlines... https://gist.github.com/2495395
23:17devnerr mefesto: https://gist.github.com/2495395/1bcb45004dc0f48748c91d227cd4091c3c61db9f
23:17devnnow im revealing my OCD
23:17mefestodevn: by staggard i mean something like this https://gist.github.com/2495393
23:17devn"you have OCD! you don't do it my way!"
23:17mefestolmao
23:18devnmefesto: i think a 1 space or two space indent is appropriate there, and personally i really dislike the comments.
23:18devnmefesto: again, i think that's OCD, but i just find it to be noisy as hell. we have docstrings and indentation before we require comments
23:19mefestodevn: my ocd could handle a 2 space indent
23:19devnmefesto: err s/that's/im/
23:19devni meant to say i think "that's my OCD"
23:19devni really rely on indentation to aid in readability
23:20mefestoi think the 2 space indent keeps the beast happy enough that i can lose the comments too. thanks :)
23:20devnmefesto: one thing i am always struggling with aesthetically in cond is inlining :else (do-other)
23:20devnor :else\n(do-other_
23:21mefestodevn: i know the feeling!
23:21devn(do-other)*
23:21wkmanireI'm having a newb moment.
23:21devnwkmanire: im always having one of those ;)
23:22wkmanireUnable to resolve symbol doc in this context...
23:22wkmanire:/ Isn't it in clojure.core?
23:22mefestowkmanire: (use 'clojure.repl) ?
23:22devnwkmanire: mefesto has it
23:23wkmanireOh.
23:23devnwkmanire: i don't know exactly what prompted this and i personally disagree with it
23:23wkmanireThanks.
23:23wkmanireWell, to put it very ignorantly, it seems to me that by starting my REPL I've done everything I need to do for doc to be available.
23:23devnwkmanire: but as of 1.3 or thereabouts doc was no longer there
23:24mefestowkmanire: i agree ... if im in a repl i want clojure.repl :)
23:24devnwkmanire: i think rich's keynote at the last conj was fitting: we need different types of builds
23:24devnid like to see a developer build/env, and a production build/env
23:24wkmanireThat seems appropriate to me.
23:24mefestoim probably overreaching but i'd like clojure.pprint as well
23:25devnmefesto: i dont think i disagree with that
23:25devnit doesnt WARN in core, so please gimme it
23:26devnanother thing i think about is: I want to search for functions that might be in clojure.walk, but that i can find via other avenues
23:27mefestowhich reminds me. lately in my projects i've been using lein's :repl-init myapp.repl which has all those goodies plus helper functions all loaded in it. then when i connect to the repl i switch to that ns.
23:27devnI want to: (apropos "macroexpand" :std-lib) and see #'clojure.walk/macroexpand-all
23:27mefestois that the wrong way to use :repl-init ?
23:28muhooone of these days, i'm going to write my own ns macro that automatically pulls in clojure.repl, clojure.pprint, and my own library of trying-to-make-lein-into-ipython utils, whenever i change ns's in the repl
23:28devnmefesto: im not a user of it, so i cant speak to that.
23:28devnmuhoo: are you familiar with "pry"
23:28muhoono, what's that?
23:28devnhttp://pry.github.com/
23:29devnthis is a ruby thing, but the idea of it is something ive wanted to build in clojure for awhile now
23:29devnI want to (cd String)
23:29devn(ls)
23:29muhooneat
23:30muhooi really should just try slime. probably everything i want is in there already
23:30devnmuhoo: meh. it's a PITA to configure if you want bells and whitles
23:30devnwhistles*
23:30hugodfelideon: what is proving difficult?
23:30felideonipython sucks?
23:30felideonnot that i've used it often
23:30wkmanireWould someone be able to recommend an in-depth article on namespaces.
23:31devnwkmanire: i have the perfect article
23:31wkmanireI am absolutely confused by them.
23:31devnwkmanire: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
23:31muhoodevn: well of course, it's emacs. it's taken me 8 years to set up emacs, and i'm about halfway done
23:31wkmaniredevn: Thank you!
23:31felideonhugod: getting a repl running
23:31mbriggsdevn: what kind of bells and whistles are there? other then sending stuff to it and whatnot, the only whistle I have is ac-slime :)
23:32hugodfelideon: you trying with jack-in, or a manually installed slime?
23:32devnmbriggs: i have syntax highlighting, paredit, and fuzzy completion in the slime repl
23:32mbriggsooo
23:32devni do full editing in the slime repl quite a bit
23:33mbriggsi remember reading somewhere syntax highlighting in the repl made stuff run real slow
23:33felideonhugod: i installed slime through marmalade
23:33felideonand tried jacking in
23:33mbriggsmuhoo: i just did a du -h on my .emacs.d and got 121M .emacs.d
23:34mbriggsfelideon: install clojure-mode
23:34devnmbriggs: here's the config: it's heavy and may not work for you... https://gist.github.com/2495437
23:34devnmbriggs: it can make thing super slow
23:34muhooheh. i just looked at the git history on my .emacs first commit: Mon Feb 9 22:08:51 2004 +0000
23:34hugodfelideon: for jack-in, you shouldn't have slime installed
23:34devnmbriggs: so i (set! *print-length*)
23:35felideonhugod: the readme page is pretty hard to follow then
23:35devnerr (set! *print-length* 10) and (set! *print-level* 3)
23:35felideonhugod: under the Install headline, those are all OR options?
23:36mefestofrom reading the mailing list i think there is a different between property access and function access in clojurescript. is there a doc on this plus other things like js/* somewhere?
23:36mbriggsdevn: you don't use rainbow parens?
23:36muhoois there a way to jack-in to an already running lein repl, without starting a new one?
23:36devnmuhoo: nah
23:36devnthat looks like clown puke
23:36mbriggsdevn: and thanks, i love finding new emacs stuff :)
23:36hugodfelideon: I see how it could be confusing
23:37felideonhugod: ok so i have lein ritz running
23:37felideondo i need to slime-connect to that?
23:37devnmuhoo: i meant yes
23:37devnmbriggs: that "nah" was directed at you
23:37devnmuhoo: slime-connect is what you want
23:37hugodfelideon: yes
23:38muhoolol, clown puke
23:38devnmuhoo: "lein swank" assuming you have the lein-swank lein plugin installed
23:38muhoodevn: thanks
23:38mbriggsdevn: haha
23:38devnthen M-x slime-connect, and accept the defaults
23:39mbriggsdevn: i use it, but all the faces are customized to stuff that is a bit less intense
23:39emezeskeAnyone have a recommendation for a clojure time library for a webapp? I'm looking at clj-time right now, it looks good.
23:39devnemezeske: is that a joda-time thingamajig?
23:39devni think it is right?
23:39emezeskedevn: Yeah
23:39brehauttechnomancy: relevant to your interests http://vimeo.com/40980282
23:40devnemezeske: yeah ive used that in the past. it was good.
23:40amalloymbriggs: i don't like rainbow-parens, mild colors or no, because it encourages manual matching up of parens
23:40emezeskedevn: Thanks!
23:40mbriggsamalloy: you mean as opposed to just relying on paredit?
23:40amalloyyes
23:40devnmbriggs: just paren matching is good enough
23:41devnparedit is icing
23:41devnit's nice, but it doesn't exactly make you turn into a turnip or anything -- just need to find the rhythm of it and you're fine
23:42felideondevn: well, I didnt really appreciate paredit until i did manual paren matching for a while and tried it again
23:43mbriggsi use something called mic-paren as well, it matches the parens right before the point as well in a different colour
23:43mbriggsactually way more helpful then it sounds
23:44devnfelideon: it's nice, but until it's second nature it's a weird, weird world
23:44felideondevn: paredit?
23:44devnfelideon: so when im showing someone clojure for the first time i dont install emacs and paredit and all manner of craziness
23:44devnbecause 90% of them dont use emacs by default
23:44felideonright
23:44devni use that stuff personally and i agree with you
23:44devnbut it's a lot to take in
23:45felideoni know well seasoned lispers who use IDEs rather than emacs
23:46felideonand there is no paredit there, and are mad confused when one uses paredit
23:46LuminousMonkeyI switched to Emacs purely because of Clojure.
23:46LuminousMonkeyParedit took some getting used to.
23:47mbriggsi was using vim and i switched because of lisp in a general way
23:47mbriggsbut i use evil mode
23:47felideonrequire: Symbol's value as variable is void: slime-ritz
23:47felideonnow slime-connect doesnt work
23:48felideonyou would think setting up a clojure environment in emacs is much more straightforward than Common Lisp
23:49devnhonestly i have to say that the amount of discussion ive seen in this channel at editors is like...whoa
23:49devnjust write the damn code in notepad
23:49hugodfelideon: you could try a M-: (require 'slime-ritz)
23:49devns/at/about
23:50felideondevn: hell no.
23:50muhooiirc, rhickey was married to lispworks IDE for a long while, before switching to emacs after clojure was released
23:50mbriggsdevn: i love obsessing about editors :) its like, the one type of code i write that is useful to ME as opposed to other people
23:50devnlol. i just think it's so superficial'
23:50LuminousMonkeyI don't think it is.
23:50felideonand copy&paste into terminal repl? nothx
23:51devnfelideon: the code is more important than its indentation
23:51felideonI disagree.
23:51LuminousMonkeyIt's pretty much your interface into programming, you need it to be as comfortable as possible.
23:51felideonand it's more than indentation.
23:51hugodfelideon: the latest slime-ritz is available in the melpa package repo at http://melpa.milkbox.net/packages/
23:51devni tickled a nerve!
23:51devnim playing devil's advocate on this for a reason
23:51felideonwell I'm a real lisper, what can I say.
23:51felideonbahaha
23:51LuminousMonkeyThat's why Light Table stirred up all that interest. :)
23:52devnive seen people who are way more efficient programmers than me
23:52devnand they use crude environments with no safety nets
23:52felideonhugod: i think my inexperience with melpa and package.el is adding to the confusion
23:52devnand they make me look like a 10 year old
23:52felideonah yes, the masochists.
23:52felideoni am not so smart, i need my safety nets. :P
23:52devnfelideon: that cuts both ways
23:53devndo you know how long i spent setting up my fucking editor?
23:53LuminousMonkeyYeah, I'm nowhere near that good.
23:53devnlet's not get into masochism
23:53mbriggshaha
23:53devnthere is a *balance*
23:53LuminousMonkeyHey, at least you're not putting a window into the side of your computer with neons.
23:53devnbeing OCD about your editor is not balanced
23:53LuminousMonkeyYou're not doing that right?? :)
23:53devnnor is not caring about any niceties
23:53felideondevn: true. i spent 2 hours figuing out why my emacs background was off than the screenshot of the theme i'm using
23:53felideon(damn you sRGB bug! *shakes fist*)
23:54devnfelideon: i wish i knew how much time ive spent in emacs and how much time ive lost as a result of: "OMG GOTTA GET MY TERMINAL TO WORK WITH ESHELL BETTER"
23:54devnit's just a distraction most of the time for me personally
23:54LuminousMonkeyI'm sure there was a Steve Yegge rant about something similar to this...
23:54devnim glad i spent the time, because im done messing with it now
23:55mbriggsdevn: I screw around with that stuff either when i'm fried from work and don't feel like hacking on real code, or sitting next to my wife, "watching" so you think you can dance
23:55devnbut i think it truly was a waste
23:55devnmbriggs: lol
23:55devnthe "so you think you can dance" reference just sealed this conversation
23:55mbriggshaha
23:55felideonlol
23:55mefestolol
23:55devnyou need a signet ring or something
23:55devnthat's how epic that is
23:56felideonhugod: thanks for helping.
23:56devn"So You Think You Can Dance" stamped in wax
23:56felideonare you supposed to add elpa directories to load-path?
23:57devnfelideon: stop it!
23:57devn;)
23:57felideondevn: :(
23:57devnfelideon: im kidding, i just need to look at my config and ill tell you what i do
23:57hugodfelideon: (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/&quot;) t)
23:57devnfelideon: i dont add them to the load path
23:58devnfelideon: if you're on emacs 24 i think they're already added to the load-path
23:58felideonoh ok.
23:58felideonhugod: ok so i have the marmalade-repo.org/packages
23:58devnfelideon: yeah, thats all ive added as well
23:59felideonhugod: adding melpa.milkbox.net gives me bleeding?
23:59hugodfelideon: yes
23:59devnmilkbox.net
23:59devnthat's a great domain
23:59felideonnow requiring clojure-mode fails, if i don't add the elpa sub-dir to load path