Fork me on GitHub
#clojure
<
2015-10-23
>
sashton00:10:38

perfect, thanks. that's my next step

sashton00:10:13

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

sashton00:10:40

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

bfabry00:10:36

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

sashton00:10:55

makes sense

bfabry00:10:27

I definitely got the pattern from someone's talk at clj/west this year, just trying to remember who... probably Anthony Marcar here https://www.youtube.com/watch?v=av9Xi6CNqq4

sashton00:10:04

@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

bfabry00:10:09

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

blissdev04:10:48

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

martinklepsch10:10:49

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

Pablo Fernandez10:10:18

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.

thheller10:10:07

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

thheller10:10:21

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

sashton10:10:39

@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

thheller10:10:24

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

sashton10:10:40

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

korny13:10:11

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.

Alex Miller (Clojure team)14:10:23

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

ghadi14:10:52

Enjoyed this talk on transducers in C++ https://www.youtube.com/watch?v=vohGJjGxtJQ

Pablo Fernandez15:10:15

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

razum2um18:10:46

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

razum2um19:10:36

oh, I looked for defmethod print-method sorry

PB19:10:09

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)

Alex Miller (Clojure team)19:10:23

The future thread pool is not fixed size - it grows

PB19:10:23

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

Alex Miller (Clojure team)19:10:48

You will just use more threads

PB19:10:40

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

clem22:10:20

Does boot offer a task equivalent to lein new?

clem22:10:54

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

rickmoynihan23:10:07

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?

rickmoynihan23:10:08

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