Last active
December 17, 2015 17:39
-
-
Save maxcountryman/5647594 to your computer and use it in GitHub Desktop.
Playing around with agents. Fun!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.java.io :as io]) | |
(import [java.net Socket]) | |
(def irc (agent {:socket (Socket. "irc.strangeloop.io" 7000)})) | |
(send irc (fn [{:keys [socket]}] | |
(doseq [line (line-seq (io/reader socket))] | |
(println line)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment