Fork me on GitHub
#specter
<
2016-10-31
>
kzeidler06:10:49

Specter looks really cool, but I can't figure out how to import it. How do I actually use the library in a namespace?

kzeidler06:10:16

Preferably without the prefix, as demonstrated in the examples

aengelberg06:10:55

@kzeidler: (use 'com.rpl.specter)?

kzeidler06:10:14

I get: `Only :refer-clojure, :require, :require-macros, :use, :use-macros, and :import libspecs supported at line 1 src/succulent/core.cljs

kzeidler06:10:40

aha, taking it out of the (ns ...) s-expr does work though

kzeidler06:10:33

What's the idiomatic way to put this in my code? Just place it after the ns definition?

kzeidler06:10:27

Spoke too soon. It compiled with your suggestion, but isn't able to find a definition for any of its functions

kzeidler06:10:41

And in the repl: (use 'com.rpl.specter) clojure.lang.ExceptionInfo: Only [lib.ns :only (names)] and optionally :rename {from to} specs supported in :use / :use-macros; offending spec: [com.rpl.specter] at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :root-source-info {:source-type :fragment, :source-form (ns succulent.core (:use [com.rpl.specter]))}, :tag :cljs/analysis-error}

nathanmarz11:10:39

@kzeidler in clojurescript you can't do use, you have to do require

nathanmarz11:10:25

if you don't want the prefix in cljs you have to enumerate every symbol you want to import, e.g. (require '[com.rpl.specter :refer [ALL srange keypath]])