Clojure

Add support for undefining a spec

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Release 1.9
  • Fix Version/s: Release 1.9
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Screened

Description

Currently there is no way to remove a spec from the registry. During interactive development, particularly when working on complicated or recursive specs, it would be useful to have this ability.

Proposed: Make s/def take nil as a way to "clear" a spec:

user=> (s/def ::a string?)
:user/a
user=> (s/def ::a nil)
:user/a
user=> (s/get-spec ::a)
nil

Patch: clj-2060-4.patch

  1. clj-2060.patch
    16/Nov/16 11:55 AM
    0.7 kB
    Alex Miller
  2. clj-2060-2.patch
    10/May/17 1:03 PM
    0.9 kB
    Alex Miller
  3. clj-2060-3.patch
    19/May/17 2:41 PM
    3 kB
    Alex Miller
  4. clj-2060-4.patch
    29/Jun/17 4:25 PM
    3 kB
    Alex Miller

Activity

Hide
Alex Miller added a comment -

Moving to 1.9 so it will get looked at, may not be added.

Show
Alex Miller added a comment - Moving to 1.9 so it will get looked at, may not be added.
Hide
Alex Miller added a comment -

Updated patch to apply to spec.alpha

Show
Alex Miller added a comment - Updated patch to apply to spec.alpha
Hide
Alex Miller added a comment -

Update s/def docstring as well in -4 patch.

Show
Alex Miller added a comment - Update s/def docstring as well in -4 patch.

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated: