                  component)
                (start)))
 
-        (close [this instance]
+        (close [_this instance]
           (stop instance))))))
 
 (defn using [component dependencies]

                             (zipmap dependencies dependencies))]
      (reify
        yadic/Activator
        (activate [this container]
          (->> dependencies-map
               (map (fn [[alias k]]
                      [alias (get container k)]))

  (stop [^AutoCloseable this]
    this))

(defn- system-map->container* [m]
  (yadic/->container
    (reduce-kv
      (fn [as k x]
        (assoc as
          k (if (satisfies? yadic/Activator x)
              x
              (component->activator x []))))
      (yadic/->activators)
      m)))

(defn start-system [system]
  (-> (if (instance? Container system)
        system
        (system-map->container* system))
      (yadic/eagerly-instantiate)))

(defn stop-system [^AutoCloseable system]
  (.close system))

(defn system-map [& keyvals]
  (system-map->container* (apply hash-map keyvals)))
