Skip to content
Browse files

Mire: use shorthand for anonymous functions

  • Loading branch information...
1 parent 83ebd6b commit a62d254e10c32bdf28ee674a21ddac30b2e3c298 @apauley committed Dec 24, 2009
Showing with 5 additions and 6 deletions.
  1. +5 −6 PeepCode/Clojure/mire/src/mire/commands.clj
View
11 PeepCode/Clojure/mire/src/mire/commands.clj
@@ -46,16 +46,15 @@
(def commands
{:move move,
- :north (fn [] (move :north)),
- :east (fn [] (move :east)),
- :south (fn [] (move :south)),
- :west (fn [] (move :west)),
+ :north #(move :north),
+ :east #(move :east),
+ :south #(move :south),
+ :west #(move :west),
:look look,
:grab grab,
:discard discard,
:inventory inventory,
- :wtf (fn []
- "Yeah sure, I'll do that right after you grow a brain.")})
+ :wtf #(str "You need help.")})
(defn execute
"Execute a command passed from the client"

0 comments on commit a62d254

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