Fork me on GitHub
#clojure
<
2016-10-10
>
val_waeselynck17:10:16

@bcbradley maybe this belongs in #core-async

bcbradley17:10:32

sorry i didn't know that channel existed :x

punnie19:10:15

hey, looking for some inspiration regarding a problem I'm currently having

punnie19:10:36

I'm trying to implement a simple filter-map-reduce over a lazy sequence, but in the filter-map operations I only operate over a specific field of the map that comes in the sequence

punnie19:10:23

so I have as sequence of maps like {:a 1 :b 2}, and the filter-map operations focus only on :a

punnie19:10:47

but, in an operation before the reduce part I have to feed back :b

punnie19:10:50

since this has a lot of filters, I was wondering if there's a method to do this that isn't me doing deep accesses on the maps on each filter-map function

punnie19:10:59

a map over the sequence with a let would work, but filtering would be hard

jr19:10:24

maybe keep + reduce combo?

bfabry19:10:02

@punnie you could combine all your maps and filters and reduces into one function that you pass to reduce. you could write a function that does the "deep reaching" for you so it's not inconvenient in each of the maps and filters. you could use specter with filterers and collectors

punnie20:10:13

keep has the same problem, I think: I'd have to keep the map structure throughout the operation when all I want up until the end is the value of :a

punnie20:10:38

I'll take a look at that approach @bfabry

punnie20:10:49

thank you both for your help 😉

bfabry20:10:54

(personally I'd use specter)

bfabry20:10:36

well.. most of the time. I wouldn't use it if I was writing something I want to distribute as a library I guess

punnie20:10:07

makes sense

mattly21:10:01

Is there a way to do a docstring in a method definition for deftype or is that limited only to the protocol's definition?

hiredman21:10:30

docstrings are limited to things with vars

ghadi21:10:26

which means @mattly you can add a docstring to the automatic ->Foo constructor that you get when you (deftype Foo...)

ghadi21:10:36

use alter-meta

fenak23:10:26

is anyone building the app from jenkins to docker? i’m unsure if there’s an easy automatic way to bump the release version and create a container with the right version, as the jar has the version number appended to it.

hiredman23:10:03

just don't have your launcher script rely on the exact filename

hiredman23:10:43

sorry no, when I've something like that before we didn't version stuff in docker

fenak23:10:18

as i come from a rails (that we basically checkout and run), i’m a little bit confused in how to integrate all that with our ci..

hiredman23:10:18

Oh no, we did, actually the version was a build param

fenak23:10:37

imagine we’d build it like, 10 times a day...

fenak23:10:52

there must be a way to automatically control the project version on project.clj

hiredman23:10:05

you an replace the version string with ~(System/getenv "VERSION") or whatever

hiredman23:10:46

if you are building 10 times a day, my guess that is your app, not some library you are depending on, in which case the maven coordinates are pretty arbitrary

hiredman23:10:14

its not like you are ever going to use those to pull the code from a maven repo