Clojure

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

Details

  • Type: Feature Feature
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: Release 1.9
  • Fix Version/s: Release 1.10
  • Component/s: None
  • Labels:
  • Approval:
    Vetted

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.

Activity

Hide
Moritz Heidkamp added a comment -

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).

Show
Moritz Heidkamp added a comment - 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).
Hide
Josh Brandoff added a comment -

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.

Show
Josh Brandoff added a comment - 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.
Hide
Alex Miller added a comment -

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

Show
Alex Miller added a comment - We don't have a recommended approach to this yet so not looking for a patch at this time.
Hide
Felix Andrews added a comment -

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 CLJ-2037 https://dev.clojure.org/jira/browse/CLJ-2037

Show
Felix Andrews added a comment - 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 CLJ-2037 https://dev.clojure.org/jira/browse/CLJ-2037

People

Vote (60)
Watch (26)

Dates

  • Created:
    Updated: