Skip to content

Instantly share code, notes, and snippets.

@borkdude
Last active January 6, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save borkdude/4d7a2c7fcbb4d4a124be98fa16b557e7 to your computer and use it in GitHub Desktop.
Save borkdude/4d7a2c7fcbb4d4a124be98fa16b557e7 to your computer and use it in GitHub Desktop.
Speculative + Expound in Klipse
(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