Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Trivial
-
Resolution: Unresolved
-
Affects Version/s: Release 1.5
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Patch:Code
Description
user=> (source clojure.core.protocols/coll-reduce) Source not found
But since the protocol fn's var's metadata points to the protocol var, and the protocol var knows the file and line where it was defined, it would be trivial to improve 'source' to look like this:
user=> (source clojure.core.protocols/coll-reduce)
(defprotocol CollReduce
"Protocol for collection types that can implement reduce faster than
first/next recursion. Called by clojure.core/reduce. Baseline
implementation defined in terms of Iterable."
(coll-reduce [coll f] [coll f val]))
Attachments
Activity
Chouser
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Patch | Code [ 10001 ] | |
| Attachment | 0001-Add-support-for-protocol-fns-to-repl-source.-CLJ-1088.patch [ 11592 ] |
Chouser
made changes -
| Assignee | Chouser [ chouser@n01se.net ] |
Chouser
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Chouser
made changes -
| Status | In Progress [ 3 ] | Open [ 1 ] |
Chouser
made changes -
| Assignee | Chouser [ chouser@n01se.net ] |
Add one-line patch to clojure.repl/source so that it will find the protocol definition for a given protocol function.