speced.def
speced.def copied to clipboard
spec-backed forms of defn/defprotocol/..., aided by metadata
## Brief Part of nedap/speced.def#70 ## QA plan ## Author checklist * [ ] I have QAed the functionality * [ ] The PR has a reasonably reviewable size and...
## Context speced.def is designed with toggleability in mind. One can add or remove `speced/`(those literal 7 chars) to existing forms written in vanilla Clojure and get desirable properties in...
## Context Attaching multiple specs to the same symbol is forbidden by u.s and made impossible by the Clojure reader (for some cases; but I don't want to create a...
## Context Generally it is recommended to disable instrumentations/preconditions in production systems: * It results in slower performance * It can result in an unfriendly UX * UIs shouldn't break...
## Brief When using `spec-assertion-thrown?` with a programmatic nilable spec, its spec key is not evaluated. Repro: ```clojure (ns repro (:require [clojure.spec.alpha :as spec] [clojure.test :refer :all] [nedap.utils.spec.api :refer [check!]]))...
## Context 'Promise' return values are non-trivial to spec: derefing them on `:post` would make that defn blocking, defeating the purpose of promises ## Task Implement `speced/promise` (a `promise` replacement),...
## Context `%` is not a very clear part of the Expound error reports. The `%` comes from the `:post` syntax, which is an impl detail users shouldn't necessarily be...
## Problem statement Currently no cljs option exists for this assert expression and the impl isn't bound by specs. ## Task - [ ] add `check!` around `impl.spec-assertion-thrown?`; note this...
## Problem statement Given a `speced` defn with user-provided `:pre`conditions: * both sources of preconditions will be correctly merged; but * the user ones take precedence. This means that more...
Use case: ```clojure (spec/def ::present-string? (complement string/blank?)) (speced/def ^::present-string? clojure-test-source (-> "clojure/test.clj" io/resource slurp)) ```