Skip to content
Browse files

set! *e *1 *2 *3 in eval command

  • Loading branch information...
1 parent 62b39ed commit 76088dea15d789ce6fa93017629dad94b799e3e0 @ninjudd ninjudd committed Jun 3, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/portal/server.clj
View
10 src/portal/server.clj
@@ -41,13 +41,21 @@
(dissoc contexts id)
contexts)))
+(defn prn-val [val]
+ (set! *3 *2)
+ (set! *2 *1)
+ (set! *1 val)
+ (prn-str val))
+
(defn read-eval-print [data]
(try (let [forms (read-seq data)]
- (try ["result" (apply str (map (comp prn-str eval) forms))]
+ (try ["result" (apply str (map (comp prn-val eval) forms))]
(catch Exception e
+ (set! *e e)
(let [e (root-cause e)]
["error" (str (.getName (class e)) " " (.getMessage e))]))))
(catch LispReader$ReaderException e
+ (set! *e e)
["read-error" (.getMessage (root-cause e))])))
(defn handler [channel client-info]

0 comments on commit 76088de

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