#clojure logs

2013-02-19

00:14Raynescallenbot: http://dl.dropbox.com/u/23745600/Screenshots/bRgP.png Think I'm doing a good job moving to laser?
02:07callenbotRaynes: nice.
02:07callenbotRaynes: one of my main problems with clabango is that I'm not too sure it escapes HTML. This...concerns me.
02:10Raynescallenbot: In previous releases of laser, strings were *always* escaped. Now strings are always escaped unless you wrapped them in a special type, forcing you to actually think before you throw unescaped text into your html.
02:11callenbotRaynes: that's more or less what I'd like to clabango. At some point I'm going to need to buckle down and fix it because the next site I am making has users exposed to each others' input.
02:11callenbotto do in*
02:11RaynesI keep discovering little things that need to be added/changed as I go along in refheap. Once I'm done with it I'll release 1.0.0.
02:14Raynescallenbot: Also happy to report that I'm not far from finishing up the move to laser in refheap. I buckled down and did biggest part today, since it was a holiday.
02:16callenbotRaynes: you had a holiday today?
02:16callenbotgod fucking dammit
02:16Raynespresidents day!
02:16callenbotI need to leave the startup world.
02:18callenbotRaynes: are you working out of a branch?
02:18RaynesYes.
02:19callenbotRaynes: code's like a sniper rifle, but awful specific about the markup.
02:19callenbotRaynes: looks a lot more practical than enlv.
02:20Raynescallenbot: I'm not sure what 'like a sniper rifle' means in the context of code. :p
02:21callenbotRaynes: it reaches out and touches things.
02:21callenbotwith an economy of effort.
02:21RaynesI think you mean like a laser.
02:21RaynesI'm having serious trouble telling whether you're saying you hate it, or...
02:22RaynesThese phrases are bizarre.
02:22Raynes:P
02:22callenbotRaynes: I like it, but I don't know if it's for me yet or not.
02:22callenbotRaynes: it's definitely won out over enlive and I'll start sending people that way if they like enlive.
02:22RaynesWell if you don't like enlive (and you don't), you probably won't like laser either just because it's generally the same concept.
02:23RaynesRight, I see what you mean.
02:23Raynes"I don't care for this style of templating, but I prefer your library over the other one regardless."
02:23RaynesAppreciated, sir.
02:23callenbotRaynes: I'm not really sure what I'd use if I wasn't using clabango.
02:24callenbotI think I'm better off thatching the roof danlarkin made.
02:25RaynesHeh
02:25RaynesI wonder...
02:26Raynes~hmmm, when suddenly...
02:26clojurebotGabh mo leithscéal?
02:26RaynesAw.
02:26Raynes~suddenly
02:26clojurebotBOT FIGHT!!!!!111
02:26Raynescallenbot: He used to have a thing where he'd say "CLABANGO" a couple of years ago when you did that.
02:26callenbotthat's awesome.
02:26callenbotI love how bots are unpredictable.
02:27RaynesThere was something else named clabango back then.
02:27RaynesI can't remember what that was all about.
02:27Raynes~suddenly
02:27clojurebotBOT FIGHT!!!!!111
02:27Raynes~suddenly
02:27clojurebotBOT FIGHT!!!!!111
02:28RaynesI know it's in there somewhere.
02:29Raynescallenbot: http://clojure-log.n01se.net/date/2010-08-08.html#03:13
02:29RaynesApparently danlarkin planned something called clabango several years ago, but only recently actually did a project with that name.
02:30RaynesMaybe he'll give us a history lesson one dya.
02:30Raynesday*
04:49NeedMoreDesuIs there something like (arity-match? f arity) function, returning true/false?
04:50NeedMoreDesuWhere f is function, arity is integer.
05:42alexnixonNeedMoreDesu: not in the general case, as far as I'm aware. You can look at the :arglists metadata if you have a var though.
05:47xsynHi all, I wonder if you can help
05:47xsynI've been building a project with lein
05:48xsynand everything has been fine
05:48xsynbut I've recently added the clojure-csv library
05:48xsynand no matter what I do, I get this:
05:48xsynuser=> (use 'clojure-csv.core)
05:48xsyn 4 #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure_csv/core__init.class or clojure_csv/core.clj on classpath: >
05:48xsynI've check in my ~/.m2 and it's there
05:48xsynI'm not sure what to do?
05:54ucbxsyn: check lein classpath see if the jar is there
05:55xsynit is
05:55ucbstrange
05:56ucbwell, rather, I don't know what might be happening :)
05:56xsyn:) thanks
05:57xsynI even cracked open the jar to check that it was there, and everything seems fine. I suspect this is a case of user error
06:24borkdudeI'm trying to rebuild some examples from https://github.com/relevance/org-html-slideshow - there is a command "git submodule update" which doesn't seem to to anything
06:26borkdudehmm https://www.refheap.com/paste/11462
06:32vijaykiranborkdude: did you try git clone --recursive ?
06:33vijaykiranborkdude: which version of git are you using ?
06:33borkdudeaaah, no I didn't
06:33borkdudevijaykiran this is actually the first time I see such a recursive git project
06:38borkdudevijaykiran tnx, it works
06:41vijaykiranborkdude: yw :)
06:46augustlany suggestions for SOAP clients for Clojure? I'm new to the JVM as well so not familiar with the various libraries I could interop with.
06:50xsynucb: turns out that you need to restart your nailgun when you add new libraries. The reason it couldn't find it from the repl is that the repl was loaded before the code was added
06:51ucbxsyn: oh, nailgun!
06:51ucbmakes sense :)
06:51ucbI assumed this was fresh JVMs all around
06:51xsynyeah, I had forgotten about it, and was making the same assumption
06:52xsynthe repl I use for editing uses vimclojure, and as such....
08:16gfredericksdoes anybody have a jquery externs file for 1.7.1 (or whatever)?
08:17gfredericksthe link in the jayq README 404s
08:35mpenetgfredericks: that sucks. I will try to fix that
08:36gfredericksmpenet: thanks :)
08:36mpenetit was here: http://code.google.com/p/closure-compiler/source/browse/#git%2Fexterns
08:36mpenetbut for some reason the jquery externs disapeared
08:37mpenetgfredericks: ok http://code.google.com/p/closure-compiler/source/browse/#git%2Fcontrib%2Fexterns
08:38borkdudewhat is the most "common" way to add TODOs to an org-mode document without creating extra headings (so extra structure) for it
08:39borkdudeI can of course add comments
08:39gfredericksborkdude: a TODO has to be on a heading...so depends what you mean by "extra" I guess?
08:39gfredericksmpenet: sweet, thanks!
08:40borkdudegfredericks I'm writing documents with org-mode, I want to remind myself to fix some things in the document, but I don't want to change the toc etc, just to add some todos
08:40gfrederickshm
08:40borkdudemore like "inline todos"
08:40gfredericksI do slides in org-mode and I end up with a * Meta heading at the top for stuff like that
08:41gfrederickswhich is exactly not inline
08:41gfredericksso I guess I don't know an easy way to do what you want
08:41gfredericksheadings are complected!
08:41borkdudegfredericks just curious: how do you export your org-slides?
08:41gfrederickshtml export, the use the org-html-slideshow lib
08:42borkdudegfredericks built by stuart sierra et al?
08:42gfredericksyep
08:42borkdudegfredericks great, I was experimenting with it and I like it
08:42borkdudegfredericks one thing that got me though was that MathJax doesn't work in presentation mode :(
08:42gfredericksreally?
08:43gfredericksdoes MathJax run some JS at startup?
08:43borkdudegfredericks not out of the box at least
08:43borkdudegfredericks yes, I think so
08:43gfredericksI have a fork that gives you hooks for manipulating the slides after rendering
08:43gfredericksthat should probably give you a straightforward way to make it work
08:43borkdudegfredericks I also tried #+OPTIONS: LaTeX:dvipng which got me into some -shell-escape problem
08:44gfredericksI don't know anything about that :/
08:44borkdudegfredericks good, does it allow javascript to be executed?
08:44gfredericksborkdude:as in "rather than clojurescript"?
08:45gfredericksit's a regular callback, so yeah you can do anything you want
08:45borkdudegfredericks I guess I can call mathjax from there
08:45gfredericksexactly
08:45gfredericksI used it to make an interactive slideshow
08:45borkdudegfredericks I was just trying the standard mathjax stuff which org-html-export puts in
08:46borkdudegfredericks I opened an issue for it, but I have not yet the solution myself https://github.com/relevance/org-html-slideshow/issues/12
08:46augustlare there any libraries out there that reads XML and outputs hiccup-like data?
08:47borkdudeaugustl why, isn't the "parse" output good enough?
08:47augustlborkdude: what are you referring to with "parse"?
08:48borkdudeaugustl http://clojuredocs.org/clojure_core/clojure.xml/parse
08:48augustlah
08:49gfredericksborkdude: https://github.com/fredericksgary/org-html-slideshow/blob/com.gfredericks/src/cljs/org_html_slideshow/main.cljs#L282
08:50gfredericksborkdude: I'd like to extend that so you can add handlers based on the class of the slide
08:50gfredericks(helpful since you can add custom classes to slides in org-mode by just adding more tags)
08:50borkdudegfredericks cool, I will look into this later this afternoon
08:50gfredericksso e.g. I have slides that want to show two <pre> areas side-by-side, so I mark those with a special class and have a handler than rearranges the html
08:51borkdudegfredericks cool
09:16borkdudegfredericks I have smth weird here: I cloned your repo, but I don't see the callback changes in the code, while I see it on github...
09:18borkdudegfredericks ah fixed, it's only in that branch I see
09:18gfredericksborkdude: ah yes, sorry
09:19gfredericksthe com.gfredericks branch is supposed to correspond to the clojars artifacts under the com.gfredericks group
09:19gfredericksI kept it off master because I was hoping tamer stuff would get merged back into the main project, but I'm less hopeful about that now
09:19gavilancomunHi. Is it possible to use the new reducers with clojure 1.4.0? I can only find examples using 1.5 beta.
09:20gfredericksgavilancomun: I don't think they're included with 1.4
09:21gavilancomunOK, thanks.
09:23borkdudegfredericks you removed the clj sources from this branch? https://github.com/fredericksgary/org-html-slideshow/tree/com.gfredericks/src
09:23gfredericksprobably? I removed clojurescript one, maybe that was related
09:23borkdudegfredericks I was trying to build
09:24gfredericksthere aren't too many commits, I think the messages are probably meaningful
09:26borkdudegfredericks ah so lein cljsbuild once
09:26gfrederickssure
09:27borkdudegfredericks yeah, it works :-) (at least, my dummy callback, now let's try to include some mathjs stuff)
09:27gfredericksnice
09:31gfredericksborkdude: how're you using it? from your own cljs project?
09:32borkdudegfredericks how do you mean?
09:33gfredericksborkdude: just curious whether you're modifying org-html-slideshow inline, or using it as a lein dep
09:33borkdudegfredericks now I'm modifying inline
09:33borkdudegfredericks just to see if I can get it working
09:33gfrederickscool
09:33gfredericksI think I went out of my way to make it more usable as a library than the original
09:34borkdudegfredericks I might consider doing that later
09:34borkdudegfredericks I'm kind of new with clojurescript and all this, even org-mode
09:35gfredericksit's definitely more of a toolchain to wrangle than powerpoint
09:36arkxlein-cljsbuild doesn't support --debug flag to Google Closure Compiler?
09:36borkdudegfredericks yeah, I like it a lot
09:37dnolenarkx: lein-cljsbuild can only support what ClojureScript itself supports passing through to Closure
09:38arkxRight. ClojureScript itself doesn't support --debug flag? It seems pretty useful.
09:39arkxI'm still hunting down the bug from yesterday. It wasn't related solely to doseq after all. Instead whenever the advanced compiler decides to emit one function as global function s, it's broken, and whenever it uses u or t instead all works... Really irritating to debug.
09:40arkxSome other part of the generated code or some library is overwriting the global function s to undefined... sigh.
09:42borkdudehow do I call MathJax.Hub.Startup.onload() in Clojurescript, like this? (.onload MathJax.Hub.Startup)
09:42xsynDoes anybody here use VimClojure
09:42xsyn?
09:43dnolenarkx: that doesn't really make sense - are you sure own code isn't redef'ing something?
09:45borkdudeor (MathJax.Hub.Startup/onload) ?
09:46xsynI've been using vimcloure, and it's been great, with lein
09:46dnolenborkdude: (.onload js/MathJax.Hub.Startup ...)
09:46xsyntrouble is I recently made a bunch of changes to my code, passed the function to the vimclojure repl
09:46xsynand nothing happened
09:46xsynhad to restart the nailgun server
09:47xsynsurely this isn't the best workflow
09:47xsynam I doing something incorrectly
09:47borkdudednolen trying
09:48arkxdnolen: at least not on purpose. Switching away from advanced mode makes all errors disappear.
09:58dnolenarkx: yeah I'm skeptical that adv mode overwrites anything (as long as it handles all source files) unless it is happening somewhere in your own code.
10:00dnolenarkx: that said advanced mode is tricky, there are many things which work outside of advanced that don't work under advanced. doing property stuff with strings is a big no no and an easy way to run into trouble.
10:00arkxAt this point I'm betting it's some js plugin we use.
10:00arkxLike jQuery datatables..
10:00dnolenarkx: and you're using the jQuery extern file and everything is going through closure?
10:00arkxYep.
10:01arkxThe externs file for jQuery.datatable is hand-written though.
10:01borkdudedoes it matter to javascript if I pass a persistentvector or an array
10:02borkdudeI mean: do I need to do something special if javascript expects a normal array
10:04dnolenborkdude: passing CLJS to JavaScript is not a good idea
10:04borkdudeinto-array presumably then
10:04dnolenborkdude: we have cljs->js in core now
10:04borkdudednolen I want to attach a callback function in clojurescript and call a js function that expects an array
10:04dnolenborkdude: which handles all the relevant data types
10:05dnolenand is extensible to your own data types
10:05borkdudednolen ok
10:06ChongLimarshalling and unmarshalling :(
10:07arkxdnolen: anyway, what do you think about adding support for the --debug flag? Seems pretty useful to me until we get source maps
10:07dnolenarkx: what does it do?
10:07dnolenarkx: link?
10:08borkdudeprobably I'm doing smth terribly wrong, but I get this: return MathJax.Lb.Zc(tc.b(V(["Typeset", MathJax.Lb])
10:08dnolenborkdude: yes because you're using MathJax w/o an externs file
10:08arkxhttps://code.google.com/p/closure-compiler/wiki/FAQ#My_code_broke_when_using_advanced_optimizations!_How_do_I_figure
10:08dnolenand running some level of optimization greater than whitespace
10:10borkdudednolen yes, I figured that out :-s
10:10borkdudednolen I'm new to clojurescript, sorry
10:11dnolenarkx: open a ticket. it'll move faster if I get a patch.
10:12dnolenborkdude: hrm tho it shouldn't munge if you're using a leading js/ like I said earlier.
10:12borkdudednolen hmm
10:13borkdudednolen I'm doing this now (.Queue js/MathJax.Hub (into-array ["Typeset",MathJax.Hub]))
10:15dnolenjs/MathJax.Hub, foreign stuff always needs leading js/
10:15borkdudeyes, it works!
10:16borkdudednolen probably this was a caching thing
10:16dnolenborkdude: good to hear was about to get worried there :)
10:16borkdudednolen I can try again now with pretty-print turned off
10:19borkdudedoes lein cljsbuild / the clojurescript compiler recompile if the source didn't change?
10:19borkdudelein cljsbuild once
10:19arkxNope.
10:19borkdudeshit, without pretty-printing it doesn't work
10:20dnolenborkdude: if you're going to be making many changes auto would be much faster
10:20borkdudednolen I was only changing the compilation settings, not the source
10:20borkdudednolen but to be sure I deleted the compiled file
10:21borkdudednolen guess something is wrong after all
10:21borkdudeI might be using an old clojurescript version - how do I tell?
10:21dnolenborkdude: that it wouldn't work w/o pretty-printing doesn't make much sense
10:22borkdudednolen do you mean, I would need an externs file even when I use js?
10:22dnolenborkdude: you only need externs if you're compiling MathJax w/ your own code.
10:22borkdudednolen I don't
10:22dnolenthen no need
10:23dnolenborkdude: that said it's easy to make simple mistakes w/ CLJS compilation - have you looked at http://github.com/magomimmo/modern-cljs?
10:23borkdudednolen I have this code (.Queue js/MathJax.Hub (into-array ["Typeset",MathJax.Hub])) but it gets translated to MathJax.Lb.Zc(pb.b(V(["Typeset", MathJax.Lb]))
10:24dnolenborkdude: hrm, I don't know and I gotta run, ask your question on the CLJS ML, people are pretty active there
10:24borkdudednolen tnx!
10:24dnolenborkdude: it maybe a bug with js/, though I'm surprised this hasn't come up before
10:24borkdudeactually I gotta run too, but will ask this later.
10:25dnolenif it is
10:25ravsterhello all
10:25bendlashi all
10:26bendlasQuestion: In core.logic (run* [q] (fd/in q (fd/interval 3 3))) throws right now
10:26bendlasis this intended or a bug?
10:26bendlasdnolen: can you tell?
10:30TimMcstuartsierra: Hey, how have y'all been testing apps for unbound *read-eval*? When I set -Dclojure.read.eval=unknown in a leiningen project, clojure.main blows up...
10:30stuartsierrasorry, busy
10:30TimMckk
10:31TimMcWell, the question is really for anyone who has done so.
10:39dnolenbendlas: checking
10:41dnolenbendlas: yeah that's a bug, I don't think that ever worked, file a ticket please
10:50TimMcThis is just sad: https://en.wikipedia.org/wiki/Scala_%28programming_language%29#Syntactic_flexibility
10:52ravsterdo people prefer liberator or using ring directly for auth?
10:53NeedMoreDesuWhat is the most straightforward way to hold recource file outside of jar in lein?
10:54NeedMoreDesuI wish to write in that file, not only read it.
10:56degI need to transform equal-sized subsequences of a list. I know I can partition the list and then use mapcat to transform each piece and put them back together, but I'm looking for an idiomatic way to avoid constructing temporary small lists.
10:57degFor example, a cleaner way to say (mapcat (fn [[var val]] [(symbol var) val])
10:57deg (partition 2 raw-bindings))
11:09ChongLideg: I don't think there's an idiomatic way to do it without some kind of deforestation/fusion library
11:09gfredericksconstructing temporary small lists is totally idiomatic :)
11:11TimMcdeg: Unless you can show a severe performance hit, it's not worth trying to avoid those allocations.
11:12ChongLihaskell's got some advantage in this area
11:12ChongLighc rewrite rules are pretty nice
11:13ravsterWhats the best way to have a system do a basic-auth OR cookie-auth? I'm thinking of using the ring libs for that directly.
11:13ChongLiyou can probably do the same thing with macros but it'd be tricky
11:14ravsterRemvee's code looks like it would fail if a request comes in without basic-auth , even though it might still have a cookie
11:17gfredericksChongLi: and then you'd be using macros :(
11:19TimMcChongLi: I think deg's use-case *is* a macro.
11:20pochoIs there a better way to get all of the values in a map than (map (fn [x] (get x 1)) (seq my-map))
11:20TimMcvals
11:20bbloompocho: ##(doc vals)
11:20lazybot⇒ "([map]); Returns a sequence of the map's values."
11:21TimMc$findfn {:a 1 :b 2} [1 2]
11:21TimMc(Slow, or broken?)
11:21lazybot[clojure.core/vals]
11:21olenhadHey folks, do namespace based operations (use, require ) etc compile down to js/require when you're compiling for node?
11:22Bodilolenhad: No, it still uses Google Closure's package system on Node.
11:24ChongLiI wish there was an asynchronous version of auto-complete.el :(
11:24ChongLiac-nrepl is so slow
11:31NeedMoreDesuWhy use ac when there is nrepl-indent-and-complete-symbol?
11:31ChongLigood question
11:32ChongLiit doesn't seem to work in clojurescript
11:33NeedMoreDesudidn't try it in clojurescript, sorry.
11:33BodilIt does with auto-complete?
11:33ChongLilet's see here
11:33ChongLinope, it pops up nrepl-error
11:34ChongLiI had just been using ac-source-dictionary
11:34ChongLiand yasnippet etc.
11:34BodilYeah, it did sound a bit strange, as Piggieback doesn't rebind anything but eval...
11:35NeedMoreDesuAc can be very slow on low number of letters
11:35ChongLiac is slow because it's synchronous
11:35ChongLithey had the same problem doing clang completion
11:36ChongLiblocking the UI while talking to a server is not a good idea
11:36BodilChongLi: Somebody should write an async version of auto-complete. :)
11:36ChongLiI wonder if this would apply?
11:36ChongLihttps://github.com/BinaryPeak/kdcomplete
11:37gfredericks#datomic is pretty inactive :/
11:38BodilChongLi: Oh, that looks _very_ interesting...
11:41ChongLithe author puts closing parens on their own lines :(
11:41clojurebotauthor is hiredman
11:41TimMchaha
11:42TimMchiredman: Oh snap, did you see what the bot just said about you?
11:42ChongLifantastic stuff
11:42NeedMoreDesuWait, how do you need to put closing parens?
11:42BodilChongLi: That's pretty much as discouraging as catching somebody indenting with tabs :(
11:44ChongLispeaking of which, something in emacs is inserting tabs randomly
11:44ChongLiI have no idea where to start looking
11:45TimMcNeedMoreDesu: Consecutive closing parens are generally stuck together with no intervening whitespace.
11:46TimMcIt's just a style thing. There's no syntactic significance, but if you give each closing paren its own line, people will look at you as though you are wearing your underpants on the outside.
11:47craigbrohey, I sometiems put a closen paren on it's own line
11:47NeedMoreDesuAh, I see the code now.
11:47gfrederickscraigbro: come on man underpants go on the inside
11:47TimMcI've done it very occasionally, where it really made sense. Can't remember why that was.
11:47NeedMoreDesuI do put, but close and format afterwards.
11:47craigbrospecifically, if the containing form is explicitely a list of "things to do" -- like shell scripting commands
11:48ChongLionly time I do that is when I comment something out with paredit-comment-dwim
11:48ChongLiwhich forces the closing parens to a new line on its own
11:48TimMccraigbro: Yeah, that sounds about right. But you end up with two chunks of parens, not a sequence of lines each with a single paren.
11:48craigbroyah, I don't do the staircase thing, on purpose
11:49NeedMoreDesuWith one exeption: when it's convinient to have plain lines between parens, like large list.
11:49ChongLithis is the code we're all talking about:
11:49ChongLihttps://github.com/BinaryPeak/kdcomplete/blob/master/kdcomplete.el
11:49ChongLikdc-create-completion-types makes my eyes bleed :(
11:50TimMcThere's definitely some clothing layer inversion going on there
11:50ChongLiat least he didn't use camelCase
11:50rboydmaybe he gets paid by the line
11:50NeedMoreDesuStill, how do I make some resource in the folder near uberjar? I can't edit resource when it's in uberjar, where lein place them.
11:50ChongLiif this was clojure I bet he'd have used commas all over the place too!
11:51ChongLiresources aren't meant to be edited afaik
11:52NeedMoreDesuWell, it's config files.
11:53ChongLi(System/getProperty "user.home")
11:53ChongLisomething like that
11:53ChongLijust start spitting files in there :)
11:54NeedMoreDesuI'd like to place them all in a folder near .jar
11:54ChongLiwhere is the .jar going to be stored on the client machine?
11:55NeedMoreDesuSort of anywhere. It's runnable.
11:55ChongLiit's generally bad form to put user config stuff in places like that
11:55ChongLisince the .jar may be run by different users
11:56ChongLiand you may not have write permissions there
11:57NeedMoreDesuHm, ok, that may make sense.
11:58ChongLiyeah this was a big problem for legacy windows applications
11:58ChongLiwhich would store their configs in the program directory
11:59alexnixonIs it a bug that (realized? some-cancelled-future) returns true, despite the docstring which states "Returns true if a value has been produced for a promise, delay, future or lazy sequence."? A related consequence is that an exception is *thrown* if you attempt to print a cancelled future, whereas printing an agent which saw an error *prints* the exception.
12:01TimMc,(doc future)
12:01clojurebot"([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?."
12:01callenbotTimMc: is it safe to use future to do work in the background from a parent thread that will close before the future finishes?
12:02TimMcI believe so.
12:02callenbotcool, just trying to avoid needing to use a queue.
12:02TimMc(I was just checking the docs above, it was not by way of an answer.)
12:04alexnixon,(let [f (future (Thread/sleep 10000)] (future-cancel f) (prn "realized?" (realized? f)) (prn f))
12:04clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException>
12:04alexnixon:-(
12:05hiredmanthat is an unmatched delimiter exception
12:06TimMcalexnixon: Missing a paren in the let binding.
12:06alexnixon,(let [f (future (Thread/sleep 10000))] (future-cancel f) (prn "realized?" (realized? f)) (prn f))
12:06clojurebot#<SecurityException java.lang.SecurityException: no threads please>
12:06alexnixon:-(
12:09hiredman,(let [f (future (Thread/sleep 10000)] (future-cancel f) (prn "realized?" (realized? f)) (prn f))
12:09clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
12:09hiredman~botsnack
12:09clojurebotbotsnack is scoobysnack
12:09alexnixonwell, the output is "true" and then a CancellationException is thrown, which to me feels like a bug as it's inconsistent with the behaviour of other implementators of clojure.lang.IDeref (agents and delays)
12:10alexnixonthe problem being that (I believe) the intended semantic of `realized?' is "if we deref the IDeref, will we get a value?". And that's broken for cancelled futures.
12:11augustlare there any libraries out there for calling a function daily, another function hourly, etc? Other than using cron, of course.
12:12rboydaugustl: there's https://github.com/michaelklishin/quartzite
12:13augustlrboyd: thanks
12:23augustlhmm, Quartz seems to be very fond of singletons
12:34dnolenbbloom: ping
12:34bbloom dnolen: pong
12:34dnolenbbloom: http://jsperf.com/om-vs-pam-vs-phm
12:35dnolenso threshold at 8 seems fine to me
12:37bbloomdnolen: ok, sounds good
12:37bbloomdnolen: so let's get OM out of there :-)
12:38dnolenbbloom: heh, not quite there yet - situation does look as good in other browsers - and I'm curious if we can do better if the compiler understands ^not-native fns
12:39dnolen"doesn't look as good in other browser" I mean
12:41progodo you know good clojure projects that used nested namespaces in a good fashion? I'm looking for an example
12:42borkdudenested namespaces do not exist as far as I know
12:43progowell, just multi-part named namespaces then :)
12:43bbloomborkdude: huh? you can just have ./foo/bar.clj and ./foo.clj
12:43bbloomborkdude: that works fine
12:43progoI've always written very short namespaces/modules and I'm starting to feel uncomfortable with 500-line files
12:44bbloomprogo: that's something that took me a while to get used to as well: my rails files were generally ~50 lines max
12:44bbloom(except user.rb, which is always a mess :-P)
12:44borkdudebbloom those aren't nested namespaces, those are just two namespaces whose name reflect a directory structure
12:44bbloomborkdude: so then what exactly is a "nested namespace"?
12:44borkdudebbloom I would say a namespace that lives inside another namespace
12:45bbloomprogo: 500 lines is getting big, but you should only break it up once you have clear layers/components
12:45bbloomborkdude: i think you're arguing semantics
12:45borkdudebbloom yeh probably
12:45bbloomprogo: like the ClojureScript compiler which has one big compiler.clj at around 2,000 lines. that got broken in half into analyzer.clj and compiler.clj
12:46progobbloom: yeah it consists of hiccup-based page templates and some helpers
12:46bbloomprogo: just like you shouldn't prematurely optimize or prematurely generalize, you shouldn't prematurely organize :-)
12:46bbloombasically, -ize-ing is bad prematurely :-P
12:46progobbloom: yeah... Might have done that sometimes :p
12:47borkdudeizing on the cake
12:47progoperhaps I should altogether move hiccup-templates to user-configurable space and load-eval them in later on.
12:48abpdnolen: Just ran it on my Galaxy S2 in Android Chrome, it's listed as Chrome 18.x, so don't let those results annoy you..
12:50dnolenabp: hehe, no it's always good to get mobile numbers
12:50dnolenabp: a pretty fast device
12:51bbloomdnolen: abp: yeah, wow, phones are getting fast....
12:51abpdnolen: It's just that it's not listed as 'Mobile', so quite misleading. I think Chrome 18 Desktop would be much faster.
12:51dnolenabp: I find it hilarious that you're mobile device is competing w/ FireFox nightly
12:52dnolener I mean 18
12:52abpdnolen: Yeah gave me a stop too. Chrome's crazy. Now running in the native browser..
12:52abpNext up: Ipad3 :D
12:52dnolenFF nightly is actually doing pretty good, especially PAM numbers
12:52dnolener PHM
12:52dnolen:P
12:53abpdnolen: Did not expect that too. Thougt they were still improving on memory usage. ;x
12:54arkxdnolen: turns out it was a piece of Flex code defining single-letter global variables through ExternalInterface.
12:54abpdnolen: What the.. even faster!
12:54dnolenarkx: heh, yuck
12:54arkxMy thoughts exactly..
12:57abpChrome on iOS is a disaster. Thanks Apple. :)
12:57dnolenabp: yeah no JIT'ing I believe
12:59abpdnolen: Safari isn't doing any better. So my old smartphone is faster than the IPad 3..
12:59craigbroheh
13:00abpOr at least the browsers are lightyears ahead.
13:00bbloomabp: it's basically only useful for sending tabs to my ipad for reading in bed
13:02abpProblem is they don't allow other browsers. All get to use UIWebView.
13:02abpEven more horrible than safari.
13:02dnolenabp: well I just added iPad mini numbers, they seem only slightly better than Chrome iOS
13:03borkdudedoes clojurescript have a separate mailing list?
13:03dnolenborkdude: it does
13:03borkdudednolen I googled but only found discussion on whether it should exists
13:04dnolenborkdude: http://groups.google.com/group/clojurescript
13:04borkdudednolen tnx, I will post my issue now there
13:05borkdudednolen before I post, what relevant version info should I include?
13:05dnolenborkdude: I'm assuming your using lein-cljsbuild?
13:05dnolen0.3.0?
13:05borkdudednolen yes
13:06dnolenit just pulls the latest, just post your issue
13:06AtKaaZhi, could anyone help me out with this: https://gist.github.com/AtKaaZ/4988320
13:07TimMcarkx: This is the doseq issue? How did Flex interfere exactly?
13:08borkdudednolen done
13:08dnolenTimMc: it writes JS globals via ExternalInterface
13:08dnolenabp: btw, you can emit your CLJS code w/ a wrapper
13:09TimMcI wouldn't expect rogue globals to interfere with doseq.
13:09dnolenTimMc: it will interfere w/ everything, doseq was a red herring
13:09abpdnolen: Huh?
13:09TimMcHuh, OK.
13:09dnolenabp: oops sorry
13:10abpdnolen: np. :D
13:10dnolenarkx: ^ see my comment above about emitting w/ a wrapper
13:12TimMcDoes that imply that CLJS will (by default) write its own single-letter globals?
13:12arkxIn advanced mode Google Closure Compiler writes single-letter globals
13:12TimMcOh, gross/
13:13arkxdnolen: I was unaware of that. How?
13:13TimMcSo... it's a collision of two latent bugs.
13:13AimHereProbably makes sense if you're optimising JS for space; presumably it renames all your own single letter globals from cljs
13:13dnolenTimMc: well just short name globals - a non-issue if you control the source.
13:13dnolenTimMc: Closure behavior is not a bug
13:15dnolenarkx: :output-wrapper true in your cljs-build :compiler options
13:15arkxAh, beautiful.
13:15arkxThanks.
13:15dnolenarkx: np
13:16AtKaaZ,(eval '`{:a (+ 1 2) :b ~(+ 1 3)}) ;can you replace the "eval '`" part with a macro ? so it's (xmacro {:a (+ 1 2) :b ~(+ 1 3)}) but returns same result
13:16clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
13:16dnolenarkx: it may be incompatible w/ ^:export, but I'm not sure
13:16TimMcdnolen: Misfeature, then. In JS, you can't really expect to always be the only one playing in the sandbox.
13:17arkxI first suspected some JS libraries we were using, but they all used 'var' correctly before their single-letter variables.. gah. :)
13:17arkxWe're rewriting a Flex client with ClojureScript
13:17dnolenTimMc: I've worked on many projects where you can assume that.
13:17arkxDidn't think that there was some previous uses of ExternalInterface in that inherited code.
13:18dnolenTimMc: and arguably the most complex JS apps in the world written by Google also get away w/ this just fine.
13:18arkxStill, missing var from declaration is one of *the* most common bugs in JavaScript
13:18bbloomdnolen: although to be fair, more and more google stuff is moving from closure -> angular :-P
13:18augustlI need to subclass a class, create instances of that class, and be able to get the .class of that subclass. Should I just do that in Java? :)
13:18TimMcIs there some insignificant cost to wrapping?
13:19dnolenarkx: yes, and wrappers won't really save you there.
13:19bbloomdnolen: at least closure UI -> angular. closure compiler is likely still in use
13:19TimMcAnyway, just because someone successful gets away with something doesn't mean it's a good idea.
13:19dnolenbbloom: that's interesting though I haven't heard such rumblings.
13:19augustlbbloom: what Google systems are AngularJS now? The only one I'm aware of is the first one, DoubleClick
13:20TimMcSafety is a process, and you process is different from theirs.
13:20TimMc*your (ugh, insane lag)
13:21bbloomdnolen: augustl: nothing pre-exsisting
13:21bbloomdnolen: augustl: i just know a few folks working on new(-ish) google stuff w/ angular
13:21augustlI see
13:22bbloomit also plays nice with closure-ui in the sense that you can embed angular in a div without much pain
13:22dnolenbbloom: interesting
13:23dnolenTimMc: in anycase, this not a point I care about much. JS is a mutable anywhere anytime language - there's no real protection from anything.
13:26TimMcdnolen: You can work to protect yourself from spending a day or two stuck debugging something nasty like this.
13:27dnolenTimMc: trying to protect yourself from a library overwriting some global will take you more than a day. Trust me, the NYTimes is most hostile JS environment I have ever seen.
13:27TimMcheh
13:28Raynesdnolen: Battleship: NYTimes.
13:28TimMcWhat I mean is, if wrapping by default protects developers from anguish and has little cost, it's probably worth it.
13:28ChongLidnolen: would caja help?
13:29dnolenTimMc: yes we use wrappers and all that stuff, doesn't fix some library changing a prototype, or overwriting a global namespace with shared data, or a billion other things.
13:29dnolenChongLi: I never looked closely at caja, but I doubt - that's more about eval'ing untrusted sources I thought.
13:30TimMcEh, not trying to solve *all* those problems.
13:30ChongLihmm
13:31dnolenTimMc: the problem is all of a kind. Closure approach of saying - no everything should and must go through this one whole program compile program process is not a bad solution given that.
13:33TimMcWhat can I say, I'm a belt-and-suspenders kind of guy.
13:37Raynesgf3: Dunno if you've committed anything on develop, but just a heads up that I've removed develop and master is the primary branch now. It shouldn't matter regardless of your changes.
13:39AtKaaZis there a textual way to type ` like quote is for ' ?
13:40AtKaaZtype=write
13:40Chousukeno
13:40Chousukeat least not in jvm clojure
13:40AtKaaZk
13:40Chousukeit's implemented purely on the reader level
13:40Chousukedunno about clojurescript
13:40AtKaaZI'm into jvm only
13:40bbloomAtKaaZ: Chousuke is correct, but if it did have a way to write it, it would likely be clojure.core/syntax-quote
13:41bbloomChousuke: clojurescript uses clojure's reader (for now)
13:41ecmendenhallHi, everyone. I'm wrapping some js methods in Clojurescript and wondering about the most idiomatic solution.
13:41bbloomAtKaaZ: do you need programatic usage of syntax-quote?
13:41ecmendenhallMacros (like `shim` in cljs-d3: https://github.com/lynaghk/cljs-d3/blob/master/src/clj/cljs_d3/macros.clj) need specified arities to avoid trouble with `this`.
13:41AtKaaZbbloom: it appears so, but that's probably because I don't know how to do something
13:42bbloomAtKaaZ: what are you trying to do?
13:42ecmendenhallWrapping direcly with lots of `defn`s (eg. jayq: https://github.com/ibdknox/jayq/blob/master/src/jayq/core.cljs) works, but it seems like there should be a better way
13:42ecmendenhall...and there's always just learning to accept the interop dot.
13:42Chousukewrite a macro to write the defns?
13:42AtKaaZbbloom: i sent a msg to clojure ML, but basically a macro that returns same as (eval `(quote {:a (+ 1 2) :b ~(+ 1 3)})) but by replacing "eval `" with macroname :)
13:43ecmendenhall(In fact, I see some value in keeping the js methods explicit). Is there some widely accepted solution?
13:44bbloomAtKaaZ: github.com/brandonbloom/backtick
13:44AtKaaZbbloom: oh sorry, I mean replacing "eval `(quote" with macro
13:45bbloomAtKaaZ: let me know if backtick does the trick
13:45AtKaaZbbloom: will do, thanks so far
13:45ecmendenhallChousuke: Yeah, that's where I started. But it's difficult to use `apply`, which compiles to fn.call(null, …) in js.
13:46Chousukedifficult in which way?
13:47ChousukeI don't know clojurescript specifics much but I can help with macros :P
13:49ecmendenhallChousuke: js functions that use `this` sometimes break (or at least, they did six months ago).
13:49mpenetecmendenhall: how so?
13:50dnolenmpenet: because of fn.call(null, ...)
13:50Chousukecan't you write your own apply that handles this explicitly instead of passing null?
13:51dnolenecmendenhall: hmm, actually I'm not sure why you're running into issues
13:51clojurebotNo entiendo
13:51mpenetI never encountered an issue with this. and I use this (via this-as) all the time.
13:52`abpI'm preparing my first open source library for release. :)
13:52dnolenecmendenhall: if you look at implementation of apply you'll see we invoke via (.apply f f ... args ...)
13:52dnolenin the case of real JS fns
13:53AtKaaZbbloom: template is the macro that I wanted, thanks!
13:54AtKaaZit is freaking amazing :)
13:55ecmendenhalldnolen: Thanks, I'll take a look. Actually, I think I'm thinking too far ahead here. I'm not sure I need to worry about `this` anyways. Back to the REPL!
13:59bbloomAtKaaZ: nice! thanks :-)
14:14FrozenlockAw cmon, gmail blocks an outgoing email because there's a .exe in a zip file.
14:15AtKaaZlol, does passwording it work? or + encrypt file names
14:19Frozenlockchanged .zip to .abc -_-
14:19FrozenlockStill, I'm really against the idea of gmail deciding what I can and can't send.
14:20amalloyvote with your feet, Frozenlock. use another email provider if you're actually "really against" it
14:20ChongLior send files via dropbox!
14:20pimeysI have this infinite project to start my own email server
14:20pimeysencrypted, in netherlands
14:20ChongLior numerous other services
14:21Frozenlockamalloy: thinking about it.
14:21AtKaaZinfinite?
14:21pimeyssigh, configuring imap/smtp is just so boring
14:21pimeysAtKaaZ: because I never start it :D
14:21pimeysjust talk about it all the time
14:21FrozenlockI have my own domain, so I could just use my own mail server.
14:21AtKaaZpimeys: sounds like something I'd do=)
14:21pimeysVPS is very cheap now
14:21pimeys3,50 euros per month
14:21pimeysso I can buy two of them
14:26bbloomdnolen: so what's the latest on predicate dispatch?
14:29dnolenbbloom: uh, not having time to work on it? :)
14:30bbloomdnolen: that's what i figured :-)
14:30dnolenbbloom: it's waiting a bit on me finding a couple weeks to dedicate to core.match
14:30TimMcFrozenlock: cotse.net is not bad.
14:31bbloomdnolen: along the lines of the stuff i was showing you on sunday, i've been exploring some of those ideas via fipp. one of the things i discovered is that i need two tools for processing propertied-trees: a transformation language and a style language. roughly XSLT and CSS
14:31technomancyFrozenlock: does it block it on the SMTP level or just from the web UI?
14:31dnolenbbloom: I'd like to refactor and document everything - and hopefully it'll be easier to see how you could make something like pred dispatch work.
14:31bbloomdnolen: things like Enlive covers XSLT for HTML, but there really isn't a comparable solution for arbitrary clojure trees
14:32bbloomdnolen: either way, XSLTs (and CSS for that matter) have a "best matching" behavior, which is very similar to predicate dispatch
14:32bbloomdnolen: ie the most specific selector or the most specific xpath query matches
14:32dnolenbbloom: right
14:32bbloomdnolen: i'd love to do something like that with arbitrary predicate dispatch
14:33NeedMoreDesuWhy print doesn't print anything to console, but prints to repl?
14:33bbloomdnolen: i made fipp to basically be a playground for those ideas :-) so i might dig into predicate dispatch a bit
14:34dnolenbbloom: well you could attempt to understand core.match - I don't get much help w/ that projects sadly.
14:34bbloomdnolen: i'll definitely look through it a bit
14:34dnolenbbloom: probably best to read the paper first - not much of the codebase will make sense otherwise
14:34Frozenlocktechnomancy: Did not check, I'm usually only using the web UI.
14:34FrozenlockYeah I know... I should read my mails in emacs :P
14:34bbloomdnolen: i'm rewatching your predicate dispatch talk, since it's been a full year since i thought about this problem. in the process, i have opened all the relevant papers you're mentioning in tabs. heh
14:34technomancynot a fan of the UI, but they seem like a reasonable IMAP provider
14:35TimMcNeedMoreDesu: The REPL is set up to intercept stdout.
14:35technomancyinsofar as reasonable and IMAP can go together
14:35dnolenbbloom: the Maranget is the most relevant - we only really changed a couple things.
14:35NeedMoreDesuTimMc: what should I do, then?
14:35TimMcDepends on what you want, I guess.
14:36NeedMoreDesuPrint to stdout.
14:36bbloomdnolen: cool, we'll chat about it more after i have some time to digest
14:36NeedMoreDesuAnd, well, see something on the screen.
14:37TimMcYou mean, see it once you;ve exited the REPL?
14:37bbloomdnolen: in particular, i'm thinking about how to represent XPath or CSS-selector like ideas on arbitrary clojure trees
14:37NeedMoreDesuI don't see printed text at all, when I'm not in repl.
14:37NeedMoreDesuWhen program is run via lein run
14:37TimMcWait, what am I thinking... the REPL isn't necessarily capturing stdout.
14:37TimMcNeedMoreDesu: lein run isn't a REPL.
14:38NeedMoreDesuYep. print prints to repl only?
14:38NeedMoreDesuIs there a way to change that?
14:38dnolenbbloom: oh right, somebody had mentioned tree matching - not support for that at the moment - Will Byrd has mentioned cata matching and maybe that's good enough. I know the Chez guys use that stuff int their compiler
14:38dnolenso maybe cata matching is good enough for trees?
14:39AtKaaZbbloom: can I resolve them like ` does when using template if I wanted to?
14:40TimMcNeedMoreDesu: The behavior you're describing doesn't make sense.
14:41gfredericksAtKaaZ: check how template is defined -- you can supply a resolver fn
14:41AtKaaZgfredericks: in process, thx
14:41TimMcNeedMoreDesu: I think you need to make a SSCCE.
14:41TimMc~sscce
14:41clojurebotAn SSCCE is a Short, Self-Contained, Correct Example <http://sscce.org/&gt;
14:42dnolenbbloom: have you looked much at the Chez compiler literature?
14:42AtKaaZgfredericks, bbloom: done dit it: (defquote like-backtick resolve)
14:43gfredericks:)
14:43AtKaaZthis is so awesome=)
14:43NeedMoreDesujee, I've just needed to println.
14:43bbloomAtKaaZ: gfredericks is right. i think that the real clojure implementation is slightly different than just clojure.core/resolve, let me check for you in a few minutes. i migh tjust add that to backtick directly as backtick/syntax-quote
14:43bbloomdnolen: no, i haven't. link?
14:44NeedMoreDesuProblem solved.
14:45dnolenbbloom: I may be off, but I think any serious dive into compiler approachers for a modern Lisp should probably start here http://www.cs.indiana.edu/~dyb/
14:46RaynesNeedMoreDesu, TimMc: Funfact: print doesn't automatically flush.
14:46bbloomAtKaaZ: gfredericks: yeah, so the difference is between Compiler.resolveSymbol and Compiler.maybeResolveIn
14:46bbloomAtKaaZ: gfredericks: one returns symbols, the other returns Vars, value objects, etc
14:46RaynesIf you use print, you need to do (flush) before you'll see anything.
14:47AtKaaZRaynes: but newline does?
14:47gfredericksbbloom: any advantage to backtick/syntax-quote over `?
14:48AtKaaZgfredericks: i can write a macro like this: (xmacro {:a (+ 1 2) :b ~(+ 1 3)})
14:48bbloomgfredericks: backtick/syntax-quote doesn't exist, i'm creating it right now :-P but the only real advantage would be the ability to (list* `syntax-quote ...) ie in a macro or something.
14:49Raynes$(source println)
14:49RaynesJesus.
14:49gfrederickssounds good enough to me
14:49RaynesIt's my own bot and I can't use it.
14:49Raynes$source println
14:49lazybotprintln is http://is.gd/WCT4fo
14:49AtKaaZboot owner, if you typo :)
14:50RaynesAnyways, https://github.com/clojure/clojure/blob/clojure-1.4.0/src/clj/clojure/core.clj#L3306
14:51RaynesWhen *flush-on-newline* is set, prn flushes.
14:51RaynesAnd since println calls prn, you get a flush.
14:51Raynespr (which print calls) does not do this.
14:51AtKaaZcool
14:52Raynesprintln is like one of those automatic toilets with a sensor that flushes when you step away from it. print is a normal toilet with a handle for manual flushing.
14:54cemerickRaynes: you need to finish your book, if only so I can see that description in print
14:54RaynesHeh
14:59hyPiRionThat's not far from how System.in works. Except that you receive the stuff flushed from the toilet.
14:59TimMcRaynes: I hate those automatic toilets. When I'm wearing a black t-shirt, they randomly decide I've stopped existing.
14:59hyPiRionAnd that you can switch pipes so that the tubes spit out something else instead.
15:00RaynesYikes, hyPiRion.
15:00RaynesSaying that after he said that...
15:00hyPiRionAnd the fact that you can remove some screws from the source and get a constant leaking in
15:00RaynesNot the best idea ever.
15:00hyPiRionWell, I need to get rid of my System.in anger somewhere
15:01hyPiRionComparing it to toilets is a great way of doing it
15:02`abpSo, Raynes metaphor reaches quite far. Congratulations on a job well done!
15:02RaynesI'll pat myself on the back immediately.
15:02`abpInstant reward
15:03`abpHm, making conflict free DSVs is hard.
15:04`abpIt's LISP, just in vectors. Clojures XML.
15:04`abpBut this time the aspect human readable is actually a truthful guarantee.
15:04FrozenlockIs there a way to test lazy stuff in the REPL? For example, when I test a function, everything is fine, but when I try it in production, I find a lazy@sdasfe instead of the actual data.
15:05gfredericksI often `(def name expr)` instead of `expr` to keep it from being realized
15:05gfrederickswell wait
15:05gfredericksif you're just talking about printing rather than errors
15:05gfrederickss/errors/debugging/
15:05gfredericksthen you want prn/pr-str, etc?
15:06FrozenlockOk, so instead of just typing 'expr', I should do (pr-str expr)?
15:06RaynesThat'll do it.
15:08denlabwatching Clojure/conj 2012 - Lightning Talks / heroku. it's cool
15:09bbloomAtKaaZ: almost done with a full syntax-quote macro with resolving. you're not the first person to ask for it, so i figured i'd just get it done
15:10AtKaaZbbloom: awesome, I was just preparing to use just this until then: (backtick/defquote almostLikeBackTick clojure.core/resolve)
15:10bbloomAtKaaZ: yeah, that's close. it misses mostly interop forms, like .foo and Bar.
15:13AtKaaZbbloom: also doesn't throw when it doesn't resolve to anything, i just notice it just does nil like (resolve 'f)
15:13`abpAtKaaZ: You like camelCase don't you? :)
15:13bbloomAtKaaZ: yeah, clojure.core/resolve is pretty different than what you actually need, it only appears to work :-P
15:14AtKaaZ`abp: but for the wrong reasons :)
15:15TimMcFrozenlock: Or prn
15:15AtKaaZ`abp: ie. some-weird-symbol can't be double clicked selected, oh but I just notice it can be triple clicked to select it=) so let's just say I'm reconsidering it
15:16AtKaaZ`abp: if only i could move over it with one Ctrl+left/right-arrow when I want to
15:16`abpAtKaaZ: Sounds like you don't use Emacs a lot.
15:16AtKaaZ`abp: indeed, in eclipse:)
15:18`abpAtKaaZ: Let me tell you this: Two weeks into Emacs and in no way looking back. Clojure, paredit, Javascript, orgmode, eshell, dired etc. It's a dream.
15:18AtKaaZ`abp: ah, nevermind tripleclick selects entire line, so close
15:18AtKaaZ`abp: i believe you, but i'm not ready to make the quantum leap i guess
15:19Frozenlock`abp: Would be even better if github's support of org-mode wasn't so sketchy.
15:19Rayneshttp://images2.fanpop.com/images/quiz/243000/243987_1246097307737_400_300.jpg
15:20`abpAtKaaZ: Actually it's no quantum leap. Read the tutorial built into Emacs, pick emacs live if you don't want to configure everything yourself and you are ready to read up on modes keychors. It's mostly reading about key combinations and memoizing them.
15:20RaynesMemoizing them. lol
15:20RaynesI've memoized all my keys.
15:20`abpAtKaaZ: You can convert orgmode to markdown
15:21AtKaaZ`abp: yeah that's what I tried but I found the key combinations to be different in emacs-live than some other normal emacs configs others use, so some tutorials were not doing what I'd expect
15:22`abpAtKaaZ: Those are really only a few you can read up or even comment in the default-keybindings file in your .emacsd.
15:22AtKaaZ`abp: if someone could write an emacs tutorial for replacing eclipse , I'd be most interested to read and point out what's missing=)
15:22`abpAtKaaZ: Not much interferring except C-h => delete characer, M-h => help instead of C-h
15:23`abpAtKaaZ: Just a suggestion to improve your worklife
15:24AtKaaZ`abp: i don't remember if emacs-live had git support? and some way to diff and compare two commits,
15:25AtKaaZ`abp: i know emacs would be better, but so far eclipse seems easier
15:25`abpAtKaaZ: magit
15:25FrozenlockAtKaaZ: It's a trap :P
15:25`abpAtKaaZ: Yea
15:26`abpAtKaaZ: You will be stuck forever if you don't leap forward.
15:27augustlany suggestions for automating testing of calls to an external SOAP API, without actually calling the external API?
15:28Frozenlock"Thankfully, although Emacs has a steep learning curve, once you “get” it — you get it." http://www.masteringemacs.org/articles/2011/11/10/belated-first-anniversary/
15:29denlab@<augustl> I've got a project in progress for that (because I have the same problem at work)
15:30augustldenlab: I guess I'll just write the code so that I can test it without actually doing HTTP
15:30bbloomAtKaaZ: sorry, gotta run for a bit. will release new version of backtick later tonight
15:30Bodilaugustl: You will if you expect to be able to call your tests unit tests, at least :)
15:31AtKaaZFrozenlock: that's exactly what puts me off with emacs(i think), i need to understand how it uses that elisp code (aside from it being fully elisp or lisp or whatever it is) so that i can know where to look when i want to change a key for example or run some code at startup or on open and stuff
15:32denlabaugustl: the idea of the project (http-scribe) is to listen to http traffic, record it, then pretend to be the server
15:32AtKaaZbbloom: it's ok, i can wait, tc
15:33AtKaaZFrozenlock: i'll give that a read , this one: http://www.masteringemacs.org/reading-guide/
15:34denlabeveryone is talking about microservices & all, but there is no obvious way to test/mock/fake/stub them
15:36augustlBodil: I hate unit tests! :P
15:37denlabaugustl: I used to love unit tests
15:38augustlI do automated testing and test first, but I prefer to only test the actual app (such as doing HTTP requests to an HTTP API)
15:38augustland selenium for UI, etc
15:39denlabwith some technologies it's safer to test everything
15:41denlabBodil: What IRC client are you using?
15:42Bodildenlab: Irccloud - why, what's it doing wrong? :)
15:43denlabBodil: nothing :) It's just it's only my 2nd time on #clojure and I find my IRC client (XChat) a bit bulky...
15:44denlabBodil: I was asking advice
15:45Bodildenlab: Well, Irccloud lives in a browser tab, I can recommend it if that's where you prefer to keep your irc session. It's a paid service, though.
15:46denlabBodil: huh?! and then aoutch!?
15:46denlabBodil: ;-)
15:47denlabBodil: I should try one of the emacs IRC client anyway
15:47augustlI hope I can buy and deploy my own irccloud instance when it goes out of beta
15:47Bodildenlab: I prefer as few open windows as possible, and I've found Emacs and Chrome to be a minimum. And my Emacs window is where I go to focus on programming, so I don't want my irc client in there. So it has to go in the browser. :)
15:47hashbang1denlab: if you are looking for a text-mode client, irssi and weechat are nice.
15:48Bodilaugustl: Why'd you want the trouble of hosting it yourself?
15:48denlab:hashbang1 thx, I'll put it on my org-mode list
15:48denlab:Bodil it make sense
15:49Bodildenlab: +1 for irssi, it's my favourite console client.
15:49augustlBodil: I don't want to pay for it on a monthly basis, I already pay for lots of bandwidth and CPU elsewhere..
15:51Bodilaugustl: The price is easily worth the lack of bother for me. Life's too short for sysadmin work. :)
15:51augustlI'll probably end up paying as well..
15:51augustlthe client is so much better than irssi
15:56denlabI will represent Clojure on a code contest next thursday
15:56denlabwith a friend of mine (pair prog contest)
16:01TimMcBodil: I happen to already have a server (well, a laptop that lives under the couch at home), so irssi is a no-brainer.
16:06Raynesdenlab: You'll want to kill yourself within 5 minutes of using any given Emacs IRC client.
16:06Raynesdenlab: XChat is an excellent client though.
16:06RaynesIrccloud would have to give me cookies on a daily basis to get me to pay for them.
16:06BodilTimMc: I have servers to run it on, I've just done too much server admin in my life to pass up on paying someone a couple of dollars to do it for me. :)
16:07RaynesThe only hting it has going for it is "Stay connected even when you're offline" and I have a znc server for that.
16:07technomancyerc is fantastic
16:07Raynesthing*
16:07Bronsaerc is ^
16:07Raynestechnomancy: I was implying setup.
16:07Frozenlock+1 for erc
16:07RaynesErc is rudimentary if you want to program your IRC client.
16:07technomancyRaynes: you don't *have* to turn paredit on in erc you know =)
16:07BodilRaynes: I was super happy with ERC (aside from the bit about interfering with my programming), after spending about a month configuring it...
16:09denlabRaynes: What client do you recommand?
16:09Raynesdenlab: Well, I normally recommend XChat on *nix, but...
16:09Raynes:p
16:09technomancyuse irissi if you don't use emacs and aren't allergic to perl
16:10ChongLiI use irssi despite using emacs!
16:10RaynesI'm not a fan of irssi.
16:10Bronsai switched to erc from irssi
16:10Bronsaand now my erc looks like irssi :(
16:10denlabI'am neutral regarding perl, and in love for emacs
16:11brainproxytechnomancy: weechat > irssi
16:11technomancydenlab: rcirc is another option that ship with emacs; they're nearly indistinguishable these days. erc has more 3rd-party modules; rcirc's codebase is a bit cleaner.
16:11hashbang1weechat is nice, and you can extend it with a handful of diff languages
16:11TimMcBodil: What admin is there to do?
16:11Bodilhashbang1: If one of them is a lisp, I'm sold.
16:11hashbang1Bodil: scheme is one
16:12BodilTimMc: Installing and configuring? :)
16:12RaynesBodil: Like you even use Lisp. You write Clojure editors in CoffeeScript.
16:12technomancythere's a big difference between "can extend in lisp" and "written in lisp"
16:12TimMcI guess a dedicated IRC service can make sure your client "comes back up" after restart.
16:12TimMcBodil: sudo apt-get install irssi; irssi
16:12RaynesHeh.
16:12RaynesThat's like 5 year old buys car, drives.
16:12BodilRaynes: Go hug a pony. :)
16:13TimMcNot trying to convert you; just trying to understand the appeal of a web service.
16:13denlabI want a great IRC Client, the Emacs integration is secondary (or is it related? ;-)
16:13BodilTimMc: I'd tip you more than what I pay Irccloud just for typing that for me. ;)
16:13TimMcHow much do they charge?
16:13RaynesTimMc: I think the appeal is persistent IRC connections without having to set up znc (which is easy).
16:13Raynes$3 if you don't want to connect to a private IRC network.
16:13Raynes$5 if you do.
16:13RaynesPer month.
16:13TimMcTotal? Per month?
16:13brainproxymy personal setup is znc running on a vps
16:14brainproxythen I use weechat running in tmux on my mac to connect to it
16:14Raynesbrainproxy: I run znc with a web interface and everything and do it as a service to tons of people.
16:14technomancyRaynes: znc is easy against one server; it's a nightmare going to multiple though.
16:14Raynestechnomancy: No it isn't.
16:14RaynesYou need to upgrade your znc.
16:14brainproxytechnomancy: it's not that bad nowadays
16:14Raynes1.0 has multiple server support per user.
16:14technomancyhm; the docs I read were horrible
16:14RaynesIt's damn near perfect now.
16:14technomancyhuh; that's encouraging
16:15brainproxyyou can get a $5/month vps from digitalocean
16:15technomancyit still uses fauxml, which I try to avoid on principle
16:15bloopcan someone explain to me why (sort subset? [list of sets]) works sometimes but not other times? It seems like subset? should work as a comparator because it's transitive... is there some property its missing that stops it from making a stable sort?
16:15Raynestechnomancy: I've set up 5 different accounts and haven't touched a config file in two years because of the web interface.
16:15TimMcbloop: subset? is a partial order
16:16brainproxyRaynes: agreed, the web interface takes a lot of the pain away
16:16RaynesI lie, I had to touch it once to enabled SSL cause I couldn't figure out how to do that in the web interface.
16:16TimMcbloop: What is the correct sort for this? [#{} #{3} #{5} #{3 5}]
16:16technomancyRaynes: configuring solely through an HTML form is just as bad as learning a bullshit XML dialect though (on a different axis albeit); if I'm going to configure something it's gotta be in version control or it doesn't exist
16:17bloopTimMc: Is there a better function to use? I don't care if it's stable - only that subsets appear before supersets.
16:17technomancyI guess you could do the config in the web UI and check in the generated files provided it emits them properly?
16:17Raynestechnomancy: It emits things properly.
16:17bloopTimMc: I would say that hat is already "sorted"
16:17RaynesThe web interface is just an interface to the one config file, technomancy.
16:18TimMcbloop: What if I switched the two middle elements?
16:18technomancywell that's good to hear; after what I read from earlier versions I didn't have high hopes for them getting things like that right =\
16:18bloopTimMc: still "sorted"
16:18RaynesPretty sure the web interface has emitted to the regular config file for ages.
16:18bloopTimMc: As long as no supersets appear before a subset
16:18RaynesBut yeah, znc has had some misses.
16:19RaynesThe original one-server-per-user thing was batshit crazy.
16:19TimMcbloop: OK, it's not the best example... I need one that doesn't have simple equivalence classes.
16:19jweisswhat's a common way to share behavior among several related records? i've seen maps of kw to functions be passed around as "behavior". is that as good as anything or is there a more idiomatic way
16:19RaynesI nearly hurled myself out the window with excitement when I found out they were fixing it in 1.0.
16:19bloopTimMc: it's seems to mess up most often when there is more than one "island" of sets, if you catch my meaning
16:20amalloybloop: "works sometimes but not other times" is not debuggable. what is an x such that (sort subset? x) returns a value you don't like?
16:20brainproxyznc also use to have problems with floods if the connection between znc and the irc server/s got interrupted, especially if you were in lots of channels
16:20brainproxybut I haven't experienced that problem in awhile
16:21bloopTimMc: eg (sort subset? [#{17 18} #{1} #{17} #{1 2} #{2} #{1 2 3 4} #{18}])
16:21amalloythough actually the problem is pretty easy to see: as TimMc says, subset? imposes a partial order, whereas sort requires a total order
16:22TimMcbloop: Is this sorted? [#{} #{1} #{1 2} #{1 6} #{1 2 3}] -- I suspect you won't like that, but subset relationships are never reveresed in that one.
16:23bloopamalloy: yes
16:23bloopTimMc: yes
16:24TimMcYou could probably make a "total comparator" by wrapping something around subset?, such as a size check...
16:24bbloomgfredericks: updated backtick with full syntax-quote
16:24amalloyit's fine to say you want subsets to come before supersets, but if you tell sort that #{17 18} comes before #{1} (because you don't care about their ordering), and then that #{1} comes before #{17} (again, you don't care), it will conclude that #{17 18} comes before #{17} without ever calling subset? on the two of them
16:24bloopTimMc: that list is sorted according to my needs: no superset appears before a subset
16:24amalloyTimMc: that total comparator is easy: (sort-by count sets)
16:25amalloybloop: so just sort them by size, as i say above
16:25amalloyyou'll never get a larger set before a smaller one, so problem solved
16:25TimMcI'm not even sure how sort is supposed to work with a predicate like subset?.
16:26bloopha! thanks guys, I think that works, doesn't it?
16:26amalloyTimMc: it probably converts it using copmarator
16:26TimMc,(sort = [1 5 2 8 9])
16:26clojurebot(1 5 2 8 9)
16:26TimMc,(doc comparator) Oh, is that a thing?
16:26clojurebot"([pred]); Returns an implementation of java.util.Comparator based upon pred."
16:26amalloyah no, it doesn't do that
16:27TimMcI'm not sure what *that* does.
16:27amalloyclojure functions implement Comparator
16:27amalloyTimMc: it assumes that pred is a function like <, and implements Comparator by calling pred
16:28TimMcOh, fancy. cond (pred x y) -1 (pred y x) 1 :else 0)
16:29hyPiRionoh, muha
16:29hyPiRion,(sort - [5 1 4 -3 2])
16:29clojurebot(-3 1 2 4 5)
16:29amalloywhich is odd, because i think that's already how (fn) implements Comparator
16:30clintnewsombit of a n00b to clojure
16:30clintnewsomi have an atom (def my-atom (atom {:turns [] :winner false :game-over false}))
16:31clintnewsomwhich i'm trying to update the value :winner
16:31clintnewsomi know update-in
16:31clintnewsomis the way to go
16:31TimMcamalloy: Interesting, I don't see it in the Java source.
16:31amalloyTimMc: Afunction/compare
16:31amalloyAFunction
16:31clintnewsombut can't seem to wrap my head around the syntax
16:31TimMcAh, thanks.
16:31amalloy(swap! my-atom assoc :winner true)
16:32clintnewsomi know updating the :turns vector would be something like
16:32clintnewsom(swap! my-atom conj [:turns :first])
16:32hyPiRion(swap! atom fn-to-use arg1 arg2) => (reset! atom (fn-to-use @atom arg1 arg2))
16:32dnolen,(assoc-in {:turns [] :winner false :game-over false} [:winner] "Bob")
16:32clojurebot{:turns [], :winner "Bob", :game-over false}
16:32hyPiRion(Except it's atomic, so no issues with that @atom thing)
16:33clintnewsomthanks
16:33dnolenclintnewsom: in the case of setting a winner you don't really need update-in, just assoc-in
16:33clintnewsomthat worked
16:33clintnewsomhaha
16:33clintnewsomi knew i'd see you here
16:33clintnewsomyes
16:33clintnewsomthankyou
16:33TimMcamalloy: In fact, it's even better than clojure.core/comparator, since it allows use of both booleans and numbers.
16:33amalloyyeah
16:33clintnewsomoh
16:33dnolenupdate-in is only when you want to change an existing value w/ a function to something else.
16:33hyPiRionTimMc: Not sure what you mean by better. What is true, and what is false?
16:34hyPiRionIt's not evident from my perspective.
16:34hyPiRion(Neither's -1, 0 and 1 though)
16:36TimMchyPiRion: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFunction.java#L51
16:36TimMcIf a boolean is returned, the fn may be called again with the params reversed.
16:40gf3Raynes: Thanks for the heads up
16:40Raynesgf3: There shouldn't be any merge conflicts or anything, so I'm not sure why I bothered you at all.
16:41gf3Raynes: BECAUSE YOU'RE A NICE GUY
16:41Raynescallenbot: You mentioned a css preprocessor. Are you saying I should use SASS?
16:42RaynesBecause we might have to engage in fisticuffs.
16:57Frozenlockwhat would be a clojure way of trying something up to X number of time? (->> (repeatedly 5 do-stuff) (take-while empty?)) ??
16:57lazybotFrozenlock: Definitely not.
17:00TimMcTwo end-conditions, where one is a max iterations and the other depends on output of the body?
17:01FrozenlockYup
17:01TimMcLooks like a reasonable approach.
17:01TimMcI'd add a dorun at the end of that, though.
17:02FrozenlockI've used a doall...
17:02TimMcOr that.
17:02FrozenlockI always confuse them..
17:03FrozenlockOr rather they confuse me.
17:03TimMc,(do (take-while identity (repeatedly 5 #(do (println "x") 1))) '_)
17:03clojurebot_
17:03Frozenlock*grammar time*
17:03TimMc&(do (dorun (take-while identity (repeatedly 5 #(do (println "x") 1)))) '_)
17:03lazybot⇒ x x x x x _
17:04AtKaaZbbloom: hi, is this why I should use the *-fn version? https://www.refheap.com/paste/11487
17:04bbloomAtKaaZ: that first line is analogous to ##(-> `'foo)
17:04lazybot⇒ (quote clojure.core/foo)
17:05AtKaaZCompilerException java.lang.RuntimeException: No such var: user/quote, compiling:(NO_SOURCE_PATH:1)
17:05bbloomAtKaaZ: oooooooo
17:05bbloomAtKaaZ: you may have discovered a bug: specials
17:06bbloomAtKaaZ: let me look
17:08bbloomAtKaaZ: https://github.com/brandonbloom/backtick/commit/f194cb1e429923a68d3e3a9cc4ec25f0f833b838
17:08bbloomAtKaaZ: I redeployed 0.3.0-SNAPSHOT to clojars
17:08bbloomAtKaaZ: thanks for kicking the tires!
17:08AtKaaZcool
17:10solussdanyone know if there is an OAuth2 provider workflow for Friend? I've found Clauth, but it doesn't integrate with friend and I've found friend-oauth2, but it is just an oauth2 client, afaict.
17:21degIs there a standard function like partial, that takes the additional args on the left, rather than the right?
17:25`abp`Can I load data readers I just wrote at the repl?
17:26cmdrdatsdeg: sounds like a strange case? you could just #(f % arg1 arg2)?
17:27mjiigdoes anyone know how you're meant to connect to a database with jdbc now since the docs say with-connection is depreciated?
17:27Raynes(defn weird-partial [f & args] (fn [& new-args] (apply f (concat new-args args))))
17:27Raynesdeg: ^
17:27degcmdrdats: Yes, that's exactly what I'm doing now, but I was hoping for an idiomatic parallel to partial. No biggy.
17:27RaynesThere is no standard function though.
17:28degRaynes: Ok. Is it worth duplicating the multiple cases implemented by partial (for short arglists)? How much efficiency do they gain?
17:28clojurebotOne idea I had was to parameterise Keyword with the key it looks up. :a is of (Keyword :a). But that has other issues.
17:29Raynesdeg: Not really.
17:29cmdrdatsdeg: if it's for a call to a function in your own code, consider flipping it around in the signature?
17:30weavejesterDoes anyone know offhand how to find which resource a namespace comes from?
17:30degcmdrdats: I thought of doing that, and still might, but it makes the code slightly less readable in other contexts. Mostly, I was asking out of curiosity. "weird-partial" seems as useful, in general, as partial.
17:30weavejesterI have an odd bug where an out of date class is somehow creeping into the classpath
17:31deg(Or maybe it's just me. I'm also bothered that -> doesn't have syntax allowing the arg-threading in arbitrary positions.
17:31hiredmanweavejester: have you cleared classes and/or target classes?
17:31weavejesterhiredman: Yep
17:31cmdrdatsdeg: I used to write my functions a lot with the partial-able args at the beginning
17:31cemerickweavejester: e.g. (clojure.java.io/resource "clojure/set.clj")
17:31weavejestercemerick: Yeah, that claims the dependency is up to date
17:32weavejesterBut I know it isn't
17:32cmdrdatsdeg: but recognized that there's huge value in putting them at the end, especially if you want to use the ->> macro mixed with list transformation functions like map, filter and reduce
17:32amalloydeg: arbitrary-position threading is just 'let
17:33stuartsierradeg: Clojure 1.5 has as-> which does allow the argument in arbitrary positions
17:33degcmdrdats: Understood. I'm still fighting the language here, as a newbie.
17:34degstuartsierra: What is the syntax for as->? Sounds interesting. Is 1.5 stable enough already for average users?
17:34hiredmanweavejester: how do you know?
17:34stuartsierrait's in the source, and yes
17:34degstuartsierra: Cool. I will try switching up from 1.4 soon.
17:35weavejesterhiredman: When I run the code in project A, it works, but in project B, it doesn't. The dependencies for the library in question are the same.
17:35hiredmanweavejester: have you checked the working project for stale classes, etc
17:35weavejesterio/resource says they're from the same jar
17:36weavejesterhiredman: I've lein cleaned before running lein repl
17:36hiredmanweavejester: and `lein classpath` is the same for both?
17:37jsabeaudryI need to serve a lot of json and cheshire.core/generate-string is the bottleneck, any recommendations?
17:37hiredmanis this on the same machine using the same ~/.m2?
17:37weavejesterhiredman: The projects have differing dependencies; but the library in question has the same version on both, on the same machine, with the same user.
17:37dakronejsabeaudry: are you using custom encoding?
17:37hiredmanjsabeaudry: depending on what you are serving you may want to look at some kind of templating instead of a general purpose encoder
17:38hiredmanweavejester: ok, so the jar for the library in question in `lein classpath` is the same for both?
17:38jsabeaudrydakrone, nope
17:39dakronejsabeaudry: how did you determine encoding is the bottleneck? what version of cheshire?
17:39weavejesterhiredman: Yes
17:39jsabeaudryhiredman, ok some kind of "hardcoded" encoder that only works for my data?
17:39dakronejsabeaudry: what does your data look like?
17:39weavejesterhiredman: Let me try again, see if I can narrow the issue down with some test code
17:39hiredmanweavejester: ok, so take the rest of the jars that differ and write a little for loop that searches them for the same resource
17:40jsabeaudrymy data looks like {:a [0.00001 0.333 0.45555] :b 4 :c 5} x1000
17:40hiredman(format "{:a [%s %s %s] :b %s :c %s}" ...)
17:41hiredmanwell, but with json
17:41jsabeaudrydakrone, cheshire 5.0.1 and perhaps I am wrong, it just that when i call the http handler doing the encoding the processor goes up to 100% for a few seconds
17:41jsabeaudrydakrone, could be jetty really bad at serving a string
17:42dakronejsabeaudry: you may need to do profiling to determine where the bottleneck is
17:42jsabeaudrydakrone, yes, indeed
17:44jsabeaudrydakrone, is there a limit to the size of the json string? can I serve 100KB strings?
17:45jsabeaudryGetting late, I'll profile that tomorrow
17:46jsabeaudrythanks for the suggestions hiredman and dakrone :) also thanks for cheshire, great little lib :)
17:46dakronejsabeaudry: you should be able to servec strings that size without a problem
17:49amalloycould be any number of things. perhaps your data points are generated slowly but lazily, and only realized when cheshire tries to encode them
17:51`abp`Do I need to start a new repl everytime I change data_readers.clj?
17:52ravsterhello all
17:53brehaut`abp`: (require :reload 'foo.data-readers)
17:53brehaut`abp`: or :reload-all to reload it, and its dependancies.
17:53brehaut`abp`: there are gotchas with multimethods and protocols
17:54hiredmanbrehaut: he is talking about data_readers.clj
17:54hiredmanthe magic file for literals
17:54brehautoh right. my bad
17:55`abp`I just wondered. ;)
17:55hiredman`abp`: data_readers.clj is used to populate *data-readers*, which you can binding via binding or alter the root value of
17:55weavejesterIs there a way of interrogating a namespace to figure out which classloader it came from?
17:55cemerickmagic http://3.bp.blogspot.com/-fuukRVObpiI/T_W_LVsivkI/AAAAAAAABB8/YcXkIn4QeDE/s320/magic.gif
17:56amalloyweavejester: probably not for a namespace, but you can ask the functions in it
17:56weavejesteramalloy: That'll do. Do you know offhand how to do that?
17:56amalloy,(.getClassLoader (class inc))
17:56clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")>
17:57weavejesteramalloy: Oh right, because functions are classes. Duh me.
17:57amalloyweavejester: functions are objects, man
17:57weavejesteramalloy: Or objects, rather
17:58weavejesterOhh, interesting
17:59weavejesterIn the library that works, the classloader is: #<DynamicClassLoader clojure.lang.DynamicClassLoader@816c920>
17:59weavejesterIn the library that does not, the classloader is: #<AppClassLoader sun.misc.Launcher$AppClassLoader@7361b0bc>
18:00hiredmanthat is aot vs. not
18:00hiredmanwhen code is compiled you get a dynamicclassloader
18:00hiredmanso maybe one of your other deps is shipping with an aot compiled version of the lib or something
18:02`abp`so, *data-readers* has my readers, but an exception that the reader function for the tag was not found.
18:03hiredman`abp: what did you put in *data-readers* ? and how are you reading? and have you loaded the code that implements your data reader before trying to read?
18:03weavejesterhiredman: Yeah, I figured. And… with .getResource I've found it. I need to remember that it's __init.class instead of .clj
18:04ravsterwhats the best way to make a system both basic-auth and cookie-auth? remvee's basic-auth lib doesn't look like it would allow a request to continue without basic-auth , and I'd like something that supports both.
18:05`abphiredman: I didn't put anything. Clojure loaded them. But requiring the implementing namespace and then trying to use a read form fails.
18:05`abpa tagged form
18:05weavejesterOh, that's strange. It's been compiled by a library that shouldn't have any AOT.
18:05hiredman`abp: pastebin your data_readers.clj
18:06hiredmanweavejester: none should, really
18:06`abphttps://gist.github.com/abp/2f7b952d9d9ebf290d5b
18:07weavejesterhiredman: Yeah. This is a library in a private repo, but it doesn't have any :aot directives, no :main and no :gen-class. I just grepped the source. Yet in .m2 the jar has compiled classes in. Weird!
18:07arrdemrandom musing from the last few days: will the JVM's JIT take {:foo bar :baz bung} and inline it to a struct given sufficient use?
18:07hiredmanweavejester: if you have stale stuff in classes/ lein may just throw them in to the jar :/
18:07clojurebotinner classes are a Java fiction; for the Double "inner class" in Point2D, write Point2D$Double (not Point2D.Double).
18:08hiredman`abp: and do you have an example use of the literal?
18:08weavejesterhiredman: Yeah, that was my next thought, too. My git repo for the lib is at 0.1.2, and the compiled version is 0.1.4 so maybe someone updated it...
18:08`abp#route/get :a
18:08`abp#route/get [1 2 3]
18:08`abpoh.. wait
18:10weavejester"lein jar" doesn't compile any classes so… maybe someone screwed up the packaging somehow.
18:10`abphiredman: Nope, doesn't work
18:11hiredman`abp: would those readers return nil?
18:11`abpthey were returning nil, just printing, now they are returning their argument
18:12`abphiredman: even (('routes/post *data-readers*) :a) works
18:13`abpas well as routes/get in there
18:13hiredman`abp: what repl are you using?
18:14`abpnrepl via nrepl.el 0.1.6
18:14hiredmanwhat happens if you send (read-string "#routes/get :a") ?
18:15`abphiredman: works..?
18:16hiredmanso somewhere in nrepl something is trying to read the code you send it, but it doesn't have the data readers installed
18:16`abpeww oh my god
18:16`abp
18:16`abp
18:16hiredmancomplain loudly in the github issues for nrepl.el and the jira for nrepl
18:17`abpbut it's not working with lein repl either
18:17`abpso more like nrepl?
18:17hiredman^- that was a pretty sweet diagnosis
18:17weavejester Yeah, someone, somehow managed to get a bunch of classes in a jar deployed to a private repo. Maybe they compiled it and that left a bunch of classes in the target directory that were picked up by the "lein deploy" command.
18:17amalloyafaik that's a known problem with nrepl
18:17hiredman`abp: I am not sure how `lein repl` works these days, it is actually pretty complex now
18:17`abpamalloy: Uh, that would be tough
18:18hiredmanamalloy: really, my reader literals seem to work fine?
18:18hiredmanwell, unless whatever it is doesn't have a corresponding print-method
18:18amalloyhiredman: perhaps they fixed it for the common case? i know it used to be a problem
18:18hiredmanbut the reading happens fine in that case
18:18`abpI'm on Clojure-1.5.0-RC16 btw
18:20`abpOh snap, I'm not.
18:22`abpOk still doesn't work.
18:28`abphiredman: heh, clojures neat error handling strikes again. last fragment of implementing ns and tag must match up..
18:29`abphiredman: that's a connection I didn't know of
18:29hiredmanhuh
18:29hiredmanme neither
18:29`abpRuntimeException No reader function for tag route/post clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1164)
18:30`abpthat's all it has to say on that..
18:30hiredman`abp: are you sure about that? I don't see that in the code anywhere?
18:36`abphiredman: I can't spot anything causing this behaviour either..
18:38pppaulanyone here use drip?
18:42Raynespppaul: Well, I use it and work with the guys who wrote it.
18:43pppaulhow hard is it to get drip working with lein/ring/whatever-clojure?
18:43RaynesNot hard at all.
18:43pppaulgreat
18:43pppauli'm going to install it right now
18:43RaynesIf you just install drip lein will use it automatically.
18:43weavejesterI tried drip, but I didn't see any difference between drip-enhanced Lein and normal Lein
18:44Raynesweavejester: Did you actually time it?
18:44RaynesActually, lein won't automatically use it.
18:44weavejesterRaynes: No, but I was expecting a subjective difference
18:44Raynespppaul: After you install drip, add "export LEIN_JAVA_CMD=drip" to your ~/.profile or ~/.bashrc or whatever.
18:44RaynesAnd then lein will use it and you'll be good to go.
18:46weavejesterRaynes: I used someone's plugin a while ago. Perhaps it didn't work. I'll try again with the official instructions.
18:46Raynesweavejester: https://www.refheap.com/paste/11490
18:46Raynesweavejester: This is the raw performance gains over using 'java' directly with a Clojure project.
18:47pppaulhmmmm
18:47Raynesweavejester: However, lein is going to be slow no matter what you do, especially when it uses subprocesses (which means you get the JVM startup anyways, even though drip has cut out the original startup time).
18:47weavejesterRaynes: Ohhh… maybe that's why it didn't seem to make a difference to Leiningen.
18:48pppaulRaynes how will i know if lein is using it?
18:48Raynesweavejester: drip is much more useful for actual end-user things. For example, IIRC jruby either ships with it or plans to at some point.
18:48Raynespppaul: do 'drip kill' and then run `lein version` and then do `drip ps`
18:48RaynesIf there are JVMs then leiningen is using drip,.
18:49pppaulthank you
18:50pppaulhttp://librelist.com/browser//leiningen/2012/9/10/ann-drip-a-fast-jvm-launcher/
18:50Raynesweavejester: Another thing is that if you try to run two commands in quick succession, one of them will have the startup time since it hasn't given the second drip JVM enough time to spin up. There is some thing you can set that makes drip keep n JVMs running so that you can run several commands back to back without hitting the startup time.
18:50RaynesNot sure how well tested that feature is though.
18:50muraiki1Hi all, I'm new to clojure and clojurescript and have run into a problem. I've successfully used org.clojure/math.combinatorics in my clojure project, but now that I'm switched it to cljs I get the following error in the web console when running it: goog.require could not find: clojure.math.combinatorics
18:51ivanif there were an easy way to have cleanly isolated Clojure runtimes in the same JVM, you wouldn't need drip, right?
18:51weavejesterRaynes: I can actually kinda see a difference now
18:52ivanmuraiki1: the repo suggests there is no cljs version
18:52pppauldrip ps -> command not found Raynes
18:52Raynesweavejester: https://www.refheap.com/paste/11491
18:52muraiki1ivan: heh, now I feel dumb... thanks!
18:52hiredmanweavejester: now not only do you have to worry about stale classes, but stale jvms
18:53weavejesterhiredman: Haha
18:53Raynespppaul: Try `which drip`
18:53hiredmanI kid you not
18:53RaynesSounds like drip isn't on your PATH.
18:53RaynesHow did you install it?
18:53ivansome CLJS users might know if https://github.com/clojure/math.combinatorics/blob/master/src/main/clojure/clojure/math/combinatorics.clj is all valid CLJS, it might be
18:54hiredmanI have heard people swear off drip, having been burned by that very thing
18:54weavejesterhiredman: I believe you. I think I'll try it until it bites me, though.
18:55RaynesEh.
18:55pppaulRaynes which drip shows that drip is on my path. drip is running… i don't see lein using it
18:55Raynesdrip is wildly less volatile than persistent JVMs.
18:56pppauli followed the instructions from the website http://librelist.com/browser//leiningen/2012/9/10/ann-drip-a-fast-jvm-launcher/
18:56RaynesAnd if you think it's causing a problem 'drip kill' will fix it. I've yet to have any sort of issues with it caused by stale jvms.
18:56muraiki1ivan: actually it looks like the one function I need works fine in cljs, so I'll just include it in my project for now
18:57muraiki1ivan: and my project is also EPL so no worries about license, hehe
18:59Raynespppaul: What version of lein do you have?
18:59pppaul2
18:59pppaulbut i'm using fish as my shell
19:00pppaulso the wiki on flatland is giving me trouble
19:00RaynesYeah, I can't help you at all with fish. :p
19:00pppaultrying with zsh now
19:00RaynesOnly thing I know about fish is the name. ;)
19:05pppaulwhat is the jps command in drip?
19:08pppauloh man, there is a note on the drip wiki that says it doesn't work with lein preview 10....
19:09weavejesterpppaul: Haven't you upgraded?
19:09pppaulhmm
19:09RaynesThat's kind of why I asked you which version you were using. :p
19:09pppaulpreview 10 isn't the latest version?
19:10RaynesNo, there is a final release.
19:10RaynesUpgrade, boy.
19:10RaynesThe future is here.
19:10pppauli feel like an old man
19:11pbostromRaynes: I've noticed that clojail will "lose" defs after I've sent it a few things to evaluate
19:11Raynespbostrom: Did you notice this from using clojail itself or from tryclj?
19:11RaynesThis was reported on tryclj, but I didn't realize it was a clojail problem specifically.
19:11pbostromI'm using it on my own app, which is similar to tryclj
19:12Frozenlockpbostrom: you can change the limit on the number of defs that clojail will accept.
19:12RaynesYeah, but the limit seems to not matter anymore.
19:12Frozenlocko_O
19:12RaynesThe limit is higher than 2 on tryclj yet it drops defs after 2 defs.
19:12RaynesIt has magically broken somewhere along the line.
19:12pbostromit seems to lose it if I just reference the def a few times
19:13RaynesYeah, that's what I meant. It's evil.
19:13Raynespbostrom: Could you open an issue? I'll take a look asap.
19:13RaynesYou could probably fix it faster, but I'd be concerned about suicide.
19:14pbostromRaynes: I may look into a bit more, but I don't really now where to begin, I will open an issue though, thanks
19:14FrozenlockIs there some kind of forms-helpers for compojure/hiccup?
19:14Rayneshttps://github.com/weavejester/hiccup/blob/master/src/hiccup/form.clj
19:15FrozenlockWell yes, but helper for that.
19:15FrozenlockInput validation, automatic conversion, etc etc
19:16Raynespbostrom: https://github.com/flatland/clojail/blob/master/src/clojail/core.clj#L149 and search for 'def' https://github.com/flatland/clojail/blob/master/src/clojail/core.clj#L221 might help.
19:16RaynesBut I don't expect you to fix it.
19:16RaynesJust warning you it might be a little while.
19:17pbostromRaynes: I might be able to look into it, I'll just harass you on irc if I get stuck
19:17RaynesSure thing.
19:17FrozenlockHmm what would be really sweet is a validator maker. Here's an example map <map>, make sure the returned value fit it in, with the correct data-type.
19:18FrozenlockMust.. not... start ... something ... new...
19:19weavejesterFrozenlock: There are a few projects under "validation" at http://www.clojure-toolbox.com/
19:20Frozenlockweavejester: thanks, looking now!
19:21Frozenlockweavejester: btw, just tried codox, works like a charm :)
19:22weavejesterFrozenlock: Excellent :)
19:35DaReaper5How would i get the difference between two dates in clojure?
19:36DaReaper5Do i have to have an ugly loop or use joda?
19:37FrozenlockDaReaper5: clj-time
19:39DaReaper5(- (years date1)(years date2) ?
19:41ivaraasenshould buy some more CS books. anyone got recommendations?
19:41DaReaper5or: (- (in-years date1)(in-years date2)) ?
19:42Frozenlock(in-minutes (duration (date-time 1986 10 2) (date-time 1986 10 14)))
19:45ravsterI want to write an authorization function for a handler for a particular route. how do I make sure that the authorization function gets the request object. I'm looking at compojure's source, but I'm not understanding it.
19:45weavejesterravster: It sounds like you're describing middleware
19:47ravsterweavejester: the middleware I wrote puts stuff into the :session map. I need an authorization function that will look in the :session map of a request, see if a particular entry matches, and then chooses to pass the request on to the actual handler for the route.
19:47ravsterdifferent routes would have different authorizations, so I can't put it all in a wrapper, right?
19:48weavejesterravster: You can assign different middleware to different routes
19:48weavejesterravster: A route is just a Ring handler
19:49weavejesterravster: Compojure is essentially a library for connecting together Ring handlers into bigger handlers.
19:50RaynesWith weird modified destructuring syntax.
19:50Raynes;)
19:50ravsterhuh. looking through ring wiki now.
19:51weavejesterRaynes: For parameters - you can destructure the request normally.
19:51RaynesI know.
19:51RaynesIt just always makes me squint.
20:00ravsterso instead of a (GET "/foo" [] handler) I'd do a (wrap-superusers-only (GET "/foo" [] handler)) ?
20:18yedi_is :remote-addr the ip address of a user
20:18yedi_(in a compojure request map)
20:19aperiodicyes
20:21ravsterIs there any way I can make the authorization function as part of the compojure handler so I can take advantage of its destructuring? Something like (Get "/foo/:id" [] (authorize id handler)) ?
20:24aperiodicyou need to put the id param in the arguments vector after the route string and uppercase 'Get', but yeah, that looks good
20:24aperiodickeep in mind id will be a string, if you're expecting an integer you'll need to coerce it
20:26aperiodicalthough wait, if authorize is your authorization fn why not just call it there; what's the handler arg doing?
20:27ravsterhandler is the function thats doing whatever the route is supposed to do. (authorize) would be a function that checks the :session to see if we are a user that is allowed to do the stuff.
20:28ravsterso in authorize I'd have something that looks at :session, sees the :id from the params of the request, and does a check to see whether we execute (handler) or not.
20:29yedi_how can i view the entire stacktrace while using nrepl in emacs? i'm running lein repl from the terminal and connecting to it via emacs, now when i run commands in the terminal only the error msg shows up
20:29ravsterI've only ever made handlers that take in the request function and thats it. I'd like to find out how to define a function that will take in the request map and another function.
20:29yedi_*nrepl error* doesn't seem to display the stack trace for these errors
20:30ravsters/request function/request object
20:32ravsteroh, yikes. I should be able to just do it with an anonymous function.
20:33aperiodicravster: (defn if-authorized [session do-authorized] (if (authorized-pred? session) (do-authorized) {:status 403 :body "VERBOTEN"}))
20:33aperiodicravster: then you pass a fn thunk as do-authorized like #(foo-handler id) or the like
20:36ravsterso it'll look like (GET "/foo/:id" [] (if-authorized (:session request) #(foo-handler id))) -ish ?
20:58AtKaaZ,#_({:a 2 :a 1})
20:58clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: :a>
20:58AtKaaZis that normal because it happens at compiletime? the {} part as opposed to (hash-map :a 2 :a 1)
20:58yedi_can someone help me out with this: https://gist.github.com/yedi/4992075
20:59yedi_what is clojure.lang.IDeref
21:01brehautyedi_: its the interface used to implement reference types, eg (deref (atom 1)) ;=> 1. @a is reader syntax for (deref a). something (whatever the unbound var is) in that is being derefed, and failing. perhaps you havent set up the session storage?
21:03yedi_brehaut: ahh you're right. i got passed that error when i lein ring server, i guess testing in the repl wasn't the best idea
21:21holohi
21:21holo,(reduce #(-> %2) '(1 2 3))
21:21clojurebot3
21:22holoif %2 stands for the second argument, where is the second argument? i can't sort this out
21:24jeremyheilerholo, because 3 is the second argument on the final reduction.
21:24jeremyheiler,(reduce #(-> %2) '(1 2))
21:24clojurebot2
21:24jeremyheiler,(reduce #(-> %2) '(1 2 3 4))
21:24clojurebot4
21:27yedi_my one petpeeve with clojure is that i have to wrap a do around a form if i want to print something, esp with paredit-mode making it kind of a nuisance to type parens (still gettin the hang of it)
21:28ldhis there a naming convention for where to put leiningen hooks that I'm missing? it seems that wherever i put the file containing the activate function, i get "cannot resolve my.hook/activate hook"
21:33jeremyheileryedi_, well, only when there isn't an implicit do ;-)
21:33dnolenheh, ClojureScript data structures could be constructed a lot, lot faster
21:34yedi_jeremyheiler: oh my... are there implicit dos in many places?
21:35jeremyheileryedi_, they're generally where you expect them, like when, loop, and of course fn.
21:35holojeremyheiler, wow thanks.. this solution is pure awesomeness
21:36ChongLiyedi_: paredit mode a nuissance?
21:36ChongLino way!
21:36ChongLijust use M-(
21:36yedi_ChongLi: can't tell if sarcasm
21:36ChongLinot sarcasm :)'
21:36ChongLiI love paredit
21:37bbloomdnolen: what did you find?
21:37bbloom(RE: faster construction of data structures)
21:37ChongLiyedi_: do you use all the paredit navigation keys?
21:37yedi_ChongLi: oh wow, i've been using C-space, C-M-f, parens
21:37yedi_ChongLi: almost definitely not
21:37ChongLiC-M-u is a great one
21:38yedi_jeremyheiler: thanks for pointing that out!
21:38yedi_ChongLi: what does that do
21:38ChongLigoes up a level
21:39ChongLiC-M-d goes down a level
21:39dnolenbbloom: ArrayMap can take an array if we have a literal, no work needs to be done
21:39ChongLiwith those two and C-M-f you can get around quite quickly
21:39dnolenbbloom: same for sets
21:39dnolenbbloom: if they use ArrayMaps underneath
21:40ChongLithe other ones you usually want are slurp, barf and splice
21:40bbloomdnolen: ah, of course :-)
21:40dnolenbbloom: currently fromArray(s) code is wasting time building when we don't need to
21:40dnolenbbloom: I was looking at the horrific numbers for constructing sets
21:40dnolenand realized we can make it 10X faster
21:41bbloomdnolen: cool. although as long as perf doesn't get *worse* i'm more interested in work moving towards self hosting. although i know you do looove to tweak performance, and having fun certainly counts for something :-)
21:42dnolenwell these are pretty simple optimizations with fairly big payoffs for users so ...
21:43bbloomso go for em!
21:45callenbotRaynes: I'm saying you should use SCSS
21:45callenbotRaynes: SASS specifically is for communists. SCSS is amazing.
21:46mefistoI'm trying to remember... isn't there a function that reverses the argument order of a function?
21:46bbloommefisto: (defn reverse-args [f] (fn [& args] (apply f (reverse args))))
21:46bbloomthere you go
21:47ravsterhow do I make ring-basic-authentication optional for a route?
21:48mefistohmmm
21:53amalloyi've never really gotten the hang of paredit's down and up commands. all the fancy forward, backward, and editing make me content enough that i haven't really tried
21:53amalloyi wonder if you can point out, ChongLi, a case where i'm doing something in a dumb way because the "obviously right" way is with up or down movement
21:55ChongLiamalloy: I use the up movement whenever I need to get out of the current level
21:55ChongLiperhaps to wrap it with another expression
21:58alandipertdnolen: thanks for your cljs optimization work!
22:00dnolenalandipert: no problem - I find it quite entertaining
22:02holomy solution to problem #21 in 4clojure: http://ctrlv.in/162822 i wonder why no one thought about that 4 character answer :D
22:03dnolenwriting #{1 2 3} in your CLJS is now 20X faster
22:05alandipertholo: crafty!
22:06bbloomdnolen: nice!
22:09dnolenmore and more I'm liking the idea of ^not-native
22:10alandipertfn meta i presume? what would it do?
22:11bbloomalandipert: https://github.com/clojure/clojurescript/commit/bf4c85c1f17c3f2a26ba57fef896350a7651d8cf
22:12bbloomdnolen: if not-native helps, i'm all for it. but wouldn't any non js/ prefixed type hint constitute a not-native type hint?
22:12bbloomdnolen: ie would it be better to use explicit type names in hints? assuming we had full hinting working
22:13FrozenlockAnother proof that dnolen do not sleep. Ever.
22:14dnolenalandipert: eliminates protocol dispatch
22:14dnolenbbloom: no, because you can pass in native types to core functions
22:15dnolenbbloom: non-native means you're writing some high perf stuff and you want to write in Clojure and you don't want to deal w/ the fact that natives are on a slow protocol path
22:16bbloomdnolen: oh, i see, hinting ISeq or PersistantArrayMap or whatever isn't good. you want to hint "any type other than native ones"
22:16dnolenI take no credit - Rich suggested it at TechMesh - I was getting annoyed that we could avoid protocol overhead
22:16dnolenbbloom: exactly!
22:16bbloomdnolen: still, PersistentArrayMap implies not-native, but ISeq & other protocols don't
22:17bbloomin the case where a concrete type is known, it seems preferable to hint with that, rather than not-native
22:17dnolenbbloom: yes, no promise that protocol or concrete type hinting will persist - we'll see. So far I'm seeing more mileage out of non-native in actual code.
22:18dnolen^ "couldn't avoid protocol overhead" I mean
22:24dnolenhoho
22:25dnolen(let [v [1 2 3]] (set v))
22:25dnolen260ms on CLJ JVM
22:25dnolen282ms on CLJS V8
22:25bbloomheh, nice
22:25bbloomhow many iterations?
22:25dnolen1e6
22:26bbloomdnolen: back to the predicate dispatch topic for a moment
22:26bbloomdnolen: b/c i've been reading etc
22:27dnolen(hash-set 1 2 3) in CLJS V8 is faster than hash-set in CLJ JVM
22:27bbloomdnolen: eh, i dunno how to formulate the question i'm trying to ask you, so that must mean i don't understand it enough yet to ask :-P
22:27bbloomdnolen: what's the timings on hash-set ?
22:27bbloomand is there an array-set too?
22:28dnolen~190ms on my machine V8, ~240ms for JVM
22:28clojurebotfax machine is http://tinyurl.com/ygc9w2
22:28bbloomwhere the fuck does clojurebot get this nonsense from?
22:28Raynescallenbot: The problem is that it just accumulated over time. I wouldn't know where to begin. 40% of that file probably doesn't even need to exist anymore. Are there any tools for finding out which things don't matter anymore in a css file?
22:28dnolenwhich means we have decent construction times for all Clojure data structures in ClojureScript - finally!
22:29bbloomRaynes: there are, but it's a really hard problem if you've got any javascript involved with creating elements
22:29bbloomRaynes: do you need static analysis (looking at HTML files only) or full dynamic analysis? (looking at which css classes are activated at runtime)
22:29bbloomdnolen: good stuff
22:29callenbotRaynes: there are ways to know, they're generally heuristic in nature if you're not using an aggressively declarative asset pipeline
22:29callenbotRaynes: and as bbloom said, if you're using JS, all bets are off.
22:29Raynesbbloom: What's the answer for both of those? :p
22:30callenbotRaynes: start here: http://meeech.amihod.com/very-useful-find-unused-css-rules-with-google
22:30bbloomRaynes: depends, do you create elements or add classes with javascript?
22:30callenbotbbloom: stop being pedantic and start feeding him tools to experiment with.
22:30Raynesbbloom: Maybe like two or three.
22:30RaynesNow don't be mean. I've got all night, guys. :P
22:30Raynesbbloom: The answer is "not really".
22:31bbloomcallenbot: i'm not being pedantic, i'm not gonna point him towards a tool if it's gonna be useless to him
22:31callenbotI should be happy by all rights. I'm listening to a history podcast, drinking milk, and eating reese's pieces.
22:31RaynesThe ones it does create are important and I know this, so static analysis should be very helpful.
22:31bbloomRaynes: ok, given the "not really" answer, than a static analysis tool works for you. callen's link to the google chrome audit tool is likely a good start
22:31RaynesOh, I didn't even see that in all the noise.
22:31Raynes:p
22:31callenbotRaynes: https://addons.mozilla.org/en-US/firefox/addon/css-usage/ https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/
22:31callenbotRaynes: http://meeech.amihod.com/very-useful-find-unused-css-rules-with-google
22:32RaynesOh my, I might have to break out the firefox.
22:32bbloomRaynes: and then that's the dynamic analysis tool that callenbot mentions right there too
22:32RaynesThanks guys. :D
22:32bbloombut i'd avoid that if you know for sure which selectors you use dynamically
22:32ChongLidnolen: wow congrats on the CLJS optimizations
22:33bbloomRaynes: you can create a dummy `display: hidden` div or whatever with all your dynamic classes on it. that would protect a static analysis tool from reporting them as unused
22:33RaynesNeat.
22:34bbloomRaynes: but first you need to cull your unused html, heh
22:35Raynesbbloom: I have unused HTML? 2_2
22:35bbloomRaynes: i don't know. i don't even know what project you're discussing
22:35bbloomjust saying
22:36RaynesRefheap, of course.
22:36RaynesI'm pretty sure I don't have any unused html.
22:36dnolenpretty low level stuff - but for the curious http://github.com/clojure/clojurescript/commit/bd8c9af0fd85d99695c45f40f7e20da740395c23
22:37bbloomthat's good :-) try doing a full site redesign with 100+ templates. you find unused code a couple lines at a time for months afterwards, heh
22:38dnolenone fun trick I've been using is that variadic functions generate code like this
22:38dnolen(cljs.core.foo cljs.core_array_seq([1,2,3]))
22:38dnolenso in the foo you can check to see if you got an IndexedSeq and just grab the array out of that.
22:39dnolenlist / set perf enhancements use this
22:39ChongLinice
22:39dnolensimilar tricks are employed in CLJ JVM
22:40alandipertcool, i will leverage in priority-map
22:42pbostromRaynes: init-defs old-defs new-defs defs...you are trying to kill me aren't you
22:42RaynesI warned you about suicide.
22:44bbloomdnolen: despite my nit-picking comments. all these changes LGTM!
22:47dnolenbbloom: hehe, nit-picking always appreciated
22:47bbloomdnolen: good, b/c it's my specialty
22:53bbloomdnolen: i assume you've written CSS files, but have you ever written an XSLT file?
22:53bbloom(just curious about your background knowledge, so that i can save some typing on an upcoming question)
22:56dnolenbbloom: yes I both liked it and hated it
22:56bbloomdnolen: liked idea, hated XML, i assume? heh
22:57dnolenbbloom: more or less, but it was a long time ago - so maybe I would like XSLT more now?
22:58dnolenbbloom: I'm about to run, if you've got a question shoot!
22:58bbloomdnolen: less of a question and more of a thought for you to ponder:
22:59bbloomdnolen: if you think about both XPath expressions and CSS Selectors as predicates, you can think about XSLT template matching and CSS styling as predicate dispatch. the itneresting bit is that CSS matches happen PER RULE, not per selector. so you actually need to do stuff on interior nodes of the decision tree
23:00bbloomdnolen: ie you might have two rules: .foo {color: red} and .foo.bar {background:blue} and then to efficiently style, you need to wallk the decision tree looking for .foo and apply color:red, then keep walking to test for .bar
23:00bbloomdnolen: which is generalized beyond predicate dispatch
23:01bbloomdnolen: just an interesting thought that occurred to me: there are other ways to compile the predicate matrix other than input->method. you could have input->matches where the matches can be a pre or post fix walk
23:01bbloomdnolen: that's all
23:03bbloomheh, and CSS's "important!" is basically prefer-method :-P
23:03dnolenyes it's interesting - again this reminds me of tree automata and tree pattern matching, which someone brought up when we first release core.match
23:04dnolencan't say I know much about either - nor how hard it would be to make core.match do something along those lines
23:04dnolenI'm skeptical that core.match's machinery can be hijacked for this purpose
23:04bbloomdnolen: ok, i'll google up those keywords
23:04dnolenbut I could be wrong
23:04bbloomdnolen: yeah, i'm not sure. i think i might take a crack at a library that ONLY handles the construction of predicate expressions
23:04dnolenwe should talk to Chris Frisz & Will Byrd and the other IU folk
23:04dnolenat Clojure/West
23:04bbloomabsolutely!
23:04dnolenthey use an interesting cata-matcher in the compiler
23:05dnolenso in the pattern you can have a recursive match
23:05dnolenthat gets traversed first
23:05dnolenbut perhaps this is ideal for compilers
23:05dnolenbut then that makes it more relevant to you.
23:05bbloomdnolen: hmm... didn't even think about recursion, heh
23:05bbloomin the patterns, i mean
23:06dnolencata for catamorphism
23:06dnolenhttp://en.wikipedia.org/wiki/Catamorphism
23:06bbloomok, well i'll dig in to this some more. this is all relatively need ground for me. i hope to add some cool stuff to fipp with all this
23:06bbloomwhich, in turn, will help my other project ;-)
23:07dnolenbbiab
23:07bbloomcya
23:09yedi_is there an equivalent to python's `in` in clojure?
23:09yedi_i know contains? isn't it cuz that deals with keys/indices
23:12yedi_nvm, found the `some` trick
23:19brehautyedi_: or consider a set rather than a seq/list/vector
23:32ldhleiningen profile question: if I declare :profiles {:dev {:dependencies [[some.dependency "0.0.1"]]}}, is it expected that heroku still fetches some.dependency from clojars when I deploy? I'm running using "lein trampoline with-profile production run", shouldn't that override dev dependencies?
23:38Raynesdev dependencies shouldn't happen at all because heroku sets LEIN_NO_DEV.
23:38RaynesNot sure if they still get fetched or not.
23:38RaynesI wouldn't expect it.
23:39ldhthat's what i would think, too.
23:40technomancyLEIN_NO_DEV was a hack for 1.x
23:40technomancybut... I think there's a bug where trampoline triggers the dependencies before stripping dev stuff out
23:40technomancyldh: try swapping the order for now as a workaround
23:40technomancy`lein with-profile production trampoline run`
23:42ldhok. i just did "heroku run bash" and then compared "lein classpath" with "lein with-profile production classpath" and that seemed correct. i'll try swapping the order as well
23:45ldhi didn't see the log message that it was fetched this time, but maybe it only does that the first time a new dependency is introduced? *shrug*
23:51IcarotFor a web programmer, does anyone know if using Clojure is actually somewhat mature?
23:51IcarotCompared to, maybe, say Backbone.js or <insert hip framework here>
23:57xeqi.. I consider those used for different purposes, or were you asking about clojurescript?
23:59pbostromRaynes: I made a little bit of progress (I think); this line seems to def a new tester sym every time some code is evaluated, which fills up the def quota: https://github.com/flatland/clojail/blob/master/src/clojail/core.clj#L165