   (and #+clj (instance? ExceptionInfo x)
        (contains? (ex-data x) ::condition)))
 
-#+clj
 (declare print-condition)
+
+;; Printing conditions in ClojureScript:
+;;
+;; TODO `print-method` does not exist in ClojureScript and there is no
+;; other way to define how an object should print itself.  For now,
+;; you have to call `print-condition` yourself.
+;;
+;; TODO `*ns*` does not exist in ClojureSript.  Therefore, it would be
+;; nice to have at least file name and line number information stored
+;; in `ex-info-msg`, but this does not work:
+;;
+;; (let [e (new js/Error "message" "file" 23)]
+;;   (println (.-message e))
+;;   (println (.-fileName e))
+;;   (println (.-lineNumber e)))
+;;
+;; as it prints
+;;
+;; message
+;; nil
+;; nil
+;;
+;; TODO Also, there is no run-time-independent way to get a stack
+;; trace in ClojureScript.
 
 #+clj
 (defmethod print-method ExceptionInfo [^ExceptionInfo exc ^java.io.Writer w]

                            comp))
                     (::components (ex-data cond)))]
        (nth (:arguments comp) i)
        (throw (Error. (str cond " is not a condition of type " type)))))))

(defmacro define-condition-type
  "    (define-condition-type <condition-type>

          (pr irritant))
        (.write w "\n")))
    (print-stack-trace-of c)))

#+cljs
(defn print-condition
  [c]
  (let [[type who message stuff] (decode-condition c)]
    (print (name type))
    (print ": ")
    (if (string? message)
      (let [s message]
        (print s))
      (print message))
    (let [spaces
          (apply str (repeat (+ (count (name type)) 2)
                             \space))]
      (when who
        (print " [")
        (print who)
        (print "]"))
      (doseq [irritant stuff]
        (print "\n")
        (print spaces)
        (pr irritant))
      (print "\n"))))
