Fork me on GitHub
#planck
<
2016-06-16
>
mathpunk03:06:52

I’m working on understanding the difference between planck at the repl and planck for running scripts.

mathpunk03:06:10

Here is a two-liner that works at the repl but not when run with planck hi.cljs:

mathpunk03:06:18

What surprises me is, running it with planck gives me errors like, WARNING: Use of undeclared Var cljs.user/require at line 1

mathpunk03:06:34

yet, when I’m at the repl, I’m in the ns cljs.user and require is a thing that it knows about.

mfikes03:06:41

@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.

mfikes03:06:08

(ns foo.core
  (:require [clojure.string :refer [split]]))

mfikes03:06:14

@mathpunk: You’ll also likely want to wrap your split call in println

mathpunk03:06:52

Right you are.

mathpunk03:06:04

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

mfikes03:06:18

@mathpunk: Either namespace is OK for those functions. They used to be in but were moved to planck.core to make them consistent with clojure.core. If you do (source ) you’ll see what I mean.

mfikes13:06:44

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