2014-02-07
| 00:27 | jph- | arrdem, there's a clj-btc which can be used to talk to bitcoind, dogecoind, etc |
| 00:27 | arrdem | jph-: yeah I saw that floating around a few days ago. didn't know that it was just a daemon wrapper. |
| 00:28 | jph- | arrdem, yep its just for the jsonrpc protocol |
| 00:28 | jph- | does the job |
| 00:28 | jph- | means your app doesn't have to talk to the network/blockchain direct |
| 00:28 | arrdem | for some definition of "does" sure. |
| 00:28 | arrdem | <offtopic> BTC under $800 WTF </offtopic> |
| 00:28 | jph- | yep |
| 00:29 | jph- | so you're thinking of something that can talk to -coin network directly |
| 00:30 | quizdr | arrdem i'd buy btc at $100 US but nothing higher :) |
| 00:33 | arrdem | jph-: yeah I was thinking about going after this for a while |
| 00:33 | arrdem | http://www.reddit.com/r/dogecoin/comments/1upa5y/bounty_15_million_doge_for_the_first_person_to/ |
| 00:33 | arrdem | 1.5MDoge is pretty reasonable for the dev time involved... |
| 00:34 | arrdem | the issue is the ongoing cost of running such a thing |
| 00:34 | jph- | nice |
| 00:34 | arrdem | didn't come up with a good wat to monetize it, didn't bother :c |
| 00:34 | jph- | arrdem, yeh im working on a web-based wallet for doge, but just using dogecoind as backend |
| 00:34 | jph- | i'd far prefer a lighter-weight dogecoind |
| 00:35 | jph- | seems like only bitcoin has good alternatives to bitcoind |
| 00:35 | arrdem | which really isn't surprising given the distribution of value and traffic among altcoins |
| 00:36 | arrdem | most of them are entirely graveyards or ponzi schemes. |
| 00:36 | arrdem | see the altcoin "create, premine, publicize, dump" cycle... |
| 00:36 | jph- | yep |
| 00:44 | dissipate | arrdem, i'm going to launch ClojureCoin |
| 00:46 | arrdem | dissipate: why.... we already have the only memecoin that'll matter.... |
| 00:47 | dissipate | arrdem, which is? |
| 00:47 | arrdem | dissipate: doogecoin |
| 00:47 | dissipate | arrdem, you mean dogecoin? |
| 00:47 | quizdr | ,(attractive-price? (bitcoin? $US1)) |
| 00:47 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: attractive-price? in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 00:47 | quizdr | ah indeed, we need clojurecoin to fill the gap |
| 00:48 | arrdem | see... the issue with all the coins is one of adoption. BTC made it big in no small part because of the construction of the Silk Road and successors. |
| 00:49 | arrdem | Dogecoin is the only other coin which has anywhere near as much use, thanks to the tipping culture which has grown on reddit and twitter |
| 00:49 | TEttinger | go online crime! woo |
| 00:49 | arrdem | TEttinger: hence why I'm not operating an exchange T_T |
| 00:50 | quizdr | i have read that bitcoin introduced encryption technology that will change the world, even if that currency fails |
| 00:50 | arrdem | yeah wherever bitcoin goes, the blockchain model is really really interesting and has a lot of value. |
| 00:51 | dsrx | so were these people with bitcoin apps on their phones really storing a 14+GB file on them? |
| 00:51 | arrdem | oooh yeah |
| 00:52 | dsrx | dang |
| 00:52 | arrdem | hence the rise of "light" web clients. |
| 00:52 | TEttinger | brb making Silk Doge. such drugs. very porn. wow. |
| 00:52 | dissipate | dsrx, nope. the mobile bitcoin wallets use light versions of the blockchain download. |
| 00:52 | TEttinger | I was trying to think of what else could be illegally traded on silk road |
| 00:53 | TEttinger | I guess credit cards? |
| 00:53 | arrdem | TEttinger: radio jammers and high power radios were another item... |
| 00:53 | arrdem | TEttinger: credit cards... fake IDs... real IDs... |
| 00:53 | quizdr | hey guys anyone with good Javascript experience comment if a lot of lisp techniques (aside from macros) are idiomatic in JS? Having functions as a first-class function seems to make JS very lisp-like in some ways. |
| 00:53 | arrdem | TEttinger: controlled printers... |
| 00:53 | dissipate | dsrx, in fact, the only major bitcoin wallet that downloads the whole blockchain is the 'official' satoshi client |
| 00:53 | TEttinger | arrdem how... do you know this... |
| 00:54 | dissipate | quizdr, javascript came from scheme |
| 00:54 | quizdr | arrdem i didn't know they let you guys still have internet access in the joint |
| 00:54 | arrdem | TEttinger: my introduction to CS was computer security. you meet interesting people at defcon, who get more interesting as they get drunk... |
| 00:55 | quizdr | dissipate i'm wondering if it is worth trying to refactor some lisp code into javascript or if that is a waste of time? |
| 00:55 | arrdem | TEttinger: man that's harsh... I'm usually pretty judicious with all this crazy :P |
| 00:55 | TEttinger | but why the radio jammers? |
| 00:55 | TEttinger | haha |
| 00:55 | dsrx | what flavor of lisp quizdr? |
| 00:55 | quizdr | either clojure or common lisp code |
| 00:55 | arrdem | TEttinger: they aren't FCC legal even to build let alone sell. |
| 00:55 | TEttinger | you're quite acceptable. such accept. wow. |
| 00:56 | dissipate | quizdr, clojurescript |
| 00:56 | arrdem | TEttinger: think about all the "interesting" things you could do if you could shut down all radio based tech in a 100yrd sphere. |
| 00:56 | quizdr | dissipate ah that's an idea. and it compiles down into "normal" javascript that could run in any javascript engine, like V8? |
| 00:56 | TEttinger | like police and security radios... ah. |
| 00:57 | arrdem | TEttinger: ooh yeah. let the antisocial fun begin... |
| 00:57 | TEttinger | that could be very dangerous, I can see why silk road would trade in it |
| 00:57 | dissipate | quizdr, yep! |
| 00:57 | arrdem | PSA: while I'm aware of all this crazy stuff I'm very much a white hat when it comes to security and the dark side of things |
| 00:58 | quizdr | dissipate interesting; I wonder if there is any reason to *not* write directly in JS and just use CLJS instead? are there things raw JS can do that CLJS cannot? |
| 00:58 | TEttinger | I'm a no hat, so no worries |
| 00:58 | TEttinger | alternately, silly hat |
| 00:58 | dissipate | quizdr, clojurescript is a better language. that's the main reason. |
| 00:59 | dissipate | quizdr, it has interop with javascript |
| 00:59 | quizdr | dissipate i mean are there anything in JS that CLJS cannot do? |
| 00:59 | arrdem | quizdr: no. cljs can refer to arbitrary js functions as though they were cljs fns and use them accordingly. |
| 01:00 | arrdem | quizdr: so if you want to use raw js code or raw js insanity you can. |
| 01:00 | dissipate | quizdr, nope. it has interop, so you can call JS functions from clojurescript. |
| 01:00 | quizdr | what type of compiler do you use to get from CLJS to JS for purpose of embedding in a webpage or other code that requires JS? |
| 01:01 | dissipate | quizdr, the cljs compiler |
| 01:01 | quizdr | I find it a bit odd that the OReilly book on CLJS is only a hundred pages. I love OReilly books but they are usually quite dense and comprehensive. |
| 01:02 | dsrx | a hundred page book might be very dense indeed |
| 01:02 | rplaca | quizdr: that book is a quick start for folks who already know CLojure |
| 01:02 | quizdr | ah ok |
| 01:02 | quizdr | i wonder how it speaks to those who don't already know JS quite well? |
| 01:04 | rplaca | I read it when Stuart wrote it, but I remember it mostly being about logistical and setup issues (i.e., how does all the tooling work? how do you get a repl connected? etc.) |
| 01:04 | rplaca | but I may remember that because that was the part I needed to know at that point :) |
| 01:04 | quizdr | rplaca is it fairly straightforward for a cljs compiler to co-exist in emacs with the clojure compiler? |
| 01:05 | arrdem | quizdr: yes, cljs and clj don't really get in each-others way. |
| 01:06 | quizdr | so the compiler will just spit out a file of javascript code? that's pretty neat. |
| 01:06 | rplaca | quizdr: sure, you just use leiningen for both, really |
| 01:06 | rplaca | (at least I do) |
| 01:09 | quizdr | is there a REPL in cljs? not sure how that would work. |
| 01:09 | arrdem | quizdr: not really for exacly the reasons you're thinking of. |
| 01:10 | quizdr | right |
| 01:11 | arrdem | quizdr: IMO this is entirely an issue of cljs not being self-hosting and could be remedied... but that's a long way off. |
| 01:11 | arrdem | quizdr: in the meantime there are tools that let you recompile your code and reload it in a sem-live browser. |
| 01:14 | quizdr | Since you can now use Qt to design desktop and mobile apps in Javascript, I am tempted to start using cljs to build these desktop apps instead. |
| 01:20 | arrdem | that's not far off of what Light Table does... |
| 01:21 | quizdr | what GUI kit is light table using? |
| 01:22 | arrdem | it isn't. it's HTML in a stripped down web browser. |
| 01:22 | arrdem | AFAIK |
| 01:22 | quizdr | i see. it looks great. |
| 01:23 | Raynes | quizdr: quizdr https://github.com/rogerwang/node-webkit |
| 01:23 | Raynes | much quizdr; wow |
| 01:25 | quizdr | nice |
| 01:26 | quizdr | anyone have good experience mixing cljs with jquery? |
| 01:26 | arrdem | $google github clojurescript jquery |
| 01:26 | lazybot | [ibdknox/jayq · GitHub] https://github.com/ibdknox/jayq |
| 01:27 | quizdr | wow fascinating! |
| 01:30 | Raynes | Quick, someone show him the moving pictures! :P |
| 01:30 | clojurebot | Titim gan éirí ort. |
| 01:30 | Raynes | quizdr: But yeah, from what I've heard, Chris Granger has been very satisfied with node-webkit. |
| 01:32 | quizdr | did someone say something about a MOVIE ?! |
| 01:32 | Raynes | Hehe |
| 01:33 | quizdr | it has been somewhat of a paradigm shift that such a major UI framework like Qt is now handled mostly by Javascript underneath, and I think it is similarly life-changing if I use clojurescript to work in that environment. |
| 01:35 | arrdem | Raynes: http://i.imgur.com/zrdvT.jpg |
| 01:38 | deadghost | https://github.com/magomimmo/modern-cljs |
| 01:38 | deadghost | anyone done these? |
| 01:38 | deadghost | just want to get an estimate of how long it'll take to run through |
| 01:40 | quizdr | who authored clojurescript initially? how did it come about, and when? |
| 01:40 | noonian | rich hickey i think |
| 01:41 | Raynes | Various folks at Relevance. |
| 01:41 | quizdr | interesting indeed. i'm going to read up on it. i was just reading how to manually code up implementations of partial and reduce in JS, I'd guess under the hood clojurescript is doing all taht |
| 01:41 | Raynes | You can look at the early commit logs to see who all worked on it. |
| 01:48 | quizdr | i'm looking at a commit where fogus added partial to clojurescript. the implmenentation in cljs is the same as the source from a clojure repl. i quite understand why that kind of thing would need reinvention. |
| 01:48 | quizdr | i mean, i *don't quite understand... |
| 01:51 | quizdr | unless cljs is not directly connected to clojure at all, then that would make sense. an entirely separate implementation of the same clojure api functions |
| 01:53 | arrdem | quizdr: at the moment clojurescript and clojure's compiler backends are entirely disjoint |
| 01:53 | arrdem | quizdr: hence the need for such duplication |
| 01:53 | quizdr | ah, here we go: https://github.com/clojure/clojurescript/commit/c535d501108ba24f62395f416b498975969af785 |
| 01:53 | quizdr | the actual println implemention of fn that leads to js function() |
| 01:54 | quizdr | i have to admit i'm more than a little blown away at what has been achieved here. |
| 01:55 | arrdem | shrug. as with most language implementations there's little truly "new" and a lot of reinvention, which is interesting in its own right. |
| 01:57 | quizdr | i know but the scope and concept of the project are quite vast and innovative, I think. really very intriguing. |
| 02:00 | quizdr | i'm confused where Google Closure comes into play. It seems one thing for the cljs compiler to output js. that should be enough on its own. What does Google Closure add to the mix? |
| 02:01 | arrdem | $google google closure compiler about |
| 02:01 | lazybot | [Closure Compiler - Google Developers] https://developers.google.com/closure/compiler/ |
| 02:01 | arrdem | quizdr: there's a trend here. here's a hit. google first. |
| 02:02 | quizdr | what I meant was, wouldn't the implementation of clojurescript already have ideal js behind it? |
| 02:03 | arrdem | ... what? no. why bother duplicating the effort of google closure and write a custom optimizer for the JS emitter when one could simply emit naive code and rely on gclosure to clean up the mess. |
| 02:04 | quizdr | i see. i just found this interesting discussion: https://groups.google.com/forum/#!topic/clojure/WwocFhk45us |
| 02:09 | arrdem | this thread makes me want to get beer, get irrisponsably drunk and generally mock the OP. |
| 02:09 | Raynes | arrdem: In. |
| 02:09 | quizdr | ha ha |
| 02:10 | quizdr | it is rather insightful for a newbie to read the responses however |
| 02:10 | arrdem | Raynes: dogecoin is $1.18/KDoge. how much is beer for you? I'm buying. |
| 02:10 | Raynes | lol |
| 02:11 | arrdem | https://groups.google.com/d/msg/clojure/WwocFhk45us/1wPj3kuKyIMJ |
| 02:11 | Raynes | arrdem: Can you wait 361 days? |
| 02:11 | arrdem | clojurebot: rhickey is I'll make sure you get a refund then |
| 02:12 | arrdem | Raynes: oh. right. I'm not the youngest person here. |
| 02:12 | arrdem | Raynes: happy belated birthday tho |
| 02:12 | Raynes | Well, I can get booze. You just can't buy it for me. |
| 02:12 | Raynes | Aw thanks <3 |
| 02:13 | arrdem | (context) https://groups.google.com/d/msg/clojure/WwocFhk45us/1wPj3kuKyIMJ |
| 02:15 | arrdem | https://groups.google.com/d/msg/clojure/WwocFhk45us/svpal4UEXcEJ STFU show me code hahaha |
| 02:16 | quizdr | looks like rich owned him in that thread |
| 02:16 | Raynes | No. No no no. |
| 02:17 | Raynes | Rich *pwn'd* him. |
| 02:17 | Raynes | Specifically. Has to have the p. |
| 02:17 | Raynes | There was some burn ward level stuff going on that thread. |
| 02:18 | arrdem | http://i.imgur.com/opvEg.gif |
| 02:18 | quizdr | well, i don't know what pwnd means, so i'd say... yo son that dude got OWNED! |
| 02:19 | Raynes | quizdr: http://knowyourmeme.com/memes/owned-pwned |
| 02:21 | quizdr | man i must be the oldest guy in the room, maybe |
| 02:22 | fredyr | quizdr: how old is that |
| 02:22 | quizdr | 30s |
| 02:23 | fredyr | well maybe you're not then |
| 02:23 | Raynes | Goodness grandpa! |
| 02:23 | fredyr | :S |
| 02:23 | quizdr | i feel like it often! |
| 02:23 | quizdr | i wonder what the average age in here is. i'd guess upper 20s? |
| 02:24 | Raynes | Don't worry guys, I'll only be young and classically handsome for another two decades or so. |
| 02:24 | fredyr | raynes is the one bringing down the average |
| 02:24 | fredyr | everybody else is over 30 |
| 02:24 | fredyr | :p |
| 02:25 | Raynes | I don't think that's how averages work :P |
| 02:25 | fredyr | orly? |
| 02:25 | quizdr | ha ha, well we could always throw out the hi and low extremes |
| 02:26 | arrdem | ,(swap! age-atom #(+ %1 21)) |
| 02:26 | clojurebot | 21 |
| 02:27 | arrdem | evidently it isn't. |
| 02:27 | fredyr | quizdr: did you mask your age by saying you're in your thirties? |
| 02:27 | fredyr | quizdr: aka 39 |
| 02:27 | quizdr | i could be 39. i might also be 30. |
| 02:27 | quizdr | ha ha ha.... (evil laugh) |
| 02:27 | Raynes | Could be a vampire. |
| 02:28 | Raynes | You think you know someone. |
| 02:28 | arrdem | ,(reset! age-atom {:ages 21 :agec 1}) |
| 02:28 | clojurebot | {:agec 1, :ages 21} |
| 02:28 | quizdr | you know who looks really young for his age, the author of this fine language. must be his intellectual vigor keeping him fresh. i'm a true believer of that. |
| 02:28 | arrdem | ,(defn age-avg [] (let [{:keys [agec ages]} @age-atom] (/ ages agec))) |
| 02:28 | clojurebot | #'sandbox/age-avg |
| 02:28 | fredyr | or the hammock |
| 02:29 | quizdr | true dat |
| 02:30 | arrdem | ,(defn age+ [age] (swap! age-atom #(-> %1 (update-in [:agec] inc) (update-in [:ages] + age)))) |
| 02:30 | clojurebot | #'sandbox/age+ |
| 02:30 | arrdem | ,(age+ 21) |
| 02:30 | clojurebot | {:agec 2, :ages 42} |
| 02:30 | arrdem | ,(age-avg) |
| 02:30 | clojurebot | 21 |
| 02:32 | fredyr | ,(age+ 36) |
| 02:32 | clojurebot | {:agec 3, :ages 78} |
| 02:33 | fredyr | :-/ |
| 02:34 | quizdr | fredyr nice age, i dig it. |
| 02:34 | quizdr | ,(age+ 36) |
| 02:34 | clojurebot | {:agec 4, :ages 114} |
| 02:34 | fredyr | :) |
| 02:34 | arrdem | yall can /msg the bot... no need to let me add your ages to my growing database of nicks, real names, GH profiles and IPs... |
| 02:35 | edbond | ,(age+ 31) |
| 02:35 | clojurebot | {:agec 5, :ages 145} |
| 02:35 | edbond | ,(age-avg) |
| 02:35 | clojurebot | 29 |
| 02:35 | quizdr | are we all a bunch of geeks or what. "what did you do on irc today? oh, watched this guy code up an average age algorithm using the bot's mutable structures, then we all called it with our ages" |
| 02:35 | arrdem | Raynes: below average w000 |
| 02:35 | Ember- | ,(age+ 32) |
| 02:35 | clojurebot | {:agec 6, :ages 177} |
| 02:36 | arrdem | quizdr: the swee thing is that it "just worked" on my fist cut.. live coding ftw. |
| 02:36 | quizdr | (inc arrdem) |
| 02:36 | lazybot | ⇒ 17 |
| 02:36 | edbond | (inc arrdem) |
| 02:36 | lazybot | ⇒ 18 |
| 02:37 | arrdem | holy crap it's only 1:29 and I've alreay gotten two karma... if this trend continues I'll outdo technomancy by day's end! :P |
| 02:37 | quizdr | "sweety, did anything else happen on irc than just that?" -- "oh, yeah. the guy who masterminded it called for praise, and we all obliged most willingly." |
| 02:37 | Ember- | (inc arrdem) |
| 02:37 | lazybot | ⇒ 19 |
| 02:37 | Ember- | you deserve it, simple and elegant solution to a pressing problem: the average age of ppl on this channel :) |
| 02:38 | quizdr | what's fascinating is that it is immune to voter fraud in every way. |
| 02:38 | arrdem | quizdr: not at all... negative ages... someone reset!ing the counter... |
| 02:38 | Ember- | I said simple and elegant, not foolproof :P |
| 02:38 | arrdem | Ember-: sure, but quizdr said it was nigh perfect :P |
| 02:39 | Ember- | hehe |
| 02:39 | quizdr | the most obviousl form of voter fraud is just voting more than once, of course. |
| 02:41 | arrdem | (let [better-age-atom (atom @age-atom)](defn age-avg [] (let [{:keys [agec ages]} @better-age-atom] (/ ages agec)))(defn age+ [age](if (and (< 0 age) (> 120 age))(swap! better-age-atom #(-> %1 (update-in [:agec] inc)(update-in [:ages] + age)))))) |
| 02:41 | arrdem | damnit. forgot the , |
| 02:41 | arrdem | ,(let [better-age-atom (atom @age-atom)](defn age-avg [] (let [{:keys [agec ages]} @better-age-atom] (/ ages agec)))(defn age+ [age](if (and (< 0 age) (> 120 age))(swap! better-age-atom #(-> %1 (update-in [:agec] inc)(update-in [:ages] + age)))))) |
| 02:41 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: age-atom in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 02:41 | arrdem | ,@age-atom |
| 02:41 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: age-atom in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 02:42 | arrdem | ,(age-avg) |
| 02:42 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: age-avg in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 02:42 | arrdem | yep. sandbox ticked. |
| 02:42 | quizdr | ,(dec arrdem) |
| 02:42 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: arrdem in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 02:42 | arrdem | forgot about that. |
| 02:42 | quizdr | lol |
| 02:44 | Raynes | arrdem: You know github obfuscates email addresses. |
| 02:44 | piranha | dnolen: maybe I should make this an email, but didn't catch you yesterday - so do you have any ideas in mind about making something a-la join? :) There is no way right now to get a cursor of more than one key... Or maybe I should just write a cursor implementation myself (so that I could have select-keys working, or something like that)? |
| 02:45 | arrdem | Raynes: cute... but I see no reason why someone couldn't defeat it if they cared enough... |
| 02:46 | Raynes | You could use githubthrowaway@arrdem.com |
| 02:47 | arrdem | Raynes: I said cute. I didn't say that I cared :P |
| 02:51 | ddellacosta | piranha: you realize that it is 3:00 am in NYC? |
| 02:51 | piranha | ddellacosta: haha, not really :) |
| 02:51 | piranha | ddellacosta: OTOH David's been active on GitHub just now |
| 02:51 | ddellacosta | piranha: problem why he wouldn't respond is all. ;-) |
| 02:51 | ddellacosta | piranha: oh, well, I take it back then... |
| 02:53 | quizdr | if serializing some data structures to a file for easy reading back in, would you use spit in combo with something like print-str? like (spit "file.txt" (print-str some-var)) ? |
| 02:53 | ivan | that's the backup dnolen who doesn't IRC |
| 02:54 | ivan | ,(print-str {"hello" "world"}) ; quizdr |
| 02:54 | clojurebot | "{hello world}" |
| 02:55 | ivan | ,(pr-str {"hello" "world"}) |
| 02:55 | clojurebot | "{\"hello\" \"world\"}" |
| 02:55 | arrdem | quizdr: clojure.tools.reader. use it. |
| 02:56 | quizdr | ah, so pr-str is the best way. |
| 02:57 | quizdr | arrdem why isn't clojure.tools.reader listed on this page of namespace: http://clojure.github.io/clojure/ |
| 02:57 | arrdem | quizdr: because it isn't part of the core, it's a library. |
| 02:57 | arrdem | quizdr: this is what you really want. http://clojure.github.io/clojure/clojure.edn-api.html |
| 02:58 | arrdem | are you serious. edn doesn't have a writer. |
| 02:58 | arrdem | quizdr: pr-str is apparently your tool.. |
| 02:58 | quizdr | right, so if i'm spitting it's pr-str. if i was to bind *out* to a file instead, i could just use pr itself, right? |
| 02:59 | arrdem | no.... |
| 02:59 | arrdem | ,(class (pr-str {:my {:complicated :datsastructure}})) |
| 02:59 | clojurebot | java.lang.String |
| 02:59 | arrdem | you want to to (spit "filename.edn" (pr-str {})) |
| 03:00 | quizdr | I'm saying pr vs pr-str ; the former if i write to the file by rebinding *out*, the latter if I don't and just spit. |
| 03:00 | ivan | quizdr: bind *out* to a writer |
| 03:00 | dissipate | arrdem, why is edn a subset of clojure data? |
| 03:00 | ivan | quizdr: then yes |
| 03:00 | seangone | are we still computing average ages? |
| 03:01 | arrdem | seangone: no the bot's sandbox gc'd and killed my atom |
| 03:01 | arrdem | s/gc'd/cycled/ |
| 03:01 | rplaca | seangone: you and I should drive that average up :) |
| 03:01 | seangone | too bad... I was going to ,(age+ 51) :) |
| 03:01 | arrdem | I mean... I' |
| 03:01 | seangone | nearly 52 :) |
| 03:02 | arrdem | ,(let [better-age-atom (atom {:agec 0 :ages 0})](defn age-avg [] (let [{:keys |
| 03:02 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 03:02 | arrdem | [agec ages]} @better-age-atom] (/ ages agec)))(defn age+ [age](if |
| 03:02 | arrdem | (and (< 0 age) (> 120 age))(swap! better-age-atom #(-> %1 (update-in |
| 03:02 | arrdem | [:agec] inc)(update-in [:ages] + age)))))) |
| 03:02 | rplaca | seangone: maybe by the time you get to be my age, you'll understand Clojure :) |
| 03:02 | arrdem | fak |
| 03:03 | seangone | lol |
| 03:03 | arrdem | ,(let [better-age-atom (atom {:agec 0 :ages 0})](defn age-avg [] (let [{:keys [agec ages]} @better-age-atom] (/ ages agec)))(defn age+ [age](if (and (< 0 age) (> 120 age))(swap! better-age-atom #(-> %1 (update-in [:agec] inc)(update-in [:ages] + age)))))) |
| 03:03 | clojurebot | #'sandbox/age+ |
| 03:03 | arrdem | open season. |
| 03:03 | arrdem | ,(age+ 21) |
| 03:03 | clojurebot | {:agec 1, :ages 21} |
| 03:03 | arrdem | ,(age-avg) |
| 03:03 | clojurebot | 21 |
| 03:03 | seangone | ,(age+ 51) |
| 03:03 | clojurebot | {:agec 2, :ages 72} |
| 03:04 | seangone | :) |
| 03:04 | quizdr | ,(age+ 36) |
| 03:04 | clojurebot | {:agec 3, :ages 108} |
| 03:04 | seangone | c'mon rplaca ! |
| 03:04 | quizdr | i think i can recall at least 3 others that were previously entered |
| 03:04 | arrdem | ivan: oi. vote. |
| 03:05 | rplaca | I anonymized it, so you'll have to figure it out :) |
| 03:05 | arrdem | haha |
| 03:05 | arrdem | ,(age-avg) |
| 03:05 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: age-avg in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 03:05 | arrdem | (dec clojurebot) |
| 03:05 | lazybot | ⇒ 31 |
| 03:05 | arrdem | stupid sandbox... |
| 03:05 | quizdr | it's a solid effort anyway. |
| 03:06 | rplaca | I guess my true age was lost to the sandbox :) |
| 03:06 | arrdem | I've done all I can do short of kick off a sandboxed nrepl instance or write a webapp... |
| 03:06 | dissipate | can someone explain why edn is only a subset of clojure data? |
| 03:07 | arrdem | dissipate: which specific structures are you pointing to which aren't represented/ |
| 03:07 | arrdem | dissipate: records? |
| 03:07 | rplaca | dissipate: one reason is that it's meant to work cross-language |
| 03:08 | dissipate | arrdem, i don't know, i was just reading this: Reads data in the edn format (subset of Clojure data): |
| 03:08 | dissipate | arrdem, from the 'read' function |
| 03:08 | arrdem | dissipate: the reason is that some things which we would _want_ to serialize to EDN don't make sense in other languages. |
| 03:08 | arrdem | dissipate: for instance the clojure reader supports fn literals |
| 03:09 | arrdem | dissipate: which makes no sense if you're reading from Python, Java or god forbid PHP |
| 03:09 | dissipate | arrdem, i thought it was easy to serialize everything in clojure because everything is a value? |
| 03:09 | quizdr | you could serialize a function you've already written that is now bytecode, you mean? or you mean the reader can read in a function defn |
| 03:09 | dissipate | arrdem, everything in clojure is an s-expression |
| 03:09 | arrdem | quizdr: I mean that the reader can "read" a #() form, generate the implicit IFn and go from there |
| 03:09 | dissipate | arrdem, all you need to do is build a reader in another language that translates clojure s-expressions |
| 03:09 | arrdem | ,(pr-str println) |
| 03:09 | clojurebot | "#<core$println clojure.core$println@153c9c7>" |
| 03:10 | ssafejava | clojurebot: botsnack |
| 03:10 | arrdem | dissipate: ... as shown above we don't pr-str to source |
| 03:10 | clojurebot | Thanks! Can I have chocolate next time |
| 03:10 | arrdem | dissipate: besides much of the source (see core) doesn't make sense to pr-str |
| 03:10 | quizdr | obviously if you serialzed that to a file, it would not be useful when read back in unless it already was defined and compiled, right? |
| 03:10 | arrdem | quizdr: bingo |
| 03:10 | arrdem | so serializing fns and object instances is only _rarely_ sane. |
| 03:10 | dissipate | arrdem, everything except the actual built-ins are s-expressions, no? |
| 03:11 | arrdem | dissipate: eh... only until they hit the reader |
| 03:11 | arrdem | ,(pr-str (fn [x] (inc x))) |
| 03:11 | clojurebot | "#<sandbox$eval72$fn__73 sandbox$eval72$fn__73@dd7404>" |
| 03:11 | arrdem | ,(source (fn [x] (inc x))) |
| 03:11 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol> |
| 03:11 | arrdem | ah crap. |
| 03:11 | dissipate | arrdem, so it's all a big lie. clojure has problems serializing just like any other language. |
| 03:12 | arrdem | ,(defn demo [x] (inc x)) |
| 03:12 | clojurebot | #'sandbox/demo |
| 03:12 | arrdem | ,(pr-str (source demo)) |
| 03:12 | clojurebot | Source not found\n"nil" |
| 03:12 | arrdem | lolz |
| 03:12 | arrdem | dissipate: sorta kinda |
| 03:12 | arrdem | dissipate: edn is a sane subset of standard datastructures which would be sane in other languages as well |
| 03:13 | arrdem | dissipate: maps, vecs, sets, UUIDs, dates... numbers... the things you should be sending |
| 03:13 | dissipate | arrdem, and what is the 'native' function for serializing s-expressions? |
| 03:13 | arrdem | *sending |
| 03:13 | arrdem | dissipate: sexprs don't really exist in Clojure at all beyond the reader. |
| 03:13 | dissipate | arrdem, if i want to store arbitrary clojure to a flat file, then what? |
| 03:13 | arrdem | dissipate: you're pretty much hosed. |
| 03:13 | cark | what would be a good workflow when evolving a lib at the same time as the application that uses it ? can't be storing in local repository and restarting lein ... so what do you guys do ? |
| 03:14 | arrdem | dissipate: such a thing doesn't really make sense... that said I did write a library which does this :P |
| 03:14 | arrdem | $googe arrdem sad github |
| 03:14 | cark | i tried symlonks, but git goes through these, could .gitignore but that seems cumbersome |
| 03:14 | arrdem | $google arrdem sad github |
| 03:14 | lazybot | [arrdem/sad · GitHub] https://github.com/arrdem/sad |
| 03:14 | ivan | edn is a plot to get HAMT maps and sets into other languages |
| 03:15 | dissipate | arrdem, did you watch stuart holloway's video on clojure where he called out other languages for bad serialization techniques? |
| 03:15 | arrdem | cark: keep both somewhat seperated in the same dir tree? |
| 03:15 | arrdem | cark: src/myfoo/lib/ and src/myfoo/app/ |
| 03:15 | arrdem | dissipate: can't say I have |
| 03:16 | cark | arrdem: right, but then i have a single project with both ? That's actually what i've been doing all these years |
| 03:16 | arrdem | cark: you could totally use soft symlinks to get the same effect... |
| 03:16 | arrdem | cark: but yeah I don't know of a really better solution TBH. |
| 03:17 | arrdem | srreh. |
| 03:17 | cark | that's what i tried this time...and i'm not really fond of that either |
| 03:17 | cark | i thought maybe someone had a great workflow =) |
| 03:18 | quizdr | I'm doing this: (use '[clojure.java.shell :only [sh]]) and I can then do (sh "ls") and it works, but that is all I can do. I can't even do this: (sh "echo $PATH") anyone have an idea? |
| 03:18 | quizdr | it just says no such file or directory |
| 03:19 | rplaca | quizdr: sh really isn't spawning a shell, iirc, it's just execing the process |
| 03:19 | dissipate | arrdem, damn, now i can't find the video. :( |
| 03:19 | rplaca | so: no variable expansion |
| 03:20 | quizdr | rplaca oh ok |
| 03:23 | rplaca | btw, if you're doing command spawning, I find that https://github.com/TheClimateCorporation/java.shell2 is a better choice |
| 03:25 | quizdr | rplaca interesting |
| 03:42 | jph- | rplaca, nice, bookmarked |
| 03:43 | clgv | there is also "conch" |
| 03:48 | muhoo | cark: try using checkouts. c.f. leinimgen docs |
| 03:49 | muhoo | gack leiningen docs (tablet keyboard. such suck. wow.) |
| 03:50 | clgv | for building projects using leiningen checkouts there is lein-checkouts btw ;) |
| 03:56 | cark | muhoo: i'll investigate that |
| 03:59 | borkdude | is anyone using stash here and has clj highlighting configured? it doesn't seem to work out of the box in 2.10 |
| 03:59 | cark | muhoo: looks like exactly what i was looking for |
| 03:59 | cark | muhoo: thankls |
| 04:21 | greywolve | does anyone know what the performance implications of using ^:dynamic on a function defn are? |
| 04:25 | clgv | greywolve: the same as for other dynamic variables I guess. |
| 04:26 | clgv | greywolve: depends on the frequency you call it and how long the function itself runs |
| 04:26 | greywolve | (defn ^:dynamic db |
| 04:26 | greywolve | [& [name]] |
| 04:26 | greywolve | (d/db (if name |
| 04:26 | greywolve | (conn (database-uri name)) |
| 04:26 | greywolve | (conn)))) |
| 04:26 | clgv | greywolve: provided the function runs long enough you wont notice |
| 04:26 | greywolve | would be used for getting a datomic connection, so we can mock it |
| 04:27 | clgv | greywolve: afaik you do not need a function to be declared :dynamic - there is `with-redefs` |
| 04:27 | greywolve | yeah but thats visible on all threads |
| 04:27 | greywolve | i want thread local bindings |
| 04:29 | clgv | is it really visible on all threads outside the scope of with-redefs? the docs are not that specific |
| 04:30 | greywolve | "Temporarily redefines Vars while executing the body. The |
| 04:30 | greywolve | temp-value-exprs will be evaluated and each resulting value will |
| 04:30 | greywolve | replace in parallel the root value of its Var. After the body is |
| 04:30 | greywolve | executed, the root values of all the Vars will be set back to their |
| 04:30 | greywolve | old values. These temporary changes will be visible in all threads. |
| 04:30 | greywolve | Useful for mocking out functions during testing." |
| 04:30 | clgv | hmm the implementation looks like it |
| 04:31 | greywolve | yeah... |
| 04:31 | greywolve | do you think there will be any issues with making that function dynamic? |
| 04:31 | clgv | but why is it important? why do you need mocking in some threads only while not in the others? |
| 04:31 | clgv | parallel testing? |
| 04:32 | greywolve | yeah, might want to do that, we'll be redesigning the system anyone to rather explicitly pass in dependencies, ala prismatic graph / stuart sierra component, but for now it would be nice to have testing not be a headache ;p |
| 04:33 | greywolve | anyway* |
| 04:34 | clgv | well the db function wont be called that often in performance critical spots I guess |
| 04:34 | clgv | so you can just declare it :dynamic |
| 04:34 | greywolve | awesome, thanks for the advice |
| 04:38 | clgv | greywolve: you safety net is profiling after the change ;) |
| 04:40 | greywolve | indeed ;) |
| 04:56 | AeroNotix | https://gist.github.com/AeroNotix/1a06fdedddd8785a3307 |
| 04:56 | AeroNotix | this difference is kind of annoying, what's the reasoning behind it? |
| 04:58 | cark | it's not natural to think of strings as functions of a map |
| 04:58 | cark | they could be function of their index for instance, returning a character |
| 04:59 | cark | of an* |
| 05:00 | clgv | AeroNotix: it is idiomatic to put only keyword literals in front of the map. all other map accesses should be the other way around |
| 05:01 | clgv | AeroNotix: since the map is treated as function that looks up the given key in itself |
| 05:02 | AeroNotix | It just doesn't seem consistent |
| 05:05 | clgv | AeroNotix: but it is. (my-map anything) works. but keywords are special since data is modelled as maps and keywords usually are used for property names |
| 05:06 | Cr8 | keywords are nice because you can compose them |
| 05:06 | AeroNotix | Cr8: exactly |
| 05:07 | Cr8 | ,((comp :foo :bar) {:bar {:foo 2 :baz 3} :beep 2}) |
| 05:07 | clojurebot | 2 |
| 05:07 | Cr8 | but maps-as-functions fit more into places where you'd right a function that's nothing more than a case |
| 05:08 | AeroNotix | ,((apply juxt :a :b :c) {:a 1 :b 2 :c 3})) |
| 05:08 | clojurebot | #<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: clojure.lang.Keyword {:instance :c}> |
| 05:08 | AeroNotix | w/e |
| 05:08 | Cr8 | that is, rather than (fn [x] (case x "foo" 1 "bar" 2 "baz" 3)) just write {"foo" 1 "bar" 2 "baz" 3} |
| 05:08 | Cr8 | &(map {1 "foo" 2 "bar" 3 "baz"} [1 2 1 2 3 2 1]) |
| 05:08 | lazybot | ⇒ ("foo" "bar" "foo" "bar" "baz" "bar" "foo") |
| 05:09 | Cr8 | *s/right/write |
| 05:09 | Cr8 | wtf brain |
| 05:09 | clgv | AeroNotix: only `juxt` not `apply` in that case |
| 05:09 | clgv | ,((juxt :a :b :c) {:a 1 :b 2 :c 3})) |
| 05:09 | clojurebot | [1 2 3] |
| 05:09 | AeroNotix | clgv: yeah I was copying from my code elsewhere which used &rest |
| 05:09 | AeroNotix | forgot to remove |
| 05:17 | clgv | is there an option to configure the output of `pprint` |
| 05:24 | noncom | clgv: what you mean "configure"? |
| 05:27 | clgv | noncom: number of whitespaces of identation for example |
| 05:40 | quizdr | clgv check out cl-format if you want a ton of options for formatting output, it is like the format API in common lisp |
| 05:47 | noncom | clgv: afaik no, but maybe what quizdr suggest will work |
| 06:03 | clgv | ok thx |
| 07:11 | doody1 | ~akka |
| 07:11 | clojurebot | It's greek to me. |
| 07:17 | sm0ke | whats the difference between doing (in-ns 'ok) vs (ns ok) on a repl? |
| 07:20 | edbond | sm0ke, I found some info about in-ns vs ns at http://clojure.org/namespaces |
| 07:20 | edbond | The "in-ns" function works almost the same as "ns", but does not load clojure.core - http://clojuredocs.org/clojure_core/1.2.0/clojure.core/in-ns |
| 07:23 | sm0ke | edbond: thanks! |
| 07:28 | TheBrayn | hi |
| 07:33 | daGrevis | hi! i'm trying to make quicksort in clj. sadly this fails on 3rd example and spits out (3 2 2 1). Any ideas? http://vpaste.net/s9PcS |
| 07:33 | TheBrayn | I wrote this little program while beginning to learn clojure: https://gist.github.com/anonymous/1af8da56680808458d7d am I using the letfn function correctly or should I use something else? |
| 07:35 | llasram | TheBrayn: How else would you use it? :-) |
| 07:35 | TheBrayn | well I'm not sure if I should use it here |
| 07:35 | llasram | That said, I honestly don't see letfn that often in real-world code, because usually you need to bind both functions and non-function values to names |
| 07:37 | TheBrayn | could it be that lein is really really slow? |
| 07:37 | TheBrayn | running a project with this takes about 3 seconds |
| 07:38 | llasram | Spinning up a new JVM is always slow |
| 07:38 | schmir | TheBrayn: that's to be expected |
| 07:38 | TheBrayn | ok |
| 07:38 | llasram | The normal Clojure development process involves spinning up a REPL once, then doing everything in that |
| 07:38 | edbond | daGrevis, you should find lesser greater without first elem |
| 07:39 | TheBrayn | does clojure support pattern matching? |
| 07:40 | quizdr | TheBrayn like regex? |
| 07:40 | TheBrayn | like haskell |
| 07:40 | daGrevis | TheBrayn, it has multimethods |
| 07:40 | quizdr | i don't know haskell but there are a number of regex and other sequence utilities for finding things in sequences and collections |
| 07:40 | llasram | TheBrayn: There's the core.match contrib library |
| 07:40 | TheBrayn | ok |
| 07:40 | edbond | daGrevis, also < 3 branch is not needed |
| 07:41 | daGrevis | edbond, why should my code do extra job if I know that sorted [] is [] and sorted [x] is [x]? |
| 07:41 | daGrevis | edbond, that said, it should be s/3/2/ |
| 07:42 | daGrevis | edbond, or even better, (= (count a) 1) |
| 07:43 | daGrevis | so far it works but I have no idea why it sorts list in reversed order. does concat do something i don't know? |
| 07:44 | edbond | daGrevis, yep, you should switch > and < |
| 07:44 | daGrevis | my bad, argument position in anon fn |
| 07:44 | daGrevis | behold, quicksort! http://vpaste.net/qbpT0 |
| 07:44 | edbond | daGrevis, and using (rest a) |
| 07:45 | llasram | TheBrayn: BTW, here's what I think is a somewhat more Clojure-conventional version of your program: https://gist.github.com/llasram/91eb3e13c66062fc7585 |
| 07:45 | edbond | nice done! ) |
| 07:45 | daGrevis | edbond, i could put em in let do avoid double-eval |
| 07:46 | llasram | TheBrayn: Clojure tends towards kebab-/levitating-snake-case over camelCase |
| 07:46 | TheBrayn | llasram: yeah, I see that I didn't really think about some stuff |
| 07:46 | llasram | TheBrayn: And functions ending in `?` are generally predicates which return true/false |
| 07:48 | edbond | daGrevis, maybe use group-by for lesser/greater |
| 07:48 | edbond | ,(group-by #(< 5 %) [1 2 6 8]) |
| 07:48 | clojurebot | {false [1 2], true [6 8]} |
| 07:48 | daGrevis | edbond, nice one! let me try it |
| 07:48 | daGrevis | but first things first -- gotta get some coffee |
| 07:50 | TheBrayn | llasram: why did you write not= and put the false output first? |
| 07:50 | edbond | ,(let [{l true g false} (group-by #(< % 5) [1 2 6 8])] ["Lt" l "Gt" g]) |
| 07:50 | clojurebot | ["Lt" [1 2] "Gt" [6 8]] |
| 07:51 | edbond | gte actually |
| 07:51 | llasram | TheBrayn: That one isn't as agreed on as others, but is still fairly common. The idea is that it can be difficult visually to match up dangling non-initial forms when reading code, so |
| 07:52 | TheBrayn | ok |
| 07:52 | llasram | TheBrayn: you generally want to structure your code not to flow backwards indentation-wise |
| 07:52 | TheBrayn | hm that sounds reasonable |
| 07:57 | daGrevis | how can I destruct map into two vars? http://vpaste.net/E2TWf |
| 07:57 | quizdr | llasram that's an interesting suggestion, haven't heard that before. |
| 07:57 | quizdr | you mean, as a way to encourage tight single forms that only have nested inside, rather than multiple branches or sequences in a (do) for example? |
| 07:58 | llasram | quizdr: I feel like I've read it written down somwhere, but I may be making things up |
| 07:59 | llasram | quizdr: yes/no. I mean, my take is that it's purely about readability. If you only have a single top-level if/cond/do/let whatever, then it's obvious where your un-indenting form belongs and what it's doing |
| 08:00 | llasram | But when you have especially nested `if`s, it can be difficult to tell for sure which `else` form is which w/o actually checking the parens |
| 08:01 | daGrevis | got it! any other qs suggestions? http://vpaste.net/ow3LG |
| 08:06 | ndunbar | before I finally give it up as a bad job - has anyone had success in using clj-soap with enumerated types as parameters? |
| 08:06 | ndunbar | if I had the choice, I wouldn't even be touching SOAP |
| 08:07 | ndunbar | using github.com/uswitch/clj-soap as base |
| 08:18 | Anderkent]away | llasram: parkour breaks my code coverage lib, I must be doing something wrong about handling protocols / reify :( |
| 08:18 | llasram | Anderkent: Yay! I mean, finding new edge cases is good, right? |
| 08:19 | Anderkent | llasram: I suppose :P But instrumentation errors are such a pain to debug |
| 08:19 | llasram | Anderkent: Is there any possibility it's a general build problem? Did you get the tests passing first? |
| 08:20 | Anderkent | the tests pass without instrumentation, yeah |
| 08:20 | llasram | Anderkent: I ask because I just set up travis for the project, and discovered I was depending on features of the next version of Leiningen |
| 08:20 | llasram | Ok, cool |
| 08:20 | llasram | Oh, that's right -- it's only the full cross-Hadoop-version test matrix which had that issue |
| 08:21 | Anderkent | I had to fix some stuff already, and I have no idea how to handle the fact that you conditionally include a namespace based on whether a class is available; I guess ignore compilation errors while instrumenting ;p |
| 08:21 | llasram | lol |
| 08:21 | Anderkent | but fixing the current errors will probably take me a while |
| 08:21 | Anderkent | (well actually I know how I should fix the conditional include) |
| 08:22 | llasram | Well, let me know if there's anything I can do to help. I'm actually pretty psyched that you are using it as a test-bed |
| 08:22 | Anderkent | (hook into the clojure reader rather than load the namespaces myself as I do right now; it's just that's far on the roadmap :P) |
| 08:22 | llasram | Ahhh |
| 08:22 | Anderkent | well, don't spend too much time on it, but if you can take a look at the exceptions and see if you've seen these before and what kind of error might be causing them, that might help |
| 08:23 | llasram | Send them my way and I will take a gander |
| 08:23 | Anderkent | ERROR in (test-tuple-roundtrip) (Reflector.java:271) |
| 08:23 | Anderkent | Uncaught exception, not in assertion. |
| 08:23 | Anderkent | expected: nil |
| 08:23 | Anderkent | actual: java.lang.IllegalArgumentException: No matching field found: key_class for class parkour.io.dsink$sink_for$reify__2941 |
| 08:23 | Anderkent | at clojure.lang.Reflector.getInstanceField (Reflector.java:271) clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:300) parkour.mapreduce.sink$eval1664$fn__1687$G__1656__1689.invoke (parkour/mapreduce/sink.clj:11) parkour.mapreduce.sink$eval1664$fn__1 |
| 08:23 | Anderkent | 687$G__1655__1692.invoke (parkour/mapreduce/sink.clj:11) parkour.mapreduce.sink$key_class.invoke (parkour/mapreduce/sink.clj:37) parkour.mapreduce.sink$wrap_sink.invoke (parkour/mapreduce/sink.clj:74) parkour.mapreduce.sink$wrap_sink.invoke (parkour/mapreduce/sink.clj:71) parkour.io.dsink$sink_for.invoke (parkour/io/dsink.clj:59) parkour.io.avro_test/fn (avro_test.clj:59) clojure.test$test_var$fn__7145.invoke (test.clj:701) |
| 08:23 | Anderkent | woups |
| 08:23 | llasram | heh |
| 08:23 | Anderkent | bad me |
| 08:23 | Anderkent | https://www.refheap.com/34425 |
| 08:24 | llasram | Oh, I know what this is, kind of |
| 08:24 | Anderkent | the thing is I don't enter deftype forms anyway, so it must be something *around* them that I'm messing up |
| 08:24 | Anderkent | or possibly recompilation issues |
| 08:24 | llasram | I'm doing the dnolen-style naming of private protocol functions as prefixed with '-' |
| 08:25 | llasram | But of course `.-foo` is now the field-access syntax |
| 08:25 | llasram | Clojure 1.5 throws warnings when compiling some of this because of that... It's fixed in Clojure 1.6. Let me find the ticket |
| 08:26 | llasram | This is BTW the single biggest reason I am excited about 1.6 :-) |
| 08:27 | llasram | Anderkent: Here we go: http://dev.clojure.org/jira/browse/CLJ-1202 |
| 08:28 | llasram | Not sure whether your code is tickling that bug, has revealed a similar but different bug, or has this bug itself, but it's probably one of those :-) |
| 08:30 | Anderkent | llasram: wow, nice. Yeah, I'm changing (defn dseq [obj] (-dseq obj)) to (defn dseq [obj] ((do (magic) -dseq) obj)), which can possibly be hitting the same bug |
| 08:31 | llasram | Cool beans |
| 08:31 | llasram | I need to take off now, but good luck! |
| 08:32 | Anderkent | llasram: see ya and thanks again |
| 08:36 | quizdr | keep it real yall |
| 08:38 | myguidingstar | Hi all, I'm trying to make a Clojure wrapper for XDocReport. Everything works well inside Leiningen, but if I try to add :gen-class and make executable jar, it failed |
| 08:38 | myguidingstar | the library is here https://github.com/Kaleidocs/merge |
| 08:39 | myguidingstar | the branch for packaged jar is here https://github.com/Kaleidocs/merge/tree/packaged |
| 08:40 | Anderkent | myguidingstar: how does it fail? Can you refheap the errors |
| 08:42 | daGrevis | what would be the best way to generate big vector of random numbers? |
| 08:42 | daGrevis | s/number/int/ |
| 08:43 | Anderkent | ,(take 20 (repeatedly #(rand-int 0 100))) |
| 08:43 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/rand-int> |
| 08:43 | daGrevis | i guess (repeatedly 100 #(rand-int 10)) is a way |
| 08:43 | Anderkent | oups |
| 08:44 | Anderkent | yeah or that |
| 08:44 | Anderkent | unless you have very strict performance requirements or need the numbers to be deterministicly random (i.e. control prng state) |
| 08:45 | myguidingstar | Anderkent, Exception in thread "main" fr.opensagres.xdocreport.core.XDocReportException: Null template engine. Set template engine with IXDocReport#setTemplateEngine. |
| 08:45 | daGrevis | nop, I'm okay. |
| 08:45 | daGrevis | i just need to test speed of my quicksort |
| 08:46 | scape_ | consider using a benchmark library |
| 08:46 | daGrevis | scape_, what's wrong with time fn? |
| 08:47 | scape_ | it has limits, as well GC might interfere-- depending |
| 08:47 | myguidingstar | Anderkent, I made a sample file in the 'packaged' branch, you can check it out |
| 08:47 | scape_ | https://github.com/hugoduncan/criterium is popular |
| 08:47 | daGrevis | thanks, I will take a look |
| 08:47 | myguidingstar | `lein run` works while `lein uberjar; java -jar target/...` fails |
| 08:49 | Anderkent | myguidingstar: googling about a little, https://code.google.com/p/xdocreport/issues/detail?id=54 suggests it's usually because some jars are missing from the classpath - what happens if you use jar instead of uberjar, and manually specify all dpeendencies? If that works then there's something going wrong with the uberjar process. |
| 08:51 | myguidingstar | Anderkent, do you mean java -cp somefile.jar:other.jar ? |
| 08:54 | myguidingstar | Anderkent, thanks, I'll dive into it now |
| 09:11 | katox | datomic q: is it possible to use db.fn/cas with temp-id for upserting things? |
| 09:15 | stuartsierra | katox: Datomic upsert is automatic with 'unique: identity' attributes. |
| 09:15 | katox | stuartsierra: yes, that's what I have there. It works fine without cas |
| 09:16 | katox | stuartsierra: If I add cas into transaction I must specify an existing entity id (instead of negative tempid) |
| 09:17 | katox | stuartsierra: if I pass a temp id the cas-ed attr behaves like nil |
| 09:19 | stuartsierra | I can see why that would happen. `cas` looks at the database *before* the transaction. Upsert happens *after* the transaction. |
| 09:22 | mdrogalis | stuartsierra: Component question. Have you come up with a naming convention for when you have more than one 'system'? |
| 09:22 | mdrogalis | I can't find a less awkward word than <describer>Subsystem |
| 09:23 | katox | stuartsierra: so it means that there is nothing to upsert from the cas point of view, a new temp-id is assigned, cas matched, passed, then upsert is done? |
| 09:24 | katox | stuartsierra: if that's so, it seems like a bug because the same temp-id must have different values within a single tx |
| 09:25 | stuartsierra | katox: I don't really know. |
| 09:25 | stuartsierra | I don't think I would combine `cas` and upsert in the same transaction. |
| 09:26 | stuartsierra | Use one transaction to assert that the new entity exists, get its id, then another to cas the other attribute. |
| 09:26 | stuartsierra | mdrogalis: I have never encountered a situation where I needed more than one system. |
| 09:26 | scape_ | why do I get this error? https://www.refheap.com/34428 when including (:require [clojure.data.codec.base64 :as base64]) in my namespace? if commented out lein repl starts and I can then uncomment and re-evaluate the ns and everything is fine then. |
| 09:27 | katox | stuartsierra: yeah, I'll probably end up doing exactly that, splitting creation and update, that works |
| 09:27 | katox | stuartsierra: thanks for an exaplanation though, it seems logical |
| 09:28 | stuartsierra | katox: you're welcome |
| 09:30 | mdrogalis | stuartsierra: Got'cha. |
| 09:31 | mdrogalis | I should probably just split it into multiple jars I guess. |
| 09:31 | stuartsierra | mdrogalis: I discovered that it's possible to 'merge' systems as long as your keys don't clash. |
| 09:33 | Anderkent | katox: hard to say without seeing your code. |
| 09:34 | katox | Anderkent: unfortunately not that simple I can try to simulate that on some datomic example though, if you're interested |
| 09:35 | Anderkent | katox: yeah, if you can create a repro that'd help. Otherwise maybe just post your ns form? |
| 09:35 | mdrogalis | stuartsierra: Hm, that's an idea. |
| 09:35 | mdrogalis | I suppose there's no harm in it, really. |
| 09:37 | Anderkent | katox: what you describe sounds really bizzare, though... Do you maybe have something weird in your lein profile? :repl-options :init, maybe? |
| 09:38 | stuartsierra | Anderkent: Did you mean to address scape_ ? |
| 09:38 | Anderkent | yes |
| 09:38 | Anderkent | both times |
| 09:38 | Anderkent | ;_; |
| 09:38 | scape_ | oh |
| 09:38 | scape_ | :D |
| 09:38 | Anderkent | Sorry! |
| 09:38 | Anderkent | not sure where that came form |
| 09:38 | katox | Anderkent: nothing special in project.clj or profile, only clj-stacktrace injections |
| 09:39 | Anderkent | katox: yeah, sorry about that, ment scape_ |
| 09:39 | Anderkent | scape_: hard to see without seeing your code! :P |
| 09:39 | Anderkent | *say |
| 09:39 | scape_ | well once it's up and running, i can eval the whole buffer and it's fine |
| 09:39 | Anderkent | goddamnit, brain |
| 09:39 | scape_ | one sec let me paste some |
| 09:40 | katox | Anderkent: ;) I'll try to reproduce that on day of datomic, I hope there is some unique identity attr ;) |
| 09:40 | scape_ | refresh that link: https://www.refheap.com/34428 |
| 09:41 | scape_ | it's strange to me too :-\ Anderkent |
| 09:41 | scape_ | oh shoot |
| 09:41 | scape_ | the namespace is addressed wrong |
| 09:41 | scape_ | one sec |
| 09:41 | scape_ | that's probably it |
| 09:42 | scape_ | well dang Anderkent I should have takena closer look :) thanks got it working now |
| 09:52 | effy | do some of you guys (girls?) could recommend some short/dense material to get up to speed with java, (just the bits of java a clojure programmer would need to know) |
| 09:52 | clgv | effy: that's mostly different parts of the standard lib |
| 09:53 | stuartsierra | effy: I always recommend the Sun/Oracle Java tutorials for that purpose. |
| 09:53 | clgv | effy: I wouldnt go and read about arbritrary library documentation. you can learn the lib when you need it |
| 09:53 | stuartsierra | They're quick, and you can pick and choose the features you need to know about (I/O, for example) |
| 09:55 | effy | ok, thanks |
| 10:00 | joegallo | effy: i always liked this book http://www.amazon.com/Just-Java-Peter-Van-Linden/dp/0130105341 but it's getting a little long in the teeth |
| 10:02 | teslanick | Wow, yeah. Java 2. |
| 10:02 | effy | joegallo: wow, a 600 pages book on java is way more than i'm willing to learn about java just to enjoy the interop from clojure |
| 10:03 | clgv | effy: we recommended this list of books to our students: http://www.uni-ulm.de/in/theo/lehre/archiv/ss-2013/pi1000.html |
| 10:03 | clgv | effy: under "Literatur" |
| 10:03 | teslanick | For zee germans |
| 10:04 | clgv | most are probably translations of english book and a few english ones are among them ;) |
| 10:04 | teslanick | I think my Java book is "Learning Java" by O'Reilly. |
| 10:05 | teslanick | But that was my CS 001 textbook, so it might be a bit elementary. |
| 10:06 | teslanick | effy: http://shop.oreilly.com/product/0636920027829.do This might be a bit terse, but if you're familiar with other OOP languages, it might be enough. |
| 10:11 | effy | thanks everyone, that's a lot of books guys ! i think i'm gonna go with the sun/oracle tutorials for a beginning and fallback on your suggestions if i feel a further need :) |
| 10:15 | devth | how can i make a function call on a fresh stack? would (future (somefn..)) do it? |
| 10:17 | clgv | devth: why a fresh stack? did you spoil the other? ;) |
| 10:18 | devth | clgv: essentially :) |
| 10:18 | devth | there is a better way to solve this in the long term but this will serve as a quick hack to prevent stackoverflows |
| 10:19 | devth | basically i'm at a very deep point in the stack, searching through a series of many hooked functions (using robert-hooke lib) |
| 10:19 | devth | then i need to restart the search and don't care about the current context |
| 10:19 | devth | also: just curious |
| 10:23 | clgv | just write a proper tail-recursion if you get a stack overflow for your data ;) |
| 10:23 | devth | yeah i know the "right" way to fix this, but still curious |
| 10:23 | devth | how do you drop the current stack and start over? new thread? |
| 10:25 | borkdude | Class names must start with a lowercase letter, I'm reading now |
| 10:26 | clgv | well a new thread has a smaller stack |
| 10:26 | clgv | (require 'clojure.stacktrace) |
| 10:26 | clgv | ,(require 'clojure.stacktrace) |
| 10:26 | clojurebot | #<SecurityException java.lang.SecurityException: denied> |
| 10:26 | clgv | (future (clojure.stacktrace/print-cause-trace (Exception.))) |
| 10:26 | borkdude | funny when you take that out of context |
| 10:26 | clgv | ,(future (clojure.stacktrace/print-cause-trace (Exception.))) |
| 10:26 | clojurebot | #<CompilerException java.lang.ClassNotFoundException: clojure.stacktrace, compiling:(NO_SOURCE_PATH:0:0)> |
| 10:27 | clgv | devth: well just try the above on your repl |
| 10:27 | devth | yep |
| 10:27 | clgv | devth: but I doubt that'll help much |
| 10:27 | devth | right |
| 10:29 | tim2 | Can anyone recommend a clojure specific news web site? (similar to tss, infoq etc) |
| 10:30 | borkdude | tim2 planet.clojure.in (blog aggregator) |
| 10:33 | myguidingstar | Anderkent, I tried and find out I must add a jar (fr.opensagres.xdocreport.document.odt) to classpath when exec the standalone uberjar |
| 10:34 | Anderkent | myguidingstar: right; I'd check if the files from that jar are in your uberjar. If so, then it's probably soemthing hardcoded in the lib you're using (i.e. it looks for a jar, not the contents of the jar). That'd be weird |
| 10:34 | myguidingstar | I open the uberjar and it seems to contain things found in the above jar |
| 10:34 | Anderkent | if they arent included, there's your bug - now just to figure out why :P |
| 10:34 | myguidingstar | they are included, so? |
| 10:35 | tim2 | borkdude: thanks |
| 10:35 | Anderkent | eh. Not sure you can do much about that? I guess you can try and figure out why exactly it needs to be a jar, not the contents |
| 10:35 | Anderkent | it's an issue with the xdocreport framework, not lein |
| 10:36 | myguidingstar | sorry, I don't know the java things :| |
| 10:36 | clgv | tim2: the CLojure Mailing List |
| 10:38 | myguidingstar | Anderkent, I tried to copy all the single jar content to the standalone one but it still fails |
| 10:39 | Anderkent | myguidingstar: yeah, I can't help you there. You'd have to look at how the library you depend on is detecting the templates. |
| 10:39 | myguidingstar | that means it's the issue with xdocreport |
| 10:39 | Anderkent | yeah |
| 10:40 | myguidingstar | OK, thanks a lot. I didn't even think about adding additional jars |
| 10:44 | katox | ok, isolated |
| 10:44 | katox | Anderkent: stuartsierra: https://gist.github.com/katox/8865082 |
| 10:46 | mklappstuhl__ | trying to use lein-garden but I keep getting: java.lang.ClassNotFoundException: java.nio.file.Files |
| 10:46 | mklappstuhl__ | I have my stylesheet in a different namespace than core but adjusted the plugin map in project.clj accordingly |
| 10:49 | clgv | mklappstuhl__: sounds as if you are running a JDK/JRE without java.nio |
| 10:49 | mklappstuhl__ | clgv: I think the problem is related to the fact that the project is a cljs one |
| 10:50 | rurumate | I have a tomcat server running a ring app, now I would like to log each request (unreliably) using cassaforte cassandra client. I don't want this to affect latency, should I wrap the action with (future)? Will this create a new thread for each request? |
| 10:50 | Anderkent | mklappstuhl__: are you on java7 or java6? |
| 10:50 | clgv | mklappstuhl__: you definitely need java7 for that class ^^ |
| 10:52 | mklappstuhl__ | how do I figure out which version I ahve? java -v isn't a thing |
| 10:52 | rurumate | will (future) always create a new thread, or will it try to use a thread pool? |
| 10:52 | katox | mklappstuhl__: java -version |
| 10:53 | mklappstuhl__ | java version "1.6.0_65" |
| 10:53 | Anderkent | mklappstuhl__: yeah, you need to install java 7 |
| 10:53 | mklappstuhl__ | does that mean I'm on 6 |
| 10:53 | katox | mklappstuhl__: y |
| 10:54 | llasram | Or that plugin needs to fix itself to not depend on Java 7 |
| 10:55 | Anderkent | llasram: yes, but one of these is something that mklappstuhl__ can do right now :) |
| 10:56 | mklappstuhl__ | I guess jdk-7u51-macosx-x64.dmg sounds right, eh? |
| 10:58 | Anderkent | I wish one could just `brew install java7`, but alas no. jdk-7blahblah.dmg sounds right. |
| 10:58 | gfredericks | I decided to run my project's tests with dynalint and it tells me that I should not pass the result of keys to zipmap |
| 10:59 | mklappstuhl__ | Anderkent: yeah, that would be great |
| 10:59 | gfredericks | is that an obsolete warning now? |
| 10:59 | mklappstuhl__ | can anyone point me to some resource explaining how to setup a clj + cljs project? |
| 11:00 | Anderkent | gfredericks: I guess it's more that you're relying on undocumented behaviour than obviously wrong |
| 11:00 | Anderkent | gfredericks: but afaik it's WOG that keys order == vals order == seq order nowadays |
| 11:00 | mklappstuhl__ | WOG? |
| 11:01 | Anderkent | word of god |
| 11:01 | Anderkent | i.e. rich |
| 11:01 | mklappstuhl__ | haha |
| 11:01 | gfredericks | Anderkent: so...it IS documented then, right? |
| 11:01 | gfredericks | or at least will be once that patch gets accepted? |
| 11:01 | Anderkent | documented in 1.6 I think |
| 11:01 | gfredericks | so there's nothing to gain by warning about it? |
| 11:01 | mklappstuhl__ | I read Rich's post but didn't completely understand it :D |
| 11:02 | Anderkent | gfredericks: I still feel like it's slightly wrong? Dunno. |
| 11:02 | gfredericks | Anderkent: in general or prior to 1.6? |
| 11:03 | Anderkent | in general. almost-not-wrong in 1.6, i suppose? I just can't see why you'd need to do it, over iterating ove rthe map normally |
| 11:03 | Anderkent | but I might just not be very imaginative! :P |
| 11:03 | gfredericks | The situation of "There are two ways to do X" does not imply "Let's pick one of them to be the right one and issue warnings about the other" |
| 11:03 | TimMc | gfredericks: Except for if vs. when |
| 11:04 | gfredericks | looks like ambrose added this six days ago, so maybe he knew about rich's comment? |
| 11:04 | gfredericks | I'll file an issue at least |
| 11:04 | Anderkent | gfredericks: but the situation of 'there are two ways to do X, and one requires an additional contractual obligation, then the one that's more generic is right and we should issue warnings about the odder' |
| 11:04 | Anderkent | *other |
| 11:05 | Anderkent | goddamnit what's with me and spelling today |
| 11:05 | gfredericks | the additional contractual obligation exists though |
| 11:05 | Anderkent | that's not relevant :) |
| 11:05 | Anderkent | I mean, if the contractual obligation wasn't there, it'd be WRONG |
| 11:05 | Anderkent | now it's just unnecessary |
| 11:06 | gfredericks | iterating over the whole map makes it less obvious what you're doing |
| 11:06 | gfredericks | (zipmap (keys m) (map f (vals m))) makes it obvious that I'm leaving the keys alone |
| 11:07 | Anderkent | (into {} (for [[k v] m] [k (f v)])) is pretty obvious too? |
| 11:08 | Anderkent | Eh, dunno. I might be making the impression that it's a bigger deal to me than it really is |
| 11:08 | Anderkent | but i feel like it's okay to have a warning like that |
| 11:10 | mklappstuhl__ | now, after updating java everything seems to stop after Compiling Clojurescript/Compiling Garden and nothing gets compiled |
| 11:10 | Raynes | Anderkent: Maybe we should issue warnings about otters/ |
| 11:11 | Anderkent | Raynes: only the other, odder otters? |
| 11:11 | Raynes | Yes. |
| 11:11 | Anderkent | utterly |
| 11:12 | devth | clgv: did some stack size exploration. it looks like future does reset the stack: https://gist.github.com/devth/8865799 |
| 11:13 | Anderkent | devth: yes, futures run in a separate thread. Not sure if a fresh one or if they go to the agent threadpool |
| 11:14 | devth | Anderkent: that's what i assumed, and what i originally asked above |
| 11:14 | ambrosebs | gfredericks: obsolete warning |
| 11:15 | ambrosebs | gfredericks: FWIW it's undocumented in 1.5.1 |
| 11:15 | ambrosebs | gfredericks: but I'm going remove it the warning anyway |
| 11:15 | Anderkent | ambrosebs: gfredericks: actually I checked and it's still not documented in 1.6.0 either :P |
| 11:16 | ambrosebs | Anderkent: I don't think 1.6 is out yet :) |
| 11:16 | gfredericks | ambrosebs: I could send a PR with those two lines deleted if you'd like |
| 11:16 | ambrosebs | gfredericks: fantastic |
| 11:16 | ambrosebs | gfredericks: you've got a CA right? |
| 11:18 | ambrosebs | gfredericks: nvm found you. |
| 11:20 | gfredericks | ambrosebs: I'm looking at dynalint in detail for the first time; I'm interested in how easy it is to customize |
| 11:20 | gfredericks | both adding custom warnings and suppressing existing warnings |
| 11:21 | gfredericks | warnings & errors rather |
| 11:21 | ambrosebs | gfredericks: yes. I was also thinking suppressing warnings based on regex on stack traces. |
| 11:22 | gfredericks | how do warnings relate to stack traces? |
| 11:22 | gfredericks | or do you mean stack traces *not* taken from actually thrown exceptions? |
| 11:23 | ambrosebs | gfredericks: so dynalint.lint/warn throws an exception and immediately catches it just for a stack trace. |
| 11:23 | ambrosebs | you can get this with print-warning. |
| 11:24 | ambrosebs | you might have a rule that suppresses a warning based on the stored stack trace |
| 11:24 | gfredericks | the use case being suppressing it for only one usage? |
| 11:25 | ambrosebs | say there was a trigger in leiningen that you want to suppress, perhaps at line 15 for leiningen.core.main. You might write a regex to suppress a warning if that pattern is in the stack trace |
| 11:26 | ambrosebs | it's simplistic, but so is everything else in dynalint :) |
| 11:27 | ambrosebs | gfredericks: dynalint was my January break from Typed Clojure, patches are very welcome at this point. |
| 11:27 | mklappstuhl | I just updated java and now every time I juse lein cljsbuild auto it is stuck at "Compiling ClojureScript." |
| 11:29 | gfredericks | ambrosebs: this sounds super fun to extensibilize, I'm gonna be noodling it |
| 11:29 | Anderkent | mklappstuhl: no other output at all? |
| 11:29 | mklappstuhl | Anderkent: none |
| 11:30 | ambrosebs | gfredericks: yep I've had too much fun so far :) |
| 11:30 | Anderkent | hm, try a clean build just in case it's something like that |
| 11:30 | gfredericks | ambrosebs: I'm also interested in ways to support multiple versions of clojure from the same codebase |
| 11:30 | ambrosebs | gfredericks: that would be preferable |
| 11:31 | ambrosebs | gfredericks: by definition there is one dynalint version per release. |
| 11:31 | gfredericks | ambrosebs: I don't understand that second statement |
| 11:32 | ambrosebs | gfredericks: I meant dynalint depends on implementation details of clojure. each clojure release should have explicitly different behaviour in dynalint |
| 11:32 | mklappstuhl | Anderkent: that apparently fixed it for cljsbuild. not for lein garden though. but thats another issue then. thought it was related to the update |
| 11:32 | ambrosebs | eg. current version is 1.5.1 *only* |
| 11:33 | ambrosebs | gfredericks: it'd be a might pain if that meant different release jars for dynalint |
| 11:33 | clgv | why does `sort` return an ArraySeq instead of a vector? |
| 11:33 | ambrosebs | *mighty pain |
| 11:33 | ambrosebs | ,(doc sort) |
| 11:33 | clojurebot | "([coll] [comp coll]); Returns a sorted sequence of the items in coll. If no comparator is supplied, uses compare. comparator must implement java.util.Comparator. If coll is a Java array, it will be modified. To avoid this, sort a copy of the array." |
| 11:34 | clgv | no answer over there ;) |
| 11:34 | ambrosebs | clgv: why did you think it would return a vector? |
| 11:34 | ambrosebs | (I was just checking the docs myself in IRC hehe) |
| 11:34 | gfredericks | ambrosebs: right, so I was saying ideally when 1.6 comes out, the next release of dynalint supports both at the same time; I assume that's what you're saying essentially too |
| 11:34 | clgv | ambrosebs: since it uses arrays under the hood anyway and it would be pretty useful to have O(1) lookups on the result |
| 11:34 | ambrosebs | gfredericks: yes |
| 11:35 | clgv | ,((sort (range 10)) 3) |
| 11:35 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.ArraySeq cannot be cast to clojure.lang.IFn> |
| 11:35 | gfredericks | clgv: shoving it into a vector involves copying the whole thing again |
| 11:35 | clgv | :( ^^ |
| 11:37 | Anderkent | gfredericks: not sure whether o(1) lookups or o(1) head/rest are more common with sort |
| 11:37 | mklappstuhl | is there any place where I can read up on how to use cljs and clj in one project? :) |
| 11:38 | Anderkent | gfredericks: though I guess vector just aliases an array, so returning a vector from sort then doing (seq) on it has similar performance to just (sort) right now |
| 11:38 | clgv | well ArraySeq has efficient reduce but not efficient nth |
| 11:38 | clgv | it seems |
| 11:38 | `cbp | mklappstuhl: maybe a web framework's docs like pedestal or caribuou if you're doing webdev |
| 11:39 | gfredericks | Anderkent: a vector is not implemented on top of a single array |
| 11:39 | sritchie | cemerick: posted an issue with the stacktrace I get when my emacs repl starts hanging - https://github.com/cemerick/piggieback/issues/23 |
| 11:39 | Anderkent | gfredericks: it is if you (vec array) |
| 11:39 | gfredericks | so converting from an array to a vector is O(n) |
| 11:39 | TimMc | Mmmm... not sure about that. |
| 11:39 | Anderkent | oh, my bad, only if array is shorter than 32 items |
| 11:39 | sritchie | cemerick: after stuff gets stuck, sometimes i can kill the thread, then manually connect from the browser, but it often takes a bunch of tries, and I have no idea what makes it all catch |
| 11:39 | novochar | How do you reason about ASTs? I've heard that a lot of can reason about their software's AST more easily. |
| 11:39 | sritchie | seangrove: are you on emacs too? |
| 11:40 | sritchie | seangrove: I'm wondering if some other nrepl middleware is getting in the way... |
| 11:40 | sritchie | cemerick: what editor do you use? and are you on cider? |
| 11:40 | cemerick | sritchie: yeah, that's a mostly generic nREPL interrupt exception |
| 11:40 | cemerick | sritchie: using emacs+cider latest |
| 11:40 | sritchie | me too... |
| 11:40 | sritchie | 0.6.0alpha |
| 11:41 | sritchie | calling connect manually in chrome gives me two responses, and no action in emacs |
| 11:41 | sritchie | you were saying there were supposed to be three, and when a connection succeeds, the third pops up |
| 11:42 | cemerick | sritchie: does a simple cemerick.austin.repls/exec call work for you? |
| 11:42 | sritchie | let's see |
| 11:43 | sritchie | yeah, that works, actually |
| 11:43 | sritchie | https://gist.github.com/sritchie/8866475 |
| 11:44 | sritchie | that's what I've been doing to connect |
| 11:44 | sritchie | cemerick: what's the difference between what I"m doing and a straight-up exec/ |
| 11:44 | sritchie | ? |
| 11:44 | sritchie | cemerick: I have to do all that of that maybe-resolve stuff because of the AOT compilation issue |
| 11:47 | sritchie | cemerick: okay, read the docs. unclear whether my existing app can connect to exec-env |
| 11:47 | cemerick | sritchie: I suspect a problem with how you're getting the generated client-side js into the page |
| 11:47 | mklappstuhl | `cbp: it seems that you can just mix them in the same directories |
| 11:47 | mklappstuhl | at lest pedestal does it partly that way |
| 11:48 | sritchie | cemerick: well, all the code's available at the chrome console; |
| 11:48 | cemerick | sritchie: exec-env just automates the start of the browser env, whether phantom or chrome or whatever |
| 11:48 | sritchie | cemerick: so if I do that, I can't send commands back to my existing, running app, right? |
| 11:48 | rkneufeld | mklappstuhl: cljx is something to look at. Maybe take a look at dnolen's mies template. |
| 11:48 | rkneufeld | (not related) |
| 11:49 | sritchie | cemerick: about the client side - all my cljs is available at the chrome console |
| 11:49 | sritchie | cemerick: and I've been manually calling that "connect" snippet |
| 11:49 | cemerick | sritchie: that's not saying much. How are you calling connect? |
| 11:49 | cemerick | so you're not using the (browser-connected-repl-js) helper? |
| 11:49 | sritchie | yes, I am |
| 11:49 | sritchie | but it doesn't work every time |
| 11:49 | sritchie | sometimes it does, |
| 11:50 | sritchie | but it's very finicky |
| 11:50 | sritchie | (thanks for talking this through) |
| 11:50 | cemerick | sritchie: what do you mean by "manually calling connect"? |
| 11:51 | sritchie | like, when I load the page and the repl doesn't connect, I view the source, find the snippet, go to the chrome console and paste it in |
| 11:51 | sritchie | ;goog.require('clojure.browser.repl');clojure.browser.repl.connect.call(null, 'http://localhost:53152/3337/repl'); |
| 11:51 | sritchie | usually that works after two pastes |
| 11:51 | sritchie | and there are no errors in the console,btw, so I'm not including them in the wrong order |
| 11:51 | scape_ | what would (<! (timeout 0)) do, park the go block momentarily? http://swannodette.github.io/2013/08/02/100000-processes/ |
| 11:51 | sritchie | cemerick: here's my scripts section: https://gist.github.com/sritchie/8866600 |
| 11:52 | tbaldridge | dnolen: is there an easy way to use the latest goog libs with cljs? |
| 11:52 | sritchie | cemerick: it's almost like if I make a call at the cljs repl in emacs, |
| 11:52 | sritchie | cemerick: and then the browser tries to connect, the connection's blocked |
| 11:52 | sritchie | and I have to do some thread killing and manual massaging at the chrome console |
| 11:54 | bbloom | scape_: yeah, that's basically yielding to other running routines |
| 11:54 | cemerick | sritchie: have you tried Firefox? |
| 11:54 | sritchie | is that what you develop with? |
| 11:54 | sritchie | seangrove: are you on chrome? |
| 11:54 | scape_ | bbloom: ok, cool. i was trying to figure out how to do a go loop without hogging the others, this might help. otherwise i have to rewrite some stuff |
| 11:55 | sritchie | cemerick: maybe that's why you're not experiencing any of these bugs... |
| 11:55 | mklappstuhl | rkneufeld: I'm using dnolens mies template |
| 11:55 | cemerick | sritchie: I use Firefox and Chrome, but https://github.com/cemerick/austin/issues/17 |
| 11:55 | bbloom | scape_: it's generally a sign of a bad design though.... dnolen does it in that example b/c he's perf testing with a saturated system |
| 11:56 | sritchie | cemerick: this stuff even happens in private browsing mode |
| 11:56 | scape_ | bbloom: oh, i've seen it in python in gevent (concurrency model) |
| 11:56 | mklappstuhl | rkneufeld: I probably setup garden wrong — would be really cool if anyone could give me a hint. https://github.com/mklappstuhl/talk/blob/master/project.clj |
| 11:56 | bbloom | scape_: are you writing clj or cljs? are you cpu or io bound? what are you actually trying to do? chances are a timeout 0 is not what you want at all |
| 11:56 | cemerick | sritchie: does it work in firefox? |
| 11:56 | sritchie | trying |
| 11:56 | mklappstuhl | tbaldridge: how to you mean — use the goog libs? |
| 11:57 | bbloom | scape_: well python's real threads support is, frankly, useless. if you're on the JVM, there are both real threads and parking threads. you may want real threads if you feel the need to timeout 0 |
| 11:57 | rkneufeld | mklappstuhl: I don't have time to take a look right now. If you're still stuck in an 1.5-2 hours I can give it a look for you. |
| 11:57 | scape_ | bbloom: I noticed if i make a handful of go loops everything slows down, I wanted to have each go loop check a stream for availability, but I noticed this with simple things inside of a loop |
| 11:57 | tbaldridge | I just realized that the features I was looking for are only in the goog master repo....I guess I'll have to wait till the next goog release |
| 11:57 | bbloom | scape_: are they pooling the stream as fast as possible? |
| 11:57 | bbloom | s/pooling/polling |
| 11:57 | mklappstuhl | rkneufeld: thanks for that offer & no rush — maybe I figured it out on my own by then :) |
| 11:58 | bbloom | scape_: and i ask again: clj or cljs? |
| 11:58 | scape_ | yes. basically they do: (if (> (.available ins) 0), i'm on jvm |
| 11:58 | sritchie | cemerick: ugh |
| 11:58 | sritchie | cemerick: let me figure out how to get firefox working with https... |
| 11:58 | sritchie | since I can't hit the cljs repl on http from my local https env |
| 11:58 | bbloom | scape_: ok, my suggestion is: do not poll the streams |
| 11:59 | bbloom | scape_: instead, use real threads (clojure.core.async/thread ...) instead of /go and use <!! and >!! instead for real blocking (Not parking) |
| 11:59 | scape_ | the only way around no polling them is to implement nio :-\ |
| 11:59 | bbloom | scape_: then *block on the thread* |
| 12:00 | sritchie | cemerick: nope |
| 12:00 | bbloom | scape_: that's not true at all. just call .read() and let it block |
| 12:00 | sritchie | cemerick: get, and a post, and then totally stuck |
| 12:00 | scape_ | well real threads don't scale as well, I was shooting for like 300-500 if possible |
| 12:00 | bbloom | scape_: do you have 300 to 500 streams? |
| 12:00 | bbloom | scape_: b/c polling scales worse than threads :-P |
| 12:00 | scape_ | hah ok |
| 12:00 | bbloom | scape_: how many streams do you have? |
| 12:01 | sritchie | cemerick: is there some order? like, don't do anything at the repl until firefox tries to connect... |
| 12:01 | sritchie | or something like that that you just subconsciously respect now since you know what you're doing? |
| 12:01 | scape_ | my hope is that many |
| 12:02 | cemerick | sritchie: no, the first thing I do is eval `+`, which blocks until the browser connects. When I see JS, that lets me know everything is ready, and I'm in the right type of REPL. |
| 12:02 | sritchie | yeah, I do the same thing. then you load the page... |
| 12:02 | sritchie | and if you reload and try to eval, you get a BrokenPipe, probably? |
| 12:02 | sritchie | reload the page, that is |
| 12:03 | bbloom | scape_: frankly, i think 300 to 500 threads will probably do just fine on a modern server |
| 12:03 | bbloom | scape_: just wrap each stream in a async thread thinggie and then use go routines for everything past that |
| 12:03 | bbloom | scape_: http://www.slideshare.net/e456/tyma-paulmultithreaded1 |
| 12:04 | scape_ | okay, thanks bbloom . i'll simplify and go with threads :) |
| 12:04 | sritchie | cemerick: it's wild that you've never had an unresponsive repl |
| 12:04 | scape_ | thx ill check it out bbloom |
| 12:04 | cemerick | sritchie: I don't recall exactly. There's clearly something configuration-related that can impact how austin works, but it's hardly endemic; otherwise, no one would use the kit. |
| 12:04 | bbloom | scape_: plus, if you don't have 300 to 500 threads *now* you can always swap out for a different approach later |
| 12:04 | cemerick | sritchie: does the browser-connected-repl sample in the austin repo work in your environment? |
| 12:04 | sritchie | cemerick: well, you just pointed me to a few issues that report this, and seangrove anecdotally says that everyone he tries to set up has this problem |
| 12:05 | sritchie | let's see |
| 12:05 | cemerick | sritchie: well, apparently FF doesn't work for you either, so that's something different. |
| 12:05 | scape_ | interesting talk, how'd i miss this! bbloom :D |
| 12:05 | cemerick | Not sure what to say, but I can only fix what I can reproduce. |
| 12:06 | bbloom | scape_: b/c you're going to be talkign to channels, which is going to be the interesting par tof your program. you can easily swap in NIO as needed later, if it makes sense |
| 12:06 | bbloom | scape_: make it right, make it fast. in that order! |
| 12:06 | scape_ | hah ok |
| 12:07 | scape_ | i'm fearful of nio :) seems like so much juggling to capture the right amount, i'll think on it at some point i'm sure |
| 12:08 | bbloom | scape_: evented systems are a dumb idea IMO, full stop. the problem isn't that threads are bad, the problem is that unix threads are too heavy weight, and even that's not really true any more |
| 12:09 | sritchie | cemerick: yeah, I bring it up because you may have a much better idea of how to debug, or where in the stack an issue like this might happen |
| 12:09 | sritchie | cemerick: I'll try to get you a case that repros it |
| 12:09 | bbloom | scape_: if you avoid NIO's eventing system and instead only use selectors, that makes sense & is pretty nice to work with |
| 12:09 | sritchie | cemerick: I offered my project, which'll let you fire up a failing case right away - but if you need a more minimal failing case, sure, I'll try to get that going |
| 12:10 | scape_ | another idea i was fiddling with bbloom was to spin up a smaller set of threads that take new streams in and loop thru their set of streams synchonously. but i'm pausing and reading these slides now |
| 12:10 | bbloom | scape_: just do one thread per stream and optimize later |
| 12:10 | scape_ | okay |
| 12:10 | bbloom | scape_: if you've never done this sort ofthing before, i'm 98% sure that your optimizations will actually make things worse |
| 12:11 | scape_ | haha probably right |
| 12:13 | cemerick | sritchie: my current suspicion is of some kind of race condition in your creation of the repl-env and the generation of the corresponding JS (yielding a mismatched session ID). |
| 12:13 | cemerick | I just have too much going on to provide personalized debugging, etc. :-) |
| 12:13 | sritchie | no, they match - verified at the top of the REPL and by looking at my HTML |
| 12:13 | cemerick | sritchie: well, we can scratch that off the list then |
| 12:14 | sritchie | cemerick: yeah, you said that yesterday - I'm only asking because this feels like a problem that affects many users of your library |
| 12:14 | sritchie | cemerick: and I want to help get it fixed, so that everyone can benefit |
| 12:15 | sritchie | cemerick: I run open source projects too, I get that it's a pain - it seems like you believe this is totally local to my setup, which makes this personalized debugging |
| 12:15 | sritchie | cemerick: anyway, I guess I'll try to break the demo in the austin repo |
| 12:16 | cemerick | sritchie: I was just referring to my getting set up with your particular project, etc., as opposed to a minimal repro. |
| 12:19 | cemerick | sritchie: it is certainly local to your setup, or your particular combination of plugins, or set of CLJS deps, or whatever is causing the chaos. You're in the best position to diagnose and patch, honestly. |
| 12:20 | sritchie | cemerick: the help I'm looking for is less "please fix everything!", more "okay, you should see three post requests between the browser and server, if the third hangs, yeah, I see how it could block the others.." etc so I know what to look for |
| 12:20 | sritchie | cemerick: I'll try to repro on that austin project |
| 12:21 | cemerick | sritchie: if it were that easy, I'd have provided advice like that :-P |
| 12:21 | sritchie | well, here's one error already in the example project |
| 12:21 | sritchie | cemerick: go through the tutorial, call :cljs/quit, |
| 12:22 | sritchie | then try evaluating the repl-env variable you create |
| 12:22 | sritchie | OutOfMemoryError Java heap space java.util.Arrays.copyOf (Arrays.java:2367) |
| 12:22 | cemerick | sritchie: this is after getting a working browser REPL? |
| 12:22 | sritchie | yeah |
| 12:23 | cemerick | then, I'm not so worried about that at the moment. :-) |
| 12:23 | gfredericks | ,(let [a (into-array [1 2 3]), v (vec a)] (aset a 0 42) [(seq a) v]) |
| 12:23 | clojurebot | [(42 2 3) [42 2 3]] |
| 12:23 | sritchie | cemerick: I can typically get it once |
| 12:23 | gfredericks | ^I feel like this is a little surprising |
| 12:23 | sritchie | then a page reload nukes it |
| 12:23 | gfredericks | oh wait |
| 12:23 | gfredericks | the docstring does indeed mention that behavior |
| 12:23 | gfredericks | false alarm |
| 12:24 | sritchie | cemerick: yeah, I mean, this example fails if you :cljs/quit and then run the repl again |
| 12:24 | sritchie | same bug as I've been experiencing |
| 12:24 | cemerick | sritchie: -XmxNNNm |
| 12:25 | cemerick | IIRC, lein-cljsbuild always runs with a non-default heap size b/c the CLJS compiler / gclosure compiler isn't easy on memory, etc. |
| 12:25 | sritchie | why does that affect the repl task? |
| 12:26 | cemerick | because you're hosting the CLJS compiler to compile core.cljs, your expressions to JS, etc |
| 12:26 | logic_prog | s the only svg element that clips a group the <svg> element ? |
| 12:27 | logic_prog | let me rewrite the above: |
| 12:27 | logic_prog | I have a <g > ... </g> element. I want to clip it to a rectangle. Is my only option to nest it inside a <svg> ... </svg> element ? |
| 12:27 | sritchie | cemerick: okay, reproduced... |
| 12:28 | sritchie | follow your tutorial, run (cemerick.austin.repls/cljs-repl repl-env), |
| 12:28 | sritchie | :cljs/quit |
| 12:28 | sritchie | (after getting everything working, run :cljs/quit) |
| 12:28 | sritchie | then call (cemerick.austin.repls/cljs-repl repl-env) again |
| 12:28 | sritchie | ava.lang.NullPointerException |
| 12:29 | AeroNotix | is anyone using lein-daemon? |
| 12:29 | sritchie | cemerick: ugh, it is more reliable here. I'll keep playing. |
| 12:29 | AeroNotix | it works fine locally, but on my CI server the start daemon command just hangs -- it creates the pidfile though? |
| 12:30 | AeroNotix | (alternately, some ideas on how to start a compojure app in jenkins and then run tests on it would be great.) |
| 12:31 | cemerick | sritchie: oh, right, the NPE is sort of expected (though an actual error message would be nice); :cljs/quit tears down the repl-env, which corresponds to session removal in austin: https://github.com/cemerick/austin/blob/master/src/clj/cemerick/austin.clj#L324 |
| 12:31 | sritchie | cemerick: looks like the terminal repl works great, |
| 12:32 | sritchie | but my emacs setup is acting like my project was - I'll try removing some nrepl plugins, etc |
| 12:32 | sritchie | cemerick: if I can find the thing that's hosed with my setup I'll report back |
| 12:32 | cemerick | sritchie: def, thanks |
| 12:32 | sritchie | cemerick: I'm suspicious of ac-nrepl. we'll see how my paranoia fares :) thanks for fielding the comment blast :) |
| 12:35 | seangrove | sritchie: Emacs, chrome/firefox both have the same problem |
| 12:36 | sritchie | seangrove: do you have ac-nrepl installed? |
| 12:36 | seangrove | sritchie cemerick: An interesting case that breaks the repl last time I was debugging: https://www.refheap.com/da489c6664be35717f3f514a5 |
| 12:38 | cemerick | seangrove: I don't know what I'm looking at? |
| 12:39 | seangrove | cemerick: Ah, sorry, still haven't put together a minimum case. But if setup!* is called on page load, the repl works. If setup! is called, it never works |
| 12:39 | seangrove | I thought maybe the cljs repl somehow relies on throwing errors, etc. |
| 12:39 | cemerick | seangrove: oh, I see. That's a little crazy. |
| 12:39 | seangrove | cemerick: But don't worry too much about it if it doesn't seem interesting, I know this isn't a repro case by any means |
| 12:40 | cemerick | seangrove: You mean for control flow? No, not that I know of. Does the same behaviour hold w/ the stock CLJS brepl? |
| 12:41 | cemerick | seangrove: so do things work OK when setup* throws an error? Also, is the js/Object intentional? |
| 12:42 | seangrove | cemerick: the js/Object was just while iterating fe a different things. I've never tried brepl before. |
| 12:42 | cemerick | ok, was wondering if non-Errors were expected, etc |
| 12:43 | cemerick | seangrove: I've never heard of particular userland code prompting REPL failure, so do file an issue eventually |
| 12:43 | seangrove | sritchie: Looks like ac-nrepl isn't installed. |
| 12:44 | sritchie | trying with ac-nrepl uninstalled |
| 12:50 | sritchie | seangrove: ugh |
| 12:50 | sritchie | seangrove: what is it about our emacs setup that's causing this... |
| 13:09 | hfaafb | with assoc i can pass in multiple key value pairs |
| 13:09 | hfaafb | but not so with assoc-in |
| 13:10 | hfaafb | whats an alternative to assoc-in, where my collection is a 2d vector |
| 13:11 | hfaafb | that i can change the value of 2 pairs of indices |
| 13:29 | seangrove | sritchie: I don't think it's emacs, personally, but I'd need to check the brepl stuff to be sure |
| 13:30 | sritchie | seangrove: I'm trying to create a smaller project with less deps to see if it works.. |
| 13:30 | sritchie | yeah, seriously frustrating, though |
| 13:31 | seangrove | sritchie: It's in the critical path for CLJS long-term though. Once it's sorted out in a reliable, extensible, editor-independent way, it'll be fantastic |
| 13:31 | sritchie | for sure, it'll be great |
| 13:31 | seangrove | sritchie: I think it's just so much of a black box right now, it's really unclear how it all works together for most people, so contributing and fixing problems seems beyond them (does ot me) |
| 13:31 | sritchie | me too |
| 13:33 | x^2 | can someone help me understand the 'flow' of a program i am looking to write in clojure? |
| 13:33 | pbostrom | jumping into the conversation mid-stream: have y'all tried the Lighttable browser repl? it's pretty nice, I must say I've given p on emacs cljs nrepl at this point and use Lighttable for cljs |
| 13:33 | x^2 | i know icould write it- but im wondering about doing it functionally. |
| 13:33 | bbloom | hey emacs people: what style of form evaling do you normally do? "eval top-level form" or "eval inner most form around the point/cursor" something else? |
| 13:34 | bbloom | how do you deal with (comment .............) stuff and evaling in there at the bottom of your file test code? |
| 13:34 | pbostrom | bbloom: I usually eval top-level form |
| 13:34 | bbloom | and how do you utilize full-file re-eval? |
| 13:34 | seangrove | bbloom: Initially load the file, then C-c C-c to eval the top level form of whatever form I'm in |
| 13:34 | bbloom | seangrove: what does that do if the top-level form is (comment .....) for bottom of file test code? |
| 13:35 | seangrove | bbloom: In that case I jump to the end of the form and C-x C-e to explicitely eval the previous form |
| 13:36 | bbloom | ah ok so you intentionally use two separate bindings there |
| 13:36 | bbloom | tpope changed some vim-fireplace behavior & my brain needs to readjust, but i figured i'd see if there was some even better ideas out there before i commit my fingers to memorizing different habits :-) |
| 13:37 | seangrove | Can't say if it's better or worse, but it's what we (I) have in emacs |
| 13:37 | sveri | hi, I am wondering why this happens: I retrieve some data from datomic and I have two defs at the end a "def" and a "defn" both return the same block, but the defn function fails with an error and the def function doesnt: http://pastebin.com/tR5CW11a any idea what is wrong there |
| 13:38 | bbloom | sveri: map is lazy |
| 13:39 | bbloom | sveri: oh sorry, misread. hm |
| 13:39 | bbloom | sveri: you just need to CALL get-releases |
| 13:39 | redinger | sveri: (first (get-releases)) |
| 13:39 | bbloom | (first (get-releases)) |
| 13:40 | sveri | bbloom: redinger jeez, again, I made that mistake some time ago :D |
| 13:40 | sveri | thank you very much, god, I feel so stupid |
| 13:40 | ontoillogical | Is there a good clojureism for accessing values in multi-dimensional maps? i.e {:aws {:private-key "KEY"} . (:private-key (:aws my-settings)) seems ugly to me |
| 13:41 | bbloom | ontoillogical: use get-in or -> |
| 13:41 | ontoillogical | bbloom: get-in! that's what I wanted |
| 13:41 | LLKCKfan | Is there any natural ways to relieve pain without using herbs or weed? No drugs |
| 13:41 | ontoillogical | thanks (I'm just starting clj) |
| 13:43 | bbloom | ontoillogical: 4clojure.com is a great place to learn idioms (and/or golfing techniques) |
| 13:43 | bbloom | ontoillogical: follow some top users & do some puzzles there. see also the cheatsheet |
| 13:43 | bbloom | ~cheatsheet |
| 13:43 | clojurebot | Cheatsheets with tooltips can be found at http://jafingerhut.github.com/ . |
| 13:44 | ontoillogical | bbloom: thanks. I find working through a project the best way to learn a language, but you miss idioms that way |
| 13:44 | bbloom | ontoillogical: yup, hence the 4clojure suggestion :-) |
| 13:45 | llasram | LLKCKfan: Such as a natural substance derived from the beautiful poppy flower? |
| 13:46 | ontoillogical | bbloom: what does following someone on there mean? |
| 13:46 | ontoillogical | do I get updates when they solve new problems? |
| 13:46 | bbloom | ontoillogical: no |
| 13:47 | bbloom | ontoillogical: when you solve the puzzle, you see their solutions |
| 13:47 | ontoillogical | ah way better |
| 13:47 | koreth_ | 4clojure is really helpful. Though I wish they had tasks that involved stuff other than pure data transformations, e.g., dealing with network I/O. |
| 13:49 | scottj | koreth_: maybe that's because of security issues. |
| 13:49 | LLKCKfan | v |
| 13:49 | LLKCKfan | Is there any natural ways to relieve pain without using herbs or weed? No drugs |
| 13:50 | sm0ke | LLKCKfan: are you a bot? |
| 13:50 | sm0ke | fkn bots |
| 13:50 | llasram | clojurebot: bots? |
| 13:50 | clojurebot | No entiendo |
| 13:51 | llasram | clojurebot: bots are annoying, except for clojurebot |
| 13:51 | clojurebot | Huh? |
| 13:51 | llasram | Oh well -- I tried |
| 13:51 | llasram | Ok, one more try, then I'll give up: |
| 13:51 | sm0ke | i think we should have a bot which would mine chat data and triggers alarms for trolls |
| 13:51 | LLKCKfan | Not a bot |
| 13:51 | llasram | clojurebot: bots |are| annoying, except for clojurebot |
| 13:51 | clojurebot | Alles klar |
| 13:51 | llasram | clojurebot: bots? |
| 13:51 | clojurebot | bots are annoying, except for clojurebot |
| 13:52 | llasram | woot |
| 13:52 | pjstadig | llasram: you're getting pretty good at that |
| 13:52 | sm0ke | whoa |
| 13:52 | sm0ke | clojurebot runs on datomic |
| 13:52 | sm0ke | stores *facts* |
| 13:52 | llasram | I believe clojurebot well predates datomic :-) |
| 13:53 | llasram | pjstadig: I've got to live up to that "bot whisperer" title! |
| 13:53 | pjstadig | i think it actually runs on the JVM to be precise |
| 13:53 | pjstadig | does it use datomic now? |
| 13:53 | stirfoo | I started playing with sqlkorma and sql in general. Is using a hyphen in column names going to present any future problems? |
| 13:53 | dacc | LLKCKfan: uh, physical therapy? |
| 13:53 | stirfoo | shank-dia for instance instead of shank_dia or shankDia. The latter don't mesh very well with lisp symbol naming conventions. |
| 13:54 | sm0ke | LLKCKfan needs lisp |
| 13:54 | LLKCKfan | dacc Tried no help |
| 13:54 | sm0ke | he has rsi |
| 13:54 | LLKCKfan | If anything makes the pain worse |
| 13:54 | pjstadig | dashes vs underscores are the bane of my existence |
| 13:54 | sm0ke | lisp reduces your coding time hence pain |
| 13:55 | sm0ke | clojurebot: sex? |
| 13:55 | clojurebot | It's greek to me. |
| 13:56 | sm0ke | clojurebot is a virgin |
| 13:57 | stirfoo | seems the common naming convention for sql is underscore or camel case, but with korma I can use symbols or keywords to reference them |
| 13:57 | TimMc | LLKCKfan: http://ergoemacs.org/emacs/using_voice_to_code.html |
| 13:57 | stirfoo | Bit off topic I realize. |
| 13:57 | dacc | LLKCKfan: you're talking about RSI pain? |
| 13:57 | dacc | LLKCKfan: do you get plenty of cardio? |
| 13:58 | sm0ke | clojurebot: sex |is| updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; |
| 13:58 | clojurebot | Roger. |
| 13:58 | sm0ke | clojurebot: sex? |
| 13:58 | clojurebot | sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; |
| 13:58 | sm0ke | in think finger is too early |
| 14:01 | `cbp | ._. |
| 14:02 | TimMc | "cd" is clever |
| 14:02 | sm0ke | clojurebot: sex |is| updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep; |
| 14:02 | clojurebot | Alles klar |
| 14:03 | sm0ke | clojurebot: sex? |
| 14:03 | clojurebot | sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep; |
| 14:03 | sm0ke | clojurebot gets some tips from vimgor |
| 14:11 | gfredericks | what just happened here |
| 14:13 | bbloom | ,clojure.lang.PersistentQueue/EMPTY |
| 14:13 | clojurebot | #<PersistentQueue clojure.lang.PersistentQueue@1> |
| 14:13 | bbloom | ,(clojure.lang.PersistentQueue/EMPTY) |
| 14:13 | clojurebot | #<PersistentQueue clojure.lang.PersistentQueue@1> |
| 14:13 | bbloom | hmm... is that some interop thing about static functions i don't know or understand? |
| 14:15 | llasram | Whoa -- how does the second one work? |
| 14:16 | gfredericks | ,Math/PI |
| 14:16 | clojurebot | 3.141592653589793 |
| 14:16 | gfredericks | ,(Math/PI) |
| 14:16 | clojurebot | 3.141592653589793 |
| 14:18 | gfredericks | does java allow a static field and a static method with the same name? |
| 14:18 | pjstadig | no, don't think so |
| 14:19 | gfredericks | ,(Math/PI 42) |
| 14:19 | clojurebot | #<CompilerException java.lang.IllegalArgumentException: No matching method: PI, compiling:(NO_SOURCE_PATH:0:0)> |
| 14:19 | bbloom | where is bronsa when you need him? |
| 14:19 | lgas | Hi. I'm trying to use korma (0.3.0-RC5) but when I try to use korma.core I get "Exception namespace 'korma.db' not found". I've checked and the jar file under .m2 has the korma/db.clj file and it has a proper namespace declaration. What else could be going on? |
| 14:19 | lgas | (Googling didn't turn up anyone else with the same problem) |
| 14:21 | llasram | Oh, I see: ##(macroexpand `(Math/PI)) |
| 14:21 | lazybot | ⇒ (. java.lang.Math PI) |
| 14:21 | Anderkent | lgas: is the jar on your classpath? |
| 14:21 | Anderkent | ,(macroexpand 'Math/PI) |
| 14:21 | clojurebot | Math/PI |
| 14:21 | rasmusto | ,(. java.lang.Math PI) |
| 14:21 | clojurebot | 3.141592653589793 |
| 14:22 | bbloom | aaaah |
| 14:22 | pjstadig | sneaky |
| 14:22 | Anderkent | right, the reflector checks if its method |
| 14:22 | sm0ke | ,(macroexpand Math/PI) |
| 14:22 | clojurebot | 3.141592653589793 |
| 14:22 | bbloom | odd tho |
| 14:22 | bbloom | oh interop, you so crazy |
| 14:22 | llasram | Certainly an expected effect |
| 14:22 | ieure | it |
| 14:22 | llasram | Er, unexpected |
| 14:23 | Anderkent | they don't think it be like it but it do |
| 14:23 | lgas | Well, I'm using leiningen and it's in the output of "lein classpath". |
| 14:23 | Anderkent | lgas: well, huh. :P |
| 14:23 | sm0ke | ,(bean Math) |
| 14:24 | clojurebot | #<ExceptionInInitializerError java.lang.ExceptionInInitializerError> |
| 14:24 | sm0ke | ,(bean java.lang.Math) |
| 14:24 | clojurebot | #<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class sun.awt.AppContext> |
| 14:24 | Anderkent | lgas: can you post your ns form/ stacktrace? It works for me, I'd bet on a minor syntax mistake ;p |
| 14:24 | sm0ke | ##(bean Math) |
| 14:24 | lazybot | java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain) |
| 14:25 | lgas | Yeah I'm kinda stumped. I feel like I must be shadowing some name somewhere or something that is causing a problem. I do have some thing's named "db" in other namespaces but I don't see any immediate interactions. |
| 14:25 | Anderkent | llasram: are out of memory errors when running parkour tests something you've seen before? |
| 14:26 | TimMc | &(#(Math/PI)) |
| 14:26 | lazybot | ⇒ 3.141592653589793 |
| 14:26 | TimMc | gfredericks: ^ |
| 14:26 | lgas | I mean just "(use 'korma.core)" in a repl fails with "Exception namespace 'korma.db' not found clojure.core/load-lib (core.clj:5380)" |
| 14:26 | TimMc | So #(Math/PI) is an undocumented, unstable alternative to (constantly Math/PI) |
| 14:26 | Anderkent | llasram: also, leveraging your 'oh I know what that is' magic: https://www.refheap.com/34683 |
| 14:27 | llasram | Anderkent: Nope. The main machine I run the suite on myself does have 32GB of RAM, but it's also passing on Travis CI, which I don't think is so generous |
| 14:28 | Anderkent | meh :P |
| 14:29 | sm0ke | ,`h |
| 14:29 | clojurebot | sandbox/h |
| 14:29 | konr | If I use skip-aot, generate an uberjar and run it using java -jar, java will try to load a non-existing main class and fail, right? What are the alternatives? Only not skipping compilation? Can I compile just the main file and leave the rest to be compiled at run time? |
| 14:29 | llasram | Anderkent: Huh. I have not seen that before |
| 14:29 | sm0ke | ,(in-ns sandbox) |
| 14:29 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: sandbox in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 14:29 | lgas | Anderkent: is that what you meant about my ns/form/stacktrace? |
| 14:29 | sm0ke | ,(in-ns 'sandbox) |
| 14:29 | clojurebot | #<Namespace sandbox> |
| 14:29 | sm0ke | ,(inc 1) |
| 14:29 | clojurebot | 2 |
| 14:30 | llasram | Anderkent: That's very very odd -- |
| 14:30 | Anderkent | llasram: welcome to my life :P |
| 14:30 | Anderkent | (inc 1) |
| 14:30 | sm0ke | ,(def a 10) |
| 14:30 | lazybot | ⇒ 7 |
| 14:30 | clojurebot | #'sandbox/a |
| 14:30 | sm0ke | ,a |
| 14:30 | clojurebot | 10 |
| 14:30 | Anderkent | haha someone's done that before ;) |
| 14:31 | sm0ke | (inc clojurebot) |
| 14:31 | lazybot | ⇒ 32 |
| 14:31 | llasram | Anderkent: So that's the standard exception for not having a matching clause in a `condp`. But the test is passing the result of `io/file` into abracad, and `source-for`'s `condp` has a case for `File` |
| 14:33 | Anderkent | llasram: yeah I'll just add debugging to see what it's actually getting |
| 14:33 | llasram | Ok |
| 14:34 | llasram | Oh, fun: ##(clojure.java.io/file nil) |
| 14:34 | lazybot | ⇒ nil |
| 14:34 | llasram | So that's a possibility |
| 14:34 | Anderkent | oh. |
| 14:34 | Anderkent | how does it find the file? |
| 14:35 | llasram | Yeah, that's my guess -- something is causing the test job to produce no output, which means the globing on the output directory produces an empty list, which is `first`=>`nil`, then nil all the way in |
| 14:35 | llasram | Globbin' |
| 14:37 | Anderkent | yeah, that's it |
| 14:37 | Anderkent | so i guess that's just a result of previous tests failing |
| 14:38 | llasram | Well, should be a previous part of the same test. There's no intentional dependencies between tests |
| 14:39 | Anderkent | llasram: well, running with a 2g heap fixes all errors |
| 14:39 | llasram | Iiiinteresting |
| 14:39 | Anderkent | I always knew putting more RAMs fixes everything |
| 14:40 | llasram | I'll run under some tiny heaps and see if I can figure out what goes wrong in such a non-obvious way |
| 14:40 | Anderkent | llasram: it might be that it's the instrumentation influences it |
| 14:40 | Anderkent | i.e. I only get one OOM when running standalone tests |
| 14:41 | Anderkent | as opposed to many when under coverage |
| 14:41 | Anderkent | but it's not a priority for me to make covered code perform well :P |
| 14:41 | llasram | Fair enough :-) |
| 14:42 | Anderkent | hm, looking through the outputs, I really should start handling deftype and reify |
| 14:42 | llasram | Those are pretty important, at least for anything doing serious interop |
| 14:43 | Anderkent | yeah, and the syntax isn't *that* complicated |
| 14:47 | sdegutis | Well then. |
| 14:52 | mdrogalis | Wooo! tbaldridge: The Movie |
| 14:54 | sdegutis | My love affair with Clojure is slowly dying, and I think it's mostly because of the JVM. |
| 14:54 | bbloom | sdegutis: wussamatta? |
| 14:54 | sdegutis | It just doesn't feel suitable for small things. |
| 14:55 | bbloom | sdegutis: it isn't :-P |
| 14:55 | Anderkent | sdegutis: JVM has its pain points, but also some great strengths |
| 14:55 | sdegutis | Anderkent: True dat. |
| 14:55 | cark | sdegutis: great, time to dive into clojurescript then ! |
| 14:55 | sdegutis | We're totally loving Clojure at work, but that's a big project, so it's different. |
| 14:55 | xuser | sdegutis: use CL ;) |
| 14:55 | sdegutis | xuser: ML you say? |
| 14:55 | sdegutis | cark: I want to like that idea. I really really do. |
| 14:56 | cark | sdegutis: but ? |
| 14:56 | sdegutis | I was hoping to play with ClojureCLR in some WPF apps this weekend, but I need to work on work this weekend so it'll be yet another week before I can try. |
| 14:57 | xuser | sdegutis: common lisp |
| 14:57 | sdegutis | cark: node doesn't feel any slimmer than JVM in my weird brain. |
| 14:57 | sdegutis | xuser: Hmm, that seems like a bad idea. |
| 14:57 | sdegutis | xuser: I mean, to use CL for small command line utilities. |
| 14:58 | cark | sdegutis: it all depends on what you want to do ....for some things, even C++ might sometimes be the best tool |
| 14:58 | sdegutis | cark: I can't imagine when that would be. Possibly embedded systems? |
| 14:59 | sdegutis | Or when you're working in a legacy codebase which is written in C++ maybe. |
| 14:59 | cark | sdegutis: i really don't know =) |
| 14:59 | hfaafb | games v0v |
| 14:59 | cark | maybe making a game or something |
| 14:59 | sdegutis | Oh yeah, I forgot to try compiling Quake 3. |
| 15:00 | cark | sdegutis: for command line utilities, i think node is good enough (with added clojureness) |
| 15:00 | sdegutis | cark: Maybe it's not the node VM itself, maybe it's just the way it's structured. Node just doesn't feel self-contained. |
| 15:01 | sdegutis | (I don't mean in the sense that it requires a node interpreter.) |
| 15:01 | sdegutis | Never mind. All my opinions are broken. |
| 15:01 | cark | i don't quite get what you mean |
| 15:01 | Anderkent | I wish travisci wouldn't send me emails about it erroring when 'reference is not a tree' |
| 15:02 | sdegutis | So many things aren't. So very many things. |
| 15:03 | sdegutis | Sorry for the noise. |
| 15:03 | sdegutis | Going back to work. |
| 15:04 | Voyage | hi |
| 15:04 | Voyage | the renaming of variables and methods dont work for advanced option. renaming dont work http://closure-compiler.appspot.com/home or am I on mistake? |
| 15:07 | pbostrom | Voyage: are you asking about Closure or Clojure? |
| 15:07 | Anderkent | Is there an easy way to go from function object -> the symbol of a function (assuming one exists?)_ |
| 15:07 | S11001001 | Anderkent: no |
| 15:07 | Voyage | hm |
| 15:07 | Anderkent | meh. I have to carry both with me I suppose. |
| 15:08 | splunk_ | http://stackoverflow.com/questions/21634507/require-child-namespace-as-shorthand-in-clojure |
| 15:09 | splunk_ | ^ stackoverflow points for answers? |
| 15:09 | S11001001 | Anderkent: maybe you could use the Var where relevant; Vars are IFns |
| 15:10 | Anderkent | S11001001: and build the symbol from var meta? |
| 15:10 | Anderkent | guess that could work |
| 15:10 | doody1 | there was javaspaces in the past, I wonder what happened to it |
| 15:10 | hiredman | no such thing as child namespaces |
| 15:10 | hiredman | the space of namespaces is flat |
| 15:11 | S11001001 | Anderkent: I *think* the var has the name in it. Er, maybe. |
| 15:11 | S11001001 | Anderkent: long time ago |
| 15:12 | splunk_ | hiredman: ah, thanks. if you want to type that into stack overflow I"m happy to accept. |
| 15:13 | Anderkent | S11001001: it has it in the metadata for sure, and it seems it has ns / symbol props; not sure if there's a standard api for it |
| 15:14 | cark | (ns ... (:use [cara.webtl blah bleh buh])) used to work, doesn't it work anymore ? |
| 15:14 | novochar | What are the two fundamental data structures in clojure? vectors and _ ? |
| 15:15 | gfredericks | listssetsmaps |
| 15:15 | llasram | :-) |
| 15:15 | gfredericks | clojurebot: the two fundamental data structures in clojure are vectors and listssetsmaps |
| 15:15 | clojurebot | It's greek to me. |
| 15:15 | gfredericks | clojurebot: the two fundamental data structures in clojure |are| vectors and listssetsmaps |
| 15:15 | clojurebot | Roger. |
| 15:16 | splunk_ | cark: I think that takes everything inside blah bleh bluh and puts it into your current namespace. So if you're in user, that makes cara.webtl.bluh/foo => user/foo. i'm just trying to get it into bluh/foo, not user/foo. |
| 15:17 | cark | oh i see |
| 15:17 | TimMc | Is there an ordered map that just maintains insertion order, not using a sort fn? |
| 15:18 | llasram | TimMc: In the Java-verse there are "linked" maps |
| 15:19 | llasram | I vaguely think amalloy_/flatland has a Clojure one? |
| 15:19 | TimMc | Oh, of course it would... |
| 15:19 | llasram | Ah, here we go: https://github.com/flatland/ordered |
| 15:21 | zaiste | I just wrote a tutorial about building web apps with Compojure/Om http://bit.ly/1g3jIm9 |
| 15:21 | zaiste | i'd appreciate any feedback |
| 15:45 | invasmani | zaiste: some errors for you to fix, the ns declaration for acme.core is broken after put!. above that, in the frontend section, you meant to say to create a clj/ directory, not cli/ |
| 15:47 | sdegutis | I dunno about you, but.. |
| 15:48 | AeroNotix | technomancy: how to get the pid of a `lein run`'d |
| 15:48 | AeroNotix | app |
| 15:48 | AeroNotix | ? |
| 15:48 | irctc | Anderkent: it turned out that korma is incompatible with clojure.java.jdbc 0.3.3 and bumping it down to 0.2.3 in my project fixed it. |
| 15:48 | irctc | oops this is lgas |
| 15:48 | Anderkent | AeroNotix: from within the process or from outside? |
| 15:48 | AeroNotix | Anderkent: outside |
| 15:48 | AeroNotix | I'm having trouble starting my compojure apps in CI |
| 15:49 | Anderkent | lgas: oh, that sucks |
| 15:49 | AeroNotix | and it seems that lein/compojure/ring/something is forking off the process |
| 15:49 | AeroNotix | so even if I grab $! after spawning it, that no longer is the actual pid |
| 15:49 | lgas | I'm just happy to have gotten it working. For this project I can just use the older jdbc package. |
| 15:50 | Anderkent | AeroNotix: right, that's lein - it'll start a child process for the project so that you dont get lein classes/dependencies on your classpath |
| 15:50 | AeroNotix | Anderkent: running the jar itself also ended up with a different process |
| 15:50 | Anderkent | AeroNotix: oh. Then you migh be forking twice :P |
| 15:51 | AeroNotix | Anderkent: I'm not doing any forking |
| 15:51 | invasmani | zaiste: some more errors, the fetch-widgets function definition is broken after the let |
| 15:52 | invasmani | zaiste: same with widget-box :0 |
| 15:52 | sritchie | any reagent users here? |
| 15:53 | muhoo | ~sex is off-topic and not appropriate for the channel |
| 15:53 | clojurebot | 'Sea, mhuise. |
| 15:54 | Anderkent | llasram: so, with the caveat of having to remove the non-compiling ns, run with clojure 1.6.0-alpha3, and with a large heap, cloverage 1.0.4-snapshot can now do parkour! Yay :P |
| 15:54 | Anderkent | the output seems moderately okay too. |
| 15:55 | llasram | Sweeeet |
| 15:56 | llasram | Looking forward to fixing up gaps :-D |
| 15:58 | bmath | I noticed CircleCI is hiring, and they use clojure: https://angel.co/jobs?slug=circleci |
| 15:59 | Anderkent | hm, there's some weird things about the output here and there; I'll have to look into it. If you see any obvious mistakes, bug reports are always welcome! :P |
| 16:01 | mdrogalis | bmath: For the record, CircleCI is an excellent build tool, IMO. |
| 16:01 | Anderkent | bmath: mdrogalis: I've used it before (mostly because they did private repo support while travis didnt), the guys over there were very responsive and quick with fixing stuff |
| 16:02 | mdrogalis | Same experience with support. |
| 16:02 | Anderkent | but the builds could be a little unreliable and there was no way to tell why a build was queued. That was a long time ago though (6months+), so I expect stuff's changed |
| 16:03 | bmath | I used them at a contracting job for a few months |
| 16:03 | bmath | everything worked pretty damn well |
| 16:03 | bmath | build failures were easily traceable |
| 16:03 | AeroNotix | Anderkent: found a utility to give me a process tree. |
| 16:03 | mdrogalis | Have you seen what boxes they're using recently? |
| 16:03 | AeroNotix | I'll just walk that tree |
| 16:03 | bmath | there was a bit of an integration challenge (very minor): had to write some hook scripts to get things running |
| 16:04 | mdrogalis | I'll take a screenshot. |
| 16:04 | Nyyx | anyone using cursive clojure know how to assign shortcuts to the REPL interactions? |
| 16:05 | Nyyx | nvm I found it |
| 16:15 | dacc_ | Nyyx: i'm using cursive too -- do you use the idea vim emulation? |
| 16:16 | mdrogalis | bmath & Anderkent: http://i.imgur.com/0mLZLuG.png |
| 16:16 | mdrogalis | CircleCI's build machines |
| 16:17 | Nyyx | dacc: no |
| 16:17 | amalloy | huh, load of 24 on a 24-core machine. nice balancing |
| 16:17 | Nyyx | next time I have to do something tedious with text I might install it though |
| 16:18 | mdrogalis | amalloy: Isn't that 32 cores? |
| 16:18 | amalloy | oh. i didn't scroll far enough right |
| 16:18 | mdrogalis | :P |
| 16:18 | amalloy | well, i take it all back. you guys are squandering your resources |
| 16:18 | Nyyx | people in #ruby are crazy, they think that packaging an app in gem through command line is feasible to deploy to a non rubyist end user |
| 16:18 | mdrogalis | amalloy: Hah. |
| 16:19 | amalloy | where's the bitcoin mining daemon? |
| 16:19 | seangrove | mdrogalis: Are you at CircleCI? |
| 16:19 | mdrogalis | I would live to hijack that entire box and run some code with reducers on it. |
| 16:19 | Nyyx | cpu cores are worthless for bitcoins |
| 16:19 | mdrogalis | seangrove: No, just using it for my builds. |
| 16:20 | seangrove | mdrogalis: Got it |
| 16:21 | mdrogalis | But yeah, very interesting set up. |
| 16:54 | avishai | anybody can recommend a clojure crypto library? |
| 16:55 | avishai | specifically for verifying x509 signatures |
| 17:00 | stuartsierra | avishai: There are excellent Java crypto libraries with a common API built in to the JDK. |
| 17:00 | moquist | I love http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded . But why must all state be local? |
| 17:00 | moquist | In particular, "c.t.n.repl/refresh will destroy those Vars when it reloads the namespace" -- but isn't that exactly what you want? |
| 17:00 | moquist | ( https://github.com/clojure/tools.namespace ) |
| 17:01 | moquist | I ask because my app doesn't have global state, but I want to use external libraries that do. I'm trying to figure out how much I should worry about that. |
| 17:01 | stuartsierra | moquist: That's more of a general recommendation. |
| 17:02 | avishai | stuartsierra, i know bouncycastle but i was hoping for something idiomatic |
| 17:02 | moquist | OK. So I should only sort-of worry that I'll paint myself into REPL corners without realizing it when I use libs that have global state... |
| 17:02 | stuartsierra | avishai: Using Java libraries is idiomatic Clojure. |
| 17:02 | avishai | stuartsierra, 10x |
| 17:02 | stuartsierra | moquist: Java libraries are usually isolated enough that it's not a problem for tools.namespace. |
| 17:03 | moquist | stuartsierra: OK. I'll proceed without fear, then. Thanks. |
| 17:03 | stuartsierra | moquist: You can get yourself into trouble if you need to do stuff to "clean up" the old state, like shutting down socket connections or closing files. `tools.namespace` won't do that for you. |
| 17:03 | stuartsierra | But it will destroy your references to that state, making it impossible to get back to the thing you need to close. |
| 17:04 | moquist | Right. I have stuff in mind like atoms that various libs use, and then you def a bunch of stuff into them, etc. |
| 17:04 | moquist | Seems rather innocuous. |
| 17:04 | stuartsierra | moquist: That has its own problems, but it won't necessarily break from reloading namespaces. |
| 17:05 | moquist | I was considering patching one in particular that only has a couple atoms, and sending a pull request. I'll probably still do that. |
| 17:06 | stuartsierra | I believe libraries should avoid creating their own mutable state except where absolutely necessary, but that opinion is not universally shared. |
| 17:10 | novochar | Why doesn't this print the string "adding them!"? http://gist.github.com/novodinia/6802591305d9da7ae298/raw/562251d64d7a61e8f030dd39322542d6c628448e/gistfile1.txt |
| 17:11 | _rc | novochar: (my-func 10 20) |
| 17:11 | _rc | novochar: otherwise you're just evaluating all the values |
| 17:29 | novochar | If someone has time, would you mind explaining the concert destructuring example here: http://clojure-doc.org/articles/tutorials/introduction.html#destructuring |
| 17:30 | novochar | You are creating a vector what of key, value pairs |
| 17:30 | bbloom | ~destructuring |
| 17:30 | clojurebot | destructuring is http://clojure.org/special_forms#binding-forms |
| 17:30 | novochar | where :band is associated with "The Blues Brothers" |
| 17:31 | novochar | It's odd that a vector is used here instead of a map |
| 17:32 | abp | novochar: for {:keys [band location promos perks]}? |
| 17:37 | alexyakushev | Hey guys, can some1 tell me a difference between "X.Y.Z-slim" and "X.Y.Z-sources" Clojure builds? |
| 17:39 | novochar | How do you play with clojurescript? |
| 17:40 | novochar | I can't get a repl: https://github.com/clojure/clojurescript/wiki/Quick-Start |
| 17:40 | novochar | And I don't know how to compile apps either |
| 17:40 | abp | novochar: try https://github.com/cemerick/austin |
| 17:41 | abp | novochar: for compiling https://github.com/emezeske/lein-cljsbuild |
| 17:42 | novochar | Is it possible to install austin with lein? |
| 17:43 | ivan | yep. just put {:user {:plugins [[com.cemerick/austin "0.1.3"]]}} in your ~/.lein/profiles.clj |
| 17:44 | abp | novochar: like ivan said, documented under "Installation" on there |
| 17:44 | ivan | or to a :dev profile in project.clj as this says https://github.com/cemerick/austin#installation |
| 17:44 | dnolen | novochar: yes, easiest way to play with ClojureScript w/ minimal setup is Light Table - http://github.com/swannodette/lt-cljs-tutorial, I also put this tutorial together http://swannodette.github.io/2013/11/07/clojurescript-101 |
| 17:44 | novochar | ivan: How did you know to do that, is it because you did `lein search austin` and saw the latest stable release? |
| 17:45 | ivan | well, now I know about lein search |
| 17:45 | ivan | I was using github and clojars and maven search |
| 17:45 | abp | dnolen: heh, btw, would you at some point extend your om tutorial for emacs or is that not feasible bc austin lacking optimizations none? |
| 17:46 | abp | dnolen: also damn great work on the tutorials and the lib. thank you! looking forward to build something off it |
| 17:46 | dnolen | abp: don't really have much interest in rewriting it for Emacs. Also austin not working with optimizations none doesn't make any sense. |
| 17:47 | dnolen | abp: glad you like them. |
| 17:47 | abp | dnolen: just read that somewhere |
| 17:48 | dnolen | abp: of course more than willing to put notes some where about making it work w/ Emacs since it's not going to be very different w/ the right setup. |
| 17:48 | abp | dnolen: yeah, started experimenting in the early days, so all my experiments are broken now. but i see it's getting more awesome with every commit. |
| 17:48 | abp | dnolen: sure, i thought about different entry articles for the tutorial so everyone can get going with om/cljs from there |
| 17:49 | abp | dnolen: I'd even volunteer to help out |
| 17:49 | abp | dnolen: well, light table and emacs users, not everyone |
| 17:49 | dnolen | abp: anyone can edit the wiki so, if you feel like tweaking it or linking in Emacs notes feel free. |
| 17:50 | novochar | Austin is something you use with an existing repl? |
| 17:52 | abp | novochar: basically, yes |
| 17:53 | abp | dnolen: haven't used austin from emacs for a while, but will try to put something together now anyway. you don't use browser repl from emacs? |
| 17:54 | dnolen | abp: I do yes, but just the basic one via inferior-lisp. Still haven't tried Austin yet. |
| 17:55 | abp | dnolen: ah ok, i haven't even used inferior lisp i think. pragmatically using emacs-live for a year now. |
| 17:56 | dnolen | abp: cool, never tried emacs-live. |
| 17:56 | novochar | I'm playing with the browser-connected-repl-sample in the austin repo |
| 17:57 | novochar | i open lein repl, type in `(cemerick.austin.repls/exec)` and receive an error which states: `Cannot run program "phantomjs": error=2, No such file or directory` |
| 17:57 | novochar | Has anyone else ran into this error? |
| 17:58 | abp | dnolen: well you get a whole lot and don't need to do much.. except you start to feel the urge to customize. have done some things but others just weren't worth the experiment to me, like investigating helm etc. company i work at got a real emacs resurrection out of live |
| 17:58 | abp | dnolen: mostly for org |
| 17:59 | dnolen | novochar: I suggest following my advice early if you don't want to lose time in configuration hell. Save that for after you get the basics. |
| 17:59 | novochar | brew update && brew install phantomjs seems to be a solution on github |
| 17:59 | novochar | https://github.com/cemerick/austin/pull/13 |
| 18:00 | abp | novochar: well, don't you want a browser connected repl? |
| 18:01 | novochar | dnolen: If after 10 mins, I'm not at the point of following along with the Om tutorial, I will try out lighttable |
| 18:01 | novochar | and read through the tutorial |
| 18:01 | abp | dnolen: i think he struggled with the instructions from cljs wiki before, so i pointed him to austin |
| 18:01 | dnolen | novochar: I didn't link to any Om tutorials, on ClojureScript ones |
| 18:01 | dnolen | s/on/only |
| 18:02 | dnolen | novochar: oh, I think I see what you are saying. Yeah Om is not a good introduction to ClojureScript unless you like firehoses. |
| 18:04 | abp | dnolen: well with light table it's quite smooth if you don't come from emacs |
| 18:05 | pbostrom | dnolen: fyi, I "ported" bits of your old autocomplete example to Om, going to try to document it a little bit |
| 18:05 | abp | pbostrom: great! that's what i need at some point for my work |
| 18:07 | pbostrom | abp: watch the cljs mailing list, I'll try to post a link to the repo later tonight |
| 18:07 | abp | pbostrom: nice, thank you. :) |
| 18:08 | novochar | So close! |
| 18:08 | novochar | at step 5 in https://github.com/cemerick/austin/tree/master/browser-connected-repl-sample |
| 18:08 | novochar | but it isn't alertin the browser |
| 18:08 | novochar | phantomjs is running |
| 18:08 | novochar | I don't understand the reset! statement |
| 18:09 | novochar | Is that `(reset!)` or `(browser-repl-env reset!)`? |
| 18:09 | novochar | locahost:8080 is showing the document from the sample app |
| 18:09 | dnolen | pbostrom: that sounds interesting! |
| 18:11 | novochar | dnolen: I want a firehose experience |
| 18:11 | dnolen | novochar: heh |
| 18:11 | novochar | Well, not really, but if it's required |
| 18:11 | novochar | Anyone ever got to step 5 of the austin browser connected sample app and it fails? |
| 18:12 | abp | novochar: I'm just trying for an emacs-austin om tut entry |
| 18:13 | novochar | abp: You're creating an emacs-austin om tutorial? |
| 18:13 | pbostrom | novochar: IMO Austin is one of the harder things to configure in the Clojure dev ecosystem, I've tried using it at several points, and the previous tool piggieback, LightTable is like two steps |
| 18:13 | novochar | I would love that, I really want to use emacs. |
| 18:14 | abp | novochar: well there's a server still missing etc. so it's not going to happen within hours, probably this weekend |
| 18:16 | abp | pbostrom: well, austin still uses piggieback, i've used it some times but it's not "easy" to set up, as in eval, running |
| 18:17 | novochar | "Now that the ClojureScript REPL is ready, you need to load http://localhost:8080, or reload it if you brought it up before the REPL environment was created and reset! into the browser-repl-env atom. " |
| 18:17 | novochar | This is the part that is confusing me |
| 18:17 | novochar | Does anyone understand this at all? |
| 18:18 | novochar | Oh cool! |
| 18:18 | novochar | I just needed to refresh the page |
| 18:18 | novochar | This is the coolest thing ever |
| 18:19 | novochar | ..for now at least.. |
| 18:20 | pbostrom | abp: I felt like I got into a decent workflow with it, but occasionally the java process would go crazy and I've have to restart the JVM |
| 18:21 | abp | pbostrom: heh, last time i've tried compilation from evaluating to the repl was so slow i just didn't use it alltogether |
| 18:21 | elarson | this looks pretty interesting http://techblog.netflix.com/2014/01/introducing-pigpen-map-reduce-for.html |
| 18:22 | abp | pbostrom: lein cljsbuild auto and be done with it, but now i'm trying to put together a proper om-tut project template so we all can repl some om cljs |
| 18:22 | novochar | Is it possible to instruct to include austin with every project so that you don't have to manually walk through this process each time? |
| 18:22 | novochar | instruct lein |
| 18:23 | abp | novochar: so you've combined browser-connected-repl-sample and om-tut? |
| 18:23 | novochar | abp: That's what I want |
| 18:24 | abp | novochar: I'm at it, but for your environment to work you must've done that |
| 18:24 | novochar | I assumed having austin listed in ~/.lein/profiles.clj would include it within each new project, but I'm not entirely sure why it's in there now. |
| 18:25 | abp | novochar: getting this to work generically goes against choosing your templating engine for the server side since you need to include austins script |
| 18:29 | berdario | I have a macro that takes "body" and then unquotes-splices it... I want to be able to generate a list of expressions to be passed as body |
| 18:30 | berdario | I tried with (defmacro m [body] `(innermacro ~~@body)) |
| 18:30 | berdario | but I'm unable to get it working |
| 18:30 | berdario | I looked at the output of macroexpand-1 |
| 18:31 | berdario | is reimplementing the macro the only way to do it? |
| 18:35 | l1x | hey |
| 18:36 | l1x | what is the best way to load a local jar in a clojure project? (jar is not in clojars or any jar repo) |
| 18:47 | amalloy | put it into a repo |
| 18:47 | amalloy | like, you can avoid that step, or even just use your local repo, but putting it on clojars at least is easier and better |
| 18:48 | abp | amalloy: have you set up a local repo? |
| 18:48 | amalloy | abp: no, i just mean like lein install |
| 18:48 | amalloy | your ~/.m2, not a proper repo |
| 18:48 | abp | amalloy: ah well |
| 18:50 | abp | amalloy: looking at it for a minute, setting up a private repo proper looks horrible |
| 18:50 | amalloy | berdario: (defmacro m2 [& body] `(m1 ~@body)) makes m2 act exactly like m1. if you want, you can modify body somehow on the way there |
| 18:50 | amalloy | yeah, it probably is |
| 18:50 | berdario | amalloy I used 2 unquotes |
| 18:50 | amalloy | berdario: right, which is bogus |
| 18:50 | berdario | amalloy yes, how do you suggest to modify the body on the way there? |
| 18:50 | abp | amalloy: at some point i need to :| didnt you do that at geni? |
| 18:51 | berdario | I'd like to do something like |
| 18:51 | berdario | (map unquote body) |
| 18:51 | amalloy | i mean, it sounds like you are probably trying to use a macro to do something that is impossible, but you haven't given an example |
| 18:51 | amalloy | no, abp |
| 18:51 | berdario | amalloy I'm trying to use this redis library: https://github.com/ptaoussanis/carmine |
| 18:51 | novochar | abp: did you say you are working on an om-emacs-austin tutorial? |
| 18:51 | novochar | That would be immensely useful |
| 18:51 | berdario | to use the pipeline for executing multiple instructions, it seems that the only simple way is to use the wcar macro |
| 18:52 | novochar | I ended up just launching lightable in the end since this tutorial seems to be dependent on it: https://github.com/swannodette/om/wiki/Basic-Tutorial |
| 18:52 | abp | novochar: yeah still at it |
| 18:52 | berdario | unfortunately, I want to build the instructions before calling wcar |
| 18:52 | novochar | abp: Great! |
| 18:53 | l1x | amalloy: i see, what would be the local repo way? |
| 18:53 | abp | novochar: that's what i ended up with in the first place, but light table is inacceptable from an emacs users perspective right now |
| 18:55 | novochar | How is it that Om is faster than vanilla React in http://vuejs.org/perf/ |
| 18:55 | novochar | Are there compile-time optimizations? |
| 18:55 | dnolen | novochar: just faster defaults |
| 18:56 | dnolen | novochar: immutable data structures and Om implements shouldComponentUpdate to do the most efficient checks possible. |
| 18:56 | novochar | React has default settings |
| 18:56 | novochar | ? |
| 18:56 | amalloy | berdario: from a quick read of carmine's source, it looks like it really doesn't want you to do that, sadly. wcar needs to know the things it'll be doing at compile time, and there's no obvious runtime equivalent |
| 18:56 | dnolen | novochar: React components by default just return true for shouldComponentUpdate |
| 18:57 | amalloy | if you know what you want to "build" at compile time, you can do it with a macro, but if you want to make decisions at run time you are kinda out of luck |
| 18:57 | dnolen | novochar: so the React TodoMVC is just doing more work than Om. |
| 18:57 | berdario | amalloy thanks |
| 18:57 | dnolen | novochar: I designed Om to just always be fast, I don't think people should screw around with shouldComponentUpdate ever. |
| 18:58 | amalloy | there are redis libraries around that don't force you to do everything with macros |
| 18:58 | abp | dnolen: i think you know some things about react, how long of a shot is it from knowing om basics to giving a talk on react js? |
| 18:59 | dnolen | abp: Om more or less tries to present an immutable friendly version of everything React provides |
| 18:59 | dnolen | abp: they really aren't that different. However Om encourages people to use React that same way that Facebook uses React |
| 19:00 | berdario | amalloy uhm, it seems like all the alternatives have been updated 9 months ago or earlier... carmine seems the only one actively developed |
| 19:01 | dnolen | internally they have a thing called Store, which is basically a giant immutable data structure to support make speculative changes, rolls backs |
| 19:02 | dnolen | abp: and this is how I think client side apps should work, so Om encourages that |
| 19:02 | berdario | (clj-redis is a thin wrapper around jedis... maybe that could be my best bet?) |
| 19:02 | l1x | https://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/ this is what i am looking for, thanks |
| 19:02 | amalloy | berdario: so? it's not like the redis protocol changes drastically every week. something that hasn't changed in a year probably works |
| 19:02 | amalloy | (something that changed last week probably doesn't) |
| 19:03 | berdario | you're right... but if I get back to that code in 3 years, and I want to update redis to the latest version, I'd like that the library I picked is still supported |
| 19:04 | berdario | then again... a better use of my time could be just to don't worry about it now, and adapt/change the library when the time comes |
| 19:08 | seangrove | Rule #343 of pushing Clojure to production on Heroku: Any push with even a minor bug will be bundled and launched in record time. Any subsequent pushes fixing said bug will take roughly 10-15 minutes. |
| 19:14 | dacc | Nyyx: only problem with it is that [Esc] no longer takes you from the repl back to the editor |
| 19:16 | abp | meh, nice how seemingly *all* chrome extensions break austin |
| 19:18 | dsrx | anyone ever have any luck building clojuroku apps with anvil? |
| 19:18 | abp | dnolen: Good to know, I thougt fb's emphasis on making react convinient to js guys using classes etc would crush much more of the spirit |
| 19:18 | dsrx | abp: communicating over an iframe is kind of evil :\ |
| 19:18 | seangrove | technomancy: One minute a push completes in a minute or two, next time "Timed out compiling Clojure (Leiningen 2) app (15 minutes)" |
| 19:18 | dsrx | i'm working on an alternative repl transport over websockets, similar to what lighttable does I guess |
| 19:19 | seangrove | technomancy: Am I getting rate limited or anything? Have I raised some griefer flag? |
| 19:20 | abp | dsrx: well, i think google dictionary broke austin for me, good they put a fat warning into the turorial and i haven't looked at austins internals but trying to write a tutorial for it and om.. think i need to repeat the warning in there if i'm to publish it |
| 19:21 | seangrove | abp: Would be a good idea |
| 19:26 | abp | heh cemerick, google dictionary seems to also break austin (at least with chrome on ubuntu), glad for the note in browser-connected-repl-sample |
| 19:27 | abp | cemerick: but maybe it should be *bold* ;) |
| 19:32 | abp | dsrx: for older browsers EventSource and ajax would be an alternative, right? also are you working in terms of an pr to austin or something new? |
| 19:32 | dsrx | well... |
| 19:33 | dsrx | right now it's just a drop in replacement for cljs.repl.browser/repl-env in its own project http://github.com/tomjakubowski/weasel |
| 19:33 | dsrx | integrating with austin would be a little trickier |
| 19:33 | dsrx | it does work with piggieback though |
| 19:34 | abp | dsrx: good enough, haven't even looked at austin internals |
| 19:38 | allenj12 | hey is there a way to type hint a vector if your expecting all the elements to be the same? |
| 19:38 | abp | dsrx: somehow i thought EventSource were more widely supported than websockets but thats not really the case |
| 19:38 | bbloom | allenj12: if you really need it, there is gvec |
| 19:38 | bbloom | allenj12: https://github.com/clojure/clojure/blob/master/src/clj/clojure/gvec.clj |
| 19:39 | bbloom | allenj12: only supports specializing for primitives |
| 19:41 | hfaafb | anyone have any hints on what functions (besides a for comprehension... unless thats the most clojurey) to create a pattern like this? https://gist.github.com/samcf/8874824 |
| 19:41 | dsrx | abp: if/when i make it austin-compatible you could have multiple repls for the same project, using websocket with chrome (to hopefully avoid extensions screwing with your iframe messages) and the traditional iframe-based CLJS browser repl in IE or whatever other legacy browsers you're developing for |
| 19:42 | allenj12 | hmmm ok |
| 19:42 | allenj12 | thank you |
| 19:46 | dsrx | abp: i really only wrote this so i could have a repl while i'm developing a spotify app, because the repl won't work across protocols (http: and sp:) |
| 19:47 | amalloy | hfaafb: my first guess would be a for-comprehension |
| 19:48 | hfaafb | amalloy: ok just trying to be too clever i guess :) |
| 19:49 | amalloy | something like https://www.refheap.com/34718 |
| 19:50 | amalloy | that's probably a little flatter than your example, and maybe rotated as well, but you get the idea |
| 19:50 | hfaafb | thanks ill run with it |
| 20:02 | systemfault | Hi, super-motivated clojure newbie here... what is/are the best book(s) to learn clojure? I've read about "The joy of Clojure", is that a good one? |
| 20:03 | rhg135 | yes, but not as a first |
| 20:04 | dacc | systemfault: the o'reilly book is quite good. i'm working through it |
| 20:05 | systemfault | I usually don't like the oreilly book but if you tell me it's a really good one, I will try it :) |
| 20:05 | rhg135 | JoC has a lot of "why" |
| 20:05 | systemfault | So far, I only did the clojure koans |
| 20:06 | systemfault | So I got an idea of how the language works... but that's about it |
| 20:08 | rhg135 | JoC may be a good one for you then |
| 20:08 | invasmani | systemfault: braveclojure.com, 4clojure.com, https://github.com/clojure-cookbook/clojure-cookbook for samples of common tasks, and for a textbook, i think programming clojure/clojure programming --> joy of clojure is the common path |
| 20:08 | bitwalker | systemfault: Another vote for Joy Of Clojure here |
| 20:08 | dacc | systemfault: yeah, not all o'reilly books are good, often too chatty for my tastes |
| 20:08 | systemfault | Noted, thank you so much :) |
| 20:09 | systemfault | dacc: Usually.. when possible, I like the books by Addison-Wesley |
| 20:09 | systemfault | *I like to get |
| 20:10 | invasmani | systemfault: keep in mind that joy of clojure 2nd ed is coming in the next month or two |
| 20:12 | systemfault | Hmm, the manning website offers a "MEAP" for the second edition + book when it's released. Seems like a better idea than what I had, to preorder the 2nd edition and pirate the first edition for now :/ |
| 20:12 | invasmani | you get a free copy of the first edition by preordering the second |
| 20:13 | invasmani | no need to pirate :) |
| 20:13 | abp | systemfault: theres also http://aphyr.com/posts/301-clojure-from-the-ground-up-welcome shpaing into a book |
| 20:13 | systemfault | invasmani: ah, didn't see that. |
| 20:14 | systemfault | abp: I saw it on HN a couple of months ago, great read :P |
| 20:14 | systemfault | Thanks |
| 20:15 | abp | systemfault: there are more posts now, have you seen those too? |
| 20:16 | systemfault | abp: Ah, you're right, the last chapter I read was about macros. There are more now. |
| 20:16 | abp | systemfault: if not, that's actually a better link: http://aphyr.com/tags/Clojure-from-the-ground-up :) |
| 20:16 | abp | systemfault: ok, then not much more |
| 20:17 | abp | ve |
| 20:25 | ggherdov | hello. I did run `lein ring server` on my remote machine, and it complains about not having a X11 display. details here: http://bpaste.net/show/rmZCGXRZ5RV99KVl39Zq/ why does ring needs X11 ? What's the gotcha? |
| 20:28 | amalloy | `lein ring server :headless`? |
| 20:35 | novochar | I'm reading https://github.com/swannodette/om/wiki/Basic-Tutorial#wiki-life-without-a-templating-language |
| 20:36 | ggherdov | amalloy: no, thanks! trying it. (having network problems, sorry I am on and off) |
| 20:37 | novochar | Nevermind. |
| 20:39 | locks | a lot of people seem to have been reading that novochar ;) |
| 21:04 | srruby | I want to do a file-seq on a directory under resources. The following code works under the repl, but I want to change it so that it works when I am NOT in the repl: |
| 21:04 | srruby | (file-seq (clojure.java.io/file "resources/fixtures")) |
| 21:04 | srruby | Thanks, John |
| 21:05 | muhoo | lein ring server-headless |
| 21:07 | muhoo | and, if you want nrepl too, lein update-in :ring:nrepl assoc :start? true -- ring server-headless |
| 21:09 | hiredman | clojurebot: files |are| an illusion, there are only classloaders |
| 21:09 | clojurebot | You don't have to tell me twice. |
| 21:10 | muhoo | i was thinking of building a lein invocation command line that'd use pdo and launch cljsbuild auto in addition to ring server with nrepl, but i was afraid it would summon the eldritch gods and cause volcano eruptions and blacken the earth for 40 years. |
| 21:13 | muhoo | oh, no volcanos! lein pdo cljsbuild auto, update-in :ring:nrepl assoc :start? true -- ring server-headless |
| 21:14 | muhoo | works. if i'm feeling edgy i'll try to weave austin into the mix |
| 21:48 | effy_ | the bibliography on the joy of clojure website (http://joyofclojure.com/bibliography/) is packed with mount of awesome book, does the author really had time to go through all of that, is that even possible during a single life ? |
| 21:48 | egghead | lol yes fogus reads so much |
| 21:49 | effy_ | just the godel escher bach is already a "you gonna spend a full year on it" kind of book |
| 21:51 | systemfault | Do you all think that core.async is the most awesome thing ever? :/ |
| 21:52 | systemfault | That's what made me want to learn clojure |
| 21:53 | voldyman | systemfault: core.async is cool but clojure as a whole is way cooler |
| 21:54 | systemfault | So, the difficult question... do you all use emacs? (I'm use intellij + cursive right now... thinking to switch) |
| 21:56 | Raynes | Yes. Every single person except for you uses Emacs. ;) |
| 21:56 | Raynes | In all seriousness, Emacs is indeed quite wonderful, but other editors are good and fine as well. |
| 21:56 | Raynes | Light Table, Cursive, Vim, etc |
| 21:56 | Bronsa | Just not as good and fine as Emacs. |
| 21:56 | effy_ | i mean, how do you even connect to freenode without erc ? |
| 21:57 | systemfault | effy_: I use telnet ;) |
| 21:57 | systemfault | PRIVMSG #clojure HELLO |
| 21:57 | effy_ | systemfault: ok i'll let it pass for this time then ! |
| 21:57 | systemfault | effy_: I'm too ashamed to say the truth... I use colloquy on osx :( |
| 21:58 | Raynes | Ugh, colloquy is the most abysmal IRC client I've ever used. |
| 21:58 | systemfault | So, what is the name of the package I need to install on emacs to start with clojure? |
| 21:58 | Raynes | $google textual irc client |
| 21:58 | lazybot | [Textual: IRC for Mac OS X] http://www.codeux.com/ |
| 21:58 | effy_ | systemfault: cider |
| 21:58 | systemfault | Nice |
| 22:02 | fairy44 | Probably this has been asked a million times already, but I wasn't able to find a clear explanation on the web... |
| 22:02 | fairy44 | Why does Clojure has keywords in addition to symbols? |
| 22:02 | fairy44 | Can't everything that a keyword does be done by a quoted symbol? |
| 22:04 | hiredman | no, keywords always evaluate to themselves, quoted symbols loose the quote when passed through the reader for example |
| 22:04 | dsrx | it's a security blanket for ruby refugees |
| 22:04 | dsrx | (not really) |
| 22:04 | fairy44 | Is there a practical difference when this comes up? |
| 22:05 | fairy44 | I mean, is there a situation where this comes up in practice |
| 22:05 | hiredman | yes, if you use printed clojure data as a serialization format (edn, which people do all the time) it would come up all the time |
| 22:06 | fairy44 | OK |
| 22:06 | fairy44 | Thanks :) |
| 22:07 | fairy44 | So when to use symbols? |
| 22:07 | hiredman | clojure's symbols are also not interned, but keywords are, so symbols can have metadata (you can have different instances of symbols with different metadata) but keywords are interned, so they cannot have metadata, but equality is just a pointer check |
| 22:07 | hiredman | symbols are pretty much only used for code |
| 22:07 | effy | out of curiosity un-serializing code like that through the reader is it "injection prone", or it's more like a json un-serialize kind of nothing can happen ? |
| 22:08 | systemfault | Wow, I'm looking at EDN, looks better than JSON |
| 22:08 | hiredman | effy: it is complicated, but clojure recently grew clojure.edn which is distinct from the clojure code reader |
| 22:08 | fairy44 | So is there a place I'd use a quoted symbol outside of a macro? |
| 22:08 | hiredman | it is pretty rare |
| 22:11 | effy | hiredman: the documentation isn't explicit about "could the code be evaluated during the un-serialization" :( |
| 22:12 | hiredman | effy: the code will not be, the reader is distinct from the compiler |
| 22:13 | hiredman | effy: but there are some extension points in the reader that could cause issues, hence the more restricted reader exposed in clojure.edn |
| 22:13 | effy | not even if there is macro or something like that ? |
| 22:14 | effy | macro are expendend by the reader ? (by the eval ?) |
| 22:14 | hiredman | no |
| 22:14 | hiredman | the reader turns strings in to datastructures |
| 22:14 | hiredman | macro expansion and compilation happens elsewhere on the datastructures |
| 22:15 | hiredman | https://github.com/edn-format/edn |
| 23:24 | tolstoy | dnolen: Does OM support CSS transitions? |
| 23:25 | dnolen | tolstoy: what is there to support? |
| 23:25 | tolstoy | http://facebook.github.io/react/docs/animation.html |
| 23:25 | tolstoy | But aside from that, I have an SVG that I periodically change the radius of. |
| 23:25 | dnolen | tolstoy: yeah that's not core React really |
| 23:26 | tolstoy | Not an expert that CSS transition. Before, I'd just add a class and remove it, and it worked. |
| 23:26 | dnolen | tolstoy: people can figure out what they need and go from there. |
| 23:26 | tolstoy | Okay. |
| 23:26 | dnolen | tolstoy: I suspect there are enough hooks in React already to handle most cases |
| 23:27 | tolstoy | Yeah. I guess what has me thoughtful about it is that the svg (say) isn't completely removed and added each time. So I'm confused. ;) |
| 23:27 | tolstoy | In other words, not really an OM prob. |
| 23:37 | sdegutis | Hello. |
| 23:37 | sdegutis | Anyone here familiar with ClojureCLR? |
| 23:37 | sdegutis | The documentation promises a future explanation of how to call it from a C# project, but it's not there yet. |
| 23:38 | tolstoy | Hm. TypeError: 'undefined' is not a function ... React.DOM.animate . |
| 23:40 | ambrosebs | sdegutis: If you can figure out how to resolve Clojure vars in C# and then deref/invoke them, I think that's all you need |
| 23:40 | tolstoy | Alas. |
| 23:40 | ambrosebs | sdegutis: have you got the source handy? |
| 23:40 | sdegutis | ambrosebs, That's a bit further than I am. I'm just trying to figure out how to run "(prn 123)" |
| 23:43 | sdegutis | I thought it would be clojure.runtime.Load("(prn 123)") but that doesn't compile. |
| 23:45 | ambrosebs | sdegutis: I was thinking something like clojure.lang.Compiler.maybeResolveIn(clojure.lang.Compiler.namespaceFor("clojure.core"), "prn").invoke(123) |
| 23:45 | ambrosebs | sdegutis: no idea if that works |
| 23:46 | ambrosebs | just browsing https://github.com/clojure/clojure-clr/blob/master/Clojure/Clojure/CljCompiler/Compiler.cs |
| 23:46 | amalloy | ambrosebs: i think you can just use clojure.lang.RT.var("clojure.core", "prn") |
| 23:46 | amalloy | but i guess maybe that stuff isn't there in C#? |
| 23:47 | ambrosebs | amalloy: surely it's there somewhere |
| 23:48 | amalloy | Var.intern looks like it exists, at least |
| 23:54 | sdegutis | Thanks amalloy. |