Last active
January 6, 2019 21:13
-
-
Save borkdude/4d7a2c7fcbb4d4a124be98fa16b557e7 to your computer and use it in GitHub Desktop.
Speculative + Expound in Klipse
This file contains hidden or 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 '[cljs.spec.alpha :as s]) | |
(require '[cljs.spec.test.alpha :as stest]) | |
(require '[expound.alpha :as expound]) | |
(require '[speculative.instrument :refer [instrument]]) | |
(require '[clojure.string :as str]) | |
(defonce instrument-fns | |
(do (set! s/*explain-out* (expound/custom-printer | |
{:show-valid-values? true})) | |
(eval (cons 'do (for [sym speculative.impl.syms/instrumentable-syms-cljs] | |
`(stest/instrument-1 [:quote ~sym])))))) | |
(try | |
;; insert your call here | |
;; choose of the functions listed in the bottom left quadrant | |
(subs "foo" -1) | |
(catch :default e | |
(println e))) | |
speculative.impl.syms/instrumentable-syms-cljs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment