<< Back to previous view

[CLJ-901] implementation of doc macro in core.repl incorrect for special names... add one character to fix Created: 23/Dec/11  Updated: 01/Mar/13  Resolved: 28/Feb/12

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: Release 1.3
Fix Version/s: None

Type: Defect Priority: Trivial
Reporter: Daniel Eklund Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


 Description   

In the implementation of the doc macro in core.repl, the line:
(if-let [special-name ('{& fn catch try finally try} name)]
contains:{& fn catch try finally try} which is a hashmap.

It should be a set, and the line should read:
(if-let special-name ('#{& fn catch try finally try} name)

To see the bug at work:
user> (doc &)
-------------------------
clojure.core/fn
(fn name? [params*] exprs*)
(fn name? ([params*] exprs*) +)
Special Form
params => positional-params* , or positional-params* & next-param
positional-param => binding-form
next-param => binding-form
name => symbol

Defines a function

Please see http://clojure.org/special_forms#fn



 Comments   
Comment by Andy Fingerhut [ 17/Feb/12 12:06 AM ]

Daniel, I'm pretty sure it is intended to be a map, not a set. The goal is to show the same documentation for try whether you ask for the documentation of try, catch, or finally. Also, to show the documentation for fn if you ask for the documentation of &, since that symbol is only useful in arg lists in fn (or let). They could have put multiple entries in special-doc-map and not had that little map inside doc, but that little map avoided the need for such duplication.

Comment by Daniel Eklund [ 28/Feb/12 7:34 PM ]

100% agree. It was an incorrect report on my part. Thanks for clearing it up.

Comment by Andy Fingerhut [ 28/Feb/12 8:04 PM ]

Daniel asked me to change the state of the ticket, since he could not see how to (perhaps insufficient privileges). Not sure if it should be marked Closed or Resolved, so I'm picking Resolved.

Generated at Thu Nov 27 13:45:24 CST 2014 using JIRA 4.4#649-r158309.