File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 68586858
68596859(def ^:private proxy-cache (atom {}))
68606860
6861+ ;; One consequence of adhering so closely to the Clojure proxy model is that this
6862+ ;; style of dispatch method doesn't align well with the Basilisp style of defining
6863+ ;; multi-arity methods (which involves creating the "main" entrypoint method which
6864+ ;; dispatches to private implementations for all of the defined arities).
6865+ ;;
6866+ ;; Fortunately, since the public interface of even multi-arity methods is a single
6867+ ;; public method, when callers provide a multi-arity override for such methods,
6868+ ;; only the public entrypoint method is overridden in the proxy mappings. This
6869+ ;; should be a sufficient compromise, but it does mean that the superclass arity
6870+ ;; implementations are never overridden.
68616871(defn ^:private proxy-base-methods
68626872 [base]
68636873 (->> (inspect/getmembers base inspect/isroutine)
70147024 (multi-arity
70157025 ([] ...)
70167026 ([arg1] ...)
7017- ([arg1 & others] ...))"
7027+ ([arg1 & others] ...))
7028+
7029+ .. warning::
7030+
7031+ The ``proxy`` macro does not verify that the provided override implementations
7032+ arities match those of the method being overridden."
70187033 [class-and-interfaces args & fs]
70197034 (let [formatted-single (fn [method-name [arg-vec & body]]
70207035 [(munge method-name)
You can’t perform that action at this time.
0 commit comments