   * **:system-default** the default path to use if the system-file isn't found
   in the system properties
   * **:system-property** get the resource directly from the system properties"
-  [key & {:keys [function pre-path
-                 system-file system-property system-default]}]
-  (let [fnform (concat (list (or function 'io/file))
+  [key & {:keys [function pre-path constant type
+                 system-file system-property system-default]
+          :or {type :file}}]
+  (let [fnform (concat (list (or function 'resolve-resource) type)
                        (if pre-path
                          (list `(resource-path ~pre-path)))
+                       (if constant
+                         (list constant))
                        (if system-property
-                         (list `(sysprop ~system-property)))
+                         (list `(sysdefault ~system-property)))
                        (if system-file
                          (list (remove nil? `(sysfile ~system-file
                                                       ~system-default)))))

  [fmt-str]
  (reset! res-prop-fmt fmt-str))

(defn register-resource
  "Register a resource to be used with [[resource-path]].
  This should be done at the beginning of the program, usually from `core`.

(def ^:private res-prop-fmt (atom "zensols.%s"))
(def ^:private res-paths (atom {}))

(defn- sysprop [name & {:keys [throw?] :or {throw? true}}]
  (let [val (System/getProperty (format @res-prop-fmt name))]
    (if (and (nil? val) throw?)
      (throw (ex-info (format "System property '%s' is unset" name)
                      {:name name})))
    val))

(defn- sysdefault
  ([name]
   (sysdefault name name))
  ([name default]
   (let [propstr (sysprop name :throw? false)]
     (or propstr default))))

(defn- sysfile
  ([name]
   (sysfile name name))
  ([name default]
   (let [path (sysdefault name default)]
     (if (= (type path) java.io.File)
       path
       (io/file path)))))
