planck 2018-04-11

@owenrh has joined the channel

hi, I’m trying out the main function method from the scripts page on the Planck user guide, http://planck-repl.org/scripts.html, but I’m not getting any output. It just doesn’t seem to pick up the main function var

#!/usr/bin/env planck
(ns foo.core)

(defn greet [name]
  (println (str "Hello " name "!")))

(defn -main [name]
  (greet name))
  
(set! *main-cli-fn* -main)

I’m on OSX. Installed Planck via brew. I run zsh, not sure if that is interfering somehow.

Does anyone have any ideas why this wouldn’t have worked?

Also, it doesn’t seem to resolve the commandline args either - WARNING: Use of undeclared Var bar.core/*command-line-args*

$ /usr/local/bin/planck foo.cljs Testing
Hello Testing!

That’s what I get @owenrh ^ if I put your code in a file and run it.

I also get

$ ./foo.cljs ClojureScript
Hello ClojureScript!

that’s what I figured, defo something in my environment

This is on macOS

ah yeah, I’ve got two machines - this one had an old version of Planck on from back in the day from when I first thought about checking it out. Sorry for the noise!

it’s brill by the way 👍

thanks for creating and sharing it

Ahh, cool 🙂