<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,3 @@
 {:desc &quot;You are in a long, low-lit hallway that turns to the east.&quot;
+ :items #{:detector}
  :exits {:north :start :east :promenade} }
\ No newline at end of file</diff>
      <filename>data/rooms/hallway</filename>
    </modified>
    <modified>
      <diff>@@ -52,6 +52,16 @@
   []
   (str-join &quot;\n  &quot; (cons &quot;You are carrying:&quot; @*inventory*)))
 
+(defn detect
+  &quot;If you have the detector, you can see which room an item is in.&quot;
+  [item]
+  (if (@*inventory* :detector)
+    (if-let [room (first (filter #((:items %) (keyword item))
+                                 (vals rooms)))]
+      (str item &quot; is in &quot; (:name room))
+      (str item &quot; is not in any room.&quot;))
+    &quot;You need to be carrying the detector for that.&quot;))
+
 ;; Command data
 
 (def commands {&quot;move&quot; move,
@@ -62,6 +72,7 @@
                &quot;grab&quot; grab
                &quot;discard&quot; discard
                &quot;inventory&quot; inventory
+               &quot;detect&quot; detect
                &quot;look&quot; look})
 
 ;; Command handling</diff>
      <filename>src/mire/commands.clj</filename>
    </modified>
    <modified>
      <diff>@@ -6,9 +6,10 @@
   (let [room (read-string (slurp (.getAbsolutePath file)))]
     (conj rooms
           {(keyword (.getName file))
-           {:desc (:desc room)
+           {:name (keyword (.getName file))
+            :desc (:desc room)
             :exits (ref (:exits room))
-            :items (ref (or (:items room) []))
+            :items (ref (or (:items room) #{}))
             :inhabitants (ref #{})}})))
 
 (defn load-rooms [dir]</diff>
      <filename>src/mire/rooms.clj</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,12 @@
 (ns mire.util)
 
-(defn remove-from
-  &quot;Return coll with all instances of obj removed.&quot;
+(defn remove-from-set
+  &quot;Return a set of coll with all instances of obj removed.&quot;
   [coll obj]
-  (remove #(= % obj) coll))
+  (set (remove #(= % obj) coll)))
 
 (defn move-between-sets
   &quot;Move one instance of obj between from and to. Must be called in a transaction.&quot;
   [obj from to]
-  (commute from remove-from obj)
+  (commute from remove-from-set obj)
   (commute to conj obj))
\ No newline at end of file</diff>
      <filename>src/mire/util.clj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>814ba8474cff612ad5202fb5088ee6bec6f896d5</id>
    </parent>
  </parents>
  <author>
    <name>Phil Hagelberg</name>
    <email>technomancy@gmail.com</email>
  </author>
  <url>http://github.com/technomancy/mire/commit/d176ea9cd87900797f621d8c38988a8656994235</url>
  <id>d176ea9cd87900797f621d8c38988a8656994235</id>
  <committed-date>2009-02-28T16:15:24-08:00</committed-date>
  <authored-date>2009-02-28T16:15:24-08:00</authored-date>
  <message>Implement detect command.</message>
  <tree>e3725c40722c6386b7fe0eb35a8119abe92e454b</tree>
  <committer>
    <name>Phil Hagelberg</name>
    <email>technomancy@gmail.com</email>
  </committer>
</commit>
