Fork me on GitHub
#clojure
<
2017-08-16
>
fabrao03:08:07

Hello all, I created my first github clojure project https://github.com/fdabrao/business_day_calc and my question is: Is there any particular pre-req needs to publish it to clojar?

danielcompton03:08:09

@fabrao not particularly, although I'd suggest adding a group-id to your project

danielcompton03:08:41

like org.fdabrao/business-day-calc

danielcompton03:08:48

or some other domain that you own

jonpither14:08:00

hi, is there a good place to discuss Manifold?

gsnewmark14:08:31

there is #aleph channel, Manifold related question are often answered there too

dpsutton14:08:19

ask your question and find out

jonpither14:08:47

if put! fails on a sink for some reason, is there way to report this error? Without having to deref the put at a later date?

cddr18:08:14

Not for an arbitrary sink afaik. You can of course make your own sink by implementing IEventSink. There's some macros that help with this in manifold.stream.core

dealy16:08:36

is there a way to tell clojure.test to ignore single testing context, or a whole test function?

dealy17:08:23

ok, that seems to help, though it doesn't report on how many tests were ignored. Its sorta like commenting it out, but with less work

dadair17:08:28

#_ is commenting it out (it's not specific to clojure.test)

noisesmith17:08:05

you can provide metadata on tests and tell lein test to only run tests with a given metadata

noisesmith17:08:55

you can easily make a function for the repl that does this, via all-ns, ns-publics, a filter that checks for :test metadata plus whichever other metadata you care about, and finally passing the remaining items to clojure.test/test-vars which takes care of fixtures and reporting etc.

yonatanel18:08:51

@jonpither With manifold you can use d/chain, or register a callback on the returned deferred with d/on-realized. https://github.com/ztellman/manifold/blob/master/docs/deferred.md

schmee20:08:43

if I have an array containing mutable data, is better to just stick that in an ArrayList instead to make it obvious that everything is mutable?

schmee20:08:53

it feels a bit grose to mutate the contents of an immutable array with doseq

ghadi20:08:06

both are mutable, though it's easier to perform certain manipulations with an ArrayList

schmee20:08:50

sure, it’s more that I’ve come to expect that everything that uses Clojures data structures is 100% immutable

schmee20:08:10

I’m mostly philosophizing about the semantics 😛

noisesmith21:08:47

@schmee erm arrays aren’t clojure data structures and they are always mutable

noisesmith21:08:58

do you mean vector? vectors are never mutable

noisesmith21:08:31

but you are suggesting putting the vector into an ArrayList since the things in it are mutable, is that what you are saying?

schmee21:08:34

sorry, realized I mixed up the terms (I should probably go to sleep…) 😄

schmee21:08:10

what I meant is that I have a Clojure vector containing mutable Swing JLabels which I muck around with using doseq

schmee21:08:35

and I’m thinking about replacing the vector with an ArrayList to make it more obvious that everything is mutable

spangler21:08:57

@schmee I would recommend keeping a pure-data representation of the jLabels in a vector and treat that immutably, then have a translation function that applies whatever is in your vector to the jLabels all at once.

spangler21:08:18

so you get the benefit of working with data immutably and also isolate the places where you actually interact with the mutable part

spangler21:08:53

rather than keeping a vector around and all of your functions mutating stuff in it, which sounds bad

schmee21:08:17

that’s pretty much what I’m doing right now, but where should I put the JLabels themselves?

schmee21:08:35

or maybe just recreate them every time?

spangler21:08:51

Right, at the outermost point you can you have a state map containing all your mutable stuff. Call the function that computes your label changes in a pure way, then apply them to the JLabels there

spangler21:08:17

I have never been able to make an application without having some kind of state map at the outermost level, even if it just contains configuration read in at initialization time

schmee21:08:34

cool, I’ll go for something like that 👍

spangler21:08:01

Usually it is a server and database connection at the very least

spangler21:08:22

Yeah, let me know how it works for you

rmuslimov23:08:01

I’m trying to solve lein uberjar problem in my project. Which is clearly solved here for java: https://stackoverflow.com/questions/6364333/jax-ws-when-apache-cxf-is-installed-it-steals-default-jdk-jax-ws-implementat So, trick is

For the default implementation put:

com.sun.xml.internal.ws.spi.ProviderImpl
inside /src/main/resources/META-INF/services/javax.xml.ws.spi.Provider
How can I do the same in clojure project? Can I add META-INF/… file to it

rmuslimov23:08:22

already spent few hours on it, any help appreciated