Fork me on GitHub
#off-topic
<
2019-05-20
>
jaihindhreddy13:05:06

1️⃣ Clojurians 2️⃣ Clojurists Which do you prefer?

2️⃣ 28
1️⃣ 36
🤷 24
Daniel Hines13:05:11

It depends. When identifying as a member of the Clojure community, 1️⃣. When identifying as Clojure programmer to non-Clojure people, 2️⃣.

4
👍 4
Stefan14:05:47

As a beginner in Clojure: why? 🙂

Daniel Hines14:05:48

Classic Clojure way of solving these issues: consult an etymological dictionary. https://www.etymonline.com/word/-ian#etymonline_v_34526 The entry is a little unclear, but look at the “Related Entries”: “algonquian amazonian antichristian apollonian…”

Daniel Hines14:05:47

“one who does or makes”, from Greek “-istes”, the agent-noun ending.

henrik15:05:37

We've been over this, it's "clojocytes". As in, "the Java codebase was devoured by clojocytes".

👍 4
😂 4
Daniel Hines15:05:39

Are individual clojocytes part of a superorgansim then?

Bobbi Towers15:05:53

The former makes me think "librarian". The latter makes me think "terrorist". So in other words, it depends on my current mood

ben15:05:58

Clojeur?

Nicholas Griffen15:05:12

Call me old fashioned but how about Clojure Users?

jaide15:05:57

This is what happens when a core is too stable. We spend our time endlessly debating how to refer to ourselves 😆

💯 24
4
agigao11:05:21

what about Clojurusts?)))

jaide15:05:58

Say you’re implementing something like get_in in Python. Do you make it return None when the path cannot be found or would you go for raising an exception?

borkdude16:05:20

@jayzawrotny clojure returns nil

jaide16:05:38

That’s true. However, most of the Clojure core is written to support nil as arguments where as that’s not really the case in Python.

jaide16:05:55

(:pizza {}) => nil but in Python {}['pizza'] raises a KeyError.

borkdude16:05:36

maybe make two variants, one which raises an error and another which returns None?

borkdude16:05:54

I think it depends mostly on what you want out of it yourself 🙂

jaide16:05:43

That’s a solid option 🙂 I just thought it was an interesting discussion topic since you have to think if it’s better to be consistent with Clojure or be Pythonic where it makes sense.

borkdude16:05:23

if you market the library as clojure core functions for Python, then I would stick to the Clojure idioms

Alex Miller (Clojure team)16:05:43

Clojure also has the not-found arity

Alex Miller (Clojure team)16:05:09

so by default you get nil (useful for conditions) but allows you to distinguish nil vs not-found when needed

borkdude16:05:39

it might be also be worth looking at https://github.com/appliedsciencestudio/js-interop which does the same for JS

Alex Miller (Clojure team)16:05:49

for Clojure's "open maps" philosophy, error does not make sense

jaide19:05:16

What does “open maps” mean? My guess is that they may have less or more than expected keys?

dominicm19:05:43

Doesn't python have a .get? I would copy those semantics

Alex Miller (Clojure team)19:05:08

it means the set of keys is not fixed - all maps may have missed attributes or extra attributes. so failing to find an attribute isn't an error, it's just that attribute isn't present and so you get nil

Alex Miller (Clojure team)19:05:39

even records in Clojure, while having a fixed set of known attributes, can carry extra attributes

borkdude19:05:31

although taking away required keys is considered breakage, and adding keys is always compatible

jaide19:05:21

@U09LZR36F Yes, Python has a .get on dictionaries which take an optional second argument as an optional value. But here is an opportunity to move things in a data-driven, functional-programming inspired direction. Especially since it should support lists and dictionaries. I hope people understand my hesitation in how clojure vs pythonic I should go with this. I am trying to think through the consequences of both approaches.

jaide19:05:01

Also, for context, this is not a Clojure inspired library for Python. Only a util function in the codebase at work. While the idea of such a library is appealing, I am concerned I would likely misrepresent Clojure.

borkdude19:05:34

@jayzawrotny I guess it’s in the same vein as js-interop which I already mentioned?

jaide20:05:46

@U04V15CAJ That’s correct. This just reminded me that in Pyton {}[‘pizza’] => KeyError but {}.get(‘pizza’) => None.

jaide20:05:56

Ok, now I see more value in dominicm and borkdude’s points. It should probably behave more like .get and not throw an error. If needed I could wrap it in another function like get_in_or_error to throw. Much easier to go this way than the other way.

jaide20:05:03

Thanks so much for helping me think through this. You never know the implications of “I’ll just do it like Clojure” for long term maintenance and stability for other languages.

Ivan Koz19:05:25

"I want to belie-" garbage collects into a hill "We picked up the weather balloon"