Skip to content
Browse files

Mire: move dosync block

  • Loading branch information...
1 parent ce23a48 commit e838abe8a590e8681f192660ff195a53ec45540b @apauley committed Dec 22, 2009
Showing with 3 additions and 4 deletions.
  1. +2 −3 PeepCode/Clojure/mire/src/mire/commands.clj
  2. +1 −1 PeepCode/Clojure/mire/src/mire/rooms.clj
View
5 PeepCode/Clojure/mire/src/mire/commands.clj
@@ -10,13 +10,12 @@
(defn move
"We gotta get out of this place... Give a direction."
[direction]
- (dosync
- (let [target-name ((:exits (current-room)) (keyword direction))
+ (let [target-name ((:exits (current-room)) (keyword direction))
target (rooms target-name)]
(if target
(do (set-current-room target)
(look))
- "No way."))))
+ "No way.")))
(def commands {:move move,
:north (fn [] (move :north)),
View
2 PeepCode/Clojure/mire/src/mire/rooms.clj
@@ -13,4 +13,4 @@
@*current-room*)
(defn set-current-room [target]
- (ref-set *current-room* target))
+ (dosync (ref-set *current-room* target)))

0 comments on commit e838abe

Please sign in to comment.
Something went wrong with that request. Please try again.