Fork me on GitHub

@seancorfield: it seems that db namspaces are a kind of particular case. Meaning, if I see functions in yournamespace.db.query I already know that I should not put them in an STM and therefore you can leave the ! out. The problem is with other places, where I prefer to always add it, even if there is no system visible change, in order to prevent any misuse and catch the attention of the reader. I don't want any serial killer at my door (including myself ☺️)


@richiardiandrea: And that’s a perfectly valid convention to follow IMO.


is there a way to exit a function prematurely in cljs?


there’s this monster function in js with several return; and i’m not sure what to replace them with


@krchia, sure, if you specify the condition with some branching logic and know that whatever’s last in that branch is what the function will return.


yeah, that’s the problem.. there’s conditionals peppered all over inside the function with returns


that’s for a direct js->cljs translation though


You’re going to have to refactor it into a series of smaller functions, and probably use some-> or cond-> (i.e., threading).


This is one of the wins of cljs over JS: better, more maintainable code structure — because you’re essentially forced to do that 🙂


That’s exactly what I was going to type next. [coughs]


ok, i guess i can’t translate mindlessly anymore


And never be afraid of having an army of smaller functions as long as they’re clear and predictable.


A mindless translation will be very unidiomatic cljs...


any recommendations for deployment strategies/libs/guides?


Matters what your target is, really. I went with dokku on an Ubuntu installation for a bit but after awhile it was just easier for me to generate an uberjar and use sftp to get it to my server.


It’s not at all automated, unfortunately, but it works in the small.


i'd prefer a completely automated setup, something that doesn't require me to ftp any jar (i might be on phone connection for hotfix for instance)


i could probably write some capistrano recipes but wondering what everyone else is doing


@naomarik: We have automated build / test / deploy scripts but there’s still manual intervention. We run a private Apache Archiva instance as a mirror for Maven/Clojars and a repository for our own published libraries. We’re moving toward Docker in general to help automate things.


We also run a REPL server inside all our long-lived processes so — if absolutely necessary — we can jack in (over SSH / VPN) and debug and patch a live, running process.


We’re moving toward CD as an end game but we’re aways off that yet 🙂