 (ns deferst
   (:require
    [clojure.tools.namespace.repl :as tn]
+   [clojure.string :as str]
    [deferst.system :as s]))
 
 (defprotocol ISys

       (defn ~reload-name []
         (stop! ~name)
         (tn/refresh :after (symbol (name (ns-name *ns*)) (name '~start-name)))))))

              :default-conf default-conf
              :label label})))

(defn- make-name
  [base-name suffix]
  (->> [base-name suffix]
       (filter identity)
       (str/join "-")
       symbol))

(defn- defsystem*
  [base-name builder default-conf]
  (let [name (make-name base-name "sys")
        start-name (make-name base-name "start!")
        system-map-name (make-name base-name "system-map")
        stop-name (make-name base-name "stop!")
        reload-name (make-name base-name "reload!")]
    `(do
       (def ~name (create-system
                   ~builder
