Fork me on GitHub

Does anyone know of a good academic paper citation to support the statement that "...pure functions on immutable data, are significantly easier to reason about."


Out of the tar pit is one... are there better ones that more directly support those claims though?


@rickmoynihan: I would suggest you don't need to cite a paper to back that up. at least out in the "real world" outside academia. it should be obvious to anyone with enough smarts & experience, who knows what all those words mean. a bit like do you need an academic paper to "prove" that it is safer for you to juggle a small foam ball than a running chainsaw. 😛


Hi, could someone suggest me a good clojure templating library for html. I have explored a few like selmer, hiccup and clostache but I am not sure which one to go forward with. My requirements are basically to render a html file so hiccup doesn't fit in. Selmer fits my requirements but it seems like there hasn't been any activity in it for quite sometime so I am not really sure I should go with it. Any suggestions would be great.


We use Selmer very heavily in production at World Singles and we're very happy with it. It's mature and rock solid. The lack of activity reflects that.


Besides, it's had a few minor updates in the last week or two.


(we send over half a million HTML emails every day built with Selmer, FWIW)


@seancorfield: Thanks for the suggestion I will probably go with Selmer then.


@groglogic: it is for an academic/journal paper. It's not really a key claim it's basically just provided as a justification for why the system was implemented in clojure; but the reviewer has challenged it. I'd rather not expand the statement, to provide a full explanation of the benefits of FP over imperative / pure functions vs impure etc... which is what he seems to be asking for. I'd rather save the words for more important claims and just cite something that says why it's better.


The problem I have with Out of the tarpit for these purposes is that it's advocating more than FP...


Is there a way to call a static method from an instance of a class?


@casperc: why would you want to do that if it's a static method. Unless it's a method named coincidently the same in several classes and you don't know which you have?


@agile_geek: Long story, I am fiddling around with proxy and running into a situation where this seems to be the only way. There may be another way, but was wondering why it isn’t possible to do.


Surely if you know the method to call you know the class the method is implemented on and therefore can call it the usual way?


Maybe, my question is whether it is possible though 🙂


Not that I'm aware of but not sure why you would need to.


Fair enough.


Hi. For a small service I am writing, I need to display the last N loglines on a status page. I thought I could just pass the lines through a fixed max size buffer. Would you implement this yourself (conj'ing on vec or subvec depending on size) or do you know any suitable datatype from the top of your head? PersistentQueue does not really help, I think; neither amalloy/ring-buffer)


@casperc: if I understand what you want, you can get it with eval. you probably don’t want to do that, though


boot.user=> (defn static-call [obj method-name & args] (let [c (class obj)] (eval `(~(symbol (pr-str c) method-name) [email protected]))))
boot.user=> (static-call "s" "valueOf" 7)


@ska why ring-buffer doesnt help? It seems like what you want


@dnolen: I'm trying to get up and running with modules and get an error like this:

	at cljs.closure$optimize_modules$fn__4074.invoke(closure.clj:1247)
Any ideas what can I do about that? I tried something simple in repl and it works:
(import '[ JSModule])
(def q (JSModule. "qwe"))
(require 'cljs.closure)
(def compiler (cljs.closure/make-closure-compiler))
(.sortInputsByDeps q compiler)
and that is not throwing exception I'm lost...


I have an idea at the back of my mind for some time already: how good/bad idea would it be to build a mixed Django/Clojure webapps? Let Django manage DB tables, migrations, sessions and CRUD for the backoffice stuff; let Clojure pull data using e.g. hugsql and do its user-facing magic. In a few cases where interop can be required, one can always provide a bunch of REST handles. Nginx in front of the whole contraption will make it transparent to everyone


I’m building something close to that now, and now interop on memcached level is enough (reading user sessions)


rmuslimov: did you have any problems with the setup? Why did you consider it?


I’m using it only for websockets now, and have plans to expand to other parts of the app. Btw, I concerned how to agree on which parts of app will implement on python and which on clojure


no problems with setup so far


@asolovyov: sounds like a dep issue to me


@rmuslimov: I see, thank you!


@danlebrero: It does not really add a lot (that I need in this case) over just a vector and adds another dependency.


Are there any best practices/standard conventions wrt command-line arguments for Clojure programs run via lein run?


@si14: I'm migrating from django to cljs/clj app, and some pages are displayed to user by django, some by clojure. Works well (I can show you public site), I just had to implement django sessions support in clojure. Plus my admin interface is in flask-admin.


@asolovyov: thanks! I'll ask for more details in DM :)


I’m having some problems with , i’m wanting to take a collection and save it as a csv in s3


i’ve done this to a file, using (with-open [file (io/writer filename)] (csv/write-csv file (cons headers rows)))))


but since i’m going straight to s3, i it looks like i need to pass s3 an input stream, I’m not sure what type of stream to use,


actually i think i just answered my question,