Skip to content

Instantly share code, notes, and snippets.

@mfikes
Created May 21, 2016 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfikes/30098db2366dd25b91b2c4de0a685888 to your computer and use it in GitHub Desktop.
Save mfikes/30098db2366dd25b91b2c4de0a685888 to your computer and use it in GitHub Desktop.
Quick Start Andare with Planck

Make a project.clj file that can manage the dep:

(defproject foo "0.1.0-SNAPSHOT"
  :dependencies [[andare "0.1.0"]])

Start Planck:

planck -Kc `lein classpath`

Then, use it:

cljs.user=> (require-macros '[cljs.core.async.macros :refer [go]])
nil
cljs.user=> (require '[cljs.core.async :refer [chan >! <!]])
nil
cljs.user=> (def c (chan))
#'cljs.user/c
cljs.user=> (go (prn (<! c)))
#object[cljs.core.async.impl.channels.ManyToManyChannel]
cljs.user=> (go (prn (>! c :a)))
#object[cljs.core.async.impl.channels.ManyToManyChannel]
true
:a

A few further notes:

  1. The -K option will cause the compiled code to be cached, which starts to become noticable for a library the size of core.async. So, subsequent launches will be faster.
  2. If you'd like the lein dep managment to be even faster as well see "Caching Classpath" here.
  3. While things work fine with the shipping version of Planck, master has better REPL support for the asyncronous printing you are likely to encounter when playing with core.async. You can easily install master via brew: See the "Install Master" section here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment