Permalink
Browse files

Set *print-length* and *print-level* to avoid runaway output

  • Loading branch information...
1 parent 54dfd24 commit 7fd07b00a687f02da2c8bac2ed10b2877f623ab3 @ivan ivan committed Apr 23, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/clj/org/dipert/swingrepl/main.clj
View
6 src/clj/org/dipert/swingrepl/main.clj
@@ -18,6 +18,10 @@
:title (str "Clojure " clj-version)
:on-close JFrame/DISPOSE_ON_CLOSE})
+(defn set-defaults! []
+ (set! *print-level* 15)
+ (set! *print-length* 103))
+
(defn make-repl-jframe
"Displays a JFrame with JConsole and attached REPL."
([] (make-repl-jframe {}))
@@ -40,7 +44,7 @@
(binding [*out* (.getOut console)
*in* (clojure.lang.LineNumberingPushbackReader. (.getIn console))
*err* (.getOut console)]
- (.start (Thread. (bound-fn [] (clojure.main/main)))))))))
+ (.start (Thread. (bound-fn [] (clojure.main/repl :init set-defaults!)))))))))
;; Debug swing macro

0 comments on commit 7fd07b0

Please sign in to comment.