[CLJ-835] defmulti doc string doesn't mention needing to be passed a var for the value of :hierarchy Created: 02/Sep/11 Updated: 19/Dec/12 |
|
| Status: | Open |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.2 |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Hugo Duncan | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
1.2, 1.3 beta3 |
||
| Attachments: |
|
| Patch: | Code |
| Approval: | Incomplete |
| Description |
|
The :hierarchy option for defmulti should be passed a var, but this is not mentioned in the doc string. The error message from passing the hierarchy directly is rather cryptic: Evaluation aborted on java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.IRef (SOURCE_FORM_44:19). |
| Comments |
| Comment by Meikel Brandmeyer [ 14/Sep/11 3:11 PM ] |
|
Modified doctoring to clarify the usage of :hierarchy. |
| Comment by Scott Lowe [ 10/May/12 5:16 PM ] |
|
New patch: '0001-CLJ-835-Refine-doc-string-for-defmulti-hierarchy-opt.patch' 10/May/12. I've attached a new doc string patch in response to Andy Fingerhut's request posted here: https://groups.google.com/forum/?fromgroups#!topic/clojure-dev/i7H82fJYL-U Andy's request stated "Attached patch seems to have spelling mistakes, and perhaps could be worded more clearly." I hope my new patch is an improvement upon what was there. This patch supersedes '0001-Clarify-docstring-for-defmulti.patch' from 14/Sep/11. |
| Comment by Fogus [ 16/Aug/12 2:49 PM ] |
|
This is a million times better than what was there before, but (who knew!?) it could be better. A couple points of contention:
|
| Comment by Rich Hickey [ 19/Dec/12 7:58 AM ] |
|
Please leave examples out of docs strings. Use precise language. |