Fork me on GitHub
#clojure-dev
<
2018-11-03
>
andy.fingerhut00:11:53

I am pretty sure that clojure.data/diff use doesn't require sets back now, but would work ok if it got sets back instead of a sequence like it does now.

andy.fingerhut00:11:15

There is a patch for a JIRA ticket I wrote that changes clojure.data/diff to coerce the args it sends to clojure.set functions to sets inside of clojure.data/diff code, and it passes all tests, but don't recall if the code path is exercised in existing automated sets, so that may not mean much.

schmee12:11:22

@alexmiller here’s another example for the 1.10 error handling improvements (tested on 1.10-beta4) 🙂

user=> (let [{keys [a b]} {}])
Syntax error compiling at (1:1).
Unable to resolve symbol: a in this context
user=> (let [{:keys [a b]} {}])
nil

Alex Miller (Clojure team)12:11:49

Some more changes coming shortly with CLJ-2420... won’t change this much though

borkdude12:11:29

Are instance? checks as good as free? If not, it might make sense to only coerce certain places of set functions to ensure the output is a set, e.g. the first set that goes into the final reduce

Alex Miller (Clojure team)12:11:22

They’re not free but they are pretty optimized in the jvm

borkdude12:11:39

a lot of set functions first do a count on the inputs, to decide what set to start with. I guess if the input aren’t sets, it may make sense to have them coerced before you do that… or not… worth a perf test 😉

tristefigure18:11:15

>alexmiller [10:04 PM] >also, you might notice that symbol can now take a var or a keyword … and tehre was much rejoicing >

user=> (symbol #'+)
>clojure.core/+
I have a Proposal for fuller round-trips between clojure.core's name, symbol and keyword functions with strings, symbols, keywords, vars and namespaces https://gist.github.com/TristeFigure/0e6e9f7834339288425c6dd62d368635

Alex Miller (Clojure team)18:11:07

can you start with a problem and describe the proposal? I don’t have time to read all that and infer it.

tristefigure18:11:22

generalizing the rejoincing of (symbol #'+), extending it to keyword & name, and adding support for namespaces.

tristefigure18:11:32

Benefice: I don't have to delve into the java interfaces and remember when to use the .sym, .ns, .getName .toSymbol, etc.. methods

seancorfield19:11:54

@tristefigure In eight years of writing production Clojure I don't recall ever needing to call any of those Java methods on things. What sort of code are you writing where you run into that level of interop because you can't just use "plain ol' Clojure" functions?

seancorfield19:11:56

I guess we could turn it around and ask @alexmiller what problem was solved by making those changes?

Alex Miller (Clojure team)19:11:49

Comes up all the time when doing a lot of macrology, var to symbol is particularly common - it’s all over spec and core in various places and there has never been a convenient way to do this, other than diving into Java fields

💯 4
Alex Miller (Clojure team)19:11:43

I’m still not clear what problems you’re trying to solve above or what changes are being proposed

tristefigure19:11:55

It's just to enhance homogeneity and symmetry of these functions. They should apply to anything that can either be used as a name (strings, keywords, symbols) or deemed as having a name (vars, namespaces). The changes: https://gist.github.com/TristeFigure/0e6e9f7834339288425c6dd62d368635#file-explore_round_trips-clj-L170 https://gist.github.com/TristeFigure/0e6e9f7834339288425c6dd62d368635#file-explore_round_trips-clj-L186 https://gist.github.com/TristeFigure/0e6e9f7834339288425c6dd62d368635#file-explore_round_trips-clj-L205 (i can also provide a patch for this if someone can provide me the canonical git expression to do so).

seancorfield19:11:47

"It's just to enhance homogeneity and symmetry of these functions." -- but that's not an actual problem in and of itself.

andy.fingerhut20:11:33

It is very common to think of the situation "I don't want to have to remember the asymmetric restrictions when converting between this collection of types" as a problem that seems easily solvable via removing those restrictions. In the end, is it reasonable to say that what is a problem, and what isn't, addressed via Clojure core is a judgement call, and part of what we almost always love about Clojure are the judgement calls of the core team?

andy.fingerhut20:11:14

(except when we disagree with the judgement calls, in which case we easily get a bee in our bonnet that lasts for years) ("we" meaning me, really -- not pointing fingers at others here)

andy.fingerhut20:11:52

FYI, instructions for creating patches in the form expected for Clojure JIRA tickets are on this page (search for 'format-patch', but the instructions shortly before that are relevant, too): https://dev.clojure.org/display/community/Developing+Patches

tristefigure20:11:16

Here is an interesting github search that tries to locate conversions from Namespace to Symbol/String (half of it is noise though) https://github.com/search?utf8=%E2%9C%93&amp;q=ns+getName+language%3AClojure&amp;type=Code Looking at it, it seems Class -> Symbol/String is also often used.

andy.fingerhut20:11:27

You are welcome to create a JIRA ticket describing what you see as the problem, and even proposed solutions and/or a patch. The following is a mantra I need to repeat to myself more often: What I want isn't necessarily what the owner of Clojure wants, and owners get to choose.

andy.fingerhut20:11:35

And further: "Nor is anyone obligated to explain to my satisfaction why they chose something else." Many people will choose to oblige me on many many points on reasons why, but if I have more questions, sometimes they are answered, sometimes not.

andy.fingerhut21:11:18

I should probably transcribe this lecture some time: https://www.youtube.com/watch?v=o_4EX4dPppA&amp;list=PLZHVMsQ--OdDzG6M64HL2gARKPgfams0G&amp;t=1s&amp;index=9 I'm not sure I will agree on all of his analysis for why some attitudes are prevalent today, but his explanations for what conflict situations feel like from the perspective of an open source project creator and maintainer are pretty clear and reasonable.

tristefigure21:11:08

I'm not like you, trying to push anything

andy.fingerhut21:11:41

That is good. I am not claiming you were.

andy.fingerhut21:11:00

Whether someone is or not is not easy to say for someone else.

tristefigure21:11:11

I see the ashes, I see the algae up the palm-trees and am stepping back slowly

andy.fingerhut21:11:12

I am curious to know what that might be a reference to, if it is. Not familiar phrases to me.

seancorfield02:11:27

Plus 💯 for posting a transcription of Evan's talk. As a long-time open source project maintainer and contributor it really resonated with me!

andy.fingerhut02:11:26

If/when it is done, I will send a link to #announcements channel, Sean.

andy.fingerhut02:11:50

@tristefigure Sorry if I came on way too strong in my responses there. Not trying to scare you away, but perhaps I've already stepped over a line.