Created
September 7, 2018 01:43
-
-
Save bhb/1948bfca870fbc8758b515a4d0acc5ff to your computer and use it in GitHub Desktop.
Changing s/*explain-out* to control spec errors during macro-expansion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.spec.alpha :as s]) | |
(set! s/*explain-out* (fn [ed] (println "failed"))) | |
(let [x] 1) | |
;; with org.clojure/spec.alpha {:mvn/version "0.2.168"} : | |
;; CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec: | |
;; failed | |
;; #:clojure.spec.alpha{:problems [{:path [:args :bindings :init-expr], :reason "Insufficient input", :pred clojure.core/any?, :val (), :via [:clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/bindings], :in [0]}], :spec #object[clojure.spec.alpha$regex_spec_impl$reify__2499 0x749c877b "clojure.spec.alpha$regex_spec_impl$reify__2499@749c877b"], :value ([x] 1), :args ([x] 1)}, compiling:(NO_SOURCE_PATH:3:1) | |
;; with org.clojure/spec.alpha {:mvn/version "0.2.176"} : | |
;; CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec. #:clojure.spec.alpha{:problems [{:path [:bindings :init-expr], :reason "Insufficient input", :pred clojure.core/any?, :val (), :via [:clojure.core.specs.alpha/bindings :clojure.core.specs.alpha/bindings], :in [0]}], :spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x55b5f5d2 "clojure.spec.alpha$regex_spec_impl$reify__2509@55b5f5d2"], :value ([x] 1), :args ([x] 1)}, compiling:(NO_SOURCE_PATH:3:1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment