#clojure logs

2013-06-20

00:15tomjackderek_c: I'm guessing you mean the asterisks in particular?
00:16tomjackit doesn't really mean anything in clojure, it's just a convention
00:16tomjackconventionally, it means that the variable is dynamic
00:17tomjackwhich in turn basically means it can be used with the binding macro
00:18TimMcThey're called earmuffs, and the compiler will chide you a little if you use them on anything but a dynamic var.
00:18TimMcOr rather, on a non-dynamic var. I don't think it cares in the slightest if you use them on locals.
00:18TimMcAnd yes, it's syntactically irrelevant.
00:23derek_cI see. Thanks!
00:24derek_chas anyone here used Ojo for monitoring file system events?
00:36tomjackreadme says "use defwatch". interesting.
00:57technomancythe starter kit is totally overrated
00:58technomancytoo much magic
00:58brehautwait, isnt it your starter kit?
00:59technomancyyeah, I wouldn't diss it so blatantly if it weren't
01:00brehautfair
01:00technomancyhttps://github.com/technomancy/better-defaults <- much better starting place
01:01brehauti fear i am going to be finagling my emacs config again
01:03tomjackthe x clipboard thing is very interesting..
01:05tomjackI've been fighting with everything that isn't conkeror or urxvt for a long time over the clipboard
01:06brehauttechnomancy: so instead of starter kit, you just dump this into init.el and then use packages for everything else?
01:08gt`hi need some help on appengine-magic
01:09brehaut~anyone
01:09clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
01:10ddellacostais there a way to move to different lein projects in a single repl session?
01:10ddellacosta…without killing it and cd'ing to that directory, then running lein repl again?
01:11gt`doing a project here is the project.clj
01:11gt`(defproject my-exams "0.1.0-SNAPSHOT"
01:11gt` :description "FIXME: write description"
01:11gt` :url "http://example.com/FIXME&quot;
01:11gt` :license {:name "Eclipse Public License"
01:11gt` :url "http://www.eclipse.org/legal/epl-v10.html&quot;}
01:11gt` :repositories {"releases" "http://appengine-magic-mvn.googlecode.com/svn/releases/&quot;
01:11gt` "snapshots" "http://appengine-magic-mvn.googlecode.com/svn/snapshots/&quot;}
01:11gt` :dependencies [[org.clojure/clojure "1.5.1"]
01:11gt` [appengine-magic "0.4.6-SNAPSHOT"]]
01:11tomjackddellacosta: I don't think so, but why?
01:11gt` :plugins [[appengine-magic "0.4.6-SNAPSHOT"]])
01:11gt`
01:11gt`lein debs and all the library are downloaded
01:11gt`when i lein appengine-new i am getting some error
01:11ddellacostagt`: in general, good practice to put it in a gist/refheap
01:12tomjackare you working on a fixed small set of libraries?
01:12ddellacostatomjack: for example, I'm doing testing now, and I'm using multiple libraries
01:12tomjackor just want to be able to switch easy
01:12ddellacostatomjack: jinx
01:12ddellacostaheh
01:12gt`making a skeleton for a Google App Engine application
01:12gt`java.lang.NullPointerException
01:12gt` at java.io.File.<init>(File.java:251)
01:12gt` at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
01:12tomjackdo you know about checkouts?
01:12gt` at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
01:12gt` at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
01:12gt` at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
01:12gt` at clojure.lang.Reflector.invokeConstructor(Reflector.java:180)
01:12gt` at leiningen.appengine_new$appengine_new.invoke(appengine_new.clj:47)
01:12ddellacostatomjack: hmm, maybe that would work…I want to test different namespaces in the repl, so I guess that would suffice
01:13ddellacostagt`: please use https://www.refheap.com
01:13gt`ok
01:13ddellacostado not cut and paste tons of code and output into IRC please.
01:13gt`oh ok sorry
01:14ddellacostayou'll get a better response that way too. ;-)
01:14tomjackI use checkouts all the time for e.g. testing changes in one core library while I'm using them in another library
01:14gt`:) thanks
01:14ddellacostatomjack: okay, that's a good idea, I just didn't think of it. Let me give it a shot--thanks!
01:17gt`so my problem is when i am lein appengine-new why do i have errors ?
01:19ddellacostagt`: at the risk of being "that guy," do you really need to use app-engine? It's definitely a less well-supported environment within the Clojure community, in my experience, and the appengine-magic lib doesn't seem to get a lot of updates recently (and is still labelled experimental it would seem).
01:21ddellacostathat aside, it looks like you've got an older version--try updating to 0.5.0?
01:22gt`ddellocosta: I wanted to experiment with something writing an app on GAE
01:23ddellacostagt`: yeah, the first thing I would try is seeing if 0.5.0 helps, as you are two versions back, it would seem
01:23gt`ddelocosta: any other way of doing it which is well supported is welcome
01:24gt`ddelocosta: let me try with 0.5.0 thanks
01:25ddellacostagt`: if you *do* have the flexibility, and just want to deploy *somewhere*, definitely take a look at Heroku--they make it easy: https://devcenter.heroku.com/articles/clojure
01:25ddellacostagt`: in any case, good luck!
01:38ddellacostatomjack: yeah, that didn't work unfortunately, can't get to my test namespaces in checkout projects
01:38ddellacostaah well
01:40tomjackstrange
01:40tomjackI see test dirs on my classpath for my checkotus
01:41tomjackjust to confirm, you added a dependency in project.clj with a matching version (potentially requiring `lein install` in the checked-out project), and put a symlink in ./checkouts ?
01:42tomjack(that the version matches shouldn't really matter unless you changed deps since last version)
01:44ddellacostatomjack: if I use lein install, then I shouldn't need to have it in checkouts, no?
01:44ddellacostaalso, I should be clear how I'm using it: I'm trying to load my tests into the repl, and run my tests that way
01:44ddellacostamy end goal is to run multiple projects tests in one repl session
01:45tomjackhmm
01:45tomjackand are you going to be editing the code for any of these projects?
01:46ddellacostatomjack: yeah, the item I'm working now has functionality which needs to be implemented across a few libraries--so I'm testing in one, then moving to the next library, testing there, etc.
01:46tomjackwell you'd need checkouts to be able to switch to editing another library without starting a new repl
01:47ddellacostatomjack: yeah, and I think that part of it works--changes get picked up without needing to run lein install
01:47ddellacostabut it I can't figure out how to expose my test namespaces in the checked-out project to my main repl session
01:47ddellacostaI mean, not such a big deal, just wanted some extra convenience. ;-)
01:48tomjackif you were able to edit the checked-out project, must be set up right. strange, it should just work
01:49ddellacostameh, I'll keep playing with it. If you've gotten it to work in the past it must just be something weird with my setup then.
01:49ddellacostain any case, thanks for helping me to get it working.
01:50tomjackconfirmed I can require clojure.core.async-test with core.async in checkouts, but it has an explicit :test-paths in project.clj
01:50tomjackthat wouldn't seem to matter
02:39asuraI'm learning Clojure and I'm having an issue mapping an anonymouse function... I have a simple function defined... (defn is-factor? [[product factor]] (= (mod product factor) 0))
02:39asurathis function works when applied to a literal list, as in: (map #(is-factor? [10 %]) '(1 2 3 4 5 6))
02:39asurabut not for: (map #(is-factor? 10 %) (take 5 (iterate inc 0)))
02:41racycleasura: are you missing the [10 %] ?
02:42asuraoops, I'm not, but I removed the brackets testing a moment ago.
02:46racyclethe second produces a 0 while the first doesn't
02:46racycleuse inc 1 insread
02:46racycleinstead
02:48racycleiterate: Returns a lazy sequence of x, (f x), (f (f x))
02:48asuraAha! I guess it's some kind of silent div/0 error from the mod?
02:48racycleyepp
02:49asuraCool, thanks for your help!
02:49racyclenp
02:52derek_cI might be missing something obvious here, but I have this java method that has this signature:
02:53derek_cregister(WatchService watcher, WatchEvent.Kind<?>... events)
02:53derek_cso it takes in a variable amount of parameters
02:53derek_cnow I have this Clojure array of parameters. how do I call this function with these parameters?
02:55ddellacostaderek_c: (.register instance param1 param2 param3 …)
02:55ddellacostaderek_c: check this out too, it has examples for most of this kind of thing: http://clojure.org/java_interop
03:17derek_cddellacosta: but I have an array, like [param1 param2 param3]
03:17derek_chow do I put them into the parameter list?
03:18ddellacostaderek_c: so, you want to use the contents of that array each as individual parameters/
03:18ddellacosta?
03:18ddellacostathen it has nothing to do with Java, just to be clear--you want apply
03:18ddellacosta&(doc apply)
03:18lazybot⇒ "([f args] [f x args] [f x y args] [f x y z args] [f a b c d & args]); Applies fn f to the argument list formed by prepending intervening arguments to args."
03:19derek_cddellacosta: ah right! forgot about apply
03:19derek_cthanks!
03:19ddellacostanot sure but you may need to do something like pass the java method to partial first, so you can pass it to apply
03:19ddellacostabut in any case, you're welcome! ;-)
03:21murtaza52how do I convert text into clojure data (read "[:a :b]") => [:a :b]
03:24ddellacostamurtaza52: you can use read-string for a small string
03:24ddellacosta&(read-string "[:a :b]")
03:24lazybot⇒ [:a :b]
03:25ddellacostathis is a good article on the subject, btw: http://copperthoughts.com/p/clojure-io-p1/
03:26murtaza52thanks
03:27murtaza52If I do - (def a (future (iterate inc 1))
03:27murtaza52and then (future-cancel a) => false
03:28murtaza52shouldnt it give me true, bcoz its an infinite seq ?
03:56noncomhow do i say that function takes an arbitrary map, without passing a map explicitly? example: (my-fun :a 1 :b 2), i tried like (defn my-fun [& {m}]) but does not work
03:57s-h(defn my-fun [& {:keys [a b]}] (...))
03:57noncoms-h: yeah, but the point is that idk what keys will be there
03:58s-hnoncom: well then you _have_ to wrap it in a map
03:59noncoms-h: how do you think, will (den my-fun [{:as m}] ...) work?
03:59noncomoh forgot &
04:00s-hwithout specifying any keys at all?
04:00s-h..never tried that before :P
04:00noncoms-h: yeah, i just want to avoid using unnecessary {} when passing params
04:00noncomhey, the thing with :as worx :D
04:00s-hcool :-)
04:23echo-areaDoes anyone know what could be the possible reason that an HTTP service provided by ring-jetty-adapter can't be accessed from a foreign host? It already listens on 0.0.0.0.
04:23brainproxyecho-area: how are you trying to access it?
04:24brainproxypossibly a CORS issue if you're doing browser XHR
04:24echo-areaIn many ways. One of them is "wget -O - http://IP:PORT/&quot;
04:24brainproxyhave you checked the firewall settings of the machine running the http server?
04:24brainproxymaybe the port is blocked
04:44echo-areabrainproxy: Checked with iptables -L, didn't see any.
04:45arcatancan you e.g. ping the machine?
04:46echo-areaYes
04:46echo-areaAnd 80 and 8080 are accessible
04:47echo-areaI'm using port 3000, which is inaccessible
04:48mpenetthat screams for a fwd issue
04:48mpenetfirewall
04:48mpenetmaybe not locally, but upstream
04:48mpenetdunno how's your network
05:08hyPiRionamalloy_: It is also the fourth diagonal of pascal's triangle
05:14lozdo string are collections of characters in clojure?
05:16RCarterHi everybody
05:20Blktgood day everyone
05:22noncomloz: they're java strings. check this out http://clojure.org/data_structures
05:24vijaykiran,(first "one")
05:24clojurebot\o
05:24vijaykiranloz: alomost :) ^
05:30RCarterHello, I'm learning Clojure and I would like to try integrate clojure with ZK Framework (www.zkoss.org), can I ask you some question about this?
05:31vijaykiranRCarter: "Don't ask to ask; just ask" :)
05:33hyPiRion~anyone
05:33clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
05:33hyPiRion^
05:33lozyou know, clojurescript works :D
05:47RCarterZK is a web framework in Java, you have to configure the usual web.xml file, write some xml file that will be render as html by the framework, and you have to provide some Java class that will be used as ViewModel. I would like to write ViewModel classes in Clojure (maybe writing some macros to eliminate the boilerplate). The question is I don't know how to setup a web application "the ugly way", using a provided web.xml, where to put xm
05:47RCartertemplating files etc. Is there some article I can read about this?
05:48vijaykiranRCarter: Do you have a javadoc of the ViewModel class ?
05:48vijaykiranRCarter: first step is to start with Clojure's java interop documentation
05:48plediasHi! Should I use Carmine 2.0.0-alpha1, if I just want to do basic Redis stuff reliably? (Not the fancy Tundra stuff.)
05:48antares_pledias: you should probably use an earlier Carmine version
05:49RCarterI also don't know if it's better to try to integrate ZK in a ring webbapp or to setup the web app in the usual way (java) and to use Clojure generated classes for ViewModels
05:49antares_I'm sure Carmine 2.0.0-alpha1 works well but things may change a lot to alpha2
05:49plediasantares_: Ok, thanks. I'll use 1.12.0 then.
05:49mpenetunless you are using the exotic stuff it should be backward compatible
05:49mpenetand stable
05:49mpenetbut better be safe antares_ is right
05:50RCarter@vijaykiran Thanks, a ViewModel is a simple POJO with some annotations
05:50plediasmpenet: Thanks, good point.
05:50RCarterhttp://books.zkoss.org/wiki/ZK_Developer's_Reference/MVVM/ViewModel
05:53vijaykiranRCarter: I'd suggest starting with just using clojure to write ViewModels
05:53vijaykiranRCarter: I think you can specify annotations using metadata - never used it, so not sure
05:58RCartervijaykiran: thanks again, will look at that
06:19noncomhow often do you find yourself writing thin wrappers in Clojure and ClojureScript? is it ok to write thin wrappers? I usually collect all wrapping functions in one spot, and in other places i can avoid using the dot-notation, making the code lookmore lispish. Does this give a serious overhead and is this considered a good practice?
06:20noncomlike, i do a wrapper (defn do-that [x] (.doThat x))
06:20noncomthis kind of thing
06:20mpenetvery often
06:21mpenetit's a good way to avoid type hinting all over the place too
06:21noncomah yes, type hints go there too
06:21mpenetin cljs it will be "simplified" at compile time anyway, so it has no cost
06:22mpenetwell I think so at least, I haven't used cljs in a little while
06:22noncomactually,now i think that these wrappers better be macros, in Clojure at least
06:23mpenetdefeats the goal to make them composable
06:23mpenetso imho no
06:23noncomyou're right - inlining is the best choice here
06:24noncomhmmm..
06:24noncomyes, youre right..
06:46RCartervijaykiran: It's working! https://github.com/mbarbieri/cloj-zk
06:47vijaykiranRCarter: awesome :) with Annotations ?
06:48RCarternot yet
06:48RCarterwill try soon
06:48RCartervijaykiran: Clojure = Teleportation so true!
06:52vijaykiranRCarter: :) - why ZK ? Enterprise requirements ?
06:53RCartervijaykiran: yep, but I really like it, for enterprisey apps is very cool
06:54RCartervijaykiran: and I suck at HTML/CSS
06:54lozyou can generate at least html from clojure
06:54loznot sure about css
06:55vijaykiranloz: https://github.com/noprompt/garden
06:56vijaykiranBut I don't use them - I prefer HTML/CSS to be - in HTML/CSS, easy to work with "design"
06:56RCarterloz: I can write html and css, but only ugly pages :(
06:56lozwell you need a designer :D
06:56vijaykiranor Bootstrap/Foundation :)
06:57RCarterloz: agree :)
06:57lozvijaykiran: foundation? is it set of templates like bootstrap?
06:57RCartervijaykiran: I know, but zk has lots of enterprise components, and fully ajax
06:57vijaykiranloz: http://foundation.zurb.com/
06:57RCartervijaykiran: and open source
06:58vijaykiranRCarter: true. the tables and charts and others - I'm kinda favoring Primefaces at the moment
06:58vijaykiranRCarter: Used ExtJs in the past
06:59RCartervijaykiran: I like primefaces too
07:00RCartervijaykiran: wait, are you using primefaces + clojure?
07:00vijaykiranRCarter: ah - no - not yet. It is just a JEE App
07:00clojurebotIk begrijp
07:00RCartervijaykiran: ah, so you have a job :D
07:03vijaykiranRCarter: yup
07:38MorgawrI have a question, if I want to access a keyword from javascript (clojurescript here), do I need to use "\ufdd0mykeyword" or "\ufdd0:mykeword"?
07:49dnolen_Morgawr: depending on the representation of keywords is not a good idea - likely to change
07:50dnolen_Morgawr: I recommend making a helper and exporting it so you can write keyword("foo") from JS to avoid future breakage
08:06cemerickdnolen_: is dynamic extension of types to protocols off the table for cljs?
08:07dnolen_cemerick: what do you mean?
08:08cemerickdnolen_: extend to Object, then conditionally extend to the concrete type based on marker predicates, e.g. seq?
08:08dnolen_cemerick: you absolute cannot extend to Object
08:08dnolen_massive breakage will ensue
08:09dnolen_do you mean the primitive object special case?
08:09cemerickyes; just trying to translate my Clojureisms here.
08:10cemerickSpecifically, (extend-protocol P (type x) ....) doesn't work. I suspect it never will?
08:11dnolen_cemerick: no I don't see a reason for that not to work, dynamic extension should work just like it does in Clojure
08:11dnolen_cemerick: if it doesn't work it just hasn't been worked on
08:11cemerickheh, ok
08:11cemerickthe above is an analysis error at the moment
08:12dnolen_cemerick: yeah that's likely, will need to dive into some gnarly stuff to fix that
08:13dnolen_cemerick: been hoping Bendlas would submit his refactor but I haven't seen anything yet
08:13cemerickdnolen_: oh, is that a gsoc that may produce an impl/solution here?
08:14dnolen_cemerick: unrelated to gsoc, Bendlas was working on a specify patch - instance level extend-type
08:14dnolen_which would massively rock
08:19Kototamadnolen_: hello, do you know of any changes in ClojureScript that could have introduce this bug https://github.com/emezeske/lein-cljsbuild/issues/203 ?
08:20cemerickdnolen_: dunno, I wouldn't expect the dynamic twiddling of prototypes to survive advanced compilation...
08:20dnolen_Kototama: hmm nothing comes to mind but it's certainly possible
08:21dnolen_cemerick: I don't see why not, it's not being done with strings
08:23dnolen_Kototama: if it is a ClojureScript bug a patch is most welcome. Probably easiest thing to do is git bisect on ClojureScript to figure out which commit borked it
08:24Kototamadnolen_: i see. I will try to find some time to do that
08:25dnolen_Kototama: it's hard to tell where the problem might be though from the ticket. Best would be a minimal project demonstrating the issue
08:26dnolen_Kototama: you can follow the instructions here to build the minimal against a local checkout of ClojureScript - https://github.com/clojure/clojurescript/wiki/Patches
08:26dnolen_"the minimal project"
08:27dnolen_Kototama: so then you can easily git bisect between the version of CLJS pinned to 0.3.0 and the version of CLJS pinned to 0.3.2 to figure out what happened
08:28Kototamadnolen_: ok. thank you for the help
08:29dnolen_Kototama: I'm somewhat surprised I haven't heard about this sooner as CLJS users seem to follow cljsbuild quite closely
08:30dnolen_Kototama: probably worth at least mentioning the issue on the ClojureScript Google Group to make sure
08:34tjb1982cemerick: I made another example for the friend-demo site. I wasn't sure if I did the fork/pull request thing right (I've never contributed to another project on github before)
08:35cemericktjb1982: yes, I saw :-) I just haven't gotten to looking at it yet
08:36tjb1982no rush. I just wanted to make sure I did the pull request the right way
08:41Kototamadnolen_: I got this error when compiling http://pastebin.com/gXkmRDEC
08:46dnolen_Kototama: yes that looks like weird interaction between cljsbuild and the compiler
08:47dnolen_Kototama: that stack trace is somewhat informative - probably best to produce a minimal reproducible project and attach it to the cljsbuild issue
08:48Kototamai see
08:48dnolen_Kototama: given that it starts in lein cljsbuild I'm sure Evan can see the issue quickly and determine if it's something I need to look at
08:49dnolen_Kototama: I chimed in on the cljsbuild ticket
08:50Kototamathat's nice from you, i'm going to build a small project and try reproduce the problem
08:57cemerickdnolen_: hah, it's actually not that hard to "fix", if you don't count emitting perhaps-nonsense :tag metadata :-P
09:00jweissi have a bugfix for clojure.data.xml, can someone point me to how to run the tests? there's no leiningen project file, so i do not know how the unit tests are normally run
09:02s-hjweiss: they are using Maven. Run "mvn test" to execute all tests
09:03jweisss-h, huh, i looked in the pom file and didn't see anything clojure specific there, but i'll give it a shot
09:04s-hjweiss: yeah, i think they put all that clojure stuff in their parent POM
09:07stuartsierrajweiss: Yes, `mvn test` to run the tests. `mvn install` to install a -SNAPSHOT version in your local Maven repo which you can depend on in a Leiningen project.
09:11futileDo you ever just find yourself wandering in here because you're stuck on a totally confusing bug and have no guesses as to what could be wrong?
09:12piskettiWas that a rhetorical question?-)
09:13Morgawrwhat's the point of compiling clojure (also clojurescript) code when running "lein install" when the .jar just comes with source code (.clj and .cljs)? I feel like I'm wasting a lot of time when I have to compile and repackage everything when all I need is just put my new .clj(s) files into the .jar and then compile them in my actual project that uses the library
09:13Morgawris there a way to skip compilation when running "lein install"?
09:16tomjackdoes cljsbuild run on `lein install`?
09:16Morgawrtomjack: yes
09:17tomjackdunno why that is - to make sure you don't `lein install` a project that can't compile?
09:17Morgawrwhen I do "lein install" it says "Compiling clojurescript..." and then goes on to check if there are errors etc etc and then builds and install the .jar (which doens't use the compiled output either way)
09:17tomjackyeah, does seem a bit funny :)
09:17MorgawrI can understand if I want to make sure my project actually works, but most of the time I find myself adding simple tests (like a single console.log() to test stuff) and I have to wait while it compiles
09:18ddellacostahow can I hide CLJS code from clojure.tools.namespace.repl?
09:19ddellacostaer, by that I mean stuff that is calling cljs.compiler I guess
09:19ddellacostait's obviously not loading my ClojureScript
09:19stuartsierraddellacosta: As far as I know, you don't need to hide CLJS files from tools.namespace. It will only search for .clj files.
09:19ddellacostayeah, sorry, I guess what is going on is that it is picking up my macros
09:20futilepisketti: no
09:20ddellacostaand specifically it is complaining about the cljs.compiler/cljs.core I have required
09:20futileIs there any testing lib for ClojureScript?
09:20ddellacostafutile: I've been using clojurescript.test
09:21futileddellacosta: thanks :)
09:21ddellacostafutile: np. There is also something else by the Prismatic folks
09:22tomjackMorgawr: I'd maybe try adding the cljs project as a checkouts dep so that you don't have to `lein install` when you change it
09:22tomjackdunno how/if that will work out with cljsbuild though
09:23ddellacostastuartsierra: I think the real issue may be that there are libs (cljs.compiler for example) that are present during CLJS build time, but they make tools.namespace unhappy. I suspect it's not picking up my src paths in my project file? Not sure how I should be doing that to load things properly.
09:24ddellacostafutile: this is what I was thinking of, by the Prismatic folks: https://github.com/Prismatic/cljs-test
09:24ddellacostafutile: clojurescript.test is here: https://github.com/cemerick/clojurescript.test
09:24futileddellacosta: ahh, cool. thanks again
09:24stuartsierraddellacosta: You can control what directories clojure.tools.namespace.repl/refresh is using with `clojure.tools.namespace.repl/set-refresh-dirs`
09:25ddellacostastuartsierra: got it, that's probably what I was missing. Will give it a shot, thanks. And thanks for that great write-up a few weeks back, that's why I'm working with it now. :-)
09:25stuartsierraBy default it just scans the java.class.path System property.
09:26stuartsierraddellacosta: You're welcome! Hope it's useful to you.
09:26ddellacostastuartsierra: even without getting it fully working properly, it's helped me test Ring handlers…so yes, it's super useful.
09:26stuartsierraGreat.
09:31lozis it real to write real-world web sites on clojure?
09:31ddellacostaloz: If you are asking if it is viable, I have done it a number of times. So, yes.
09:32lozcan i see a link pls?
09:32dnolen_core.match primitive array specialization via type hints http://gist.github.com/swannodette/5822664
09:33ddellacostaloz: I'll do you one better, check out this (still ongoing) thread: https://groups.google.com/forum/?fromgroups#!topic/clojure/a4Dp8gdHev8
09:35lozokey, thanks
09:35ddellacostaI'm not sure if my boss(es) are cool with me talking about our tech, so I'm over-cautious and won't say…but I'm proud and exceed to be using Clojure in production, writing it full-time.
09:35ddellacostaexceed -> excited. Broken spellcheck
09:37lozgj :)
09:38cemerickdnolen_: you're like 1 step away from erlang-style binary destructuring
09:38lozyou mean pattern matching?
09:38dnolen_cemerick: there's already experimental support for that, been there for 2 years
09:38dnolen_cemerick: it's crazy fast
09:39dnolen_cemerick: the vector matching stuff was designed early on to specialize on anything that can be matched sequentially from vectors to binary data
09:43cemerickdnolen_: right, I guess I was talking more about notation than anything else.
09:44dnolen_cemerick: oh, yeah
09:46dnolen_fun project for someone - `defm` which supports everything `defn` does via destructuring but instead uses pattern matching
09:46cemerickdnolen_: so, if the incoming value is hinted as ^bytes, pattern rows could treat e.g. namespaced keywords differently. [[:name:4 :len:4 :type:8]], etc
09:48dnolen_cemerick: something like that yes though would be nice for that generalize to everything else
09:48tomjackhow would you use that then?
09:49dnolen_[[(name 4) (len 4) (type 8)]] so it could work on vectors as well - not sure it would make much sense for arrays
09:50tomjackcan a row introduce bindings?
09:50dnolen_tomjack: for a long time now
09:50dnolen_2 years
09:50dnolen_you can both have named wildcards
09:50cemericktomjack: that's just a dumb transliteration of erlang binary destructuring
09:50tomjackI see, nice
09:50dnolen_or wrap a pattern in :as to give it a name
09:50cemerickmatching, whatever
09:51cemerickdnolen_: byte arrays or ByteBuffers ~ network messages
09:52dnolen_once we get function application core.match + instaparse should be pretty sweet for rapidly building languages
10:04gdevfinally got a chance to watch "The Language of the System" talk....mind blown
10:07lozddellacosta: do you use foundation?
10:08ddellacostaloz: you mean this? http://foundation.zurb.com/
10:08lozyep
10:08ddellacostanope. been wanting to try it out, just haven't had the occasion yet.
10:09mannymannyhi all, I'm looking for a way to define a sort of build depedencies hierarchy using lein (e.g. when I run "lein test" the "lein something" get ran before)
10:17hyPiRionmannymanny: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L91-L94 ?
10:18hyPiRionThat would not create a build dependency hierarchy, but at least you can define what task to run before other tasks
10:19hyPiRionIf I wanted some make-like functionality, I think I would use https://github.com/hyPiRion/lein-shell and make in prep-tasks
10:20gdevhyPiRion, doesn't leiningen have something for showing a deps?
10:20gdevs/a/project
10:21hyPiRiongdev: yeah, `lein deps :tree`
10:21gdevmannymanny, use lein deps :tree
10:22hyPiRiongdev: well, that can't do what he asks for though. He wants a way to e.g. do `lein something` before running `lein test`
10:22gdevmannymanny, scratch that, that won't work apparently
10:23gdevpuredanger, ohhai Alex
10:23puredangergdev: hi!
10:24hyPiRionmannymanny: actually, the simplest would probably to define aliases. So, for example in your case, you could add in `:aliases {"test" ["do" "something," "test"]}`. Then running `lein test` would be the same as running `lein do something, test`
10:24hyPiRion(And no, it won't lead to an infinite recursion, aliases are only applied once)
10:25mannymannyhyPiRion: thank you all guys, I'm going to try the aliases one
10:27hyPiRionnp
10:31edbondhow to display full collection? repl cuts it at say "(1 2 3 4 ...)"
10:31gdevchange your print-length
10:31gdev(set! *print-length* nil)
10:32edbondgdev, thx
10:33gdevyes! achievement unlocked, I successfully answered a question about clojure on irc
10:38mikerod,(inc gdev)
10:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: gdev in this context, compiling:(NO_SOURCE_PATH:0:0)>
10:38mikerodIt wasn't meant to be
10:39justin_smith(inc gdev)
10:39lazybot⇒ 1
10:39justin_smithhe earned it
10:39mikerod:)
10:39gdevnice =D
10:40justin_smith(inc inc)
10:40lazybot⇒ 1
10:40mikerodHmm
10:40justin_smith#clojure, where you can upvote the upvote system
10:40mikerodThat seems fitting for clojure
10:41justin_smithit's recursion all the way down
10:41justin_smithsomeone should make a self-hosting LOGO, just so they can say "it's turtles all the way down"
10:44clgv(inc 42)
10:44lazybot⇒ 1
10:44clgv;)
10:44justin_smith(inc 42)
10:44lazybot⇒ 2
10:44justin_smitheventually the output will be correct
10:45tomjackthen some asshole will do it one more time
10:45tomjackoh, can you dec?
10:45justin_smithlol
10:45clgvyes
10:45justin_smith(dec 42)
10:45lazybotYou want me to leave karma the same? Fine, I will.
10:45clgvoh maybe not anymore
10:45clgv(dec lazybot)
10:45lazybot⇒ 18
10:46clgv(dec lazybot)
10:46lazybot⇒ 17
10:46clgv^^
10:46clgv(dec 10)
10:46lazybot⇒ -1
10:46clgv(dec 42)
10:46lazybotYou want me to leave karma the same? Fine, I will.
10:46mikerod##(print "I thought this was how to lazybot")
10:46lazybot⇒ I thought this was how to lazybotnil
10:48clgv,(print "Hello lazybot! ##(print \"Good day, clojurebot!\")")
10:48clojurebotHello lazybot! ##(print "Good day, clojurebot!")
10:48clgvdamn, that got disabled... ;)
10:48mikerodHah, that would be pretty interesting
10:48clgvworked a while back ^^
10:49clgv,(print "&(print \"Good day, clojurebot!\")")
10:49clojurebot&(print "Good day, clojurebot!")
10:50tomjack"delimited continuations via codensity" https://gist.github.com/ekmett/1015030 hmm
10:51clgv,(print "$google clojure")
10:51clojurebot$google clojure
10:54hyPiRionclojurebot: lazybot ignores clojurebot
10:54clojurebotclojurebot is pretty cool
10:54hyPiRionclgv i meant
10:55clgvhehe
10:55clgvit was not always like that^^
10:56clgvor was it the other way round? ....
10:56hyPiRionit was not always like that
10:56clgv&(println ",(print \"Hello, lazybot\")")
10:56lazybot⇒ ,(print "Hello, lazybot") nil
10:56hyPiRionI am the reason why lazybot now ignores clojurebot :(
10:56clgvwhat did you do with it?
10:57hyPiRionclgv: http://clojure-log.n01se.net/date/2012-12-17.html#22:30
10:57hyPiRionI managed to create a multi-bot quine which would pong stuff between the bots every 16 hours
10:57clgvmuhahaha
11:01hyPiRionIt would actually be easier to just pong it immediately, but you know
11:01hyPiRionI would've been hellbanned from this channel if I did :s
11:01justin_smithwhen I worked on a mud, banning was for simple forgivable stuff
11:02justin_smithif someone really fucked up, they got a special flag on all their characters
11:02justin_smiththat accelerated hunger, thirst, and derangement of mental state
11:02justin_smithit would accumulate over months
11:02justin_smithuntil every action they took would randomly fail, or target a random entity (possibly themselves) regardless of intended target
11:03clgv"mud"?
11:03justin_smiththis was all secret, mentioning the existence of this flag to mortals was banned
11:03justin_smithmulti-user-dungeon
11:03vijaykiranmulti user dungeons
11:03vijaykiranah :)
11:03justin_smithimaging WoW with the user interface of zork
11:03justin_smith*imagine
11:04justin_smiththe first large scale multi player online games
11:04justin_smithone advantage over graphic games: very easy for users to script in any language that takes a text stream as input, and emits one as output
11:04justin_smithwhich is just about any usable programming language
11:06djanatynI found my old clojure game of life implementation :)))
11:06djanatynhttps://github.com/djanatyn/game-of-life/blob/master/src/game_of_life/core.clj
11:07justin_smithlooks like a good cantidate for clojurescript / canvas
11:14bobbrahms1anyone using core.typed? I'm trying this getting started thing at http://www.clojure.net/2013/03/14/Typed-Clojure/, and the first time I call check-ns I get a:
11:14bobbrahms1clojure.lang.Compiler$CompilerException: java.lang.UnsupportedOperationException: Unknown Collection type, compiling:(clojure/core/typed/path_rep.clj:12)
11:16justin_smithare you using the same versions of things they are with the demo?
11:16justin_smithdo you have other deps that may have overriden the deps there?
11:17bobbrahms1re: same versions, I can't tell. Probably not since that thing was written 3 months ago and I'm using the latest.
11:18justin_smithis clojure.core.typed something in 1.5 or is a separate library?
11:18bobbrahms1I suppose it's possible that I have overridden deps
11:18bobbrahms1separate library
11:19justin_smithdo you have other deps in the same project? (other than clojure)
11:20bobbrahms1well this is a big maven project with lots of deps. I'm just firing up a new repl and trying the typed stuff
11:21bobbrahms1new repl, require clojure.core.typed, load a file with nothing but a simple namespace, call check-ns, get an exception
11:22bobbrahms1I could simplify it and see if the problem persists. I just wondered if this sounded familiar
11:22justin_smithI would try in a bare bones project then if that works (which I would guess it would) compare the versions of things that show up under lein deps :tree
11:23justin_smiththen you probably need some :exclusions in your project.clj - I am guessing
11:23bobbrahms1this is not a lein project.
11:23justin_smithoh, never mind then, someone else will need to help you with that
11:23bobbrahms1would there be a maven equivalent?
11:23bobbrahms1OK
11:24justin_smithmvn has a deps command
11:24justin_smithmvn deps:tree or some such
11:24bobbrahms1I mean I could certainly set up a barebones thing anyhow
11:24bobbrahms1thanks
11:25djanatynjustin_smith: I'd love to do that! how do I get started?
11:26djanatynI found my old ant simulation thingy too :) https://gist.github.com/djanatyn/5823689
11:26justin_smithhttps://github.com/clojure/clojurescript/wiki/Quick-Start
11:26djanatynI forgot about all this clojure code I wrote in my java class ;)
11:27justin_smithI have had a bunch of fun visualizing clojure stuff in html5 canvas (with the help of the aleph lib for websockets), my next step is to try to use clojurescript instead of js
11:29djanatynjustin_smith: do you know of any place to learn about canvas? I've never used it before ^_^;
11:29djanatynor is there some sort of clojurescript wrapper library?
11:30justin_smithhttp://yogthos.net/blog/32-ClojureScript+Adventures was going to be my starting point
11:30justin_smithI was just reading javascript docs and making a canvas, putting objects in it
11:30justin_smith(before moving over to clojurescript, which will be much more sane for programming in than vanilla js)
11:31justin_smithanyway, things like life or ants really beg to be visualized on a 2d plane
11:31arrdemhyPiRion: my hat is off sir
11:34djanatynwow, this should be pretty easy, as I already have my logic seperated from my UI
11:34djanatynI think my code will actually work untouched
11:35justin_smithdjanatyn: awesome
11:35justin_smithI was having some good luck with sending json arrays with objects to draw from clojure
11:36justin_smithand then a foreach / conditional to draw each thing that came in (rect / bitmap / line / ...)
11:36justin_smiththe foreach / conditional being on the javascript end that is
11:41ciphergoth"or" is a macro, so I can't do (update-in thing [:this :that] or "default-value")
11:41ciphergothwhat's the right thing to do there?
11:42justin_smith#(or %1 %2)
11:42justin_smith(is one solution)
11:42ciphergothso (update-in thing [:this :that] #(or %1 "default"))
11:43hyPiRionjustin_smith: can %1 be false?
11:43hyPiRionor just nil?
11:43ciphergoth%1 will be a string or absent altogether
11:43justin_smithwell that is just replicating the behvior of or
11:43justin_smith,(update-in {:a 0} [:b :c] #(or %1 %2) 2)
11:43clojurebot{:b {:c 2}, :a 0}
11:44dnolen_huh
11:44justin_smith,(update-in {:a 0 {:b {:c 0}}} [:b :c] #(or %1 %2) 2)
11:44clojurebot#<RuntimeException java.lang.RuntimeException: Map literal must contain an even number of forms>
11:44dnolen_with support for binary data I guess you could easily do a binary lambda calculus interpreter in core.match
11:44justin_smithoops
11:44justin_smith,(update-in {:a 0 :b {:c 0}} [:b :c] #(or %1 %2) 2)
11:44clojurebot{:a 0, :b {:c 0}}
11:45tomjack&(map #(update-in % [:this :that] (fnil identity "default")) [{} {:this {:that "foo"}}])
11:45lazybot⇒ ({:this {:that "default"}} {:this {:that "foo"}})
11:45justin_smithtomjack: nice
11:45hyPiRiontomjack: yeah, I was thinking about that, but it's not taking any args in
11:45hyPiRionwell hm
11:46tomjackhalf joke
11:46hyPiRion(defn assoc-if-not-in [m kws elem] (update-in m kws (fnil identity elem))) is probably a good one
11:46tomjack(fnil identity "default") is longer and probably harder to understand than #(or % "default")
11:47devntechnomancy: you around? I am trying to use Syme with someone in India and they're having trouble connecting. I'm wondering if the region the instance is being hosted is an issue. Have you heard of anything like that happening?
11:47tomjackor even #(if (nil? %) "default" %)
11:49Lajjlajustin_smith, I have bought a desk fan
11:51callendevn: networking with a developing nation that has many undeveloped regions is going to possibly mess up your networked application?
11:53glosoliHey folks, anyone can recommend some nice resource online to get started with clojure for someone who is complete unfamiliar with LISP and such ?
11:53devncallen: heh
11:53devncallen: he's in a nice area :)
11:53callendevn: so 56k modem?
11:53devnaww come on
11:53devnhave you been to india?
11:53callenno no, this is India, 2.5g GSM USB dongle?
11:54callenno, but I've had a lot of conference calls with people in India
11:54callenmemories of paaaaaiiiiiin
11:54callenglosoli: 4clojure and buy a book
11:54callenglosoli: I recommend cemerick's book, "Clojure Programming". It's designed for non-LISPers. Just pay no mind when he grumbles about CLR and the JVM.
11:54clgvglosoli: yeah get a book, read it and play with 4clojure
11:55callenclgv: I would've said, "you could just say, 'what callen said'", but really - that's static and constantly the case anyway.
11:56glosolicallen: thanks! :)
11:56glosoliclgv: you too thanks
11:56callenclgv: ever been to ##C?
11:56clgvcallen: a "C" IRC channel?
11:57callenyes, although what I'm speaking of is fairly notorious and common to FreeNode and EFNet
11:57callenI can tell #clojure attracts a better quality of person than ##C, because whenever I would tell the carpetbaggers to get a book, they'd tell me to get stuffed and tell them the answer to their homework question.
11:57clgvhaha
11:57callenand they would invariably be in desperate need of a book.
11:58clgvwell, if you really want to learn the language a book is the best choice to get you started fast.
11:58glosolicallen: cemerick = Chas Emerick ?
11:58callenglosoli: da comrade.
11:58glosoliok
11:58callenclgv: the book makes certain any critical gaps are filled, which is especially important so that you don't make other programmers angry.
11:58clgvI had a student that try to avoid reading the suggested book on purpose
11:59clgvyou could see it in his code that he never understood the complete picture... :/
11:59callenclgv: hopefully you did like a proper zen master and fwacked them with a stick over the head.
11:59callenthat's my approach anyway. I don't have many students anymore.
11:59callentoo many brain-fevers and dropouts.
11:59glosoliclgv: I love books
11:59callenI love people that love books.
12:00glosoliheh, have a nice coffee
12:01callenI drink buckets of it. It doesn't have to be especially good, just hot and ready to go.
12:05glosolicallen: Same here, hmm as oddly as it sounds, it doesn't seem to affect by health in any bad way, can't drink like seven coffee per day or more
12:06callenglosoli: supposedly up to six coffees a day is fine.
12:07glosolicallen: hmm, I always thought it's something like two tops
12:07callenglosoli: naw.
12:07callenglosoli: no negatives of any verified sort seep in until 6 per diem
12:08callenverified being the key word here, most of the studies showing weak negative effects for 1-5 coffees haven't been reproducible science, 6+ have been (speaking from memory)
12:08callengenerally speaking, drinking coffee is correlated (for whatever that is worth) with a longer lifespan.
12:09TimMcThis is all in the absence of complicating factors such as acid reflux.
12:09callenof course. personal circumstances may vary.
12:09glosolicallen: Pardon me for my english, but just to be sure correlated means connected in the sense of more coffee longer life span ?
12:09callenI drink tea in addition to coffee to control for acid and stomach upset.
12:10hyPiRionglosoli: It means people who drink more coffee has, on average, a longer life span
12:10callenglosoli: correlated has a very specific and (to the public anyway) slippery scientific meaning. Just remember that it's a statistical association, not a causal relationship.
12:10hyPiRionthat doesn't mean coffee gives a longer lifespan
12:10TimMcor that naturally long-lived people prefer to drink a lot of coffee.
12:11callenwhich would be an interesting thing to try to prove given that that sort of thing is usually due to cultural factors and it'd be hard to pin coffee down to a single cohort.
12:11technomancycould also mean coffee companies secretly are killing off non-coffee-drinkers
12:11technomancyjust throwing that out there
12:11callenmy best guess is that coffee drinking sifts out lower and lower middle class people and selects for middle / middle upper class officeworkers.
12:11callenso, money, career, access to healthcare, class.
12:12callenmost poor people I've known didn't drink coffee.
12:12glosolicallen: hmm out here most poor people tend to drink coffee
12:12callentechnomancy: drinking some canned stuff I got from Nob Hill. Dark columbian stuff.
12:12hyPiRioncallen: are you implying that people without access to clean water or food doesn't drink coffee?
12:12callenhyPiRion: poor people in the US have access to clean water and food.
12:13callenhyPiRion: they tend to drink soda and the like, rather than coffee.
12:13hyPiRioncallen: yeah, it was a joke :-)
12:13callenglosoli: ^^
12:13stain_I think British construction workers etc. have little access to good quality coffee, therefore they go for tea rather than nescafe
12:13stain_which I fully support
12:13callenI drink a lot of tea too, mostly green and oolong.
12:13callenI really don't care for cheap tea though.
12:13callenstain_: nescafe? that's just grotesque.
12:13glosolinescafe is known as fertilizers out here
12:14glosolithat's how people call them
12:14callenmy father simply took a thermos with him to work everyday so that he'd have his coffee.
12:14callenbiiiiig thermos
12:15justin_smithmy father is a machine that turns coffee into frames for houses, I am a machine that turns coffee into code
12:16stain_I think I'm a machine that turns coffee into emails :(
12:16TimMcAlfréd Rényi said, "a mathematician is a machine for turning coffee into theorems"
12:16hyPiRionjustin_smith: well, apparently your machinery is able to talk on IRC too
12:16justin_smithdon't need coffee for that
12:16justin_smithcode, on the other hand
12:17glosolicallen: thanks for the recommendation again, just bought that book, will go on reading
12:17dnolen_WHOA
12:18callenglosoli: sweet. Please enjoy.
12:18callendnolen_: yeah, he looks like a younger you - right?
12:18dnolen_Luc Maranget's lazy pattern matching algorithm seems to find ROBDDs in the simple cases ?????
12:19cemerickglosoli: yeah, that's me
12:19mannymannyupdate on "how to define task dependencies in lein in order to run "lein something" before "lein test" --> I've opted for the :prep-tasks combined with the lein-shell plugin --> :prep-tasks [["shell" "./my-script.sh"]]
12:19callencemerick: I need to be getting referrals for constantly bumping your book in here.
12:19hyPiRionmannymanny: And that is working fine?
12:19justin_smithI ordered it, it is awesome, now gimme my cash too
12:20justin_smith(just kidding about the cash part, the rest is true)
12:20mannymannyactually is running the shell script before _any_ task
12:20callenI own a copy as well from AMZN.
12:20ciphergothTimMc: *googles* heh, always heard that attributed to Paul Erdős, but Wikiquote agrees with you!
12:20TimMcI was surprised as well.
12:20mannymannybut given that the script is taking less than a second it's ok
12:20ciphergothAnd of course a comathematician is a machine for turning cotheorems into ffee.
12:21justin_smithciphergoth: Erdös would likely have said meth instead of coffee
12:21justin_smithbased on his actual practice
12:21ciphergothAmphetamine rather than methamphetamine AIUI#
12:21justin_smithopps, yeah
12:21ystaelciphergoth: you owe me a new keyboard
12:21hyPiRionmannymanny: yeah. If you want to only do it before tests only, you can do `:aliases {"test" ["do" "shell" "./my-script.sh," "test"]}`
12:21dnolen_I just put in a Binary Decision Diagram from a tutorial into core.match and it produced the ROBDD illustrated
12:22ciphergothystael: :)
12:22callenciphergoth: *nice*
12:22dnolen_no redundant tests and the correct variable testing order
12:23TimMcciphergoth: That's fantastic. Gonna quote you on that.
12:24TimMcWho would you like it to be misattributed to?
12:24justin_smithAbraham Einstein
12:25ciphergothQiaochu Yuan? http://mathoverflow.net/questions/1083/do-good-math-jokes-exist
12:25arkhwhy does this block? (.start (Thread. (loop [] (send-off myagent myfunc) (Thread/sleep 5000) (recur))))
12:25arkhbut this doesn't: (.start (Thread. (loop [] (prn "hi") (Thread/sleep 5000) (recur))))
12:25TimMcciphergoth: Ah, OK. :-)
12:26ciphergoththis is from 1996, could be the invention http://mathforum.org/kb/thread.jspa?forumID=13&amp;threadID=20573&amp;messageID=48418
12:26justin_smithmbinitorics, mputer science, lol
12:29seancorfieldlack of mprehension? :)
12:32cemerickcallen: feel free to pass around your own amazon url :-)
12:32callencemerick: I'm a bloody fool, I already have an affiliate account. Woe is me!
12:35mannymannyhyPiRion: actually I've found out that I prefer to have the script to be run always, it's a javascript minifation that I prefer to have always in place (not only during test....), I've tried the alias thing but it isn't working: run the script but doesn't run the tests
12:36hyPiRionmannymanny: ah, okay.
12:41devntechnomancy: is there a way to set a different region for the AWS instance with Syme?
12:43technomancydevn: I think AMIs are tied to a given region, so if you specify a custom one in another region it should just work?
12:43technomancyhaven't tried it myself; let me know if it works =)
12:44futilefoo
12:52kmicuQuijure anyone? http://www.mathstat.dal.ca/~selinger/quipper/
12:52akells`I have a string that looks like this: "[:wood \"birch\"]- [:tree \"pine\"]" and I want to remove the [ \ and ] characters. Is there any built in way to replace multiple characters at once? Right now I could put something together using this (clojure.string/replace "[:wood \"birch"]&[:tree \"pine"\]" #"\[" "") but I'd have to repeat myself a few times
12:54LE_CESSMASTEURakells`, first, kneel before me.
12:54LE_CESSMASTEURAnd I may yet let you live, mortal.
12:56edlothiolakells`: you can use a pattern in replace, e.g. #"\[|\]|\\"
12:57LE_CESSMASTEURedlothiol, do not encourage this behaviour in front of the court.
12:58akells`thanks edlothiol, this will work perfectly. much appreciated
13:03cemerickJust fixed two "long"-standing bugs due to extending protocols to e.g. js/Number. dnolen_, is there a writeup anywhere about js/Number vs. number and similar, motivations/objectives/etc?
13:04dnolen_cemerick: I need more context, we don't do anything with js/Number incore
13:04dnolen_in core
13:05tomjack&(macroexpand-1 '(.getName Math))
13:05lazybot⇒ (. (clojure.core/identity Math) getName)
13:06cemerickdnolen_: yeah, I know, *I* did in one of my projects. I suspect I've been using e.g. boolean and js/Boolean interchangeably for a while, which I can see now is strictly wrong w.r.t. protocols. Was just wondering if there was anything I could read on the implementation differences and whys and wherefores, aside from the impl.
13:06dnolen_cemerick: the principle is simple, don't extend JavaScript language natives
13:06dnolen_cemerick: anything listed as a JS type in the EcmaScript 262 specification should not be touched
13:07cemerickThis is where my being an idiot w.r.t. js is killing me.
13:07cemerickdnolen_: isn't that what prototypes are for, at least ostensibly?
13:07dnolen_cemerick: extending to CLJS types is generally OK as that's all under the control of Closure
13:07dnolen_cemerick: at the risk of breaking everything, sure
13:08dnolen_cemerick: even extending to browser natives must weighed carefully
13:08cemerickdnolen_: i.e. if other libs happen to make changes as well, the whole unscoped monkeypatching problem?
13:08dnolen_which is why I'm looking forward to specify
13:08dnolen_cemerick: yes
13:09dnolen_specify would allow us to scope changes to an instance
13:09dnolen_giving us the flexibility we want and none of the craziness
13:09dnolen_impossible in Clojure, but certainly doable for JS
13:11cemerickI thought that was why prototype extensions are munged up the wazoo. e.g. who's going to touch Number.prototype.cemerick$sedan$impl$Sedan$ ?
13:11dnolen_cemerick: that's not what happens after advanced compilation
13:11dnolen_Number.prototype.cB
13:11dnolen_and stuff like that
13:12tomjackbut extending to 'number' is OK, right?
13:12cemerickyeah, I guess. This is a very conservative approach.
13:12dnolen_tomjack: yes
13:12cemerickright, that's the whole base-types thing in core.clj
13:13cemerickdnolen_: please distinguish between "javascript natives" and "browser natives"; the former is stuff in ecma, the latter is...DOM bits?
13:14dnolen_ROBDD fun http://gist.github.com/swannodette/5824533
13:14dnolen_cemerick: yep
13:14cemerickok
13:14tomjack:(
13:15dnolen_cemerick: I'm not against adding warning for the base-types to the compiler
13:15dnolen_I see this mistake all the the type
13:15cemerickah, ok
13:15tomjackI don't see how specify would be of help here
13:15dnolen_js/Object makes me want to cry
13:15cemerickI'll add an issue
13:15dnolen_tomjack: instance *local*
13:16dnolen_no program wide
13:17tomjackI see how it could prevent the craziness, I don't understand how it's useful for someone who was thinking "I want to extend my protocol to Element" or whatever
13:17dnolen_tomjack: clone the element and extend that just like anything else
13:18cemericktomjack: I have protocols extended to various DOM classes. Perhaps that's wrong, but it works.
13:18tomjackbut suffers the craziness?
13:18dnolen_cemerick: not wrong, just less modular than it could be
13:19tomjackso (defn my-protocol-fn-wrapper [x] (my-protocol-fn (if (instance? js/Element x) (specify ...) x))) ?
13:20dnolen_tomjack: it just depends, but the point is you get pick the level of modularity you need
13:20dnolen_even with specify, you need to touch the prototype to at least define the semantics of cloning
13:20dnolen_but there's also specify! if you don't care about cloning
13:21cemerickdnolen_: finally, what's 'default for? Isn't '_' just another name in javascript?
13:21cemerickidentifier, rather
13:21dnolen_cemerick: it's just the default
13:22dnolen_a catch all
13:23cemerickdnolen_: i.e. union of nil and object?
13:23dnolen_dnolen_: different from nil or object
13:24dnolen_the dispatch is based on the value of goog.typeOf
13:24dnolen_which returns "null", "function", "object", "boolean", "number", "array"
13:24dnolen_if we find no method in the table for those, we check "_"
13:25cemerickokay
13:25cemerickdnolen_: Thanks very much for the brain-dump. I feel thoroughly clarified now. :-)
13:25dnolen_cemerick: np
13:36futile[joke about decimal-time]
13:44RaynosI found this thread ( http://grokbase.com/t/gg/clojure/135a8m6exn/not-using-dependency-injection-how-do-i-share-services-around ) about DI very interesting, does anyone have other good recommended reading material on the subject ?
13:48bbloomtechnomancy: i'm like 99% sure i have the right passphrase, but of course it doesnt work :-P
13:48tomjackthe "punchline" sounds like what I thought when I read about angular's "solution" for demeter violations
13:50stuartsierraRaynos: Maybe my recent blog post: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
13:51stuartsierraThere are more examples in the comments on that post.
13:52hbstuntlastlog
13:53hbstunt(oops)
14:03OkasuBack to that discussion about pronouncification of `assoc', in which part of america people saying 'a-sh-o-sh-iate'?
14:13jweisswhen including clojure lib jars on classpath, does it work like java classes when there are two versions of the same lib on the classpath? (in java land, the first one wins).
14:13stuartsierrajweiss: Probably. Clojure uses Java classloaders to find files.
14:14jweissi am seeing really weird behavior. i patched clojure.data.xml and uploaded to clojars under my own group name. but another lib i use depends on an older version of clojure.data.xml
14:14jweissi'm wondering if uploading to clojars under my own group name was a bad idea
14:14jweisssince now lein considers them two different libs.
14:15stuartsierrajweiss: You can make that work if you add an :exclusion for the older version.
14:15cemerickjweiss: you can add a project-wide exclusion
14:15stuartsierraOr :exclude, I forget the syntax.
14:15jweisswould that work though? one is org.clojure/data.xml and the other is weissjeffm/data.xml
14:16jweissi guess it would since the namespaces are the same.
14:16stuartsierraYes, as long as you keep the older JAR off the classpath, and the namespaces are the same, it should work.
14:16jweissok thanks
14:17stuartsierraI don't think Leiningen makes any promises about the *order* in which things appear on the classpath, so you have to exclude what you don't want.
14:17hyPiRionyeah, true
14:18stuartsierraI'd hesitate to rely on order anyway, even if it were promised.
14:18technomancyyou don't get order guarantees within :dependencies, but on-disk directories should always have priority over jars.
14:18stuartsierraOK, that makes sense.
14:19jweissi really hope this is what caused the weird behavior because after this i got nothin :)
14:23bbloomtechnomancy: ok, i seriously can't get into my gpg key…. what do i do? *sigh*
14:24technomancybbloom: if you lost the passphrase you should publish your revocation cert and make a new key pair
14:25bbloomtechnomancy: i'm just 100% convinced that i know my passphrase, but it apparently doesn't work, so maybe i fucked up making the key
14:25bbloomanyway, where do i publish that revocation? to clojars somehow?
14:25hyPiRionbbloom: ohumm, what are you using?
14:25technomancybbloom: no, to a key server like MIT's
14:25bbloomtechnomancy: oh nevermind, i saw that in the help
14:26hyPiRionbbloom: you've tried with raw GPG, not from lein, right?
14:26hyPiRion(I'm fairly certain the stdin/out stuff is fixed, but can't be too sure)
14:26bbloomhyPiRion: yeah i'm doing this: echo '1234' | gpg --no-use-agent -o /dev/null --local-user FC97C2D7 -as - && echo 'got it!'
14:26hyPiRionokay
14:27bbloomhyPiRion: what was the issue?
14:28hyPiRiontechnomancy/leiningen#957
14:28lazybotlein run doesn't close stdin of the clojure process. -- https://github.com/technomancy/leiningen/issues/957 is closed
14:29amalloy(inc lazybot)
14:29lazybot⇒ 18
14:29hyPiRionplus #1080 and #1173 and friends. It's a mess because we're sending data around, but we can't just pass the fd to a child proc
14:32bbloomtechnomancy: what if i can't find my revoke key? lol
14:32bbloomtechnomancy: i suck.
14:36owengalenjonesI guess its impossible to have a multi variadic function with a rest argument right?
14:37hyPiRionowengalenjones: not if it's possible to distinguish between the variants
14:37owengalenjonesyeah that makes perfect sense after thinking about it
14:38hyPiRion,((fn f ([a b] (f a b 5)) ([a b & c] (apply + a b c))) 1 2)
14:38clojurebot8
14:39owengalenjonesthanks hyPiRion
14:39hyPiRionnp
14:54bbloomtechnomancy: ok, i can't revoke my old key, but i made a new one and republished all of my artifacts with that key
14:54bbloomtechnomancy: and this time i made a revoke key & will back everything up
14:55bbloomtechnomancy: the docs don't seem to say what things need to be backed up though. looks like gnugpg stores keys in some binary format. is there a good way to gather all the plain text files i need for making a backup?
14:56bbloomhttps://gist.github.com/chrisroos/1205934 <- is method 2 the way to go here?
14:58futileWhat's some idiomatic Clojure code that demonstrates just how simple it is compared to the alternative using OOP (and instance variables etc)?
14:58Chousukefutile: that's a pretty vague question
14:58futileyep
14:59jweisswe as a community should have an answer for that somewhere though :)
14:59Chousukewell, I don't know.
14:59Chousukesome things are easier, some things are not
14:59jweissmap is a nice example maybe
14:59jweissi did a blog post a while back that wasn't too far off this subject
14:59Chousukebut to pick an example, I often wish I had a good sequence toolkit when working with pythong
14:59Chousuke... -g
15:00futilejweiss: sure, any individual core function is pretty easy. but it'd be nice to see using them together to do something in a simpler way than the OOP way
15:00futileChousuke: HA
15:00jweissfutile: here's an example i posted a while ago http://jweiss.com/blog/?p=140
15:01hyPiRionfutile: the expression problem is usually a common one
15:01hyPiRionchouser did a video on that I think
15:01Chousukeit's so often that Iwant to write code that goes like filter / extend -> transform -> reduce/transform -> ...
15:01Chousukeand I have to write lots of loops in python
15:01Chousukeand make copies of things so I don't clobber stuff
15:02hyPiRionfutile: yeah, here it is http://www.infoq.com/presentations/Clojure-Expression-Problem
15:03Chousukefor example, I'm working on some visualization code that goes through a list of units on a rack, and I wanted to fill up the "blanks" on the list so that it's easy to render
15:03Chousukebut it's pretty tough in python to just insert stuff in the "middle" of a list
15:05Chousukeand after debugging a problem for 15 minutes that resulted from a missing "return" keyword I configured emacs to automatically run pylint :P
15:06bbloomChousuke: haha. that's bit me before too w/ javascript. after clojure, coffeescript, ruby, and a few other things…. "return" is a code smell to me, it implies an imperitive break from a loop :-P
15:07ChousukeI've almost got my emacs configured just right for python
15:07kmicutoo many "python" word, my eyes hurts...
15:07clojurebotbcrypt. http://codahale.com/how-to-safely-store-a-password/
15:07Chousukethe only thing missing is completion in ipython shell
15:07bbloomlol thanks for the reminder, clojurebot
15:07hyPiRionahah
15:08Chousukeas usual, all documentation online is outdated or hidden inside someone's .emacs.d on github. emacs is awesome, but...
15:09ChousukeI tried to find how to configure that nice fuzzy autocompletion that emacs starter kit had
15:09futileapparently English has an intentional pattern where words that start with "fl" are associated with fast sudden movement
15:09Chousukebut I don't even know what to google for
15:09benkaynow that i've been infected with this state management paradigm the idea of database migrations makes me cry
15:10Chousukethe feature that allows you to type eg- p-i-p and get package-install-package
15:11Chousukeand the one that searches the directory tree when you just type a file name. browsing directories manually in the minibuffer is a bit painful even with autocompletion
15:11ChousukeI know emacs can do all this, I just have no idea what it's called and how it's enabled
15:14TimMcfutile: flotsam? floating? flat? flange?
15:15TimMcflax, flour...
15:15futileTimMc: only words that started out as English
15:15TimMcflense
15:16hyPiRionflute, flint, etc
15:18TimMcfloor, flimsy, flinders...
15:19Bronsaflatulence.
15:20stuartsierraChousuke: smex
15:20stuartsierraand ido
15:21rkneufeldChousuke: I use projectile's find-file-in-directory (?)
15:36Chousukestuartsierra: ido I already have but smex I guess is the one I'm missing
15:55futileok
16:03futileoooh
16:05futilei kinda wanna try porting this to clojure, https://github.com/JoshCheek/seeing_is_believing/blob/master/lib/seeing_is_believing.rb
16:05futilejust because of all the instance variables and methods, just to see how much cleaner it would look simply by being functions
16:06futilenot to mention being clojure
16:07tomjackwould it have to be at the top-level?
16:07tomjacklike the interface is a macro which instruments the code inside?
16:08futiletomjack: uhhh
16:09futilewat?
16:09clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
16:10devntechnomancy: do you know if there are multiple endpoints? It looks like syme just uses us-west-2 right now.
16:10tomjackfutile: I mean you couldn't e.g. trace code you had already defined in a namespace somewhere
16:10tomjack(or could you?)
16:11futiletomjack: oh, i dont mean that it would actually work
16:11tomjackyou want to write a port that doesn't work?
16:11futiletomjack: i just wanna see the code transformation when going from ruby to clojure
16:11tomjackah
16:11futilei bet it'd look way cleaner
16:11futileand less confusing
16:11tomjack..so presumably with some parts missing
16:11futileyeah it might call some non-existing functions
16:12futilethe kinda stuff thats ugly and necessary when making it work, but isnt the business-logic of this lib itself
16:18technomancydevn: my understanding is that the region is determined by the AMI you use, but I haven't confirmed this
16:20devntechnomancy: interesting
16:20devntesting it now
16:22devntechnomancy: I got an "error"
16:22devnnot sure what the log looks like
16:22technomancy=\
16:22technomancyI haven't tested the custom ami stuff at all yet
16:22technomancydo you have a heroku account? I can collab you on it if you want to take a look now
16:22devnyeah
16:23technomancyin this case it's "The image id '[ami-4923611b]' does not exist" but I'll add you if you want to do more debuggin'
16:24devntechnomancy: yeah i think the endpoint needs to change
16:24devntechnomancy: i was thinking there'd be a dropdown for region, so if you select a region, it will use the default 64bit ubuntu 12.x AMI, unless you specify an AMI ID
16:26technomancyyeah, a dropdown for region would be fine
16:29TimMctechnomancy: Thoughts on the instantserver.io thing?
16:29technomancyTimMc: wonder what the Mean Time to Bitcoin is for services like that
16:30TimMc:-D
16:30technomancyTimMc: the cool thing about that one is that they can have a pool of ready instances, whereas with syme you need to spin up a node on demand, so it's a lot slower
16:31technomancyI was thinking about if I ever do something like Syme Pro it could have a slack pool, but it complicates things
16:31technomancyanyway, it's free software; if anyone wants to build Syme Pro they're welcome
16:31technomancyall I ask is for a free lifetime account =D
16:33TimMcOoh, good point about the pool.
16:36technomancypros and cons of running entirely in the user's account
16:43justin_smithI has successfully run lein based web servers on the instant server site
16:43justin_smithlog in; aptitude install leiningen git; clone my project; lein run
16:43justin_smithboom
16:43justin_smithpretty smooth process actually
16:45technomancythat's an OK way to go if you only have a single node
16:45justin_smithit was just to show something to a friend for a few minutes
16:45justin_smithwithout having to allocate a real server etc.
16:45technomancyyeah, a real deploy is going to need more infrastructure around repeatability
16:46justin_smithand the fact that it is free helped
16:46justin_smithyeah, of course
16:46technomancy`lein with-profile production run` would be better
16:46technomancykeep dev deps away
16:46justin_smithgood point
16:46technomancyalso you can save memory with trampoline
16:47technomancyplus you want to freeze your deps so snapshots don't get upgraded out from under you
16:47technomancyat some point it gets simpler to just ship an uberjar to your server
16:47technomancybut it works for a demo =)
16:47justin_smithyeah, just showing a friend the state of my work, the kind of thing I think instant server is best for
16:48technomancyoh; I missed the "instant" part
16:48technomancyheh
16:48technomancyreally looking forward to seeing lein2 in debian though
16:48technomancythe profile stuff actually won't work in that scenario since apt still gets you 1.x =\
16:49justin_smithstability: the cause of, and the solution to, all of debian's problems
16:52technomancymore or less
16:59LE_CESSMASTEURRaynos, do you still love me?
17:00RaynosWhat
17:02futileRaynos: correction: "WAT"
17:02futileRaynos: I would also except "wat"
17:03futileRaynos: or "ಠ_ಠ"
17:04Raynoswat
17:07futile(inc Raynos)
17:07lazybot⇒ 1
17:07RaynosI think I may have to leave
17:07futilei was just about to say, "stop wasting so much time on irc guys"
17:07futileso yeah
17:08RaynesRaynos: We were just talking IRL about how your name screws up tab completion for amalloy when he is trying to complete my IRC nick. :p
17:09RaynosOh.
17:09RaynosWell
17:11tomjackhmm, could a dispatch map be a map which specifies a new equality impl on incoming keys?
17:12tomjackno.. that won't work
17:13jweissanyone have any insight into what's happening here? https://www.refheap.com/15966 it's bizarre, the same clojure.data.xml call, over and over, loading different supposedly unrelated libs in between, and suddenly i get different output. the weird thing is is not consistent, after some random require, the behavior changes forever until i restart the repl.
17:19hiredmanjweiss: all that is not using a specific xml parser, it is just sort of grabbing one from the ambient environment, most of those libraries can use several different parsers depending on what is available
17:20hiredmanor generators or whatever
17:21hiredmanso they sniff the classpath or loaded vars or whatever
17:22ztellmancan you get &form on inlined functions?
17:22ztellmanor is that only for macros
17:22amalloyztellman: i don't think you can
17:23ztellmanwell, that sucks
17:23amalloyztellman: if(inline != null) {return analyze(context, preserveTag(form, inline.applyTo(RT.next(form)))); }
17:24amalloyso, definitely no
17:24ztellmanoh, hmm, the reason I wanted the &form was to preserve the tag
17:24ztellmanbecause it seems to be vanishing
17:27amalloyztellman: tbh, trying to tag function/macro calls is unreliable enough already that i'd say whoever is writing ^Whatever (your-inlined-function) shouldn't be terribly surprised that the tag falls off
17:27ztellmanyeah, this is actually nested inlined functions
17:28ztellmanand the outer inlined function is explicitly using with-meta on the inner inlined form
17:28ztellmanto no avail
17:28amalloyhah. i see. and you don't want to let it, because then you lose whatever benefit inlining gave you
17:29ztellmanamalloy: I was using let before, I was just curious if that has any performance implications
17:29amalloywell, it might or might not. but it means your inline function has less information to work with
17:30amalloyeg, perhaps the inlined thing notices that one of its inner calls is (identity x) and replaces that with just x; if you first (let [y (identity x)] (my-inlined-fn y)), it can't do that
17:30ztellmanright, in this case I'm just playing bytecode golf with a bunch of aloads and astores
17:31ztellmanI'm trying to understand if they have any impact, post-jit
17:31ztellmanbut there are certainly other reasons you don't want to have to use the let indirection all the time
17:34tomjackand no &env either..
17:34tomjackI guess an inlined fn could look at LOCAL_ENV?
17:35amalloyjweiss: you could sorta test hiredman's theory by, before requiring any "unrelated" namespaces, (alter-var-root #'clojure.data.xml/indenting-transformar memoize)
17:37amalloythat would mean the same transformer is always being used
17:40dnolen_yowza JavaScriptCore is closing the gap w/ V8 as far as ClojureScript is concerned
17:40bbloomdnolen_: nice.
17:42wastreldo emacs users tend to use the gui window or stick to command line
17:44jouiswalkerwastrel: i find the gui more convenient since i dont have to bother with weird terminal specific behavior
17:49dnolen_bbloom: 46ms for JSC to build build a transient vector of 1000000 elements, vs. 20ms on the JVM
17:49hiredmanI use gui emacs locally (so pretty on a mac) and terminal emacs on lots of vms
17:51justin_smithhiredman: ever try tramp instead of terminal emacs?
17:51amalloywastrel: i prefer gui when possible, because there are some combined keystrokes i can't manage to send properly to a terminal (over ssh, at least)
17:52justin_smithmore key commands work in the gui, that don't map nicely to terminal
17:52justin_smithie. in the gui you can have an alt key, a meta key, and a super key
17:52justin_smithansi can't do that I don't think
17:52Bronsai use emacsclient -nw because I tend to switch a lot between emacs and zsh
17:53gtrakyou can use different font sizes in the gui, that's convenient
17:54hiredmanjustin_smith: the vm is really a total working environment
17:54justin_smithyou can still ssh in, correct/
17:54hiredmanthere are services I interact with outside of emacs on there
17:54hiredmansure
17:54hiredmanI ssh in and run tmux
17:54hiredmanthen emacs
17:55hiredmanI am sure 80% could be done easily very tramp
17:55justin_smithI realized recently how much more convenient tramp over ssh is rather than ssh in and run emacs
17:55hiredmanbut I really care about the 100%
17:55justin_smithok
17:58jouiswalkeri'm going to keep tramp in mind
17:58jouiswalkerthat seems really convenient
18:14ztellmanamalloy: for the record, the solution is to write a version of macroexpand that also calls (-> (first x) resolve meta :inline) when it exists, and to use that within the inline form function
18:14amalloyan interesting question came up on stackoverflow, and i wonder what the folks in here think. what, if anything, is the difference between a form and an expression?
18:15ztellmanform as in def, if, etc?
18:16ChousukeI think the CL hyperspec actually defines what a form is
18:16amalloyztellman: form as in list of things. (+ x 1) is an example of a form in any lisp i've heard of
18:17Chousukebut my understanding is that a form is something lisp-specific while expressions exist in all languages
18:17technomancyamalloy: an expression implies evaluation; a form may not
18:18amalloytechnomancy: that's basically what i think as well (http://stackoverflow.com/a/17223015/625403), but i think it's enough of a philosophical question ("what is the nature of evaluation?") that there are other reasonable answers
18:19brehautsomething something side effects and statements something
18:19technomancyamalloy: the arglist is a good example; it's a form without being an expression
18:19amalloytechnomancy: loads of forms (under my definition are not expressions
18:20amalloy)
18:20clojurebot) is http://xkcd.com/224/
18:20technomancyheh
18:20hiredman~botsnack
18:20clojurebotbotsnack is scoobysnack
18:35futileIs there such a thing as, like, (memoize-for-seconds 60 ...) ?
18:35futileThat'd be pretty cool for caching.
18:36bbloomfutile: https://github.com/clojure/core.cache has TTL caches
18:36futileNeat.
18:37bbloomfutile: however, they rely on cache misses to trigger timeouts, which is potentially a problem if you have infrequent reads and want to reclaim memory
18:37futilenot for me
18:37bbloomit would be a pretty trivial extension to add an asynchronous timeout
18:42futilethanks bbloom
18:44devntechnomancy: you've got a PR and a few messages from me. Let me know if you want me to roll back prod.
18:56TimMc&(.append (StringBuffer.) 5)
18:56lazybot⇒ #<StringBuffer 5>
18:56TimMc&(.append (StringBuffer.) nil)
18:56lazybotjava.lang.IllegalArgumentException: More than one matching method found: append
18:57TimMc...but I can't figure out how to type-hint the nil.
18:57amalloyTimMc: (let [^String x nil] (...))
18:57TimMc:-(
18:57amalloy(.append sb ^String (identity nil))
18:57hyPiRionor Object, for that matter?
18:58TimMc(defmacro its-a-goddamn [class val] (with-meta `(identity ~val) {:type ~class}))
18:59TimMcWell, s/~class/class/
19:00TimMc (.append (StringBuffer.) (its-a-goddamn String nil)) ;;= #<StringBuffer null>
19:00TimMcThanks, amalloy.
19:00amalloyTimMc: also, s/type/tag?
19:00TimMcHmm, yes.
19:00amalloylike, that just works because the compiler decides (identity nil) is an Object
19:00hyPiRionOh, this I did not expect.
19:00hyPiRion&(.append (StringBuffer.) ^Object (and))
19:00lazybot⇒ #<StringBuffer true>
19:00TimMcIndeed.
19:00hyPiRion&(.append (StringBuffer.) ^Object (or))
19:00lazybotjava.lang.IllegalArgumentException: More than one matching method found: append
19:00amalloyhyPiRion: type-hinting macros is fraught with peril
19:01amalloyboth 'and and 'or have discarded your typehint entirely
19:01amalloyit works because (and) evals to true, which the reflector can figure out; (or) evals to nil, which has TimMc's original problem
19:01hyPiRionSo it just reflected on boolean then
19:01TimMc(╯°□°)╯︵ ┻━┻
19:02hyPiRion&(#(.append (StringBuffer.) ^Object %) nil)
19:02lazybot⇒ #<StringBuffer null>
19:02n_bcemerick: No reason to do this 140 characters at a time; Long term I'd like to backport a bunch of the Fireplace enhancements in terms of connection/nrepl to a more VimClojure-esque interface, so I'll definitely peek at that Python module and try and contribute back
19:02mthvedttype hints are reader macros. they don't become part of the macro, they become part of the list you're passing to the macro
19:02mthvedt…i think
19:03cemerickn_b: hi :-) You'll likely want to look at the module I'm building now, which is one level above nrepl-python-client. Basically a thin shell specifically for vim<=>nrepl interop.
19:03hyPiRion&(#(.append (StringBuffer.) ^int %) nil) ; ?
19:03lazybotjava.lang.NullPointerException
19:04hyPiRionI suppose it's casting it to int or something.
19:05cemerickn_b: I know exactly *zero* about vim UI stuffs, even less about its conventions. Largely, I'll be flaunting them. Again, roughly creating in vim what ccw (and enclojure, and lispworks, etc) has.
19:05hyPiRion(That was a dumb statement, of course it has to)
19:05n_bcemerick: Will definitely keep my eye out; I'm subscribed to the vimclojure ML and just haven't been keeping my eye on it. All in on /[CF]#/ for the time being
19:05n_bcemerick: I'm more or less in the same boat; I learned vimscript purely to make some tools for writing and have never had a good experience with it, which has always dissuaded me from learning more. It makes one pine for elisp
19:05LE_CESSMASTEURFIRE PHASERS, STARPORT
19:06LE_CESSMASTEUREVASIVE MANOEUVRES
19:06LE_CESSMASTEURREROUTE AUXILIARY POWER TO THE SHIELDS
19:06LE_CESSMASTEURMR PARIS, TAKE IS TO WARP 8, NOW.
19:07n_bcemerick: All the work in terms of dealing with async that I've seen has been along the lines of vim-dispatch, which is really punting on the issue. It's a complaint people have had for a long time but lots of inertia behind it that makes any easy fix more or less impossible
19:08cemerickn_b: my really minor experimentation leads me to believe you can toss stuff at vim from threads in python at will, and it responds as expected
19:09cemerickIf (big, big IF there) that holds up, then I suspect the vim-can't-do-async is more of a cultural thing about "everything should be in vimscript, python/ruby/whatever deps is unclean"
19:11n_bI don't know enough to speculate on the reasons; but I'd be very excited to have a proper, emacs-like REPL in vim
19:12n_b(mostly I just want to be able to C-c when I accidentally evaluate a 25MB form at the REPL :P)
19:12vsyncwill i have any luck at all trying to run nrepl in xemacs?
19:13technomancyvsync: very low chances
19:13vsyncis it just a lot of interactive-p versus called-interactively-p and move-beginning-of-line vs beginning-of-line?
19:14technomancyI'm sure the incompatibilities go a lot deeper than that
19:14vsyncor a lot of hairy stuff with all the emacs variants of trying to catch up to xemacs features?
19:14vsync:P
19:14technomancylots of low-level socket communications going on
19:15Raynestpope: HALp
19:17technomancycemerick: then you're going to move on to the nrepl-discover stuff, right?
19:20Apage43https://floobits.com/help/plugins/#vim
19:20Apage43floobits does some trickery to get vim async stuff working
19:21cemericktechnomancy: one step at a time :-P
19:21cemerickThough if I start thinking of ways to build a scheme into vim, come shoot me. :-P
19:22hiredmanif you don't just embed guile...
19:26Morgawrhttp://www.morgawr.eu/p/1371770066.gif woo, clojurescript game engine is slowly coming along :D
19:41dnolen_Morgawr: neat!
19:54cemerickdnolen_: were you meaning to cut a cljs release?
19:54dnolen_cemerick: yep
19:54cemerickdnolen_: it's stuck
19:55dnolen_cemerick: oh I didn't do anything
19:55dnolen_cemerick: that's some stuart sierra does
19:55dnolen_something
19:55cemerickdnolen_: oh, cljs releases aren't fully automated?
19:56cemerickthe staging repo is fully staged on oss....
19:57ZamarokIs it possible to write some sort of lazily evaluated list in Java that Clojure can access as an infinite sequence?
19:58ZamarokMaybe someone could point me in the right direction? Examples or libraries to look into..
19:58brehaut,(doc iterator-seq)
19:58clojurebot"([iter]); Returns a seq on a java.util.Iterator. Note that most collections providing iterators implement Iterable and thus support seq directly."
19:59Zamarokhmm
19:59noonianwas just going to say that in a somewhat more wordy and most likely less correct way
19:59ZamarokI will try some stuff out, thanks
20:00hiredmanif your whole deal is java->clojure you could just use LazySeq
20:03amalloylazyseq would be okay, but honestly i'd just return something that implements iterable
20:04amalloysince seq works on those
20:05amalloyotoh, just trying to sketch out how i'd write such an iterable, i now suspect hiredman's suggestion to use LazySeq might be easier
20:05dnolen_cemerick: all i know is i always ask stuart sierra to do a release
20:08nooniandnolen_: whats having a new release?
20:09dnolen_noonian: just release ClojureScript artifact
20:09noonianah cool, thanks
20:59jimrthyI have a .jar under my ~/.m2 tree. It's in `lein classpath`. Trying to require any of the namespaces that `jar -tf` claims it provides at the REPL causes FileNotFoundException.
21:00jimrthyI feel like a total moron because I'm probably missing something obvious because I don't think I really grasp the way CLASSPATHs work.
21:00jimrthyIs there a decent resource available to help me understand why I'm having this problem (it involves JNI)?
21:01hiredmanhow are you requiring it?
21:01hiredmanin what kind of environment (lein repl, nrepl, etc?)
21:02hiredmanhave you restarted the repl since you added the dependency to project.clj?
21:02jimrthyI've tried every variation I can think of of (require 'org.zeromq.jzmq)
21:02noonianand this is a leiningen repl?
21:02jimrthyleiningen NREPL through emacs, and I've learned to just restart every time I change everything in project.clj
21:03hiredmanjimrthy: and what is the exact file it says is not found?
21:03hiredman(my guess it is a native library jzmq depends on)
21:03jimrthyCould not locate org/zeromq/ZFrame__init.class or org/zeromq/ZFrame.clj on classpath: clojure.lang.RT.load (RT.java:443)Could not locate org/zeromq/ZFrame__init.class or org/zeromq/ZFrame.clj on classpath: clojure.lang.RT.load (RT.java:443)
21:04hiredmanor it could be this org.zermq.jzmq is just a broken library
21:04jimrthyI get the same error from a basic lein repl
21:04hiredmanjimrthy: which library is this?
21:05jimrthyYeah, I was about to break down and put together a basic java project to see, but I figured I'd check here first.
21:05amalloylooks to me that it's likely a java library that doesn't provide any clojure namespaces
21:06jimrthyzeromq is a C lib. jzmq is supposed to be a fairly mature JNI piece on top of it.
21:06seancorfieldin which case (import ...) instead of (require ...)
21:06hiredmanamalloy: sure, if jimrthy isn't pasting the actual error he sees
21:06muhoohmm, first time i've blown up the heap. i've got 2GB of memory assigned to the JVM, and 2GB of it used as heap, says visualvm, but only a tiny fraction of it as "used heap"
21:06noonianyeah, I think you need to import not require
21:06hiredmanbut he is loading org.zeromq.jzmq, and the error mentions org.zermoq.ZFrame
21:06muhoothe "perform gc" button is greyed out. alas, i am a jvm ignoramus :-(
21:07jimrthy(import 'org.zeromq.jzmq)
21:07amalloyoh, so he is. i figured he was trying (require 'org.zeromq.ZFrame)
21:07jimrthyClassNotFoundException org.zeromq.jzmq java.net.URLClassLoader$1.run (URLClassLoader.java:366)
21:07muhooheap dump shows 11MB of strings and PHM's, but not anythign that looks like 2gb
21:07hiredmanwhich would only happen if org.zeromq.jzmq is clojure and is trying to load a non-existent org.zermoq.ZFrame
21:07hiredmanamalloy: or he is really bad at asking for help with errors
21:07muhoosomewhere, i suspect, a head is being held on to
21:07hiredman(I dunno why I just don't jump right to that)
21:07jimrthyOops, yeah...did I mention that I've been trying lots of variations?
21:08amalloy~helpme
21:08clojurebotA bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you.
21:08hiredmanjimrthy: that is a java library, not a clojure one, so you need to load the java classes using import
21:09jimrthyI'm sorry...I'm quite the clojure newb.
21:09muhoosomewhere, a java.util.HashMap$KeyIterator keeps growing and growing in size, even though i'm not doing anything
21:09jcromartieso who's the new "Senior Clojure Engineer" at LivingSocial eh?
21:09seancorfieldjimrthy: so you have [org.zeromq/jzmq "2.2.0"] in your dependencies?
21:09hyPiRionmuhoo: well, you must be doing something
21:09noonianmuhoo: are you sure you blew the heap? not the stack? what computation causes the error?
21:09seancorfieldand you should (import 'org.zeromq.jzmq.SomeClass)
21:09muhoohyPiRion: noonian: it's heap. i'm getting OOM exceptions when doing anything
21:10hiredmanI would recommend looking at just about any alternative because why would you want to doom yourself to fighting with native libraries from the start? https://github.com/spotify/netty-zmtp gives you what I understand is a slightly dated version of zeromq has a jvm library
21:10seancorfieldyou have to import specific classes, not packages
21:10muhooand, visualvm shows heap maxed out, but not used.
21:10jimrthy2.2.0?? Where did that come from?
21:11hyPiRion$latest org.zeromg/jzmq
21:11lazybotNo project by this name exists on clojars.
21:11hyPiRionoh, you. Only on clojars? I had hopes up dude.
21:11muhooand indeed i'm not doing anything. i have nrepl running, no threads, my webserver threads appear to have shut down. bizarre.
21:11seancorfieldjimrthy: I just picked the latest version I found on Maven
21:12seancorfieldjimrthy: what dependency do you have in project.clj?
21:12muhooanyway, i've build this house of cards, adding library after library, and now i'm screwed. my own fault. RAM is not an infinite resource, apparently.
21:12seancorfieldyou could paste your project.clj file to http://refheap.com
21:12muhooand some of these libs, or my own code, may have a memory leak.
21:12noonianmuhoo: I don't know much about java vm settings, but when you said you have 2G for java and also 2G for the heap makes it sound like theres no memory to use for the stack?
21:12jimrthy@seancorfield 2.1.0-SNAPSHOT...which it's what's in .m2. 1 second
21:13muhooOutOfMemoryError PermGen space java.lang.Class.getDeclaredMethods0 (Class.java:-2)
21:13hyPiRionnoonian: the jvm has a constant stack on 64kb afaik
21:13hyPiRionby default
21:13hyPiRionthe heap can't eat from it and vice versa
21:13muhoothe error i'm seeing loks like heap, PermGen space, it says
21:13noonianhyPiRion: cool, thanks for the clarification
21:14muhooanyway, no prob, if there's no easy/obvious answer, i'll just run with visualvm running and see if i can catch it behaving badly.
21:14jimrthyhttps://www.refheap.com/15971
21:14hyPiRionmuhoo: are you redeploying much? That may be it
21:15muhoohyPiRion: what do you mean by redeploying?
21:15muhooi'm doing a ton of C-c C-k in nrepl.el, for sure.
21:15muhoowhich causes the ns to recompile.
21:15seancorfieldjimrthy: well, i don't know where you're getting that version from - it's not maven
21:16jimrthy@hiredman netty-zmtp may be my best bet
21:16hyPiRionmuhoo: uh oh, that's likely the classloader then
21:16seancorfieldbut you should be able to (import 'org.zeromq.ZFrame) - that works for me with 2.2.0 in the depencies
21:16hyPiRionmuhoo: http://frankkieviet.blogspot.ca/2006/10/classloader-leaks-dreaded-permgen-space.html
21:16muhoohyPiRion: fantastic, thanks!
21:16jimrthy@seancorfield It's a self-build, based on advice from a blog post. I'll give the maven version a shot
21:16seancorfieldjimrthy: but basically the syntax is (import 'some.package.ClassName)
21:17seancorfieldjimrthy: or (import '(some.package ClassNameA ClassNameB))
21:17seancorfieldbut you want import not require
21:17hyPiRionnp
21:17seancorfieldand you want to specify class names not just a package
21:18noonianis it more idiomatic to use lists for importing java classes instead of vectors?
21:19hiredmanyes
21:19seancorfieldand that's because it's (package Class Class Class) so the first element is "special"?
21:19hiredmansure
21:20seancorfield(i've always thought it's a weird difference but it's how i keep seeing it in people-who-know-better's code)
21:21jimrthy@seancorfield That loads at least. Thank you.
21:21hiredmanwell, that is a very good rationalization, but the reason is because then emacs indents it right
21:21noonianlol, ok thanks
21:21technomancyit's not just emacs
21:21technomancyit's everyone who copies emacs too =)
21:21jimrthy@hiredman Thank you, too.
21:21seancorfieldomg! of course hiredman - that's makes perfect sense! thankyou!
21:21hiredmanok, all good and correct editors
21:23noonianyeah, I've been going with emacs indentations except on some def/with-like fns and multiple arity fn declarations
21:31amalloy(inc hiredman)
21:31lazybot⇒ 18
21:33janpaulbultmanndoes somebody know how to read the class attribute of an interface? a la Foo.class in java?
21:33justin_smith,(class 1) ; is this what you want?
21:33clojurebotjava.lang.Long
21:33amalloyjanpaulbultmann: that's just Foo
21:34amalloy&[String Long Class]
21:34lazybot⇒ [java.lang.String java.lang.Long java.lang.Class]
21:36janpaulbultmannjustin_smith, amalloy:seems to be of the wrong time thoug
21:36janpaulbultmannhttp://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#readAttributes(java.nio.file.Path, java.lang.Class, java.nio.file.LinkOption...)
21:36janpaulbultmanngod dammit even the javadoc urls are broken by design
21:37janpaulbultmannhttp://bit.ly/17qO1SA
21:37janpaulbultmannthis horrible Files api expects the .class attribute of an interface
21:39amalloyjanpaulbultmann: what you're saying doesn't make sense
21:39amalloyonly rage against things that are actually possible. interfaces are classes
21:39janpaulbultmannamalloy: I would agree if it wasnt written right here
21:39janpaulbultmannFiles.readAttributes(path, PosixFileAttributes.class, NOFOLLOW_LINKS);
21:40janpaulbultmannhttp://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFileAttributes.html
21:40amalloyyou're probably running into the same problem everyone who tries to use nio.file does, ie that java varargs are really arrays
21:41hiredmanjanpaulbultmann: .class isn't a really member
21:42janpaulbultmannhiredman: yeah I know, don't really know what to call it then though ^^, syntactically its an attribute
21:42noonian,(class "foo")
21:42clojurebotjava.lang.String
21:42noonian,java.lang.String
21:42clojurebotjava.lang.String
21:42hiredmanjanpaulbultmann: if you want to get super technical java doesn't have "attributes"
21:43hiredmanjava classes have "members"
21:43hiredmanFoo.class is similar looking to member access
21:43hiredmanbut what you can is the instance of Class for that class
21:43hiredmanwhich in clojure is just Foo, or in this case PosixFileAttributes
21:44hiredmanif that is not working for you, I suggest looking at the exception
21:44noonian,(Class. "testing")
21:44clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Class, compiling:(NO_SOURCE_PATH:0:0)>
21:45noonian,(java.lang.Class. "testing")
21:45clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Class, compiling:(NO_SOURCE_PATH:0:0)>
21:45noonian,(. (class "foo") "class")
21:45clojurebot#<CompilerException java.lang.IllegalArgumentException: Malformed member expression, compiling:(NO_SOURCE_PATH:0:0)>
21:46noonian,(. "foo" class)
21:46clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: class for class java.lang.String>
21:47janpaulbultmannhiredman: according to those no such method exists,I first assumed this was because of type mismatch but now I lean towards amalloys vararg hypothesis ^^
21:50noonian,(.getClass "foo")
21:50clojurebotjava.lang.String
21:54janpaulbultmannhm nope, even when wrapped in (to-array [f PosixFileAttributes LinkOption/NOFOLLOW_LINKS]) it still fails :(
21:55hiredman,(to-array ["foo"])
21:55clojurebot#<Object[] [Ljava.lang.Object;@a499fa>
21:55hiredmanwhat is the type the array created by to-array? does it match the type expected by the method?
21:56janpaulbultmannhiredman: I assume it will be an object array as it is used to interact with java varargs
21:57hiredmanno, it will be of whatever type the docs say
21:57janpaulbultmannor is only the variardic part in that array
21:57hiredmanthat
22:00janpaulbultmann,(Files/readAttributes f PosixFileAttributes (into-array LinkOption [LinkOption/NOFOLLOW_LINKS]))
22:00clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: Files, compiling:(NO_SOURCE_PATH:0:0)>
22:01janpaulbultmannstill fails with No matching method found: readAttributes
22:01janpaulbultmannso close but jet so far ^^
22:01hiredmanwhat is f?
22:02janpaulbultmanna file
22:02janpaulbultmannah
22:02janpaulbultmanngoddamit
22:02janpaulbultmannwho designs this shit
22:02janpaulbultmannone thing for shure, if I get this garstly api running I'll create a library around it
22:03janpaulbultmannso that no one ever has to feel the pain of java native file io
22:03hiredmanclojure definitely needs more libraries written by people who don't know clojure
22:03wastreldoes it?
22:04wastreli don't know clojure!
22:04n_bThat seems like a recipe for disaster
22:04jcromartiejanpaulbultmann: sounds like you are on the wrong Java version?
22:04jcromartiewait
22:04n_bat the very least, unidiomatic code that's hard to integrate with existing infrastructure
22:04jcromartiejanpaulbultmann: never mind, you are figuring it out
22:05brehauthiredman: maybe they could take on the neglected web framework space
22:05janpaulbultmannjcromartie: yeah every damn place accepts an file
22:05janpaulbultmannexcept for this one where it has to be a path
22:05jcromartieexcept that :)
22:05janpaulbultmanngod dammit I hate java with as much passion as I love clojure
22:06jcromartiejanpaulbultmann: don't hate Java, hate the… OK, hate Java
22:06n_bThe issue here is more that Clojure does very little to hide details of the host platform
22:07n_band it's not an issue, so much as a design choice; one I think that makes interaction between e.g. Clojure and Java much more natural
22:07hiredmanbrehaut: I would hate to think that we had exhausted all possible ways to push bytes down a pipe
22:08TimMcPoll: With java.net.URL, which "default" value for port do you hate more? -1, or null
22:08brehautman, rails is almost ten years old
22:08TimMcI'm writing Yet Another One True URL Library, you see, and this is a very important design decision. :-P
22:09brehautTimMc: i hate -1 more
22:09hiredmanwhy not -5?
22:09TimMc(That is, java.net.URL returns -1, but it could have been designed to return an Integer.)
22:09janpaulbultmannn_b: interop is great, it is really java that is madness, ever tried to find out when a thread pool runs empty without polling or killing the damn thing?
22:09TimMchiredman: Yeah. :-/
22:10n_bjanpaulbultmann: I have, actually. On the whole j.u.c is really well designed though...
22:10janpaulbultmannn_b: how? custom queue implementation?
22:11n_bIIRC I used latches
22:13janpaulbultmannn_b: yes that works for a bounded work load where the size is known in advance. Once you have an unkown number of jobs or even worse jobs that spawn new jobs, there is simply no way except for a custom queue.
22:14janpaulbultmannand even then you won't know if the threads all finished running,so you need a custom thread as well ^^
22:14n_bAh, yea. That's considerably more complex than what I was doing
22:16nsxtSomewhat off-topic but I'm looking for a rosetta stone here... I'm looking for the equivalent of Clojure's partition in Ruby.
22:17janpaulbultmannnsxt: you provide a binary function that returns true at places to split
22:17janpaulbultmann?
22:18n_bnsxt: Probably taking the length and enumerating across a range and then calling .slice is the interview-question-attempt-#1 approach to it
22:19nsxtn_b: I figured as much, just didn't know if there were a more concise way of doing it
22:19ddellacostansxt: maybe chunk will do it? http://ruby-doc.org/core-2.0/Enumerable.html#method-i-chunk
22:19n_bif it's in stdlib it'll be defined in Enumberable
22:20ddellacostansxt: but you still have to give it some condition regarding the index I suppose
22:20nsxtThe thing is, I'm not really looking to supply a binary function
22:20janpaulbultmannnsxt: sorry reversed that relation, I thought a clojure equivalent for a ruby method ^^
22:20nsxtI'm just looking for a grouping
22:20nsxtMore concrete: I have a range of dates
22:20muhoohas anyone used clojure.tools.trace? i've been trying to figure out how to get it to trace just one function
22:20n_bnsxt: .each_with_index + an accumulator I think
22:21n_boh
22:21muhooit will trace the hell out of a whole NS though, producing a spew that crashes emacs. and i haven't figured out how to turn tracing OFF either
22:21n_bnsxt: each_slice(Int n)
22:21nsxtSay from Jan 1, 2012 to Feb 1, 2013. I want groups of full years within that. So the return result should be [Jan 1, 2012..Jan 1, 2013, Feb 1, 2012..Feb 1, 2013]
22:21nsxtn_b, yeah, that's close, but just not quite
22:23nsxtwith clojure it'd be (partition 12 1 [etc])
22:27janpaulbultmannhiredman amalloy: thanks the problem really was in the vararg stuff, and the path/file types I messed up.
22:27nsxtn_b: I suppose I could just loop, use each_slice(), and then drop the first element on each iteration
22:28nsxtNot the most elegant, but... thanks, everyone.
22:28n_bJust go at it loop/recur style :)
22:31janpaulbultmannnsxt: or you could write a thin wrapper in clojure and use jruby ;P
22:31nsxtjanpaulbultmann: haha, trying to not go the overengineering route.
22:32janpaulbultmannhehe
22:56TimMc&(.getPort (java.net.URL. "http://google.com:६&quot;))
22:56lazybot⇒ 6
23:08tomjackcrazy
23:09tomjack&(.getPort (java.net.URI. "http://google.com:६/&quot;))
23:09lazybot⇒ -1
23:09tomjack&(.getPort (.toURL (java.net.URI. "http://google.com:६/&quot;)))
23:09lazybot⇒ 6
23:10tomjackoooh
23:11tomjackI thought that was xi
23:12tomjack&(Long/parseLong "६")
23:12lazybot⇒ 6
23:20spoon16getting an NPE when I try to run "lein ring war", "lein ring jar" works
23:20spoon16anyone have any ideas, the stack trace is not helpful and I can't see anything obvious in the google searches that I have tried
23:20spoon16configuration contains the :ring {:handler
23:21spoon16and 'lein ring server' works fine as well
23:30technomancymuhoo: I have something for that in nrepl-discover
23:30technomancyhttps://github.com/technomancy/nrepl-discover
23:30technomancyM-x nrepl-toggle-trace
23:34tomjackwow, I don't think I had ever seen tools.trace
23:50mdeboardIs there a better way of implementing an interface than https://gist.github.com/mattdeboard/5828655
23:51mdeboardThe whole protocol/type/record/reify family of tools gives me trouble wrapping my head around it.
23:56muhootechnomancy: awesome, thanks
23:57technomancymuhoo: still pretty experimental, but it might do the trick
23:58mdeboardIf anyone responded to me I had to restart emacs so lost chat
23:58muhooit looks very promising. worth playing around with for sure.