All Downloads are FREE. Search and download functionalities are using the official Maven repository.

meyvn.nrepl_middleware.kawa.clj Maven / Gradle / Ivy

The newest version!
(ns meyvn.nrepl-middleware.kawa
  (:require [clojure.tools.logging :as log])
  (:import [clojure.lang Reflector]))

(defn start-repl []
  (let [port (-> ".nrepl-port"
                slurp
                Integer/valueOf
                inc
                str)]
    (if-let [kawa (resolve (symbol "kawa.standard.Scheme"))]
      (do (log/info "Starting Kawa repl on port" port)
          (.start (Thread. #(doto (Reflector/invokeConstructor kawa (to-array nil))
                              (.eval "(require )")
                              (.runAsApplication (into-array String ["--server" port])))))
          "OK")
      "Kawa Geiser not found. Check `deps.edn' for com.gitlab.emacs-geiser/kawa {:mvn/version \"0.14\"}.")))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy