Fork me on GitHub
#clojure-uk
<
2018-10-30
>
jasonbell08:10:33

Morning friends.

guy10:10:03

Morning!

danm11:10:38

Morning 🙂

👋 4
guy13:10:57

What do people prefer?

(map #(my-fn a b %) coll)

vs
(map (partial my-fn a b) coll)

otfrom13:10:49

I like partial

👍 20
thomas14:10:01

I'd go with (map #(.... %) coll)

guy14:10:04

What would be your reasoning? Also why would you go for partial @U0525KG62?

otfrom14:10:17

I think partial communicates something. To me it communicates that a function needs some helpers (either data or other functions or both) bound in before being used in a map/filter/other. I'd expect a bit more work to be done in an anonymous fn. I know not all agree w/me though.

❤️ 8
👍 4
thomas14:10:39

my reasoning is that I never really got partial so I don't really understand it... I do however understand anonymous functions.

thomas14:10:26

but @U0525KG62 explanation makes sense to me I have to admit, so maybe I might begin to understand it a bit more

guy14:10:53

ok thanks! I was similar too @U052852ES

thomas14:10:19

and with the anon function is slightly shorter and that appeals to me as well.

mccraigmccraig14:10:44

there are two types of people - those who think auto-currying is a great idea and the other, wrong, people trollface

thomas14:10:04

so for me it is more about how I feel about it... nothing particular rationalistic.

guy14:10:08

I had the same thoughts about the length as well tbh

thomas14:10:44

to me it seems simpler... as I don't (have to) understand partial

guy14:10:02

Going to ask a dumb question then, Why is auto-currying good?

mccraigmccraig15:10:13

you never need partial @U08TUA46M - leads to some very elegant code

👍 4
Ben Hammond15:10:17

to me, partial implies that you are expecting to support multiple arities.

mccraigmccraig15:10:38

auto-currying probably only works well with static checking though

👌 4
Ben Hammond15:10:46

partial will give you multiple arities, which is often not really what you want

guy15:10:14

Ok thanks everyone! Appreciate the thoughts 😄

Rachel Westmacott16:10:01

an anonymous function is more explicit about the arguments it expects

👍 8
Rachel Westmacott16:10:11

scope and context are important though

👍 4
rickmoynihan17:10:35

I’m a big fan of partial. Like @U0525KG62 I think it communicates something. In particular it communicates that the arguments are being applied left to right… i.e. there’s been some thought to the argument order. There are several reasons to prefer one argument order to another, but one reason is that argument order often reflects the time things are known… e.g. you’ll know the config or the database connection, before you know the runtime arguments; so (partial my-f db-connection) communicates that. #(f %1 %2) is easily mistaken for #(f %2 %1) in the noise.

👍 4
rickmoynihan17:10:04

I like to think about argument order when writing functions, and partial helps you do that, and apply some consistency.

alexlynham17:10:37

I think for things like db conns that I don't know all the args for yet I even use partials in python now tbh. However I see the merit of anon fns and use them if there's a need to be super declarative

alexlynham17:10:03

I guess my gut use of partial is probably from reading your code then Rick haha

😬 4
otfrom14:10:35

wow, fun when upgrading a patch version causes your test to fail

otfrom14:10:17

I think partial communicates something. To me it communicates that a function needs some helpers (either data or other functions or both) bound in before being used in a map/filter/other. I'd expect a bit more work to be done in an anonymous fn. I know not all agree w/me though.

❤️ 8
👍 4
practicalli-johnny15:10:18

I'm starting a beginners Clojure study group this weekend via the http://www.meetamentor.co.uk/ community, aimed at those just beginning Clojure or looking for a refresh. The MeetAMentor community is an off-shoot of the London Java Community. If you know anyone interested, please let them know. I will be sharing the content as we go along. Sign up form to join any of the MeetAMentor study groups - http://bcrw.typeform.com/to/VkChxI

3Jane15:10:37

Meetamentor idea looks cool 🙂 How’s the study group expected to work?

bronsa16:10:24

if anybody is interested i have a seated ticket for the king crimson show in London on Saturday -- I'd sell it at face value of 90£ (ticket goes for 82£ iirc, the rest is venue fees) -- i bought it a while ago before knowing that a friend of mine wanted to go too, so i bought 2 more so that we could sit nearby and I now find myself with an extra one

seancorfield16:10:46

Wish I was over there -- I'd take that!

🙂 8
jasonbell16:10:01

I’m pretty ready to burst into tears after reading that.

seancorfield16:10:43

I have a spare ticket to see Soft Machine in January (but, similarly, an ocean separates us 🙂 )

4
jasonbell16:10:42

I used to play in a band that opened with Hazard Profile Part 1 🙂 Then we’d launch in to Led Boots by Jeff Beck. I still have to listen to those tunes side by side.

jasonbell16:10:07

@bronsa @seancorfield Still not convinced of the new KC lineup, saw the double trio in 95/96 three times and it was just something else.

bronsa16:10:45

dunno, i only got to see them last year for the first time and they sounded insane -- a bit bummed out for the lack of Belew though

💯 4
bronsa16:10:01

i was skeptical of the triple drummer setup but they (surprisingly? it's KC after all) made it work, so curious to see what the fourth drummer will add this time

jasonbell16:10:21

Sooooo this appears to be the main “complaint” three drummers is too much, I’m not convinced. There are some 81/84 tunes that don’t completely work for me….. but I’d still go and see them live if I could.

rhinocratic22:10:37

Morning. 😐 Slightly surprised that the Venn diagram of Clojurians/King Crimson fans/Brompton owners seems to have a nontrivial overlap. Last saw KC at Shepherd's Bush Empire shortly after The ConstruKction of Light was released. Jolly good they were, too - but still wish I'd seen them when Bill Bruford was in the line-up. Would love to see them again, but there's no way I can be in London on Saturday!