Details
-
Type:
Enhancement
-
Status:
Closed
-
Resolution: Declined
-
Affects Version/s: None
-
Fix Version/s: Backlog
-
Component/s: None
-
Labels:None
Description
This seems unfortunate:
=> (-> :foo str keyword)
::foo
Symbols are far saner in this regard:
=> (-> 'foo str symbol)
foo
Simply stripping leading colons from strings prior to turning them into keywords should suffice. The 2-arity Keyword.intern method and clojure.core/keyword fn should be left intact, so as to provide an escape hatch for those that really do need colon-prefixed keywords.
After thinking about this for a while, I've now reversed my position, and am in favor or retaining the current functionality. Thanks for the pushback.
As for throwing exceptions on colon-prefixed, un-namespaced keywords, I'm not certain that that's a good idea. People use keywords to hold all sorts of data, use them as map keys and lookup fns, etc.