I’m working on understanding the difference between planck at the repl and planck for running scripts.
Here is a two-liner that works at the repl but not when run with planck hi.cljs
:
What surprises me is, running it with planck gives me errors like, WARNING: Use of undeclared Var cljs.user/require at line 1
yet, when I’m at the repl, I’m in the ns cljs.user
and require is a thing that it knows about.
@mathpunk: require
is a REPL special. It is not part of the ClojureScript language. But, you can get what you want by instead employing an ns
form.
(ns foo.core
(:require [clojure.string :refer [split]]))
@mathpunk: You’ll also likely want to wrap your split
call in println
Right you are.
great, and I think that clears up a problem I had where I couldn’t tell whether to try and get spit/slurp out of planck.core or http://planck.io — now I see I must have been abusing require again
@mathpunk: Either namespace is OK for those functions. They used to be in <http://planck.io|planck.io>
but were moved to planck.core
to make them consistent with clojure.core
. If you do (source <http://planck.io/spit|planck.io/spit>)
you’ll see what I mean.
If you are interested in contributing to the Linux / C port, a list of TODOs is being maintained here: https://github.com/mfikes/planck/wiki/Planck-C-TODOs