Fork me on GitHub
doug kirk00:07:54

pretty bold putting an Alpha in production


With the exception of core.spec, everything else seems very stable. We’re using it in staging without issue.


We’ve run Alpha builds in production since we got started with Clojure back in 2011 (1.3.0 Alpha 7 or 8 was our first production build, I believe). We do multi-version testing against master and our current stable selection all the time. Clojure is extremely stable across versions these days.


FWIW, a breakdown of our code base:

Clojure build/config 10 files 1047 total loc
Clojure source 151 files 31907 total loc,
    2284 fns, 692 of which are private,
    344 vars, 10 macros, 36 atoms
Clojure tests 106 files 11149 total loc


"build/config" is our build.boot file and the various EDN files we use to specify dependencies and environmental configuration across dev/qa/prod. Our tests are either Expectations-based "unit" tests or clj-webdriver Selenium UAT tests.


(actually the Expectations stuff includes a few large suites of tests for our REST API as well, so not all "unit" level stuff)


There is already a backport of spec to 1.8 as well out there


That backport would be (more) interesting if it also worked on 1.7 and maybe 1.6 I think. After all, 1.9 is basically 1.8 + clojure.spec anyway so I don't quite see the point of a 1.8-only backport... But that's probably because I'm happy running prerelease builds in production anyway.


The optics of pre-release in production is the pure reason I looked at the backport 😄


What industry are you in @mj_langford ? And who oversees your production systems (i.e., what kind of departmental structure do you have there)?


I suspect if we had a "fire" in production that was directly traceable to using prerelease builds, we'd change our policies... but it was the same at my last place (small, startup like) and my previous place (Adobe, not so small).


if i have a fn that imports data from a csv and I want to make that data available in the global namespace, what’s the best practice way of doing that it in clojure?


@seancorfield: I do iOS development along with the associated backends. The use of Clojure at all is something I can sell reasonably well when they care at what is used for their backends, however I see a lot of sharp intakes of breath over version numbers in libraries among other things when they’re acclimating to it.


I personally think Clojure is so stable it’s silly sometimes next to everything else in the ecosystem, and if there was budget to test more thoroughly I’d probably go with your approach.


Realizing I didn’t answer your question: I’m a consultant, I bring companies up on apps (and if needed, backends to go with them, which are Clojure these days, with cljs front ends when required). I’m sometimes the end all be all of the structure next to business folks, sometimes there are dozens of others.


hey guys, in test.check.generators is there a way to generate values that are randomly chosen from a collection?


oh I just realized that this is what



@mj_langford: Interesting. Given how bleeding edge a lot of mobile app development is, I'm a bit surprised they don't view the server side in the same light. It's always fascinating to see the different standards applied to different parts of the equation.


Yeah, we don’t want to be riding razor blades into lakes of salt all the time


that’s apple pushing us down them


And if you have lots of risk in one part, you want very little in the other parts.


@ezmiller: Take a look at delay for creating a global that is evaluated just once on demand and caches the result.


@mj_langford: We have both Android and iOS apps and it's really the wild, wild west in some ways (esp. Android!), and it makes Clojure look very mature and stable by comparison 😆


iOS dev is basically great fun from Feb till June with nothing changes and everyones on the new stuff. Then June-Sept is running in terror getting things ready for the new stuff that’s coming out. Then Sept-Feb is supporting 2-3 versions of the OS until Feb when you can drop the old ones.


Clojure is like “oh, new fun stuff from a conference, new alphas, oh look they work pretty much without change"


But I can ignore it when in the terror periods, Perfect complement


Hi, has anyone ever implemented request size restriction in ring + immutant/web?


iku000888: i have not, but there are some relevant undertow options described here:


> Call getNextException to see the cause. What is the reasoning behind SQL stuff doing this? It just seems to frustrate me 😛


@seancorfield: thanks. will checkout delay.


@dominicm: don't hate on SQL, it's not its fault! 😉


I assume this is just how JDBC works


Yeah, there's gotta be a historic reason though I guess? I've never written Java, so I have no idea.


I dunno—I would assume it's so distinct exceptions can be made out of more complex errors coming from the RDBMS in a Java-y way. But this is just part of the Java SQLException interface I believe, and has been for a while:


(let [label (if restore? "Restore" "Delete") action (if restore? :restore :delete)] (f label action)) How can I simplify this so that (if restore? ...) is not repeated?


mbertheau: among other possibilities, (apply f (if restore? ["Restore" :restore] ["Delete" :delete])


or simply (if restore? (f "Restore" :restore) (f "Delete" :delete))


dunno, lots of context I'm missing there


@ddellacosta: Hmm, the (f ..) is actually more complex, and I need label and action in separate places, not as arguments to the same function.


@mbertheau yeah, like I said, I'm missing context—a more complete snippet/pastie/gist etc. would be better for getting good suggestions


Ah, what I'm looking for seems to be (let [[label text] (if restore? ["Restore" :restore] ["Delete" :delete])] (f label text))'


sure, that works


destructuring for the win


sure, not sure how much I helped, but you're welcome 😄


reading emojis in emacs never stops being weird


Hello everyone. Do you folks have any suggestions for mocking/stubbing/spying in tests?


@stephen_turley: with-redefs works for 90% of my use cases


Hello everyone, what is the correct way to handle multi arity functions when used with cljc? Right now I am trying to use the reader conditional inside my defn, but im wondering if I should just use a root level conditional?


anyone else having encoding issue with transit-clj with Clojure 1.9.0-alpha8 and above? if I use namespace qualified keyword in my map, the resulting encoded message looks strange: {::some.namespace/foo 1} becomes {#:some.namespace {:foo 1}}


(i’m using sente, and my sente server is complaining about bad package after the version upgrade. not quite sure if it’s a sente issue, a transit-clj issue or a Clojure issue)


@alexmiller: i noticed you recently made a commit in the alpha (, and i suspect it has something to do with it ^. any insights what might be causing the issue? (sorry for singling you out if this turns out to be unrelated)

Alex Miller (Clojure team)19:07:02

@settinghead: that’s the new namespace map literal syntax


@alexmiller that’s it! thanks. i’ll file a bug to the lib author

Alex Miller (Clojure team)20:07:01

the edn reader (in 1.9.0-alpha8 +) should also understand this syntax

Alex Miller (Clojure team)20:07:21

tools.reader has also been updated, but depending on the clojurescript version you’re using, it might not


@alexmiller: yes, upgrading ClojureScript to latest master branch solved the issue. thanks


anyone else having trouble with time outs pushing to clojars lately?


@sorenmacbeth: no one else has reported that


to the clojars admins, at least


what library are you pushing?


I can look in the logs for any clues


ok. last couple of times it’s happened to me. so just 3 times or so in the last few weeks, but probably 60% of the deploys I’ve done over that time all for yieldbot/vizard


can you gist the error you get?


I only see 201's in the logs in response to vizard PUTs. Are you using a proxy?


Huh actually I had that too recently


forgot to mention it


@jcrossley3: Thanks! Will investigate!


Anyone know of any good clojure spec youtube videos?


Not on youtube, but this is a good intro:


Thanks jm. I’m specifically looking for a talk on it for a little lunch series I’m putting on.