Fork me on GitHub
#clojure
<
2016-07-22
>
verma03:07:27

I have a server side app with components(like from the component framework) which need to talk to each other, thinking of setting up some sort of an event bus, over which the components can deliver messages to each other, both one way and request-response events are needed. Any suggestions into where I should start would be of great help! can do some sort of core.async pub/sub but just wanted to know of any other viable options out there.

Alex Miller (Clojure team)05:07:48

the thought of people pouring effort into Stackoverflow Docs about Clojure rather than adding to http://clojure.org (or worse, copying from it) depresses me more than it probably should

eprozium07:07:44

@alexmiller: do you want a sincere view on http://clojure.org from the users perspective and why many would even consider Stackoverflow?

joost-diepenmaat07:07:09

@alexmiller: I’m not that interested in adding docs on SO Docs, but considering my experience with stackoverflow, I do expect that to be relatively painless. My expectations regarding adding docs on http://clojure.org can be summed up as “probably not worth even trying, if possible at all"

joost-diepenmaat07:07:54

My expectations may be completely unwarranted, but the http://cojure.org site (like clojure.core) does not present itself as a particularly friendly place for new contributors.

joost-diepenmaat07:07:30

The clojure.core contributors seem like a pretty close small group of people who really want to focus on getting a few things (simplicity, performance…) exactly right. Right now I’m thinking that that might just necessarily clash with a wish for “pouring [lots of] effort” from more people. As a non-core-contributor, it looks like the chances of my efforts never resulting in anything or taking ages to show up are too high - especially if I “only” want to improve some documentation. This extends to the http://clojure.org site.

joost-diepenmaat07:07:52

Even if for online clojure documentation, quantity (especially examples) might be more needed than quality.

lmergen09:07:28

i feel that SO doc's added value is more like a community wiki / cookbook. i think it can be a great way for beginners to get up to speed quickly for the type of information that's currently fragmented over a gazillion of blogs, and doesn't necessarily compete with http://clojure.org's documentation. having said that, i do fear that this will lead to even more increased fragmentation.

Nicolas Boskovic14:07:14

I've got a task I'd like some input on how to handle

Nicolas Boskovic14:07:44

Essentially I'd have to watch a file for updates and process it to get the last lines

Nicolas Boskovic14:07:11

I'm aware of the clojure-watch library, but what would a good way be to only get the last changes with clojure's io?

artiavis14:07:09

@verma: @ztellman's https://github.com/ztellman/manifold has an Event Bus helper utility, and Manifold's fundamental Streams structure (analogous to core.async channels) have interop capabilities with core.async

mj_langford14:07:42

The addition of examples makes clojuredocs and stack overflow so useful

mj_langford14:07:28

Is there a library (or it is even possible to write a library) to make it so invalid statements in namespace calls are more apparent? I just wasted 20 minutes due to a missing colon on an :as.

mj_langford14:07:37

I don’t know enough about macros and name fighting vs clojure core to know if it’s possible to do it even

mpenet14:07:12

you can run lein check

mpenet14:07:22

or just try to load the namespace

mj_langford14:07:48

it doesn’t crash on load, it crashes only when you’re trying to use one of those items in the failed require statement

mj_langford14:07:55

which could happen days apart in work

mj_langford14:07:02

trying lein check

mpenet14:07:02

lein check will report the error

mj_langford14:07:02

btw, this is something stack overflow excels at btw. The sentence a lost person writes is what gets indexed at google due to wonderful SEO about that term. and the expert answerer points to the correct google term. And that’s why I wish we put more clojure questions up there

mpenet14:07:51

well it's not really open, what if they put this behind paywall tomorrow

mj_langford14:07:57

It looks like lein run would have found the error

mj_langford14:07:01

but lein check did too

mj_langford14:07:19

@mpenet same problem with clojure

mj_langford14:07:31

anyone can always take their toys and go home

mpenet14:07:38

not really, it's open source, anyone can fork it

mj_langford14:07:55

Stack overflow can be entirely downloaded by topic, but you are right about redistribution

mpenet14:07:56

some already did

mj_langford14:07:43

Not saying “stack overflow is awesome” just this “noob question -> great answer/terms” mapping is super valuable!

Alex Miller (Clojure team)14:07:46

@joost-diepenmaat: picking up your earlier comment, yes, interested in hearing about how to make http://clojure.org contribution better. http://clojure.org is at https://github.com/clojure/clojure-site and takes PRs, which I typically merge within minutes for simple changes. Yes, you have to sign a CA, but that’s a one-time thing and many contributors already have one.

Alex Miller (Clojure team)14:07:03

there are plenty of requests that need work that could be done by the community https://github.com/clojure/clojure-site/issues

mj_langford14:07:04

If anyone else is confused about the CA: your name is generated from the input you make when signing

mj_langford14:07:12

You can’t manually enter it first.

Alex Miller (Clojure team)14:07:25

you mean the contributors page?

mj_langford14:07:34

If the person who updates such forms is reading this, on my internal contracts that do this, I put the “printed name” after the signature for this reason

mj_langford14:07:45

made from adobe sign

Alex Miller (Clojure team)14:07:57

if you have a modification to your name, feel free to submit a PR to the contributors.csv file

mj_langford14:07:14

naw, just almost abandoned because I couldn’t get the field to work ;D

Alex Miller (Clojure team)14:07:19

oh, I know what you’re referring to

verma17:07:47

thanks @artiavis taking a look!

Nicolas Boskovic18:07:37

'I've got a task I'd like some input on how to handle [11:01] Essentially I'd have to watch a file for updates and process it to get the last lines [11:02] I'm aware of the clojure-watch library, but what would a good way be to only get the last changes with clojure's io?' Anyone?

candiedcode18:07:28

@nnbosko are you asking how to get the last changes with just clojure io?

Nicolas Boskovic18:07:08

Or with a library, if there are any that specialize in that specific task

candiedcode18:07:54

looks like most of the libraries for clojure are using java filewatcher,

candiedcode18:07:09

you can use http://java.io and that’s what tower does so you can check that code out

Alex Miller (Clojure team)18:07:04

I think watchtower uses the old http://java.io facilities which are known to have some issues whereas clojure-watch uses the newer and better nio2 stuff added in java 7

semperos20:07:32

in Clojure 1.9, is there an intentional change being made to destructuring and type hints? to avoid reflection, I’m seeing the following (faked class names):

;; works under 1.8, but not 1.9
(extend-type clojure.lang.APersistentMap
  IQuery
  (execute [{:keys [^RawConnection connection]} ^RawQuery query]
    (.query connection query)))

;; works under 1.9
(extend-type clojure.lang.APersistentMap
  IQuery
  (execute [{:keys [connection]} ^RawQuery query]
    (.query ^RawConnection connection query)))

semperos20:07:53

under 1.8 the type hint could be added in the destructuring, in 1.9.0-alpha10 that appears to have no effect

harold20:07:16

Is there a way in clojure.test to get a report of how long each individual deftest took to run in a large run kicked off, say, by lein test?

Alex Miller (Clojure team)20:07:55

@semperos that’s a regression in the namespaced key destructuring (so dates to alpha8), I’ve already built a patch for it that will be in the next alpha

Alex Miller (Clojure team)20:07:25

(and added a test so we won’t miss it next time)

ag22:07:40

if I have a function that takes a value and function fn' as an optional argument and uses a threading macro to transform the value, how do I apply fn’ (if it exists) inside that threading macro?

dg22:07:01

Could you use a multi-arity function?

(defn sample
  ([x] (-> x inc))
  ([x fn'] (sample (fn' x))))

ag22:07:29

oh.. right I completely forgot about multi-arity!

ag22:07:53

but I still would like to find answer to my question, just curious is there a way for noop kind of thing inside a threading macro

dg22:07:21

The only thing I can think of is https://github.com/LonoCloud/synthread 's ->/when macro.

ag22:07:00

Thanks @dg I’ll check that

harold23:07:14

@ag - check out cond-> as well, it is amenable to conditional application of threading steps.