@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
can you be concrete with what you have at the point where you're making a kw?
I also regularly need (symbol (namespace ...))
and (symbol (name ...)
when I want to go from a qualified sym to a {namespace {name ...}}
structure
really, the best thing to do is to make this a request on http://ask.clojure.org with more information
ask is the forum we have to receive requests, and allow people to voice interest via voting
so as a blanket future piece of advice, that is a better place to ask these kinds of things than here
ok will do
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!
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
based on the frequency of ask, I think there are definite desires around adding/removing/changing qualifiers (probably mostly in kws) too
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
There are some parts that I feel would benefit from some blank lines or a better indentation or something like that.
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
@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.
His code is self-consistent, even if the indentation and spacing is unusual π
@seancorfield Thanks for the prompt reply. I was imagining it, I was just curious about that π
Donβt change formatting of lines otherwise untouched in your patch and Iβm sure someone can help you ensure it matches
I'm not gonna send any patch at all β very far from that
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).
@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
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.
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!).