Fork me on GitHub

perfect, thanks. that's my next step


out of curiosity, do you write any tests against the top level functions, since you have total control of the DB protocol? in my case, i was considering writing some tests against my ring handlers before i did some refactoring


top level functions => whatever you are injecting the DB into


yeah we write them how you did, you can also have the reify impl record its calls in an atom for verification, ie mock vs stub


makes sense


I definitely got the pattern from someone's talk at clj/west this year, just trying to remember who... probably Anthony Marcar here


@bfabry: hey one more question, in that defrecord for SQL-DB, is there any lifecycle stuff to do? if the actual db connection is a separate Component, it will be started and stopped on its own. it seems like there's nothing to start/stop in the SQL-DB component


if the connection is managed by a separate component then yeah, you wouldn't need to implement lifecycle for the db I don't think


Curious if it would be possible with core.match to use rest patterns but also match the last element in a vector? It seems like the rest pattern may preclude that? I want to match a few initial elements, and variable amount of elements, and then the last element


I’d like to override a single method of a protocol for a specific type — is that possible at all? extend-type tells me the protocol is already defined for this type


Other than having an if, is there a Clojure way to inc a value but if a value is at a max level, wrap around back to zero? I vaguely remember seeing very concise code for this at some point.


@sashton: yes very reasonable. Doing the same here.


hmm how did slack not show me the entire discussion that came after your post? 😛


@thheller was my code snippet the last post you saw? I edited it several times right after I posted it. Maybe slack didn't like that


yeah, then I posted my reply and the rest appeared ... but maybe it was just scroll locked


@pupeno this gets rid of the if at least: (mod (inc num) max-val)


Hey folks - if I wanted a quick and easy lib to display 3d visualisations, what would you suggest? First thought is Quil, but I haven’t looked at what else is out there.


@pupeno: you can use unchecked-inc to wrap around from Long/MAX_VALUE to Long/MIN_VALUE (basically this removes the overflow check)


Enjoyed this talk on transducers in C++


alexmiller: I’m looking to wrap around at a specific value.


how can I control of how some map is being printed in repl (aka implement rubyish inspect method, not toString for it?)


oh, I looked for defmethod print-method sorry


Hey all… Could someone explain to me how the fixed future thread pool works and if it borrows from teh available threadpool. I.e. Do spawned futures take threads away from incoming requests (assuming the app is behind a webserver)


The future thread pool is not fixed size - it grows


alexmiller: So am I correct in assuming that the more futures spawned, that less threads would be available to service requests?


You will just use more threads


And at that point you’re bound by memory. Thank you


Does boot offer a task equivalent to lein new?


Alternatively, is there a way to call lein new programmatically?


Does anybody know how to teach a CI server like Jenkins about the dependency tree of leiningen dependencies? I'd like our build server to only rebuild downstream projects if they depend on the specific snapshot build we're integrating.... Was thinking it might be possible to use lein pom and the jenkins maven plugins to do this?


Right now we just state project B depends on project A in jenkins -- and it triggers a rebuild regarless of whether or not project B actually uses the version of project A that was built