Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mire: make current-room a ref

  • Loading branch information...
commit ce23a48946d7d3dfa4ddaed9d96d4304e4ed03d0 1 parent 9a09ab5
Andreas Pauley authored
4 PeepCode/Clojure/mire/src/mire.clj
View
@@ -1,3 +1,5 @@
+(add-classpath (str "file://" (.getParent (java.io.File. *file*)) "/"))
+
(ns mire
(:use [mire commands rooms])
(:use [clojure.contrib server-socket duck-streams]))
@@ -15,7 +17,7 @@
; Re-assign stdin and stdout
(binding [*in* (reader in)
*out* (writer out)
- *current-room* (rooms :start)]
+ *current-room* (ref (rooms :start))]
(println (look))
(print-prompt)
(loop [input (read-line)]
4 PeepCode/Clojure/mire/src/mire/rooms.clj
View
@@ -10,7 +10,7 @@
(defn current-room []
"Returns the current room"
- *current-room*)
+ @*current-room*)
(defn set-current-room [target]
- (set! *current-room* target))
+ (ref-set *current-room* target))
Please sign in to comment.
Something went wrong with that request. Please try again.