Fork me on GitHub

My train cancelled this morning (some problem north of Newcastle) but slower 5 minute earlier train here so jumped on that. Always amuses me that this train leave earlier but arrive 20 mins later....stops at every cattle station on the way down.


the few times I used core.aync I never had the need to use the various alt(s)(!!) forms.... so no idea what they actually do


alt(s), is *alt*ernatives. Do one of these things. Often most useful when you want a timeout:

(let [[val port] (async/alts!! [channel-with-real-answers-hopefully
                                                    (async/timeout 1000])]
                      (when-not (= port
                        (prn "Real answer didn't come back in time, do something!"))))
That's when I use them most anyhoo 🙂


you probably knew that, just in over helpful monday mood i guess, the sun is finally shining


I know what they do, intellectually, but I always spend ages trying to get go blocks to correctly return values I need especially when alt(s) are in their some where. It's not that I don't know what they do .... I just have no intuitive grasp of how to construct various non-blocking channel operations...I have this mental blank on them. I've used core.async a fair amount but it literally takes me hours to get back into understanding it.


I don't think I've found a convenient mental model yet. The conveyor belt mental model just doesn't express the subtle semantics of non-blocking operations and go blocks returning channels!


I have much less problem when they're blocking puts and takes.


I think I need more practice....or I need to write a blog on it as that usually solidifies concepts for me.


they're definitely something that can get away from you if your not careful, so easy to create a web of chans, loops and blocks that is near impossible to think through. A little goes a long way i guess


i don’t think it’s any different from doing IO ops in java-land, except the channels make the async work explicit in a similar way to haskell’s IO


@glenjamin I find it very different. Hence the mental block


I mean’t the execution is probably similar, but it forces you to consider which things do IO work - which is the friction


Welcome @mikepjb to the UK channel


re: discussion the other day about dojos - I’m not going to be doing evening stuff for a while because baby; but one observation I had about dojos is that when I was going to them, we used to repeatedly have some extremely new people attending.


Which could be fun, but ultimately they were almost as well off just doing group 4clojure tasks as trying to actually solve a puzzle.


And it could feel rather unrewarding for more experienced people - the usual pattern was: 1. people put up all sorts of cool problems on a wall 2. people vote for one that looks cool and interesting 3. you start work on it, and find that half the sub-group you are in haven’t even got a dev environment 4. after 2 hours you have a “hello world” working, and maybe 1/10 of the cool puzzle that was on the wall.


Sorry to be a grump; it just felt that dojos were rewarding for the totally new and the still-learning-basics, and I learned stuff from teaching people as well; but I didn’t feel I was gaining all that much myself.


@korny I feel similar...although I have fun teaching I hardly ever learn anything.


if you’re familiar with the problem then giving yourself arbitrary constraints can be interesting


like: no ifs


we've done newbie 4clojure groups before w/someone happy to tutor. No reason there couldn't be a more advanced group


thanks @thomas - it’s long overdue!


yes.. split it up.


@glenjamin good shout. I like constraints as a way of learning stuff.


@glenjamin I enjoyed implementing fizzbuzz with no conditionals at ifs no cond or case etc.


Myself and my colleague will hopefully be attending our first dojo at the end of the month - after over a year we're finally getting around to it, and it has nothing to do with the need for us to find new jobs 😀


I’ve run a few dojo’s/coding events at the Manchester Lambda Lounge — and clojure dojo’s before it - and found the same… usually too little time to focus a group on stuff… most of the time feels wasted. mostly useful to helping beginners start, which is good - but hard to get much more out of it than that. I tend to discourage those kind of events now - and prefer talks.