clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
dharrigan 2021-06-23T06:09:06.165200Z

Good Morning Clojurists!

djm 2021-06-23T06:18:53.165400Z

👋

RAMart 2021-06-23T06:34:32.165700Z

fel-mazo 2021-06-23T06:34:38.165800Z

thanks ! I'll have a look !

RAMart 2021-06-23T06:57:20.166200Z

Second :clojureD 2021 talk now online: "Your own fast, native Clojure scripting CLI with GraalVM and SCI" by @borkdude https://www.youtube.com/watch?v=L2LAaQBVvxM

🍻 5
👏 11
1
gklijs 2021-06-23T07:18:45.166800Z

Good morning

pez 2021-06-23T07:37:50.167200Z

Morning!

jasonbell 2021-06-23T07:40:55.167400Z

Morning

thomas 2021-06-23T08:02:44.168200Z

morning

ordnungswidrig 2021-06-23T08:34:31.168500Z

good morning!

orestis 2021-06-23T08:35:12.168700Z

morning

2021-06-23T09:11:47.168900Z

Morning

raymcdermott 2021-06-23T09:13:44.169200Z

morning

agigao 2021-06-23T10:33:23.169600Z

Morning

borkdude 2021-06-23T10:34:11.169800Z

Morning

mccraigmccraig 2021-06-23T10:50:24.170100Z

maaaaning

javahippie 2021-06-23T11:24:53.170400Z

Morning!

slipset 2021-06-23T11:41:53.171200Z

Good morning and such. TIL manqué is in fact an english adjective, meaning >  Having failed to become what one might have been. What a poetic word. Erik Assum, a creator of bugs, a programmer manqué.

pez 2021-06-23T11:49:27.171700Z

Thought you said it was an adjective?

pez 2021-06-23T11:52:24.172700Z

I’m confused now. Google also gives such an example, and Wikipedia has: > A Manqué is a person who has failed to live up to a specific expectation or ambition. It is usually used in combination with a profession: for example, a career civil servant with political prowess who nonetheless never attained political office might be described as a “politician manqué“.

pez 2021-06-23T12:05:05.173700Z

Ah, used postpositively. Now scrambling for an adjective like that in Swedish. Drawing blank.

pez 2021-06-23T12:06:36.174700Z

I think we can do it for stylistic effect with about any adjective…

val_waeselynck 2021-06-23T18:31:34.176100Z

As an aside: "postpositively" is such a preposterous word

😂 1
slipset 2021-06-23T20:32:15.176700Z

One of my favourite Clojure gotchas has been showing up in the logs, stemming from this code:

slipset 2021-06-23T20:37:10.181600Z

(apply max l)
Which works nicely except when it doesn’t. l is a list of natural ints, so we can use a wee bit of algebra here, and fix it, since we know that 0 is the identity value for max over natural ints, so we can do:
(apply max (conj l 0))
Of course a colleague of mine pointed me to a much nicer solution:
(reduce max 0 l)
which shows that max, 0, and the natural ints form a monoid, since max is also associative.

🤯 1
vemv 2021-06-25T07:46:37.197500Z

> Which works nicely except when it doesn’t. oh TIL :) (or am about to L) in which case it doesn't?

slipset 2021-06-25T10:25:36.203500Z

when l is nil

👍 1
slipset 2021-06-25T10:25:49.203700Z

Since max isn’t defined for (max)

slipset 2021-06-25T10:26:49.203900Z

Which almost brings you into dependent types land if you squint a bit 🙂

vemv 2021-06-25T10:30:58.204500Z

a spec a day keeps the dependent away 😄

slipset 2021-06-25T15:06:02.210700Z

That’s a hard spec to write, since the spec needs to be written for apply.

borkdude 2021-06-23T21:14:53.182800Z

and that works until you don't deal with natural ints ;)

slipset 2021-06-24T08:49:17.187600Z

Jup. a safer thing would be to use negative infinity as the identity value.

borkdude 2021-06-24T08:53:00.188200Z

ah yes:

user=> (reduce max ##-Inf [1 2 -10 -10M 10M] )
10M

slipset 2021-06-24T09:17:25.188600Z

And, of course, max also has a zero value, ##Inf

borkdude 2021-06-24T09:19:31.188800Z

in computers this may work, but in math, this is flawed

slipset 2021-06-24T09:19:47.189Z

How so in maths?

borkdude 2021-06-24T09:20:34.189200Z

in math you can't treat ##Inf as one value

slipset 2021-06-24T09:20:56.189400Z

Well I guess if you go in to talking about which infinities are larger and such, like is #Inf * #Inf > #Inf and such nonsense 🙂

borkdude 2021-06-24T09:21:03.189600Z

math would say like Clojure: you can't take the value of a macro, but then for Inf

val_waeselynck 2021-06-23T22:05:54.183900Z

Fortunately, on the JVM, relative integers have a smallest element