Details
-
Type:
Enhancement
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Declined
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Approval:Not Approved
Description
1. There are some ugly and unnecessary – but harmless – inconsistencies between Symbol and Keyword:
(.run 'foo); => ArityException Wrong number of args (0) passed to: Symbol clojure.lang.AFn.throwArity (AFn.java:437) (.run :foo); => UnsupportedOperationException clojure.lang.Keyword.run (Keyword.java:97) (.call 'foo); => ArityException Wrong number of args (0) passed to: Symbol clojure.lang.AFn.throwArity (AFn.java:437) (.call :foo); => IllegalArgumentException Wrong number of args passed to keyword: :foo clojure.lang.Keyword.throwArity (Keyword.java:88) (.invoke 'foo); => ArityException Wrong number of args (0) passed to: Symbol clojure.lang.AFn.throwArity (AFn.java:437) (.invoke :foo); => IllegalArgumentException Wrong number of args passed to keyword: :foo clojure.lang.Keyword.throwArity (Keyword.java:88)
2. Keyword.java contains a lot of code that has already been factored out to AFn.java.
I propose that Keyword is modified to extend AFn to resolve the above issues.
Attachments
Activity
Christoffer Sawicki
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | Make-Keyword-extend-AFn-just-like-Symbol.patch [ 11496 ] |
Stuart Halloway
made changes -
| Approval | Not Approved [ 10008 ] | |
| Issue Type | Defect [ 1 ] | Enhancement [ 4 ] |
Stuart Halloway
made changes -
| Resolution | Declined [ 2 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
Stuart Halloway
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
At first glance, it appears that there could be some code sharing here. But the attached patch changes the semantics of run, which is a non-starter.