[spec] clojure.spec/def should support an optional doc-string

Description

Like clojure.core/def clojure.spec/def should support an optional doc string because one usually likes to describe specs in more detail as one could through keyword naming.

Environment

None

Activity

Show:
import
November 3, 2016, 10:23 PM

Comment made by: dergutemoritz

Building on this idea, I suggest to add first-class metadata support to registered specs and implement doc strings in terms of that (i.e. the same way as with vars).

import
April 1, 2017, 11:02 PM

Comment made by: emergent-behavior

Hi! Was just discussing the potential for a feature like this with a colleague. What's the current status? Was thinking of potentially working on it but wanted to get feedback and guidance from the community first.

Alex Miller
April 3, 2017, 3:32 PM

We don't have a recommended approach to this yet so not looking for a patch at this time.

import
June 20, 2018, 1:30 AM

Comment made by: floybix

If you're prioritising this, please also remember the need for source (file + line) metadata on specs. This would enable us to use specs in auto generated documentation which is really nice, especially when you can hyperlink to nested specs. See https://dev.clojure.org/jira/browse/CLJ-2037

Assignee

Unassigned

Reporter

Alexander Kiel

Labels

Approval

Vetted

Patch

None

Affects versions

Priority

Critical
Configure