         (let [msg (apply format fmt strings)]
              (message msg))))
 
-
 (defn to-buffer
   "Output to a buffer."
   [buffer-name content]

  "Given a RSG.IPromise<T> run (f result-value) when the promise resolves. A new
  promise is returned."
  [ipromise f]
  (let [ptype (type ipromise)
        of-type (.GetGenericArguments ptype)
        atype (eval `(generate-generic-type Action ~of-type))
        meth (.GetMethod ptype "Then" (into-array Type [atype]))
        arg #_(eval `(sys-action ~(apply vector of-type) [~'s] (~f ~'s)))
        (. clojure.lang.GenDelegate Create atype f)]
    (.Invoke meth ipromise (into-array Object [arg]))))

(defn pcatch

   ;;      p)
   ))

(defn read-type-from-minibuffer
  "Read from the minibuffer but of a particular type. Basically Minibuffer.Read<T>().

(then (read-type-from-minibuffer Int64 \"How old are you?\")
      #(message \"%d is a fine age.\" %))
"
  [type prompt & {:keys [input history completer require-match require-coerce]
