clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
jiriknesl 2020-09-29T04:12:12.060800Z

Morning

dharrigan 2020-09-29T05:55:26.061Z

Good Morning!

mccraigmccraig 2020-09-29T06:21:34.061200Z

månmån

mccraigmccraig 2020-09-29T08:21:18.062200Z

well that was a fun macro...

mccraigmccraig 2020-09-29T08:22:22.062700Z

i would have been lost without the internet ( https://turbofuture.com/computers/Clojure-macro-writing-macros )

alexlynham 2020-09-29T09:21:51.063400Z

morning

2020-09-29T09:35:16.063500Z

what is mlet?

2020-09-29T09:35:44.063700Z

not that I'm condoning this sort of disgraceful behaviour...

2020-09-29T09:37:08.064Z

I do enjoy the way the Clojure makes macros visually look like you are swearing

mccraigmccraig 2020-09-29T09:42:59.064200Z

mlet is monadic-let... like the do syntax in haskell, a nice way of composing bind operations

2020-09-29T11:03:18.065200Z

this is bonkers https://www.bbc.co.uk/news/uk-england-54331994 I can't get it though my > I believe that filter

2020-09-29T11:05:08.065600Z

but what a great way to cheat at your munro bagging

2020-09-29T11:05:44.066100Z

doesn't say how long the fuel lasts for of course

2020-09-29T11:06:09.066700Z

presumably they have to hike back down the hill lugging the rocket engines

mccraigmccraig 2020-09-29T12:43:51.069Z

opinion solicited: put protocols in a separate namespace to avoid recompilation dependency issues during dev, or leave them in their "natural" namespace and use c.t.n.r/refresh when things get screwy ?

wotbrew 2020-09-30T07:44:14.074500Z

if you are working on a lib there are good reasons to keep the protocols exactly where you want them (say if they form part of the api, expectation user will extend them). and absolutely repl convenience has to take a back seat during lib dev. I was talking from an application development standpoint, where repl convenience I think has to win out a bit more

dominicm 2020-09-30T08:02:43.075200Z

Sounds like the lib and the application agree here though?

mccraigmccraig 2020-09-30T08:10:56.075400Z

as it turned out, most of the protocol fn invocations were already hidden behind macros (which fill in a context param), so moving the protocols to another ns was straightforward

wotbrew 2020-09-29T12:57:22.069400Z

protocols on their own are never dependent on anything so can be require'd from anywhere, so in an application I always put them in their own file to avoid headaches.

mccraigmccraig 2020-09-29T13:03:01.069700Z

but are there any headaches other than the protocol getting recompiled mandating the recompilation of everything that uses it ?

mccraigmccraig 2020-09-29T13:04:30.069900Z

i've always done the same, put them in a separate file, but i'm wondering if there's any need now that c.t.n.r/refresh exists

wotbrew 2020-09-29T13:09:46.070100Z

I mean maybe I have live objects in my repl I do not want to discard and recreate

mccraigmccraig 2020-09-29T13:13:28.070300Z

ah, ok, interesting. i don't really do that

mccraigmccraig 2020-09-29T13:17:22.070500Z

but still, that concern affects the code you are working on, but not libs you consume... so you wouldn't really care if some lib didn't separate out its protocols ?

dominicm 2020-09-29T13:31:59.070700Z

Clojure uses separate file, with function elsewhere. That allows you to do useful things like swapping arguments or adding specific overrides.

mccraigmccraig 2020-09-29T14:24:20.070900Z

ah, yeah, in the style of reduce-kv

dharrigan 2020-09-29T17:57:14.071600Z

I found this a bit funny

dharrigan 2020-09-29T17:57:25.071800Z

<https://noyaml.com/>

dharrigan 2020-09-29T17:57:45.072300Z

there are apparently 63 ways of writing a multi-line string in yaml

dominicm 2020-09-29T18:57:46.072600Z

Yaml is a bit excessive 😀