Skip to content

Commit

Permalink
Mire: give preference to passing refs around that can be dereffed whe…
Browse files Browse the repository at this point in the history
…n necessary
  • Loading branch information
Andreas Pauley committed Dec 24, 2009
1 parent fe8dd4b commit 19b201b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions PeepCode/Clojure/mire/src/mire/commands.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"Get a description of the current room"
(str "\n"
(:desc @(current-room))
"\nInhabitants: " (current-inhabitants)
"\nItems: " (current-items)
"\nInhabitants: " @(current-inhabitants)
"\nItems: " @(current-items)
"\nExits: " (keys (:exits @(current-room)))))

(defn move
Expand Down
4 changes: 2 additions & 2 deletions PeepCode/Clojure/mire/src/mire/rooms.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

(defn current-inhabitants []
"Returns the inhabitants in the current room"
@(:inhabitants @(current-room)))
(:inhabitants @(current-room)))

(defn current-items []
"Returns the items available in the current room"
@(:items @(current-room)))
(:items @(current-room)))

(defn room-contains? [room thing]
(@(:items room) (keyword thing)))
Expand Down

0 comments on commit 19b201b

Please sign in to comment.