[CLJ-1035] Remove the need to use ":import" of a record Created: 29/Jul/12 Updated: 10/Aug/12 Resolved: 10/Aug/12
|Affects Version/s:||Release 1.4|
Right now if I need to use a record defined in another name space, I need to do this:
Hope we can remove the need of ":import" clause.
|Comment by Stuart Halloway [ 10/Aug/12 12:44 PM ]|
Importing a Java class and using a record are two logically distinct ideas, hence two separate steps in your code. Note that using a namespace makes the defrecord constructor fns (e.g.
Please discuss ideas on the mailing list before using JIRA to make suggestions.
|Comment by Warren Lynn [ 10/Aug/12 2:19 PM ]|
Thanks for giving it a thought.
I think it is conceptually simple/consistent to say "if you use a namespace, then all the public symbols in that namespace is available without namespace qualification". It is unnecessary to remind people "Hey, record is an actually a Java class so the rules do not apply". I think it is the right choice for Clojure to integrate closely with the host language, but it is not the objective to expose the host details when not needed. If you say "this is a compromise due to some implementation consideration", then I can understand. But I disagree with the rationale you mentioned.