Fork me on GitHub
#clojure-uk
<
2017-02-13
>
agile_geek07:02:18

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.

thomas08:02:49

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

tcoupland09:02:14

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
                                   channel-with-real-answers-hopefully)
                        (prn "Real answer didn't come back in time, do something!"))))
That's when I use them most anyhoo šŸ™‚

tcoupland09:02:45

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

agile_geek09:02:07

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.

agile_geek09:02:41

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!

agile_geek09:02:19

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

agile_geek09:02:35

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

tcoupland09:02:08

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

glenjamin09:02:00

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

agile_geek10:02:51

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

glenjamin11:02:26

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

thomas13:02:24

Welcome @mikepjb to the UK channel

korny13:02:31

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.

korny13:02:55

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

korny13:02:35

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.

korny13:02:50

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.

agile_geek14:02:49

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

glenjamin14:02:28

if youā€™re familiar with the problem then giving yourself arbitrary constraints can be interesting

glenjamin14:02:35

like: no ifs

otfrom14:02:53

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

mikepjb14:02:00

thanks @thomas - itā€™s long overdue!

thomas14:02:21

yes.. split it up.

paulspencerwilliams15:02:47

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

agile_geek18:02:25

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

geek-draven18:02:04

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 šŸ˜€

rickmoynihan23:02:06

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.