2012-02-28
| 00:00 | technomancy | you could always ask danlarkin |
| 00:00 | callen | danlarkin: remember subrosa? |
| 00:01 | callen | technomancy: I found an example here: https://github.com/danlarkin/subrosa/blob/master/src/subrosa/plugins/catchup.clj |
| 00:01 | callen | technomancy: it seems like it's pretty close to where you want it, it may be best not to wait for me to get something rolling, he's kinda already solved the problem. |
| 00:03 | technomancy | yeah... hard to say. |
| 00:04 | technomancy | you'd get something workable faster if you used it |
| 00:04 | technomancy | and you'd learn about how a real-world project is put together |
| 00:04 | callen | I would understand virtually none of it in the process and end up banging my head against walls and not necessarily learn much Clojure. |
| 00:04 | technomancy | but you run the risk of staring at inscrutable code |
| 00:05 | technomancy | too bad subrosa isn't a literate program |
| 00:05 | callen | I'll try it your way |
| 00:05 | callen | I'm dreading this though. |
| 00:06 | muhoo | wow, this guy doing this talk is a genius. |
| 00:06 | callen | muhoo: ? |
| 00:06 | callen | technomancy: how do I add a github repo to leiningen? |
| 00:07 | Scriptor | callen: can you find it on clojars? |
| 00:07 | muhoo | callen: the vimeo one, with the live javascript editor |
| 00:07 | technomancy | callen: just declare a regular dependency in project.clj, create a "checkouts" directory, and clone it into there |
| 00:07 | callen | Scriptor: no |
| 00:08 | lynaghk | Is it possible to enforce input/output types for a protocol? I'm wondering if it makes sense to implement an IProjection protocol for map projections that should implement IFn but only take a 2-vector and return a 2-vector. |
| 00:09 | mabes | lynaghk: no.. that is one reason why I often wrap my protocol API will regular functions (so I can use pre/post checks) |
| 00:09 | muhoo | actually, it's a live EDA tool too |
| 00:09 | muhoo | genius |
| 00:10 | callen | technomancy: I have subrosa cloned inside of checkouts at the same level as my project.clj, src, test. It's referred to as [subrosa "1.0.0"], why can't it find/use it |
| 00:10 | mabes | accel: dunno if you got your question answered but I always use VisualVM to spot the hot spots in my code |
| 00:10 | lynaghk | mabes, I'm not sure what you mean. You wrap where you actually call the protocol methods on an instance? |
| 00:12 | accel | mabes: will look into it; thanks |
| 00:12 | callen | technomancy: "checkouts" isn't in the Tutorial.md nor the wiki... |
| 00:13 | callen | anyone here know how to use github repos with leiningen? |
| 00:13 | mabes | lynaghk: so I have a protocol that every one implements, but I then have the "public" facing function that delegates to the protocol function.. the other advantage is that while protocol functions can't be variadic normal fns can and then just send the args as a vector |
| 00:13 | lynaghk | mabes, ahh but I want other people to be able to write implementations of the protocol too |
| 00:13 | technomancy | it's in the readme |
| 00:15 | callen | technomancy: that's what I did... |
| 00:15 | technomancy | callen: does it show up in `lein classpath`? |
| 00:15 | mabes | lynaghk: right, and so they can implement the protocols but they should still use the other fn when calling it.. much like how #'reduce in clojure is a regular clojure function but relies on underlying protocol implementations.. I agree, this isn't ideal and not what you are exactly looking for, but it is the best option ATM AFAIK |
| 00:15 | lynaghk | mabes: ahhh, I see. |
| 00:16 | mabes | lynaghk: more of a convention than a pure technical solution.. |
| 00:16 | lynaghk | mabes: that makes sense, thanks. I'll have to think about whether the added verbosity |
| 00:16 | callen | Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing: |
| 00:16 | callen | 1) subrosa:subrosa:jar:1.0.0 |
| 00:16 | lynaghk | is worth the extra safety. |
| 00:16 | callen | that occurs when I run lein classpath |
| 00:17 | callen | it breaks. |
| 00:17 | lynaghk | mabes: verbosity in this case because a projection is just a specific kind of function, and I think should be called as a function (albers [x y]) instead of (project albers [x y]) |
| 00:17 | callen | I found it, it's some BS code in subrosa. |
| 00:17 | callen | god dammit. |
| 00:18 | lynaghk | mu |
| 00:19 | callen | it was one of those lazy trim/slurp etc/version things |
| 00:19 | callen | ffs |
| 00:19 | technomancy | callen: "checkouts" is meant to be complementary of regular dependencies |
| 00:19 | callen | /home/callen/mastodon/test:/home/callen/mastodon/test-resources:/home/callen/mastodon/src:/home/callen/mastodon/classes:/home/callen/mastodon/resources:/home/callen/subrosa/src:/home/callen/subrosa/classes:/home/callen/subrosa/etc:/home/callen/.lein/plugins/swank-clojure-1.4.0.jar |
| 00:19 | technomancy | so if it's not on clojars you'll need to manually install it |
| 00:19 | callen | technomancy: ^^ lein classpath |
| 00:20 | muhoo | i predict this guy will be keynoting at TED this year |
| 00:20 | technomancy | muhoo: he's already been invited to strange loop |
| 00:21 | mabes | TED > StrangeLoop ? |
| 00:21 | mabes | half joking.. Strangeloop is basically a TED conf for devs :) |
| 00:22 | callen | technomancy: still claims "unable to resolve artifact: missing" |
| 00:23 | callen | technomancy: I saw the entry in the README, doesn't really explain much to me. |
| 00:23 | technomancy | callen: subrosa is weird because for some reason it's not on clojars |
| 00:24 | technomancy | did you do "lein install" in the subrosa dir? |
| 00:24 | G0SUB | technomancy, ping |
| 00:24 | technomancy | G0SUB: pong |
| 00:24 | callen | doing so now. |
| 00:24 | callen | technomancy: that fixed it. |
| 00:24 | G0SUB | technomancy, can you kindly review my reflection removal patch for clj-stacktrace? |
| 00:25 | G0SUB | technomancy, I have sent a pull request. |
| 00:25 | callen | technomancy: thank you. |
| 00:25 | choffstein | anyone know of a clojure zlib library? |
| 00:25 | technomancy | G0SUB: sure; sorry about the delay, I'll see if I can run that by mark tomorrow |
| 00:25 | choffstein | besides java.util.zip ... which is a horrendous pile of shit to work with |
| 00:25 | G0SUB | technomancy, I understand. that's not a problem. thanks in advance. |
| 00:26 | dnolen | ibdknox: well you did well on Reddit at least. |
| 00:26 | dnolen | so rhickey's got a new kind database - this will be interesting. |
| 00:26 | G0SUB | dnolen, I am excited :-) |
| 00:27 | G0SUB | dnolen, something like allegro-cache? |
| 00:27 | callen | I'm hoping it's not language-specific actually. |
| 00:28 | technomancy | a database that supports UUIDs as first-class data types |
| 00:28 | technomancy | now we know why that feature made it into 1.4 |
| 00:28 | G0SUB | technomancy, how does first-class UUID help? |
| 00:28 | dnolen | G0SUB: that would be cool. |
| 00:28 | technomancy | G0SUB: I don't think it actually does |
| 00:28 | callen | I'm not sure what that would solve. |
| 00:28 | technomancy | but relevance seems to think differently |
| 00:29 | technomancy | and they call the shots |
| 00:29 | G0SUB | dnolen, indeed. |
| 00:29 | callen | using and indexing UUIDs is a common pattern. |
| 00:29 | dnolen | callen: given that it has its own website I wouldn't be surprised, curious about the strategy. opensource? license? etc |
| 00:29 | dnolen | free / not-free |
| 00:29 | ibdknox | dnolen: yeah :) |
| 00:29 | G0SUB | technomancy, yeah, but I don't see how that could be a significant advantage. |
| 00:30 | ibdknox | they've been tossing around the word "product" which indicates money will be involved |
| 00:30 | dnolen | ibdknox: yes, that was my impression as well. |
| 00:32 | G0SUB | if datomic turns out to be a completely proprietary database then it'd be a non-starter for many. |
| 00:32 | callen | myself included. |
| 00:32 | callen | I cannot build anything of value on a persistence backend I don't have control over. |
| 00:32 | technomancy | srsly.com |
| 00:32 | dnolen | ibdknox: or not, perhaps the model is consulting |
| 00:33 | G0SUB | dnolen, the same as Clojure's. |
| 00:33 | ibdknox | dnolen: maybe, but I'd be a little surprised |
| 00:33 | ibdknox | that's not really a "product" and consulting doesn't scale |
| 00:33 | dnolen | that said - I respect Alex Miller's opinion, if he thinks it's big, it must have features worth getting excited about. |
| 00:34 | ibdknox | dnolen: that's true. |
| 00:34 | callen | technomancy: there is no way in hell, I'd have to port everything and fix all the breakage. |
| 00:35 | ibdknox | usually something has to be in place a while for consulting to work out. I think it's likely a PaaS of some kind |
| 00:35 | callen | technomancy: I can't even (use ...) his code without it raising an exception. |
| 00:35 | technomancy | callen: maybe fall back to clojure 1.2? |
| 00:36 | dnolen | ibdknox: database ecosystem is pretty saturated w/ options these days - I imagine it must do something quite different. |
| 00:36 | callen | technomancy: that only exacerbates and extends the problem. Contemplating this is making my spleen rupture, it's abandoned code, why am I trying to drag it along? |
| 00:36 | ibdknox | dnolen: I agree |
| 00:36 | technomancy | callen: I think it's stuck because it uses aleph, which hasn't been updated? |
| 00:37 | callen | no, uses netty. |
| 00:37 | ibdknox | dnolen: I've worked with some guys here on something that is taking a different angle on the DB market |
| 00:37 | ibdknox | dnolen: there are still places to go :) |
| 00:37 | callen | technomancy: for someone who's adept at clojure, it's really close. You fit under that definition, I don't. It would take you 1/100,000th the time to get this doing what you want. I cannot work with this, I don't know enough and I don't have any experience fixing broken deps and code. I can scarcely muddle through the 50-some puzzles I've done on 4clojure. |
| 00:38 | technomancy | callen: yeah, I agree it sucks. I'm not sure that starting from scratch would be any easier, but it would certainly have fewer frustrations. |
| 00:38 | callen | if this is were Python, Ruby, JS, it'd be another story, but I'm swimming through mud when it comes to clj. |
| 00:39 | technomancy | or at least, most of the frustrations would be your own fault. =) |
| 00:39 | technomancy | and those kind of frustrations are usually easier to deal with |
| 00:39 | callen | technomancy: I'm totally inept at Clojure and Java. I don't even know where to start with integrating his code and fixing it. |
| 00:40 | ibdknox | what are we talking about? |
| 00:40 | bbloom | who should i follow on 4clojure for idiomatic *implementations* instead of idiomatic *shelling out to some library function* ;-) |
| 00:40 | technomancy | ibdknox: building an IRC bouncer on top of subrosa vs starting from scratch |
| 00:40 | callen | ibdknox: subrosa, IRC framework => bouncer, abandoned code. |
| 00:40 | ibdknox | I see |
| 00:40 | bbloom | for example, I implemented parsing a binary number string… then I saw people use Integer/parseInt and was like *sigh* |
| 00:41 | callen | ibdknox: I'm inept at clj, way more comfortable with Python, Ruby, JS, can't really even get started at using some abandoned code that's on 1.2 because I can't even (use ...) the code. |
| 00:41 | bbloom | i realize that's the code you'd ACTUALLY write in a program, but it seems against the spirit :-P |
| 00:41 | dnolen | bbloom: Integer/parseInt is idiomatic, use the host unless there's some reason not to. |
| 00:41 | callen | bbloom: I implement foolish decisions all the time. I'm bitemyapp on 4clojure. |
| 00:42 | callen | bbloom: use the library functions whenever possible IRL though. |
| 00:42 | bbloom | well of course :-P |
| 00:42 | bbloom | i'm trying to learn clojure tho.. i already know the java std lib (a bit anyway) |
| 00:42 | bbloom | #(reduce (fn [acc c] (+ (bit-shift-left acc 1) (if (= \1 c) 1 0))) 0 %) |
| 00:42 | bbloom | i mean that's just so pretty :-) |
| 00:44 | muhoo | is aleph abandoned? |
| 00:44 | ibdknox | lol |
| 00:45 | ibdknox | muhoo: aleph is not abandoned |
| 00:45 | muhoo | "subrosa, IRC framework => bouncer, abandoned code". i'm wondering what was abandoned? |
| 00:46 | callen | muhoo: subrosa was, it's still using 1.2 and contrib. |
| 00:46 | lynaghk | ibdknox, you have a second? I'm porting some D3 JS to CLJ and am wondering how best to emulate its behavior using records/protocols |
| 00:46 | muhoo | zh ok |
| 00:46 | callen | ibdknox: aleph is using 1.2 too... |
| 00:46 | ibdknox | callen: there's a 1.3 branch |
| 00:46 | muhoo | well i have aleph running in 1.3, it seems to work |
| 00:47 | callen | I missed it. |
| 00:47 | ibdknox | and using 1.2 isn't a problem. Using old contrib is the problem |
| 00:47 | muhoo | i think i just grabbed a snapshot |
| 00:47 | callen | ibdknox: I know, just saying. |
| 00:47 | ibdknox | lynaghk: I can try, though admittedly I try not to use either of those if possible :) |
| 00:47 | lynaghk | heh |
| 00:47 | lynaghk | https://github.com/mbostock/d3/blob/master/src/geo/albers.js |
| 00:48 | lstoll | I've been using aleph in 1.3, and it's fine. |
| 00:48 | ibdknox | oh no's.. it's math! |
| 00:48 | lynaghk | don't worry, none of that is the issue = ) |
| 00:49 | ibdknox | haha good. Cuz I's dumb with teh numb3rs |
| 00:49 | dnolen | lynaghk: where do defrecords/protocols come in? and is this CLJ or CLJS? |
| 00:49 | lynaghk | so I can implement the albers projection using a record just fine. I implement IFn, you can say (a [lat lon]) and you'll get the projected [x, y] |
| 00:49 | muhoo | did bret victor use clojure to do those demos? |
| 00:49 | dnolen | muhoo: JS |
| 00:49 | lynaghk | dnolen: I want a solution that will work fine on both |
| 00:49 | ibdknox | muhoo: no, JS |
| 00:49 | muhoo | ah |
| 00:50 | ibdknox | lynaghk: can't they just be functions? Why do you need records and protocols? |
| 00:50 | callen | http://richhickey.github.com/clojure-contrib/condition-api.html <--- alright, where'd it go? |
| 00:50 | lazybot | Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/condition-api.html and try to stop linking to rich's repo. |
| 00:50 | lynaghk | you can also say (:parallels a) and get whatever parallels you're using in the albers projection, yeah |
| 00:50 | lynaghk | ibdknox ^ |
| 00:50 | choffstein | anyone know any compression libraries in clojure? |
| 00:51 | callen | alright, where'd *this* http://clojure.github.com/clojure-contrib/condition-api.html go if not in contrib? |
| 00:51 | lynaghk | This comes more into play with implementing scales, so I'm trying to figure out the best way to structure all of these things. D3 uses closures with getter/setters for everything. |
| 00:51 | ibdknox | lynaghk: ok, so you need something you can treat as either a vector or a map? |
| 00:51 | dnolen | lynaghk: huh, that's some weird JS code IMO |
| 00:52 | lynaghk | So my question is: how can I encorporate custom setter logic in defrecords |
| 00:52 | technomancy | callen: slingshot is the successor to contrib.condition |
| 00:52 | dnolen | lynaghk: not possible, defrecords define IAssociative |
| 00:53 | lynaghk | or come up with some other abstraction that has the niceites of records (e.g. field access) |
| 00:53 | ibdknox | just define an interface through functions |
| 00:53 | callen | technomancy: (ノಠ益ಠ)ノ彡┻━┻ |
| 00:53 | lynaghk | dnolen: yeah, that's what I was thinking. So maybe get away with records for simple cases, and in more complex cases just write the IAssociative special setter logic myself? |
| 00:54 | dnolen | lynaghk: just implement the features of maps (via deftype) that you need for it to work. |
| 00:54 | ibdknox | lynaghk: or just do them as deftypes :( |
| 00:54 | technomancy | callen: if you start out working on the subrosa codebase itself instead of your own project, you won't have any mismatch issues |
| 00:54 | dnolen | lynaghk: that said, there's little benefit unless you want to define a common set of abstractions here. maybe that's what D3 is doing. |
| 00:54 | lynaghk | dnolen, ibdknox: okay, thanks guys. |
| 00:55 | technomancy | but maybe that's a sign that it's time to make a clean break from subrosa before you suffer internal bleeding |
| 00:55 | lynaghk | dnolen: what do you mean? |
| 00:55 | callen | technomancy: the code literally relies on the class hierarchy of the original condition |
| 00:55 | callen | slingshot is totally different, i'd have to restructure everything |
| 00:55 | technomancy | you have my permission to yell at danlarkin |
| 00:55 | callen | this is fucking stupid |
| 00:55 | callen | I'm not using subrosa. |
| 00:56 | callen | I just want a while loop and a socket, ffs. |
| 00:56 | dnolen | lynaghk: is there some cross cutting concern that's being expressed in albers that appears elwehre in d3, like invert, origin, parallels, scale, translate, etc |
| 00:56 | dnolen | elshwere |
| 00:56 | dnolen | oof, elsewhere |
| 00:56 | lynaghk | dnolen: Really, the only things I want are field access and the ability to derive easily from existing objects. |
| 00:56 | technomancy | but how will you scale without being asyyyyyyyyyyync? |
| 00:56 | callen | technomancy: I'll do it live. |
| 00:56 | technomancy | http://p.hagelb.org/async.jpg |
| 00:56 | ibdknox | hahaha |
| 00:56 | bbloom | lol. |
| 00:57 | dnolen | lynaghk: where is there derivation in that d3 code? |
| 00:57 | lynaghk | dnolen: through the setters. |
| 00:57 | dnolen | lynaghk: line num? |
| 00:58 | lynaghk | dnolen: 104 |
| 00:58 | dnolen | I like Node.js, but this is funny http://www.youtube.com/watch?v=bzkRVzciAZg |
| 00:59 | lynaghk | for instance. The albersUSA is a composite of a few different albers projections with translations mucked around with so Hawaii and Alaska get positioned just off California |
| 00:59 | callen | dnolen: it's true though :( |
| 01:00 | lynaghk | so when the scale is changed in the setter, there is custom code to update the internal albers projection scales |
| 01:01 | lynaghk | So, I could follow that in Clojure by using deftype and writing custom logic in assoc to catch the :scale keyword and do the same |
| 01:01 | dnolen | lynaghk: ah yeah, delegation - I gotta run, I can send my thoughts on this later |
| 01:02 | dnolen | lynaghk: adding custom logic doesn't make sense, Clojure/Script allows for real delegation |
| 01:02 | dnolen | lynaghk: you can hook in via protocol fn defaults |
| 01:05 | callen | oh ffs, aleph is using contrib too |
| 01:05 | callen | alright, how do I fix the fact that code I'm calling is using contrib? do I add it to my dependencies? |
| 01:07 | kwertii | Anyone know the correct way to recycle a channel that has closed for some reason in WabbitMQ? As far as I can tell, it keeps trying to reuse the closed channel. |
| 01:10 | yesudeep | wabbitmq? heh. |
| 02:05 | muhoo | i tried that cljs-live demo, and got this: https://refheap.com/paste/876 |
| 02:10 | ibdknox | use lein run |
| 02:10 | ibdknox | also delete classes/cljs/ |
| 02:11 | muhoo | ah cool thanks. so there's no way to run it from inside lein repl? |
| 02:12 | ibdknox | I'm sure there is |
| 02:12 | ibdknox | but the cljs compiler seems to be finnicky |
| 02:14 | bbloom | ibdknox: Can you describe the finnickiness? Are you able to deduce a pattern that would lead to an improvement? |
| 02:14 | ibdknox | don't AOT compile it |
| 02:15 | ibdknox | that's all I know |
| 02:15 | bbloom | heh ok |
| 02:15 | ibdknox | I wasted two hours figuring that out |
| 02:15 | bbloom | i havent used AOT at all |
| 02:15 | muhoo | worked, thanks. tho i did get this warning: https://refheap.com/paste/877 |
| 02:16 | ibdknox | those are just normal cljs warnings |
| 02:16 | ibdknox | they happen when core is compiled heh |
| 02:17 | bbloom | yeah, seems like easy fixes tho… you know, broken windows and all :-P |
| 02:18 | ibdknox | the compiler blindly warns any place where you might've had the old style of property access, so it warns when you've done the exact right thing heh |
| 02:18 | ibdknox | can't be deterministic about it until runtime, unfortunately |
| 02:19 | bbloom | it has to do with differentiating property access and function calls, right? wouldn't just adding the hyphen fix the issue? |
| 02:19 | muhoo | why is the mouse broken in firefox? is that something that could be hacked around? |
| 02:20 | ibdknox | bbloom: it's warning on things that don't have a hyphen. You can't add a hyphen for the function call or it won't be a function call anymore :) |
| 02:20 | ibdknox | muhoo: I dunno? |
| 02:20 | ibdknox | I'm sure there's some fix |
| 02:20 | ibdknox | it wasn't meant to be something that was just fun, fixing browser bugs doesn't fall into that category :) |
| 02:21 | ibdknox | err was* |
| 02:21 | muhoo | good point |
| 02:21 | bbloom | ibdknox: but you can add an extra () |
| 02:21 | bbloom | so from: (. foo bar) to: ((. foo -bar)) |
| 02:21 | ibdknox | sure |
| 02:21 | bbloom | & shut up the warnings :-) |
| 02:21 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: shut in this context |
| 02:22 | ibdknox | doesn't make much sense when those warnings will get removed |
| 02:22 | muhoo | maybe i'll poke around and see if i can figure out the mouse thing |
| 02:22 | bbloom | fair enough |
| 02:22 | ibdknox | muhoo: I'm sure it's something simple |
| 02:23 | ibdknox | alright, g'nite guys |
| 02:23 | muhoo | this really is amazingly good, what you've done here. |
| 02:24 | muhoo | thanks |
| 02:24 | ibdknox | glad you're having fun :) |
| 02:26 | muhoo | i'm still too bewildered to be having fun. but i'm amazed and impressed, that's for sure. this is fantastic. |
| 02:37 | devn | Can anyone take a peek at my gigantic post on the GSoC thread and give me some feedback? |
| 02:39 | muhoo | oh i see what's going on. when you change any of the code, it XHR's it to the jetty server, where i guess lein recompiles the whole code, and spews the emitted js back to the browser. from there i guess it gets eval'ed |
| 02:56 | muhoo | i really have to thank people for using :use :only. otherwise, i'd be totally lost trying to figure out other people's code |
| 02:57 | muhoo | if i see a function i have nfi where it came from, a quick look at the top of the file will tell me exactly where, i.e. (:use blah :only [foo bar baz]) , ok, foo comes from blah, great |
| 03:00 | _ulises | morning |
| 03:03 | damagednoob | as an exercise to learn clojure, i'm trying to create an svn pre-commit hook in clojure that will parse an svn diff and look for disallowed addition to js files. I'm having trouble recursing through the lines and returning only the offending ones. here is my code: http://pastebin.com/EkUwjzsu |
| 03:04 | damagednoob | i'm having trouble with the get-lines functions |
| 03:07 | tomoj | hmm |
| 03:08 | _ulises | damagednoob: there's a line-seq fn already I think (it takes a reader) |
| 03:08 | tomoj | damagednoob: first, formatting "fixes": https://gist.github.com/0f01eed063bdfacb9c9d :) |
| 03:08 | _ulises | ,(doc line-seq) |
| 03:08 | clojurebot | "([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader." |
| 03:10 | tomoj | damagednoob: second, don't use def to define local variables |
| 03:10 | tomoj | (def debugger-line #"...") would be OK, but it can also be just a local here |
| 03:11 | damagednoob | tomoj, okay, so just do it inline? |
| 03:11 | tomoj | https://gist.github.com/8e9cb8a83e11986a6682 |
| 03:12 | tomoj | certainly lower-line should be a let not def |
| 03:12 | tomoj | but debugger-line etc and added-line could be let or def (or inline..) idiomatically perhaps |
| 03:12 | tomoj | can't tell what you're trying to do |
| 03:13 | tomoj | in the body of the when-let inside your get-lines, you have two forms |
| 03:13 | tomoj | but only the second will be returned |
| 03:14 | tomoj | that is, in (when-let [foo bar] baz bing), 'baz' is evaluated but the return value is lost |
| 03:14 | damagednoob | i thought that in order to 'loop' over the input stream, i'd have to break it up into head and tail and recurse over the tail |
| 03:15 | tomoj | that could work.. but I think it will probably be easier |
| 03:16 | tomoj | would maybe be helpful if you could show an example input and desired output for your function, e.g. (= (get-lines ["foo" "bar"]) ["foo"]) or whatever |
| 03:17 | damagednoob | okay, one sec |
| 03:21 | damagednoob | tomoj, given an svn diff like this: http://pastebin.com/5EsF3xy5, I want to output something like 'found errors in javascript files. file one: <line> <line> file two: <line> <line>' |
| 03:21 | damagednoob | http://pastebin.com/5EsF3xy5 |
| 03:22 | damagednoob | so for instance, line 28 in the diff is an example of an offending line |
| 03:22 | tomoj | ah, I see |
| 03:28 | yesudeep | muhoo: which cljs-live demo? |
| 03:35 | tomoj | damagednoob: well |
| 03:37 | tomoj | so you had this https://gist.github.com/5740242e24fc83f1ca38 |
| 03:37 | tomoj | if you change it to this https://gist.github.com/c45ee235367c5a160eb2 , it works |
| 03:37 | tomoj | the (if (is-jsfile-line line) (lazy-seq (get-lines reader "js"))) is just ignored in your version |
| 03:37 | tomoj | because when-let just returns the last thing in its body |
| 03:40 | tomoj | (the change to (clojure.java.io/reader "/tmp/file") was just so I could test it..) |
| 03:45 | damagednoob | awesome, thanks tomoj |
| 03:46 | damagednoob | i think i see where i went wrong, i kind of expected it to just drop down to the next 'if' if the first one didn't match |
| 03:51 | devn | damagednoob: in some cases that would be true |
| 03:53 | devn | damagednoob: the body of defn is an implicit (do ...), but only the last expression in the body wins |
| 03:53 | devn | (in returns of what it returns) |
| 03:53 | devn | in terms* |
| 03:55 | Fossi1 | which weans if the part inbetween is lazy it wouldn't get executed either |
| 03:55 | Fossi1 | oh, which seems to be what you did :) |
| 03:57 | tomoj | this may be helpful https://gist.github.com/99665f77b73f1fb5cad4 |
| 03:57 | tomoj | but there should be a prettier way to write it? |
| 04:00 | tomoj | oh, useful has something for this |
| 04:01 | amalloy | does it? |
| 04:01 | tomoj | well, partition-between could implement the partition-starting I was going to write, I think |
| 04:02 | tomoj | (partition-between (comp is-file-line second) lines) |
| 04:02 | devn | when you say "useful" are you referring to http://clojars.org/repo/clojure-useful/clojure-useful/0.3.8/ ?? |
| 04:02 | lazybot | devn: What are you, crazy? Of course not! |
| 04:02 | tomoj | :D |
| 04:02 | tomoj | lazybot: botsnack |
| 04:02 | lazybot | tomoj: Thanks! Om nom nom!! |
| 04:02 | tomoj | https://github.com/flatland/useful/ |
| 04:03 | devn | lazybot: botsnack |
| 04:03 | lazybot | devn: Thanks! Om nom nom!! |
| 04:03 | devn | see, you can abuse it and it still loves you |
| 04:06 | damagednoob | blegh, now i have to go to work. thanks for the help and the code |
| 04:06 | damagednoob | i'm sure i'll be back :) |
| 04:07 | devn | useful reminds me, i need to spend some time this friday organizing all of the user.clj/personal fns repos I've cloned |
| 04:08 | devn | I'd like to make a gigantic repo of them with nice docstrings, etc. |
| 04:08 | devn | useful is along those lines |
| 04:13 | muhoo | how does one regenerate bootstrap.js? |
| 04:13 | muhoo | it seems like it has all the old code compiled into it, and, if i change the source, the bootstrap.js does not change. |
| 04:14 | amalloy | muhoo: huh? just check it out from git if you accidentally deleted it |
| 04:14 | muhoo | no, it seems like it's generated from the cljs files |
| 04:14 | muhoo | but, when i change the code in the cljs files, the bootstrap.js is then out of date |
| 04:30 | ejackson | tune out of #clojure for one day, and its like the world goes by: datomic, cljs live-coding... |
| 04:30 | muhoo | ah, i see, i have to use cljsbuild, somehow |
| 04:31 | muhoo | ejackson: man, try drinking from this firehose starting from nothing. i feel like i keep getting stupider every day. |
| 04:31 | ejackson | welcome, brother. |
| 04:33 | muhoo | yesudeep: the one at chris-granger.com |
| 04:34 | muhoo | i just read all of its code, and i understand about 50% of it |
| 04:35 | muhoo | i poked around trying to fix the firefox mouseclick bug and failed really |
| 04:36 | muhoo | mousedowns work if i bind them manually with jquery. |
| 04:36 | muhoo | i think it's either a jayq problem, or the (when (.-focused me) needs to be removed |
| 04:36 | muhoo | it's not going to get a mouseclick if it's not focussed anyway |
| 04:37 | muhoo | but, the problem is that i don't understand cljsbuild and it won't run from inside lein repl |
| 04:37 | muhoo | so i've no way to actually get the bootstrap.js to recompile with my attempts at testing the mouseclick thing |
| 04:38 | muhoo | i guess the right thing to do would be to try to duplicate the mousedown bug in a very simple clojurescript-one or something, and then keep adding in bits of the livecoding demo until it breaks |
| 04:39 | muhoo | too tired; must sleep |
| 05:05 | Scriptor | man, debugging macros is a pain |
| 05:06 | lucian | Scriptor: that's by far the most common argument against them |
| 05:07 | lucian | it's easier in scheme, especially with editor/ide support |
| 05:07 | Scriptor | lucian: hmm, at the least it'd be nice to know which line number is, say, throwing a null pointer exception |
| 05:07 | Scriptor | put it's all just thrown into evalSomeNumberHere |
| 05:08 | lucian | ah, that's just regular clojure sucking at tracebacks |
| 05:08 | Scriptor | hah, figured :) |
| 05:09 | lucian | it *really* needs to get better tracebacks, python and racket are way ahead |
| 05:10 | Scriptor | agreed, getting errors where it can't find the line number is really annoying |
| 05:10 | Scriptor | especially when it's just a stray letter typo'd after a parenthesis or something |
| 05:14 | Scriptor | hmm, so I have a macro that returns the result of a map |
| 05:15 | Scriptor | when I try to do that, it thrown a nullpointer exception, when I return the (first ...) of the result, it's fine |
| 05:16 | lucian | maybe because map is lazy |
| 05:16 | lucian | try (do ...) to force the map, see if you still get the nullpointer |
| 05:17 | Scriptor | just do? |
| 05:18 | raek | lucian: 'do' has nothing to do with laziness |
| 05:19 | Scriptor | hmm, tyring do, dorun, and doall don't seem to have an effect |
| 05:19 | raek | did you mean 'doall'? |
| 05:19 | Scriptor | http://clojuredocs.org/clojure_core/clojure.core/doall |
| 05:19 | lucian | oh, right |
| 05:20 | ts__ | hi |
| 05:20 | ts__ | i have trouble understanding this loop (doseq [[anchor id] (.. input-tuple getMessageId getAnchorsToIds)] anybody care to explain ? |
| 05:21 | raek | Scriptor: what happens if you do something like (defmacro foo [] (map identity '(println "hello"))) (foo) |
| 05:22 | raek | ts__: it is a combination of java interop, the doseq macro, and destructuring. which parts do you know about? |
| 05:22 | Scriptor | raek: that works fine, hello is printed and nil is returned |
| 05:23 | raek | ok, that seems to indicate that laziness is not the problem, at least |
| 05:23 | raek | Scriptor: have you tried looking at the output of macroexpand-1 ? |
| 05:23 | raek | (macroexpand-1 '(your-macro ...)) |
| 05:24 | raek | if it blows up with that call, then the problem is in the macro body. otherwise, it's in the generated code |
| 05:25 | Scriptor | here's the code if it helps https://gist.github.com/1931758 |
| 05:25 | Scriptor | raek: yep, tried it, it still blows up |
| 05:25 | ts__ | raek: what i want to know is what kind of variable i will have in the loop ? anchor and id ? is it like a for loop iterating over each anchor->id in this case ? |
| 05:25 | raek | Scriptor: what type is 'line'? |
| 05:26 | Scriptor | raek: it takes a body of clojure code so whatever each expression is, so far I'm testing it with (debug-block (prn "hi")) |
| 05:27 | tscheibl | ts__: (.. input-tuple getMessageId) would in Java be written like: input-tuple.getMessageId().getAnchorsToIds(); |
| 05:27 | raek | ts__: well, the loop first calls (.getAnchorsToIds (.getMessageId input-tuple)) to get a sequence of things. each "thing" is then treated as a sequence and the first "subthing" is named "anchor" and the second "id" |
| 05:28 | raek | the loop body is executed once for each "thing" in an environment where "anchor" and "id" are bound to the "subthings" |
| 05:28 | ts__ | yeah and the getAnchorsToIds() return a map of <long,long> |
| 05:28 | Scriptor | hmm, I'm trying it now with a function other than prn |
| 05:29 | raek | ts__: ok, if it is a map then you will iterate over the entries |
| 05:29 | Scriptor | different errors this time, so this might be a good sign |
| 05:29 | tscheibl | ts__: yep.. and [anchor id] destructures this arry into anchor and id |
| 05:30 | raek | Scriptor: so you want to turn (prn "hi") into (debug prn "hi")? |
| 05:30 | tscheibl | ts__: actually it destructures EACH array in a loop |
| 05:30 | Scriptor | raek: yep |
| 05:30 | ts__ | so it will loop over each entries of the map or it will loop like anchor1 -> id1 , anchor1 -> id2, anchor2 -> id1 ? |
| 05:30 | raek | if you take multiple expression you need to wrap the result expressions in a 'do' |
| 05:31 | raek | I guess you want (debug-block (prn "foo") (prn "bar")) to expand into (do (debug prn "foo") (debug prn "bar")) and not ((debug prn "foo") (debug prn "bar")) |
| 05:31 | tscheibl | ts__: in each iteration you will get the next anchor, id pair |
| 05:32 | tscheibl | ts__: referenced using the symbols anchor and id |
| 05:32 | ts__ | tscheibl: alright so there's no mixing between different keys and values |
| 05:32 | tscheibl | ts__: correct |
| 05:32 | raek | Scriptor: I would write it like this: (defmacro debug-block [& lines] (cons `do (for [line lines] (if (seq? line) (cons `debug line) line)))) |
| 05:33 | ts__ | okay thanks ! |
| 05:34 | tscheibl | ts__: you are welcome :) |
| 05:34 | raek | or like: (defmacro debug-block [& lines] `(do ~@(for [line lines] (if (seq? line) `(debug ~@line) line)))) |
| 05:35 | raek | Scriptor: two small remarks: 1) it's safer to use 'seq?' to detect a list-like thing. 2) it's safer to use syntax-quote instead of ordinary quote since you don't know what "debug" will mean where the macro is expanded |
| 05:35 | Scriptor | raek: thanks, using do fixed it! Still used map though :) |
| 05:36 | Scriptor | ah, I changed debug to the fully namespaced version (clj-here.core/debug), does syntax-quote do the same? |
| 05:37 | raek | Scriptor: the error in your original code came from (debug-block (prn "hi")) expanding into ((prn "hi")), which evaluated to (nil), which casued the NPE |
| 05:37 | raek | Scriptor: yes, that's exactly what it does for symbols |
| 05:38 | raek | if you did (ns ... (:use [foo.bar :rename {x y}])) then `y will expand into 'foo.bar/x |
| 05:38 | Scriptor | right, I was thinking that by just returning the result of the map it would prevent it from getting embedded in the extra list |
| 05:38 | clojurebot | Huh? |
| 05:38 | raek | Scriptor: map always create a sequence |
| 05:39 | Scriptor | yea, must be the late time, it wouldn't make sense for clojure to automatically unpack that sequence just because it's returned by a macro |
| 05:39 | raek | since it applies the function _to each_ element in the input sequence |
| 05:41 | Scriptor | thanks again, raek! |
| 05:41 | Scriptor | my little debugging tool is starting to take shape |
| 05:57 | devn | map a function over a function and get function composition |
| 05:57 | devn | gah, can't sleep, time to try again, cheers |
| 06:23 | broquaint | I'm trying to follow the instructions in this repo https://github.com/djhworld/testproject but when I try to build the cljs I get this - https://refheap.com/paste/880 |
| 06:23 | broquaint | Does that look familiar to anyone? |
| 06:27 | ejackson | ,(map Math/abs [-1 -2 3]) |
| 06:27 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to find static field: abs in class java.lang.Math, compiling:(NO_SOURCE_PATH:0)> |
| 06:27 | ejackson | why's that ? |
| 06:28 | ejackson | ,(map #(Math/abs %) [-1 -2 3]) |
| 06:28 | clojurebot | (1 2 3) |
| 06:28 | ejackson | works |
| 06:34 | broquaint | Because it's trying to access it as a static property rather than a method (I think). |
| 06:35 | ejackson | yeah I'm not sure how to be explicit with it though |
| 06:36 | ejackson | i would have guessed |
| 06:36 | ejackson | ,(map (. Math abs) [1 2 -3]) |
| 06:36 | clojurebot | #<CompilerException java.lang.NoSuchFieldException: abs, compiling:(NO_SOURCE_PATH:0)> |
| 06:37 | ejackson | but no dice there either |
| 06:37 | tscheibl | ,(map (. Math (abs)) [1 2 -3]) |
| 06:37 | clojurebot | #<CompilerException java.lang.IllegalArgumentException: No matching method: abs, compiling:(NO_SOURCE_PATH:0)> |
| 06:37 | tscheibl | seems to be a static method |
| 06:39 | gju | yes, there are only static methods in java.math |
| 06:39 | ejackson | is this general, that you can't map static methods ? |
| 06:39 | ejackson | or otherwise do more than just apply them, I guess that makes some sense |
| 06:41 | gju | i think you need an object as the first parameter of . and since math is a class that makes sense, i guess. |
| 06:41 | broquaint | It seems like the interop expects args to invoke a method - http://clojure.org/java_interop |
| 06:41 | broquaint | i.e Classname/staticField vs. (Classname/staticMethod args*) |
| 06:54 | broquaint | Sorted my cljs-build problem by upgrading lein by the by (should've read the github issues before making noise). |
| 07:04 | cemerick | ,(map #(Math/abs %) [1 2 -3]) |
| 07:04 | clojurebot | (1 2 3) |
| 07:05 | cemerick | oh, ejackson already got that |
| 07:05 | ejackson | chicken feet, dude. |
| 07:05 | ejackson | :) |
| 07:05 | cemerick | heh, yeah |
| 07:05 | clgv | cemerick: I like the Math/abs style better so yours is worth to mention |
| 07:06 | cemerick | Actually, a good-looking rooster on the cover would have been pretty neat. |
| 07:06 | cemerick | clgv: yeah, any static method/field interop that uses . looks warty to me. |
| 07:06 | ejackson | YES ! |
| 07:06 | cemerick | We had no control over the animal chosen. |
| 07:07 | ejackson | yeah, cgrand told me |
| 07:07 | cemerick | I was trying to pitch for leaf-cutter ants, but alas |
| 07:07 | ejackson | I would have claimed to have been viciously scarred by a painted snipe in my youth... |
| 07:07 | clgv | cemerick: ah your book will be released in april? |
| 07:07 | cemerick | clgv: whenever it plops out of the O'Reilly machine, honestly |
| 07:08 | clgv | cemerick: amazon says april ;) |
| 07:08 | cemerick | Their own catalog says March, Amazon says April, and the people we have contact with have no further information :-P |
| 07:08 | Apage43 | oh |
| 07:09 | Apage43 | just read the draft today |
| 07:09 | Apage43 | won't the reduce functions on the couchdb break since they don't account for rereduce? |
| 07:09 | Apage43 | *couchdb chapter |
| 07:10 | gju | what book are you talking about? |
| 07:10 | Apage43 | http://clojurebook.com/ I'm assuming |
| 07:10 | ejackson | yup, |
| 07:10 | Bahman | Hi all! |
| 07:11 | Bahman | Is there any Clojure'ish way to this problem? http://stackoverflow.com/questions/991489/i-cant-delete-a-file-in-java |
| 07:12 | ejackson | so datomic, huh. |
| 07:12 | Bahman | I'm using (with-open) macro for all I/O stuff. It handles closing open streams but I'm not sure how to set them as NULL so that I can delete the file just done I/O with. |
| 07:13 | clgv | Bahman: just have a look in the java apis. I think deleting files is available as function nio2 |
| 07:13 | clgv | *function in nio2 |
| 07:14 | ejackson | dataomics: the field of study of all data ! |
| 07:14 | ejackson | but, given the provenance, I'm guessing it means something else. |
| 07:14 | clgv | Bahman: honestly I dont understand why you write to a file that you want to delete instantly thereafter |
| 07:15 | Bahman | clgv, it's a temp/buffer file. I need to copy the contents to a final file and delete the temp one. |
| 07:15 | cemerick | Apage43: you're quite right |
| 07:15 | Bahman | Checking javadocs. |
| 07:15 | cemerick | good catch |
| 07:17 | Bahman | clgv: By nio2 you mean java.nio ? |
| 07:17 | clgv | Bahman: no. nio2 was added in java 7 and had some more file centered classes |
| 07:18 | Bahman | Aaah. Using 1.6 here :-S |
| 07:18 | clgv | Bahman: but maybe a delete function was present before already. the stackoverflow entry says that he forgot closing the streams which caused the deletion to fail |
| 07:19 | Apage43 | cemerick: mhm. It's fine until there's enough stuff in the view that there's more than one node in the B-tree. I work on CouchDB and have been bitten a few times when my tests weren't failing simply because the amount of docs I was using wasn't big enough to cause that to happen. |
| 07:19 | Bahman | clgv: there is a delete() available. And I assumed that (with-open) closes all streams. But still the GC doesn't understand right away that the streams/files are ready to be disposed of. |
| 07:19 | clgv | Bahman: you have a sample of your code? |
| 07:20 | Bahman | Yes....let me put it on pastebin. |
| 07:20 | cemerick | Apage43: sure; though technically, rereduce can happen with any data size, especially in a distributed implementation like bigcouch |
| 07:21 | Bahman | clgv: http://pastebin.com/KDG2zTBv |
| 07:23 | Apage43 | ah right. I wasn't even considering what happens at query time, only generation time. |
| 07:23 | cemerick | Apage43: I'll try to think of a reasonable bug bounty. :-) |
| 07:25 | G0SUB | ejackson |
| 07:25 | ejackson | G0SUB: BG ! |
| 07:25 | G0SUB | ejackson, howdy! |
| 07:25 | G0SUB | ejackson, will I be meeting you at Clojure/West? |
| 07:25 | ejackson | sadly not man, |
| 07:25 | clgv | Bahman: humm. that seems to depend on the semantics of deleteOnExit. I never used it. with-open just calls (.close index-is) in a finally statement |
| 07:26 | G0SUB | ejackson, Ok, need to think about submitting a talk at EuroClojure then :-) |
| 07:26 | ejackson | YES!! |
| 07:26 | G0SUB | ejackson, how's work going on? |
| 07:26 | ejackson | I'll definitely be there |
| 07:27 | ejackson | G0SUB: Check your pms, I don't wanna incur the Wrath of Chas by spamming up #clojure :) |
| 07:27 | G0SUB | lol |
| 07:27 | Bahman | clgv: deleteOnExit() is just an attempt. At first I just renamed temp to final. But that didn't work. So I thought maybe I should give deleteOnExit() a try. But don't count on it as a final solution :-) |
| 07:28 | Bahman | Maybe I just need to do something like ` index-is=null ` in Java. |
| 07:28 | Bahman | But what is the equivalent of that in Clojure (if any)? |
| 07:28 | clgv | Bahman:hm well, I cant dig into that api right now. but I hope the explanation of with-open above helps you on your way |
| 07:29 | Bahman | clgv: thanks for your time :-) |
| 07:30 | clgv | Bahman: so your stream will be closed but maybe that isnt sufficent for deleteOnExit to work... |
| 07:31 | Bahman | clgv: Yes. The problem is that GC doesn't free the file resource back to OS right away. Unless I set the instream as NULL and call gc() manually. |
| 07:32 | clgv | Bahman: you should definitely not depend on the gc for deleting the file when he pleases. there is probably some other way to do that explicitly. |
| 07:32 | cemerick | ejackson: meh, I've no wrath, and certainly no Wrath ;-) |
| 07:32 | ejackson | cHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAS |
| 07:33 | Bahman | clgv: Absolutely right. But I can't think of any other way. Maybe calling a Perl script which delete a file in a blocking way? :-P |
| 07:33 | clgv | O_O |
| 07:34 | cemerick | hrm, I *do* have a fondness for Shakespeare... |
| 07:34 | ejackson | hehehehe |
| 07:51 | _ulises | hey all, I'm having unicode issues with slime+emacs and this is the message I get: http://pastebin.com/BUsaB1sL anybody got any thoughts? I came across this SO question which although related does not provide a solution: http://stackoverflow.com/questions/4843976/unicode-clojure-unit-test-output |
| 07:54 | jimduey | ejackson: good morning or whatever time of day is appropriate |
| 07:55 | ejackson | hey jimduey :) |
| 07:57 | tomoj | _ulises: (setq slime-net-coding-system 'utf-8-unix) |
| 07:57 | _ulises | tomoj: thanks, let me try |
| 07:57 | tomoj | then reconnect |
| 07:58 | _ulises | that did it, yay! |
| 07:58 | r4vi | r4 |
| 08:00 | xumingmingv | hello |
| 08:00 | xumingmingv | anyone tell me how to debug clojure in eclipse? |
| 08:00 | xumingmingv | any plugin? |
| 08:06 | dan_b | anyone here in London? |
| 08:06 | ejackson | cambridge |
| 08:06 | ejackson | have fun |
| 08:07 | dan_b | maybe learn to type, too. who knows? |
| 08:13 | G0SUB | dan_b, unfortunately that's a prerequisite. |
| 08:17 | clgv | a question out of curiosity: in clojure 1.2 it was said that destructuring values of a map was slower than manually extracting thos values from the map. did this change with clojure 1.3? |
| 08:19 | morphling | clgv: no |
| 08:21 | ejackson | that's a bummer, I destructure everywhere |
| 08:25 | clgv | ejackson: well as with anything else this will only matter in hotspots |
| 08:25 | clgv | or bottlenecks^^ |
| 08:25 | ejackson | yup |
| 08:27 | clgv | I didnt really understand why it's slower. |
| 08:27 | morphling | i wonder if there's any documentation why it's done the way it is |
| 08:27 | morphling | ,(macroexpand-1 '(let [{a :a} {:a 5}] a)) |
| 08:27 | clojurebot | (let* [map__30 {:a 5} map__30 (if (clojure.core/seq? map__30) (clojure.core/apply clojure.core/hash-map map__30) map__30) a ...] a) |
| 08:29 | morphling | the ... is (clojure.core/get map__30 :a) |
| 08:32 | clgv | morphling: ah the (if seq? ..) is for option destructuring in defns |
| 08:37 | morphling | clgv: ah, thx, that makes sense |
| 08:49 | gtrak` | god, can we do something about http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html ? |
| 08:49 | lazybot | The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.? |
| 08:51 | gtrak` | I intercepted a guy on twitter that was about to give up clojure because that didn't work. |
| 08:52 | mdeboard | Yeah that almost screwed me up too |
| 08:53 | gtrak` | does amazon tell you when people reply to your comments? |
| 08:53 | fliebel | gtrak`: 1) Ask them to take it down 2) apply negative SEO? ( bad idea) |
| 08:53 | gtrak` | he has a book review :-) |
| 08:53 | r4vi | I have cloju.re - maybe i'll stick uptodate tutorials on there |
| 08:53 | r4vi | im sure they'll rank pretty good on goole |
| 08:54 | gtrak` | I'll shoot him an email |
| 09:00 | gtrak` | maybe I should just make one that's more up to date |
| 09:00 | mdeboard | Yeah |
| 09:01 | mdeboard | gtrak`: Get people to link to it: submit to HN, reddit & twitter |
| 09:01 | gtrak` | yea |
| 09:01 | mdeboard | gtrak`: That's a better solution |
| 09:06 | clgv | gtrak`: dont forget the shortcut for non-emacs people - install Eclipse + CCW plugin and you are done for first experiments ;) |
| 09:10 | the-kenny | This isn't a shortcut. Starting eclipse takes hours. |
| 09:15 | ungamedplayer | is the programming clojure book (pragprog) too outdated to be useful as a learning tool ? |
| 09:16 | gtrak` | clgv, I use eclipse for java 40-hours a week, emacs is a breath of fresh air, especially with clojure |
| 09:17 | gtrak` | ungamedplayer, why not just get a newer one? |
| 09:17 | ungamedplayer | gtrak, house repayments. |
| 09:17 | tsdh | Is there a better way to capture the output and the result of evaluating an expression than let with a promise over an with-out-str + deliver? |
| 09:18 | ejackson | ungamedplayer: i still refer to it |
| 09:18 | gtrak` | joy of clojure is pretty serious, but still a little out of date now |
| 09:19 | ungamedplayer | i googled the question before i asked, its just given me a very mixed bag of responses. |
| 09:19 | ungamedplayer | i'll start with the web based stuff, see how far i get. |
| 09:20 | gtrak` | I think I got much more out of joy of clojure than I got out of 5 wendy's combo meals |
| 09:21 | clgv | the-kenny: really? not here and this pc is about 4 years old now |
| 09:21 | tomoj | tsdh: no. why do you want to capture the output? |
| 09:22 | tomoj | (at least, I can't think of a better way..) |
| 09:22 | tsdh | tomoj: I'd like to have a variant of `time' with custom format string. |
| 09:22 | tomoj | ah :) |
| 09:23 | tomoj | I'd just write it from scratch |
| 09:25 | tomoj | time's behavior has always seen.. broken to me. but is there a better alternative? |
| 09:25 | tomoj | er, s/seen/seemed/ |
| 09:30 | harrison | do you object to the irreversible asymmetry of time? |
| 09:30 | harrison | its ineluctable flow? |
| 09:31 | harrison | the inevitable withering of mortal flesh? |
| 09:32 | ungamedplayer | the rate of one second, per second always bugs me. |
| 09:32 | harrison | you might as well ask for another dimension of space |
| 09:32 | harrison | or one fewer |
| 09:32 | ungamedplayer | i have was closed NOTABUG. |
| 09:33 | ungamedplayer | i have, was closed NOTABUG. |
| 09:47 | gtuckerkellogg | I'm just getting familiar with leiningen, but not familiar enough. |
| 09:47 | gtuckerkellogg | i keep having the same stupid problem |
| 09:48 | tsdh | tomoj: If you're interested: https://gist.github.com/1932917 |
| 09:54 | clgv | tsdh: why do you use promise+deliver there? |
| 09:55 | babilen | gtuckerkellogg: You might want to provide more details if you want us to be able to help you. |
| 09:55 | gtuckerkellogg | OK :-) |
| 09:55 | gtuckerkellogg | it was so low traffic I wasn't sure anyone was paying attention. |
| 09:55 | tsdh | clgv: I didn't know a better way to get the value of evaluating form inside with-out-str. |
| 09:56 | clgv | tsdh: ah you mean since it might be lazy? |
| 09:56 | gtuckerkellogg | basically, i'm trying to replicate the tutorial at the leiningen github site |
| 09:56 | clgv | tsdh: no it can be lazy as well. |
| 09:56 | gtuckerkellogg | it's as simple as it gets, and it all works when it's in the source area |
| 09:56 | gtuckerkellogg | so i can "lein run" just fine |
| 09:57 | gtuckerkellogg | and "lein uberjar; java -jar <uberjar-file> args" |
| 09:57 | ungamedplayer | gtuckerkellogg, i have just finished, whats the problem ? |
| 09:57 | gtuckerkellogg | that all works |
| 09:57 | ungamedplayer | ok |
| 09:57 | tsdh | clgv: no, because with-out-str returns just the output string but not the value of its body. |
| 09:57 | gtuckerkellogg | but when I "lein install" and try to run it from ~/.lein/bin, it complains "Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main" |
| 09:58 | clgv | tsdh: when you are writing your own macro, you can just implement time measurement yourself via (System/nanoTime) |
| 09:58 | gtuckerkellogg | I'm not at all familiar with maven; I come from an R/Perl/Ruby background, not java |
| 09:58 | gtuckerkellogg | so i'm sure my ignorance is manifest |
| 09:58 | clgv | clgv: it's even less code than the current approach ;) |
| 09:58 | clgv | lol tsdh ^^ |
| 09:59 | tsdh | clgv: Hm, right. That would possibly be much better than misusing `time'. :-) |
| 09:59 | ungamedplayer | gtuckerkellogg, python/erlang guy here. |
| 09:59 | gtuckerkellogg | ungamedplayer, i put a gist about it https://gist.github.com/1932895 |
| 10:00 | ungamedplayer | reading. |
| 10:01 | clgv | gtuckerkellogg: you seem to not be using keywords in your project.clj, e.g. :dependencies instead of dependencies |
| 10:03 | clgv | tuckerkellogg: ah. the jar has only your project and needs to be started with a clojure.jar - you can build a uberjar that is runnable without any other dependency |
| 10:03 | gtuckerkellogg | cljv, that's just a mistake in the way the org-file is formatting on github. They are keywords in the file |
| 10:04 | gtuckerkellogg | clgv, ok, that makes sense. but (again, my java ignorance), shouldn't the shell-wrapper haul in the clojure.jar? How do I specify that? |
| 10:15 | clgv | gtuckerkellogg: I never used install on a jar with a main-Method yet. I only used it for libraries... |
| 10:15 | gtuckerkellogg | oh, ok |
| 10:16 | clgv | gtuckerkellogg: when I want to run the program standalone, I build an uberjar. otherwise I use lein run or lein repl |
| 10:17 | clgv | or my IDEs repl... |
| 10:20 | gtuckerkellogg | to run an uberjar standalone, you run java -jar every time, right? It seems weird to me that the "lein install" would install a shell wrapper for the jar (not the uberjar) but not in a way that that shell wrapper actually functions if its in my path. That's why I think I must be doing something wrong in my configuration |
| 10:21 | gtuckerkellogg | what's the point of "lein install" putting an executable shell wrapper in ~/.lein/bin if I can't run it? I must be doing something wrong for that to happen |
| 10:22 | gtuckerkellogg | clgv, thanks for the insight, btw. |
| 10:23 | harrison | You have done wrong but we will be "leinient" thsi time. |
| 10:23 | harrison | this time |
| 10:26 | raek | gtuckerkellogg: the shell wrapper should include clojure on the classpath |
| 10:27 | gtuckerkellogg | raek, thanks. |
| 10:27 | gtuckerkellogg | maybe it doesn't |
| 10:27 | raek | gtuckerkellogg: what does the generated shell wrapper file contain? |
| 10:28 | raek | for one of my projects it generated a line like CLASSPATH="$HOME/.m2/(...)/adt4j-1.0.0-SNAPSHOT.jar:$HOME/.m2/(...)/clojure-1.2.1.jar" |
| 10:29 | raek | so clearly my project and clojure itself is on the classpath for me |
| 10:30 | technomancy | gtuckerkellogg: it could be a bug in shell wrappers; they are an obscure feature that's not used very often. feel free to open an issue |
| 10:30 | gtuckerkellogg | the shell wrapper is exactly the same as the default wrapper except for the subs |
| 10:31 | raek | technomancy: FYI, shell wrappers have been useful for me (so someone is actually using them) |
| 10:31 | gtuckerkellogg | damn that works. |
| 10:31 | gtuckerkellogg | the default shell-wrapper does not include the clojure.jar CLASSPATh |
| 10:31 | gtuckerkellogg | if i add it to the wrapper explicitly, it works |
| 10:32 | gtuckerkellogg | raek, thank you |
| 10:32 | technomancy | raek: I think shell wrappers would be a lot more useful if they didn't require Leiningen to get installed in the first place |
| 10:33 | raek | gtuckerkellogg: do you have anything in your project.clj file that could cause the clojure dependency to be excluded somehow? |
| 10:33 | technomancy | I wonder if most of their use cases could be covered by one of those crazy shell/jar hybrid files |
| 10:33 | gtuckerkellogg | no, i don't think so |
| 10:34 | gtuckerkellogg | my project.clj started as a direct copy of the one at https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md |
| 10:34 | gtuckerkellogg | the only changes I have made were attempts to get the shell script to work after what I copied didn't |
| 10:37 | gtuckerkellogg | thank you all, and good night |
| 11:38 | horatio_cromwell | out of the current crop of books/online material, what would you recommend as the best way to get started with clojure |
| 11:42 | tmciver | horatio_cromwell: The 2nd edition of Stuart Halloway's book "Programming Clojure" has recently come out and though I haven't read it, I thought that the first edition was a very good beginners book on Clojure. |
| 11:48 | horatio_cromwell | tmciver: has a lot changed in clojure since the first edition of the book, I can get teh first edition cheap, although obv. if it is out of date the lnew version isn;t gonna break the bank |
| 11:50 | ejackson | tmciver: you can't go wrong, just get a book and start coding |
| 11:50 | tmciver | horatio_cromwell: I would stay away from the first edition. Enough has changed that the first edition is outdated. |
| 11:50 | horatio_cromwell | tmciver: cheers |
| 11:51 | dan_b | ok, I didn't know yesterday that the riddel.us page was so out of date, but I now have a believed-to-be-mostly-working clojure set up anyway |
| 11:51 | horatio_cromwell | does clojure have good libraries for bit twiddling and handling of binary data |
| 11:51 | dan_b | only thing bothering me so far is that emacs reports a version mismatch between swank and slime every time I M-x clojure-jack-in |
| 11:52 | dan_b | is that important or just annoying? |
| 11:52 | stuartsierra | dan_b: just annoying |
| 11:52 | dan_b | Versions differ: 2009-07-27 (slime) vs. 20100404 (swank). Continue? (y or n) |
| 11:52 | stuartsierra | horatio_cromwell: no |
| 11:53 | stuartsierra | dan_b: Put this in your .emacs: |
| 11:53 | stuartsierra | (eval-after-load 'slime |
| 11:53 | stuartsierra | '(setq slime-protocol-version 'ignore)) |
| 11:53 | dan_b | Connected. Lemonodor-fame is but a hack away! |
| 11:53 | clgv | horatio_cromwell: as much as java has |
| 11:53 | dan_b | haha. i remember lemonodor ... |
| 11:54 | stuartsierra | horatio_cromwell: I lied, you can do bit-twiddling in Clojure. Somebody did a base64 encoder that was faster than the Apache Commons Java version. |
| 11:55 | dan_b | stuartsierra: thanks. unsightly but not deletorious then |
| 11:55 | stuartsierra | yeah |
| 11:56 | dan_b | s/deletorious/debilitating/ maybe |
| 11:56 | stuartsierra | It's because the upstream SLIME distribution doesn't ever do versioned releases, just timestamps from CVS. |
| 11:56 | tmciver | horatio_cromwell: also, check out gloss. |
| 13:05 | ssedano | in data.xml how can I retrieve the value of a tag's attribute? |
| 13:06 | ssedano | I can get the content with (first (:content x)) where x is the tag, but (first (:attrName x)) nor (first (:attrs (:attrName x))) does not |
| 13:11 | dan_b | ok, london clojure dojo here I come |
| 13:20 | ssedano | nevermind, done |
| 13:25 | technomancy | replaca: hey; how hard would it be to get a pprint dispatch that works nicely on defproject? |
| 13:44 | ibdknox|away | quiet morning |
| 13:45 | technomancy | everyone's taking a breather after the rush of news yesterday? |
| 13:45 | Bronsa | which news? |
| 13:46 | drewr | Bronsa: datonical clubuntu: linux on clojure |
| 13:46 | drewr | the lisp machine is back |
| 13:47 | Bronsa | i am quite sure you are not being serious about this |
| 13:47 | drewr | Bronsa: just a guess |
| 13:48 | technomancy | didn't you see the news about clojure compiling to arc? |
| 13:48 | gtrak`` | does canonical care about clojure at all? |
| 13:48 | technomancy | MenTaLguY might know |
| 13:48 | technomancy | I would guess no? |
| 13:49 | ibdknox | Bronsa: clojure book is finished, datomic (a new database?), and my little live game thing |
| 13:50 | ibdknox | made a lot of noise yesterday |
| 13:50 | Bronsa | oh, ok |
| 13:51 | Bronsa | your 'little live game thing' is pretty cool though |
| 13:52 | ibdknox | it's fun :) |
| 13:53 | dnolen | ibdknox: a success on reddit, even got people think how it would be to accomplish in C# ;) |
| 13:53 | dnolen | how hard it would be |
| 13:53 | ibdknox | dnolen: that made me laugh |
| 13:54 | ibdknox | Ryan Singer got ahold of it and retweeted it too |
| 13:54 | ibdknox | apparently it got retweeted 45 times |
| 13:54 | ibdknox | twitter is a weird little microcosm |
| 13:55 | ibdknox | for those interested, my site got about 14,000 pageviews between today and yesterday |
| 13:55 | ibdknox | 11,500 were unique |
| 13:56 | dnolen | ibdknox: nice! |
| 13:59 | ibdknox | dnolen: everything else will be boring now though ;) Hard to beat that demo lol |
| 14:00 | ibdknox | in terms of what to write about next that is |
| 14:03 | gtrak`` | you could live-stream a game built in 48 hours of clojurescript |
| 14:04 | ibdknox | haha |
| 14:04 | devn | ibdknox: gtrak``: YES! |
| 14:04 | ibdknox | the nodeknockout... but live in CLJS |
| 14:05 | gtrak`` | it would be more fun to watch than notch, and I watched a few hours of that |
| 14:05 | devn | No I'm serious, you really should do it |
| 14:05 | devn | I think it would be really awesome. |
| 14:05 | devn | Have you watched any of notch's livecoding? |
| 14:05 | devn | It's really interesting to watch. |
| 14:06 | gtrak`` | mostly because it works at all :-) |
| 14:06 | ibdknox | I would think it would be extremely boring |
| 14:07 | technomancy | ibdknox: have you seen peepcode's play-by-plays? |
| 14:07 | ibdknox | technomancy: nope |
| 14:07 | technomancy | they do the whole "put together a whole app in a couple hours" thing |
| 14:08 | technomancy | but they have a back-and-forth conversation between 2 people, and are somewhat heavily edited (though not as heavily edited as regular peepcodes) |
| 14:08 | ibdknox | I see |
| 14:09 | technomancy | TBH I was a bit bored by the one I watched, but that was mostly because I wasn't too interested in the tech |
| 14:09 | ibdknox | basically do it in the style of a football replay |
| 14:10 | ibdknox | still think it would be really boring for people to watch lol. I'm not a very interesting coder |
| 14:14 | ibdknox | my friend and I were talking about a game idea the other day where you're given a goal and you have to write the code to create the environment that allows you to achieve that goal |
| 14:14 | mdeboard | Man what a fantastic idea |
| 14:15 | ibdknox | the only problem is how to control for cheating lol |
| 14:15 | ibdknox | the game couldn't be as simple as get to here |
| 14:15 | Scriptor|wrk | write your own language for it ;) |
| 14:15 | ibdknox | because you could just modify the guy's position to be there |
| 14:16 | Scriptor|wrk | well, you could require him to pick stuff up from different waypoints along the way |
| 14:16 | ibdknox | if I did collision detection the right way, I guess I could ensure that |
| 14:17 | ibdknox | otherwise I could still just warp myself to the things I need |
| 14:18 | ibdknox | really, the only thing I'd have to protect are the player's coordinates and the objectives, I guess |
| 14:21 | tmciver | you could limit the player's acceleration; warping == infinite acceleration. |
| 14:21 | ibdknox | tmciver: not a bad idea |
| 14:22 | tmciver | actually, I think I mean velocity. |
| 14:22 | ibdknox | you do |
| 14:22 | ibdknox | but that's ok :D |
| 14:22 | ibdknox | both work in that case really |
| 14:22 | emezeske | I think warping would imply both infinite acceleration and velocity |
| 14:23 | tmciver | s/admint/admit |
| 14:23 | ibdknox | emezeske: 1 tick is a unit of time so not really infinite |
| 14:24 | emezeske | Ah, that's sensible |
| 14:24 | ibdknox | in any case, as long as I don't let you directly set the position, it seems that problem is solved |
| 14:25 | ibdknox | I guess you could still modify your speed to get you there "instantly" but I actually think that would be really boring for you |
| 14:25 | ibdknox | lol |
| 14:26 | emezeske | Maybe you can accelerate as fast as you want, but it's potentially dangerous for your character |
| 14:26 | emezeske | "Oops, your internal organs just turned to applesauce" |
| 14:26 | technomancy | "No no, light speed is too slow. We need ludicrous speed." |
| 14:26 | emezeske | Smoke if ya gottem |
| 14:26 | ibdknox | haha |
| 14:26 | pandeiro | ibdknox: how long did the game editor take you, out of curiosity? |
| 14:26 | ibdknox | I haven't seen that in a long time |
| 14:26 | ibdknox | pandeiro: 7ish hours |
| 14:26 | ibdknox | I lost around 2 to the damn class file thing |
| 14:27 | ibdknox | speaking of.. technomancy is there a way to prevent .class files from being created? |
| 14:27 | technomancy | don't compile? |
| 14:27 | ibdknox | I'm just doing lein run |
| 14:28 | ibdknox | I assume that implicitly compiles? |
| 14:28 | technomancy | nah |
| 14:28 | technomancy | ibdknox: you can tag it to do otherwise: :main ^{:skip-aot true} mine.main |
| 14:28 | technomancy | or just use lein run -m whatevs.bro |
| 14:28 | ibdknox | fantastic |
| 14:29 | ibdknox | such a simple fix |
| 14:29 | ibdknox | technomancy: thank you sir |
| 14:29 | technomancy | in lein2 you'll be able to alias "lein go" to "lein run -m whatevs.dude" with partially-applied aliases |
| 14:30 | technomancy | np |
| 14:31 | ibdknox | emezeske: that would be a cool mechanic though |
| 14:31 | ibdknox | have some constraints actually placed on the guy/world so that you can't do anything too ridiculous |
| 14:34 | emezeske | Yeah, it strikes me as a decent way to limit a lot of stuff, without being too arbitrary |
| 14:49 | _ulises | evening folk |
| 14:56 | ibdknox | thinking more about it |
| 14:56 | ibdknox | the only thing you'd really need to do to make that demo I did general is that editing something only recompiles the outter-most form |
| 14:56 | ibdknox | not the whole thing |
| 15:02 | ibdknox | managed to get it working from a jar: https://github.com/ibdknox/live-cljs/downloads |
| 15:03 | gtrak`` | no closure compiler, right? |
| 15:05 | ibdknox | yep |
| 15:05 | ibdknox | just java -jar live-cljs.jar |
| 15:06 | gtrak`` | err, i mean, how's it compiling cljs without it? |
| 15:06 | ibdknox | oh |
| 15:06 | ibdknox | it has it in the uberjar |
| 15:07 | ibdknox | it just takes a dep on the cljs compiler |
| 15:07 | ibdknox | which includes it |
| 15:22 | muhoo | nice it seems to work from inside lein repl now! |
| 15:27 | clj_newb | is there any periodic process like clojure proj? |
| 15:27 | muhoo | though the repl part doesn't seem to. it's locking up the repl completely. |
| 15:30 | muhoo | oh, here it is. it was just slow |
| 15:30 | muhoo | firefoxx using 85% of CPU :-) |
| 15:36 | muhoo | well that was fun. https://refheap.com/paste/887 caused ff to flip out |
| 15:44 | muhoo | ibdknox: is it even possible to have a cljs repl connected to the browser while the live-cljs thing is running? |
| 15:44 | muhoo | or would that cross the streams and melt the space-time continuum? |
| 15:45 | dbushenko | hi all! |
| 15:45 | dbushenko | which clojure lib do you guys use for logging? |
| 15:45 | dnolen | muhoo: use is not a function in CLJS |
| 15:47 | hiredman | dbushenko: clojure.tools.logging + logback-classic |
| 15:48 | muhoo | well that's not cljs |
| 15:48 | muhoo | that's clj. cljs starts up at the end of that |
| 15:48 | muhoo | and.. locks up. |
| 15:49 | clj_newb | what is the best way to iterate indefinetely ? infinite lazy-seq or a plain while true or (loop (recur))? |
| 15:49 | technomancy | clj_newb: depends if you want new locals each time |
| 15:50 | clj_newb | mmm, where can I read about it? |
| 15:50 | clj_newb | no I don't want new local vars every time |
| 15:53 | clj_newb | there is also the iterate function is it? |
| 15:59 | clj_newb | so with recur being stack constant, no new locals are allocated? |
| 15:59 | raek | yes |
| 16:00 | clj_newb | it is the best option to perform an infinite loop then? |
| 16:00 | raek | I guess so. (loop [] (do-something) (recur)) would be the most minimal way, I think |
| 16:00 | brehaut | ,(while true) |
| 16:01 | clojurebot | Execution Timed Out |
| 16:01 | brehaut | ;) |
| 16:01 | raek | ,(macroexpand '(while true (do-something))) |
| 16:01 | clojurebot | (loop* [] (clojure.core/when true (do-something) (recur))) |
| 16:02 | clj_newb | got it |
| 16:02 | brehaut | it'd probably be nicer to write 'forever' which doesnt include the when |
| 16:03 | clj_newb | thank yo! |
| 16:03 | clj_newb | you* |
| 16:04 | brehaut | or alternatively, keywords are true so (while :forever (do-something)) could work too |
| 16:13 | pjstadig | can someone explain to me why Rich removed checked exceptions from Clojure's Java code base? |
| 16:14 | Raynes | I'd expect it was because of the way the stars were shining that night. |
| 16:15 | brehaut | Rich is a mythos cultist‽ |
| 16:16 | infosophy | Iä! Iä! Clojure Fthagn! |
| 16:17 | pjstadig | cause I can't come up with any valid reason myself |
| 16:17 | pjstadig | but i suppose i lack imagination |
| 16:18 | pjstadig | it's causing a bloodbath in my code though, when trying to upgrade to 1.3 |
| 16:24 | brehaut | devn? huh? |
| 16:25 | devn | I'm running all of the valid sexps in this channel for the last 5 years in clojail, those (while true] <-on purpose, expressions keep biting me |
| 16:25 | brehaut | devn: oh right. sorry :) |
| 16:25 | devn | or rather, they eventually time out, but some of them like [map inc (range 1e6]] |
| 16:25 | Raynes | Heh |
| 16:26 | devn | i had to remove a bunch of them by hand because it broke all of the redis libraries ive tried when running hgetall on "passing-expressions" |
| 16:27 | Raynes | devn: Perhaps setting the timeout really low would help? |
| 16:36 | Scriptor|wrk | amalloy: so, I took a crack at that debugging expressions idea: http://github.com/Scriptor/clj-here |
| 16:37 | m0smith | ibdknox: I am having a problem creating a noir war file |
| 16:37 | Raynes | ibdknox: I am having a problem having a problem. |
| 16:38 | amalloy | Scriptor|wrk: the reverse in https://github.com/Scriptor/clj-here/blob/master/src/clj_here/core.clj#L9 is a huge warning sign. you're trying to create ordering in a map, a thing which is explicitly unordered |
| 16:40 | Scriptor|wrk | amalloy: actually, it makes sure that the N for each argN matches up correctly |
| 16:41 | Scriptor|wrk | it just makes sure reduce goes through it in the right order |
| 16:42 | amalloy | what do you mean, matches up? |
| 16:42 | Scriptor|wrk | so, without the reverse ARG0 becomes the key to the last argument, ARG1 the penultimate, and so on |
| 16:43 | Scriptor|wrk | with reverse ARG0 points to the first argument in the function call |
| 16:43 | Scriptor|wrk | once the hash is created it doesn't matter what the order for that is, as long as the key names are correct |
| 16:44 | amalloy | i guess i don't see why args is in the wrong order, then, but i guess that's a separate problem |
| 16:45 | duncanm | hey technomancy |
| 16:45 | Scriptor|wrk | because I decided to make args a list and conj the last arg to the beginning |
| 16:45 | Scriptor|wrk | because it's easier to destructure that way |
| 16:45 | duncanm | technomancy: are you maintaining SLIME on elpa/marmalade? |
| 16:46 | Scriptor|wrk | it does mean that I have to reverse when I actually use it, but it seems to be worth it |
| 16:46 | Scriptor|wrk | er, and the destructuring is so that I have easy access to the latest arguments that were added, which is usually what is debugged |
| 16:47 | amalloy | just use a vector and pop from the end? |
| 16:47 | amalloy | or peek at the end, i suppose |
| 16:50 | Scriptor|wrk | would that be more idiomatic? I was considering that but opted for destructuring as opposed to the extra code to bind to last and such |
| 16:52 | amalloy | just...take args, as a vector. instead of argx print (peek args) |
| 16:52 | amalloy | destructuring in arglists is kinda tacky anyway |
| 16:52 | infosophy | what is the currently recommended version of lazytest? |
| 16:54 | TimMc | amalloy: Bah, nonsense. It's self-documenting code! |
| 16:54 | TimMc | inb4 "just like all code" |
| 17:02 | devn | Raynes: *nod* it might -- I think I just need to get clever about some specific combinations of functions and set the timeout low only for those combiantions |
| 17:03 | devn | Raynes: there are some computationally intensive things that dont produce giant sequences but are good examples, for instance |
| 17:03 | devn | infosophy: are people using lazytest? I guess all i hear about these days is midje |
| 17:04 | technomancy | duncanm: I wouldn't really say I'm maintaining it |
| 17:04 | technomancy | but I'm the closest thing it has to a maintainer if that's what you mean |
| 17:04 | technomancy | if it were facebook, our relationship would be "It's complicated" |
| 17:04 | duncanm | heh |
| 17:04 | duncanm | technomancy: you're not about to make a new release, are you? i wanted to play with slime-js, and they require a build from 2012-02 |
| 17:05 | duncanm | https://github.com/swank-js/swank-js |
| 17:05 | duncanm | swank-js |
| 17:05 | duncanm | "The backend was verified to work with SLIME 2012-02-12, it may or may not work with other versions, but note that breaking change in the protocol was introduced in SLIME 2011-11-27." |
| 17:06 | technomancy | yeah... this situation is a mess, and it will continue to be a mess until the slime developers learn how software releases work =\ |
| 17:06 | Scriptor|wrk | amalloy: eh...the reason why I didn't use peek was that if I needed to use (peek args) more than once I'd have to bind it to something else for clarity's sake |
| 17:06 | Scriptor|wrk | aaaand I preferred destructuring to that |
| 17:06 | technomancy | duncanm: I recommend using M-x clojure-jack-in to load slime for clojure |
| 17:07 | Scriptor|wrk | so really, almost no reason other than I wanted to destructure |
| 17:07 | duncanm | technomancy: i've been out of the clojure scene for a while, if i use clojure-jack-in, which slime does it load? |
| 17:07 | technomancy | duncanm: it uses the same revision of slime that is on marmalade, but it loads it on-demand |
| 17:07 | amalloy | but...you don't do that. and you don't destructure more than one thing. and if you did, it would be nearly as gross? and you could easily destructure a vector from the other end by calling rseq on it first? |
| 17:07 | infosophy | devn: I love midje. But see no reason not to use both. |
| 17:08 | Scriptor|wrk | amalloy: I might in the future, only a few basic things have been added so far |
| 17:08 | Scriptor|wrk | how would it be as gross? |
| 17:08 | technomancy | duncanm: in addition, I'd recommend anyone else writing a swank backend write something like M-x clojure-jack-in that installs the exact version of slime that's known to work with their server |
| 17:09 | amalloy | Scriptor|wrk: i'm probably just an opinionated old curmudgeon |
| 17:10 | amalloy | but seriously, you can destructure a vector from either end easily |
| 17:10 | duncanm | technomancy: does clojure-jack-in leave a version of slime inside $HOME/.emacs.d/site-lisp or something like that? |
| 17:10 | amalloy | &(let [v [1 2 3 4 5], [last butlast] (rseq v)] (+ last butlast)) |
| 17:10 | lazybot | ⇒ 9 |
| 17:10 | technomancy | duncanm: inside ~/.emacs.d/swank but not on the load path |
| 17:10 | duncanm | ahh |
| 17:10 | amalloy | and putting your argument list in reverse just so you can destructure easily is disgusting IMO |
| 17:11 | technomancy | duncanm: but the fact that it writes them to disk is only an optimization |
| 17:11 | Scriptor|wrk | well, it just made sense to me since it's the first few items that would be most accessed anyway |
| 17:11 | technomancy | it used to send it all via stdout |
| 17:12 | duncanm | technomancy: without writing it to disk, you'd have to download a fresh copy of SLIME every single time you 'jack-in'? |
| 17:12 | technomancy | duncanm: FSVO "download" |
| 17:12 | technomancy | you would have to load it from the jar into your emacs instance |
| 17:12 | tylergillies | oh nice i need to use FSVO |
| 17:12 | technomancy | and that worked fine for a time, it was just slow |
| 17:13 | tylergillies | i usually say "for certain definitons of" but i like "values" better |
| 17:13 | ihodes | (between homework assignments, some spam; i'm still looking for any cool companies/startups on the west coast interested in a clojure hacker) |
| 17:14 | ihodes | (or not just clojure, but whatever :) |
| 17:20 | tylergillies | ihodes: for free? :) |
| 17:23 | cemerick | ihodes: readyforzero just posted an ad |
| 17:24 | Raynes | I'm Ready For -1 |
| 17:24 | Raynes | ibdknox: Your turn, sir. |
| 17:38 | ihodes | tylergillies: haha nooooo, i'm afriad i need to eat |
| 17:38 | ihodes | cemerick: thanks--i'll check 'em out :) they look interesting at first glance |
| 17:41 | jhulten | Is the call stack available in Clojure? Does a function know what called it? |
| 17:42 | technomancy | jhulten: you can construct a new Throwable without throwing it and inspect its stack trace |
| 17:42 | amalloy | no |
| 17:42 | amalloy | if you try really really hard and don't mind being a horrible person, you can fake it (see: technomancy) |
| 17:43 | technomancy | hah |
| 17:45 | TimMc | devn: Luckily, you only have to run each infinite loop form once, since you are deduplicating. (RIGHT?) |
| 17:47 | m0smith | jhulten: (.getStackTrace (Thread/currentThread)) |
| 17:58 | ibdknox | ihodes: RFZ is definitely looking for folks :) |
| 17:58 | ibdknox | m0smith: what's wrong with the .war? |
| 18:00 | m0smith | ibdknox: I think I figured it out. I have to require the views AND call server/load-views-ns |
| 18:01 | ibdknox | hm |
| 18:01 | ibdknox | that doesn't make sense |
| 18:01 | ibdknox | the former is what the latter attempts to do |
| 18:01 | m0smith | (:require [noir.server :as server][flirtinator.views.welcome]) |
| 18:02 | m0smith | (server/load-views-ns 'flirtinator.views) |
| 18:02 | ibdknox | is welcome your only view? |
| 18:02 | m0smith | yes |
| 18:02 | ibdknox | shouldn't need to do the load-views-ns call then. Werid |
| 18:02 | ibdknox | I don't pretend to understand tomcat though |
| 18:02 | m0smith | ibdknox: It is deployed here http://m0smith.jelastic.servint.net/ |
| 18:03 | ihodes | ibdknox: i'm looking at you guys now (well...now your website in particular). you guys are at the intersections of cool problems, math (my major), finance (a major interest), and in SF. definitely will be contacting you... |
| 18:09 | gtrak`` | m0smith: I need this app |
| 18:10 | m0smith | gtrak: :) |
| 18:10 | gtrak`` | if you can automate this, my life is much improved |
| 18:11 | ibdknox | haha |
| 18:11 | m0smith | define "automate". That is the plan. I was going to have it email, txt and maybe post to twitter and facebook on a random basis |
| 18:12 | gtrak`` | intermittent randomly spaced reminders and suggestions sound great, I suppose it still has to appear thoughtful to the recipient, so it would be hard to automate the part of actually doing the action ;-) |
| 18:12 | gtrak`` | m0smith: maybe borrow some concepts from http://en.wikipedia.org/wiki/Spaced_repetition |
| 18:13 | m0smith | gtrak: I was thinking of it from the other direction, have it automatically send messages to my wife. But auto reminders to me is a good idea as well |
| 18:14 | hiredman | actually I started on something to generate events that on average happen every x days for my calendar |
| 18:14 | hiredman | e.g. the closer to 15 days it is since the last time the last event happened the more likely it will happen again |
| 18:15 | hiredman | for reminding me to buy flowers |
| 18:15 | m0smith | It was really nice to get a decent looking webapp up in so little code and configuration. I was going to use Spring MVC with clojure but noir was awesome for this |
| 18:15 | gtrak`` | I tried the spring mvc thing, and even with annotations it's twice the code-size for no gain |
| 18:16 | gtrak`` | the annotation-based configuration approaches closures asymptotically |
| 18:17 | m0smith | kinda except it strill requires a java support to structure it |
| 18:19 | gtrak`` | for example, adding spEl |
| 18:22 | m0smith | I must admit I have not used SpEL for anything except in an xml. Looks like having it int the annotations is an interesting use |
| 18:22 | m0smith | I see you rpoint |
| 18:22 | gtrak`` | meh, like I said, it's a hack |
| 18:23 | gtrak`` | and I think clojure the language is smaller than spring-core? |
| 18:24 | m0smith | I think you are right especially when you consider all the other stuff it takes to make spring MVC run |
| 18:26 | m0smith | My Spring MVC war file it 62MB while the Clojure/Noir one is 6MB |
| 18:26 | gtrak`` | woah |
| 18:32 | nickmbailey | ibdknox: any idea why i can't run 'lein nailgun &' using your lein-nailgun plugin? |
| 18:32 | ibdknox | not with that little information ;) |
| 18:32 | ibdknox | what's it do? |
| 18:32 | nickmbailey | not much |
| 18:32 | nickmbailey | Nicks-MacBook-Pro:agent nick$ lein nailgun & |
| 18:32 | nickmbailey | [5] 42048 |
| 18:32 | nickmbailey | Nicks-MacBook-Pro:agent nick$ |
| 18:32 | nickmbailey | [5]+ Stopped lein nailgun |
| 18:32 | nickmbailey | refuses to background |
| 18:33 | ibdknox | does it work FG? |
| 18:33 | nickmbailey | yep |
| 18:33 | ibdknox | no idea |
| 18:33 | nickmbailey | i can foreground it after running with '&' and it works |
| 18:33 | ibdknox | it works in the background for me |
| 18:33 | nickmbailey | bollocks |
| 18:33 | ibdknox | I really hope kotarak releases the new client soon so we can fix this nonsense |
| 18:34 | nickmbailey | oh is one in the works? |
| 18:34 | technomancy | you mean switching to nrepl? |
| 18:34 | ibdknox | technomancy: yeah |
| 18:34 | ibdknox | nickmbailey: he wrote a haskell nrepl client to use for it |
| 18:35 | nickmbailey | awesome |
| 18:36 | nickmbailey | ibdknox: do you run on osx? linux? |
| 18:36 | ibdknox | os x lion |
| 18:36 | nickmbailey | well shoot |
| 18:44 | nickmbailey | well apparently i can start it the foreground, suspend it, then background it |
| 18:44 | nickmbailey | so i guess i'll go with that |
| 18:47 | amalloy | if it won't run in the bg it's probably trying to do some console i/o |
| 18:47 | amalloy | and blocking on that because it doesn't have control of the console when it's in the background |
| 19:08 | Kowboy | I am looking for a clojure library I found quite some time ago |
| 19:08 | Kowboy | it is a nosql database writting in clojure |
| 19:08 | Kowboy | might even be an in-memory database |
| 19:09 | Kowboy | began with an f |
| 19:09 | Kowboy | found it |
| 19:09 | ibdknox | fleetdb |
| 19:09 | Kowboy | FleetDB |
| 19:09 | Kowboy | adding "in-memory" pulled it up in the search results |
| 19:16 | tylergillies | isn't clojure an in-memory database in itself? |
| 19:17 | tylergillies | ;) |
| 19:17 | nickmbailey | its a codebase |
| 19:17 | nickmbailey | code=data |
| 19:17 | nickmbailey | so yes |
| 19:18 | tylergillies | code != data |
| 19:18 | tylergillies | because not all data is code |
| 19:19 | tylergillies | but thats more semantics than anything ;) |
| 19:19 | nickmbailey | s/semantics/pedantics/ :) |
| 19:26 | Kowboy | what is the simplest Java SQL database for a prototype project? |
| 19:27 | Kowboy | hsql or derby? |
| 19:28 | Kowboy | this is a nice summary of options http://java-source.net/open-source/database-engines |
| 19:29 | scottj | does cljs still only work with sun jdk? |
| 19:36 | technomancy | scottj: I don't think so |
| 19:41 | ibdknox | scottj: it plays well with everyone now |
| 19:48 | scottj | ibdknox: good to hear I can use gcj :) I was actually getting an error running lein run on your live-cljs demo (can't recur here/coding.server$_main) though I don't get an error with the jar |
| 19:49 | ibdknox | scottj: readme |
| 19:49 | ibdknox | no one reads the readmes :p |
| 19:49 | ibdknox | scottj: the latest pull should have that fixed now though :) |
| 19:50 | scottj | ibdknox: they don't read the readme when you say in your post "all you have to do is..." :) |
| 19:52 | seancorfield | all you have to do is read the readme? :) |
| 19:52 | ibdknox | haha |
| 19:52 | ibdknox | that should actually be true now :) |
| 19:53 | scottj | ibdknox: btw the two panels aren't side by side on my 1400px screen. |
| 19:53 | ibdknox | I fixed the sizes for my screen |
| 19:53 | ibdknox | 1440x800 |
| 19:54 | ivan | so, has anyone written a reStructuredText that works in Clojure yet? |
| 19:54 | ivan | preferably without all the problems |
| 19:56 | Kowboy | why doesn't this work? (apply new [FileRecord 1 2 3 4 5 6]) |
| 19:56 | Kowboy | or even (apply FileRecord. [1 2 3 4 5 6]) |
| 19:57 | technomancy | Kowboy: apply only works on functions |
| 19:58 | Kowboy | so I have to wrap it then |
| 19:58 | Kowboy | or do it manually |
| 19:59 | technomancy | I think you have to know the arities up front |
| 19:59 | technomancy | but I don't use records, so don't listen to me |
| 20:01 | technomancy | niiice: https://mobile.twitter.com/plt_borat/status/174585616502231040 |
| 20:03 | gf3 | hola, for some reason I'm having an issue catching exceptions in clojail, has anyone experienced this? |
| 20:06 | scottj | ibdknox: live-cljs could be a cool programmers version of mario bros. each client that connects gets their own colored circle. add some bad guys and let users try to avoid getting killed while making changes to the code. flash code changes from other users in their color on the clients of everyone. |
| 20:07 | ibdknox | scottj: yeah, I was talking earlier about game ideas. My favorite so far is to have a goal that you have to write an environment for that allows you to complete it |
| 20:08 | ibdknox | with some constraints, like moving too fast will cause your guy to disintegrate due to friction or whatever |
| 20:10 | technomancy | cumulative speed: to fast to live http://images.wikia.com/scottpilgrim/images/a/af/Disin.png |
| 20:10 | alexbaranosky | if I have a macro inside of a (binding ...) can the expandion of the macro depend on the var being rebound? |
| 20:10 | alexbaranosky | or will it ignore the new value of the bound var, because the rebinding is happening after the expansion? |
| 20:11 | ibdknox | technomancy: lol |
| 20:11 | hiredman | alexbaranosky: binding happens at runtime |
| 20:12 | ibdknox | is there some code floating around somewhere that will take a string of clojure and give me the text or structure that represents the top-most form at a given point? |
| 20:13 | alexbaranosky | hiredman, yeah, makes sense. Thx. |
| 20:13 | technomancy | ibdknox: you mean like (read-string (apply str (take offset my-str)))? |
| 20:13 | ungamedplayer | if i wanted to wrap a processes stdin and stdout in clojure, (interactive, not a once off fire and forget) what should I use ? |
| 20:13 | ibdknox | scottj: btw I pushed a little css change to force the wrapper size so they won't flow underneath eachother |
| 20:14 | scottj | ibdknox: don't see it pushed |
| 20:14 | ibdknox | gr |
| 20:15 | ibdknox | is now |
| 20:16 | ibdknox | technomancy: that would just give me EOF's |
| 20:17 | ibdknox | basically what I want to do is char 80 was inserted find the the outer-most form and re-eval it |
| 20:17 | scottj | ibdknox: doesn't support firefox? add to readme? |
| 20:17 | ibdknox | scottj: hm? "Works best in Chrome. It runs in FF, but the mouse events don't work" |
| 20:18 | ungamedplayer | for example, i was thinking something like expect wrapping stdin/stdout |
| 20:18 | scottj | ibdknox: my bad, I searched for firefox |
| 20:55 | hiredman | ls |
| 20:55 | hiredman | pardon me |
| 20:56 | chewbranca | src clojure pizza |
| 21:52 | qbg | Any one have experience getting Overtone setup? |
| 21:54 | tomoj | I got it set up once, though not in a while, and couldn't help until later tonight |
| 21:55 | tomoj | but note there are a few lurkers in #overtone, someone may be paying attention there |
| 21:58 | qbg | Looks like I might need the jack_lsp installed (I'm on linux) |
| 21:58 | qbg | Lets see if that works |
| 22:34 | simard | how can I update counterclockwise's clojure.jar/clojure-src.jar ? it seems it's still using 1.2.0 and clojure contrib |
| 22:37 | ungamedplayer | http://www.4clojure.com/problem/3 <-- can someone tell me if that test is broken, I really expected it to be "HELLO WORLD" |
| 22:38 | emezeske | ungamedplayer: I think it might be giving you a hint ^_^ |
| 22:39 | emezeske | ungamedplayer: To answer your question, though, it doesn't seem broken to me. |
| 22:39 | ungamedplayer | ok. |
| 22:40 | ungamedplayer | emezeske, test something for me.. does (= (.toUpperCase "hello world") (.toUpperCase "hello world")) work for you ? |
| 22:41 | ungamedplayer | i tried the obvious, (= "HELLO WORLD" (.toUpperCase "hello world")) |
| 22:41 | ungamedplayer | and it doesn't work. |
| 22:41 | ungamedplayer | You failed the unit tests |
| 22:42 | emezeske | Well that seems a bit odd. Both of those work for me. |
| 22:42 | ungamedplayer | ok, so i'm not an idiot. |
| 22:42 | emezeske | Are you maybe using a non-english language browser? |
| 22:43 | ungamedplayer | not that i know of. |
| 22:43 | emezeske | Seems like a bug! Maybe tell team@4clojure.com ? |
| 22:44 | ungamedplayer | Firefox 10.0.1 , character encoding ISO-8859-1 |
| 22:44 | ungamedplayer | yeah, i might. |
| 22:45 | emezeske | For someone that doesn't know to login to IRC and ask questions, that could be pretty bogus :) |
| 22:46 | ungamedplayer | a little frustrating for those that do know too. |
| 22:47 | emezeske | Aye! |
| 22:49 | ungamedplayer | failing on both chrome and firefox. |
| 22:50 | gtrak` | ungamedplayer, I think 4clojure uses a similar backend to tryclojure, why not try it there? |
| 22:50 | ungamedplayer | ok |
| 22:50 | ungamedplayer | works, returns true |
| 22:55 | amalloy | ungamedplayer: you're supposed to fill in the blank, not rewrite the entire expression |
| 23:06 | tmciver | amalloy: are you still the lead for clojure.data.xml? I haven't used it yet but I'm wondering if there is any way to do css-style selectors. |
| 23:07 | amalloy | i was never the lead. chouser started the project, and ryan senior seems to be the one keeping it moving at the moment |
| 23:08 | tmciver | Hmm, http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go seems to indicate that you are, or maybe it means you're the lead on the old contrib lib? |
| 23:09 | amalloy | no, i was just the first one to make an effort like ryan is doing now. but who cares what that says, i'm not :P |
| 23:40 | gf3 | hello all, (still) having an issue catching exceptions from clojail |
| 23:40 | gf3 | check this out → http://cloud.gf3.ca/EcqD |
| 23:40 | gf3 | any idea? |
| 23:41 | gf3 | whoops, typ |
| 23:41 | gf3 | +o |
| 23:46 | jodaro | huh |
| 23:46 | jodaro | i guess i haven't been paying attention to scala land lately |
| 23:46 | jodaro | sbt is out |
| 23:46 | jodaro | buildr is in |
| 23:46 | jodaro | http://buildr.apache.org/ |
| 23:50 | devn | emezeske: thanks for paredit.vim -- im giving vim a try as a clojure editor for a bit |
| 23:51 | devn | i think i killed the GSoC thread |
| 23:51 | emezeske | devn: Ah, yeah, you should thank Tamas Kovacs though :) |
| 23:52 | devn | emezeske: i would if he were here! |
| 23:52 | emezeske | ^_^ |
| 23:52 | devn | emezeske: anyway, i once did half the job of extracting paredit.vim from slimv |
| 23:52 | devn | but you did it, packaged it up all nicely |
| 23:53 | emezeske | true. |
| 23:54 | devn | man, im going a little crazy though, so used to emacs for clojure development |
| 23:54 | devn | M-) automatic |
| 23:54 | devn | must learn to ,> |
| 23:54 | jodaro | wait, you are leaving emacs for vim? |
| 23:54 | devn | Ommmmm |
| 23:55 | devn | jodaro: i use both at work |
| 23:55 | Raynes | emezeske: I talked to the author of slimv. He wants to separate paredit.vim out soon. |
| 23:55 | devn | jodaro: i run a meetup group and want to help others with vim, and besides, i like vim for lots of things, i like emacs for lots of things as well, id like to know how to do what i do in both |
| 23:55 | emezeske | Raynes: Awesome. I won't have to live in perpetual fear of my branch being behind :) |
| 23:55 | jodaro | devn: sounds reasonable |
| 23:56 | Raynes | ... |
| 23:56 | devn | Godspeed emezeske |
| 23:56 | Raynes | Does everybody I know how to play Starcraft? Seriously, guys. |
| 23:56 | Raynes | have* |
| 23:56 | jodaro | Raynes: parse error |
| 23:56 | devn | I did for a bit, but no longer |
| 23:56 | Raynes | jodaro: Shhh. |
| 23:56 | ibdknox | I got bored with it |
| 23:56 | jodaro | ive never played it |
| 23:57 | jodaro | for what its worth |
| 23:57 | Raynes | ibdknox: Apparently the biggest perk of me going to California is that I get to play it with amalloy and lancepantz. Bah humbug. |
| 23:57 | jodaro | Raynes: are you coming out for clojure west |
| 23:58 | Raynes | jodaro: No. I'm coming out in April to visit Geni. |
| 23:58 | Raynes | And LA. |
| 23:58 | amalloy | emezeske: what league/server? might be fun to play with some clojure users |
| 23:59 | devn | how do i eval a line in vimclojure? |
| 23:59 | amalloy | so never, then, arohner1? |