clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
2020-11-11T15:17:11.196500Z

@alexmiller on a number of occasion we build qualified keywords from simple ones, so I do not know about useful, I think it would be more of a convenience to avoid having to do the extra conversion back to a string

alexmiller 2020-11-11T15:24:11.197Z

can you be concrete with what you have at the point where you're making a kw?

borkdude 2020-11-11T15:26:29.198600Z

I also regularly need (symbol (namespace ...)) and (symbol (name ...) when I want to go from a qualified sym to a {namespace {name ...}} structure

alexmiller 2020-11-11T15:26:32.198700Z

really, the best thing to do is to make this a request on http://ask.clojure.org with more information

alexmiller 2020-11-11T15:27:17.199100Z

ask is the forum we have to receive requests, and allow people to voice interest via voting

alexmiller 2020-11-11T15:27:42.199700Z

so as a blanket future piece of advice, that is a better place to ask these kinds of things than here

2020-11-11T15:34:51.199900Z

ok will do

seancorfield 2020-11-11T17:10:40.201300Z

I have quite a bit of code that goes back and forth between symbols and keywords, as well as transforming keywords, but I think it's good that Clojure requires us to be explicit about that. And I'll post this as an answer on http://ask.clojure.org if I see this question raised there!

alexmiller 2020-11-11T18:22:37.202400Z

we have expanded some of these conversion options in recent releases (vars to symbols was the worst one). I don't think we're opposed to adding more, but it's a matter of looking at what's needed/useful/common

alexmiller 2020-11-11T18:23:29.203200Z

based on the frequency of ask, I think there are definite desires around adding/removing/changing qualifiers (probably mostly in kws) too

βœ”οΈ 2
vncz 2020-11-11T22:46:48.204800Z

Likely a stupid question, but still asking out of curiosity: is there a style guide for the Clojure codebase? I'm looking around some java files and I struggle read it through it

vncz 2020-11-11T22:47:11.205400Z

There are some parts that I feel would benefit from some blank lines or a better indentation or something like that.

vncz 2020-11-11T22:48:08.206400Z

Some instances: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Atom.java#L49 (indentation) https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Atom.java#L52 (new lines) https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Atom.java#L53 (spacing) I know de gustibus not disputandum est β€” I'm just curious what is the rationale

seancorfield 2020-11-11T22:57:20.208Z

@vincenz.chianese Rich has a somewhat unique style for his Java code but the core team have made it clear that they won't accept patches to change the layout. You get used to reading it, over time.

seancorfield 2020-11-11T22:58:35.208500Z

His code is self-consistent, even if the indentation and spacing is unusual πŸ™‚

vncz 2020-11-11T23:28:00.208900Z

@seancorfield Thanks for the prompt reply. I was imagining it, I was just curious about that πŸ™‚

dpsutton 2020-11-11T23:29:16.209900Z

Don’t change formatting of lines otherwise untouched in your patch and I’m sure someone can help you ensure it matches

vncz 2020-11-11T23:29:43.210200Z

I'm not gonna send any patch at all β€” very far from that

2020-11-11T23:45:31.211500Z

Most inconsistencies in the indentation style of the Java code were I believe introduced in patches from others. The original Java code is pretty much all in Whitesmith's style: https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style (which I had strangely never seen in 25 years of curly brace language exposure before seeing Rich's code).

souenzzo 2020-11-12T10:52:34.213500Z

@vincenz.chianese If you ever format your code "after a commit", you will lost many information about your codebase. https://erikbern.com/2016/12/05/the-half-life-of-code.html

2020-11-11T23:46:30.211800Z

If it bugs you when reading the code, you can always run a tool like indent on it to put it into a different indentation style, in your own local copy.

seancorfield 2020-11-11T23:58:08.212400Z

Ah, Whitesmith's... that brings back memories! And, yeah, that might explain why an old hand like Rich uses that style (so... not unique, but just a very old, "traditional" style!).