   embedded REPL (in a JScrollPane) and the corresponding output
   thread."
   [frame]
-  (let [[repl-container repl-thread output-thread] (make-clojure-repl frame),
+  (let [[repl-container, ^Thread repl-thread, ^Thread output-thread] (make-clojure-repl frame),
         rpl (into-text-area repl-container repl-thread)]
     (doto rpl
       (.setFont (Font. "Monospaced" Font/PLAIN 16))

(ns conexp.contrib.gui.repl
  (:import [javax.swing.text PlainDocument]
           [java.io PushbackReader StringReader PipedWriter PipedReader
                    PrintWriter CharArrayWriter]
           [javax.swing KeyStroke AbstractAction JTextArea JScrollPane JFrame]
           [java.awt Font Color])
  (:use [conexp.base :only (defvar-)]
        conexp.contrib.gui.util)

(defn get-repl-thread
  "Returns for a given frame its corresponding repl-thread, if existent."
  [frame]
  (let [^JTextArea repl-container (get-component
                                   frame
                                   (fn [thing]
                                     (and (= (class thing) JTextArea)
                                          (implements-interface? (class (.getDocument ^JTextArea thing))
                                                                 conexp.contrib.gui.repl.ReplProcess))))]
    (when repl-container
      (.. repl-container getDocument getReplThreadMap))))

