Skip to content

Instantly share code, notes, and snippets.

@halgari
Last active December 19, 2015 16:58
Show Gist options
  • Select an option

  • Save halgari/5987327 to your computer and use it in GitHub Desktop.

Select an option

Save halgari/5987327 to your computer and use it in GitHub Desktop.
(defn make-read-only [c]
(reify clojure.core.async.impl.protocols/ReadPort
(take! [port handler]
(clojure.core.async.impl.protocols/take! c handler))))
(println (<!! (make-read-only (go 42))))
;;(println (>!! (make-read-only (go 42)) 42)) <- this throws an error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment