planck

Planck ClojureScript REPL
fasiha 2016-06-06T18:09:21.000005Z

What do people who are writing scripts for Planck do when it comes to using spit, and other things that are at the top-level in Clojure but require an import in Planck?

fasiha 2016-06-06T18:10:04.000006Z

I'd like to write "scripts" that will work as-is in Clojure as well as Planck, but can't do that when I use spit etc.

mfikes 2016-06-06T18:10:13.000007Z

I often :refer them

fasiha 2016-06-06T18:11:11.000008Z

Oh, in your ns? If I (:require [planck.core :refer [spit]]), will that not make Clojure yell?

fasiha 2016-06-06T18:11:14.000009Z

<goes to try now>

fasiha 2016-06-06T18:13:03.000010Z

Yeah, Clojure will get mad since it can't find Planck. I am talking about Clojure (not cljs) because often I'll write little projects and because lein run is so slow, I often switch to planck

fasiha 2016-06-06T18:14:13.000012Z

But not this nice workflow doesn't work for code using spit, slurp, format, and usually I just make a Planck-only version, but it'd be nice to have a single file for lein/clojure and for planck

fasiha 2016-06-06T18:16:15.000013Z

I guess the Lisp way would be to keep the lein repl open all the time and reload my functions into it as they change 😛 I can try that

noonian 2016-06-06T18:16:40.000015Z

Is it possible to add custom reader conditionals? It seems like that would be the right solution here if its doable. I didn’t find anything from a quick google talking about registering a new platform though.

mfikes 2016-06-06T18:17:05.000016Z

I was thinking the same… I don’t know if you can...

mfikes 2016-06-06T18:17:22.000017Z

But at least for Clojure and Planck you can use :clj and :cljs

noonian 2016-06-06T18:18:27.000018Z

Right. I guess it only matters if you want to support browser cljs and planck cljs

noonian 2016-06-06T18:19:13.000019Z

Theres a note at the bottom of the design page for reader conditionals but sounds like its a potential future feature and I doubt there has been any work done to support it yet: http://dev.clojure.org/display/design/Reader+Conditionals