Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some interpretation of client commands

  • Loading branch information...
commit 6ac3830a7e7ba08ab5abf864f95ab5cf4a906b85 1 parent 915266a
@apauley authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 PeepCode/Clojure/mire/src/mire/commands.clj
View
12 PeepCode/Clojure/mire/src/mire/commands.clj
@@ -1,4 +1,12 @@
(ns mire.commands)
-(defn execute [input]
- (str "The input: " input " :"))
+(defn current-time []
+ (str "The current time is now " (java.util.Date.)))
+
+(def commands {"time" current-time,
+ "look" (fn [] "You see nothing. Yet.")})
+
+(defn execute
+ "Execute a command passed from the client"
+ [input]
+ ((commands input)))
Please sign in to comment.
Something went wrong with that request. Please try again.