Fork me on GitHub
#planck
<
2016-06-06
>
fasiha18:06:21

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?

fasiha18:06:04

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.

mfikes18:06:13

I often :refer them

fasiha18:06:11

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

fasiha18:06:14

<goes to try now>

fasiha18:06:03

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

fasiha18:06:13

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

fasiha18:06:15

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

noonian18:06:40

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.

mfikes18:06:05

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

mfikes18:06:22

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

noonian18:06:27

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

noonian18:06:13

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