         (if (= platform :clj)
           `(i/bind-params* ~precompiled-sym (~params-maker-sym ~@used-locals) 0)
           `(i/handle-params
-             ~precompiled-sym
-             ~params-maker-sym
-             ~(mapv (fn [p] `(fn [] ~p)) possible-params)
-             ))
+            ~precompiled-sym
+            ~params-maker-sym
+            ~(mapv (fn [p] `(fn [] ~p)) possible-params)
+            ))
         ]
     (if (= platform :clj)
       (i/intern* *ns* cache-sym (i/mutable-cell)))
     `(let [info# ~get-cache-code
-           
+
            ^com.rpl.specter.impl.CachedPathInfo info#
-            (if (nil? info#)
-              (let [~info-sym (i/magic-precompilation
-                               ~prepared-path
-                               ~(str *ns*)
-                               (quote ~used-locals)
-                               (quote ~possible-params)
-                               )]
-                ~add-cache-code
-                ~info-sym
-                )
-              info#
-              )
+           (if (nil? info#)
+             (let [~info-sym (i/magic-precompilation
+                              ~prepared-path
+                              ~(str *ns*)
+                              (quote ~used-locals)
+                              (quote ~possible-params)
+                              )]
+               ~add-cache-code
+               ~info-sym
+               )
+             info#
+             )
 
            ~precompiled-sym (.-precompiled info#)
            ~params-maker-sym (.-params-maker info#)]


    (i/fn-invocation? path)
    (let [[op & params] path]
      ;; need special case for 'fn since macroexpand does NOT 
      ;; expand fn when run on cljs code, but it's also not considered a special symbol
      (if (or (= 'fn op) (special-symbol? op))
        `(com.rpl.specter.impl/->SpecialFormUse ~path (quote ~path))
        `(com.rpl.specter.impl/->FnInvocation
           ~(ic-prepare-path locals-set op)
           ~(mapv #(ic-prepare-path locals-set %) params)
           (quote ~path)))
      )

    :else


(defmacro defprotocolpath
  "Defines a navigator that chooses the path to take based on the type
  of the value at the current point. May be specified with parameters to
  specify that all extensions must require that number of parameters.

  Currently not available for ClojureScript.

  Example of usage:
  (defrecord SingleAccount [funds])
  (defrecord FamilyAccount [single-accounts])

  (defprotocolpath FundsPath)
  (extend-protocolpath FundsPath
    SingleAccount :funds
    FamilyAccount [ALL FundsPath]
    )
"
  ([name]
   `(defprotocolpath ~name []))
  ([name params]
   (let [prot-name (protpath-sym name)
         m (-> name (str "-retrieve") symbol)
         num-params (count params)
         ssym (gensym "structure")
         rargs [(gensym "params") (gensym "pidx") (gensym "vals") ssym (gensym "next-fn")]
         retrieve `(~m ~ssym)
         ]
     `(do
        (defprotocol ~prot-name (~m [structure#]))
        (let [nav# (reify RichNavigator
                     (~'rich-select* [this# ~@rargs]
                       (let [inav# ~retrieve]
                         (i/exec-rich-select* inav# ~@rargs)
                         ))
                     (~'rich-transform* [this# ~@rargs]
                       (let [inav# ~retrieve]
                         (i/exec-rich-transform* inav# ~@rargs)
                         )))]
          (def ~name
            (if (= ~num-params 0)
              (i/no-params-rich-compiled-path nav#)
              (i/->ParamsNeededPath nav# ~num-params)
              )))))))



