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 68246824
68256825(def ^:private proxy-cache (atom {}))
68266826
6827+ ;; One consequence of adhering so closely to the Clojure proxy model is that this
6828+ ;; style of dispatch method doesn't align well with the Basilisp style of defining
6829+ ;; multi-arity methods (which involves creating the "main" entrypoint method which
6830+ ;; dispatches to private implementations for all of the defined arities).
6831+ ;;
6832+ ;; Fortunately, since the public interface of even multi-arity methods is a single
6833+ ;; public method, when callers provide a multi-arity override for such methods,
6834+ ;; only the public entrypoint method is overridden in the proxy mappings. This
6835+ ;; should be a sufficient compromise, but it does mean that the superclass arity
6836+ ;; implementations are never overridden.
68276837(defn ^:private proxy-base-methods
68286838 [base]
68296839 (->> (inspect/getmembers base inspect/isroutine)
69806990 (multi-arity
69816991 ([] ...)
69826992 ([arg1] ...)
6983- ([arg1 & others] ...))"
6993+ ([arg1 & others] ...))
6994+
6995+ .. warning::
6996+
6997+ The ``proxy`` macro does not verify that the provided override implementations
6998+ arities match those of the method being overridden."
69846999 [class-and-interfaces args & fs]
69857000 (let [formatted-single (fn [method-name [arg-vec & body]]
69867001 [(munge method-name)
You can’t perform that action at this time.
0 commit comments