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 69646964
69656965(def ^:private proxy-cache (atom {}))
69666966
6967+ ;; One consequence of adhering so closely to the Clojure proxy model is that this
6968+ ;; style of dispatch method doesn't align well with the Basilisp style of defining
6969+ ;; multi-arity methods (which involves creating the "main" entrypoint method which
6970+ ;; dispatches to private implementations for all of the defined arities).
6971+ ;;
6972+ ;; Fortunately, since the public interface of even multi-arity methods is a single
6973+ ;; public method, when callers provide a multi-arity override for such methods,
6974+ ;; only the public entrypoint method is overridden in the proxy mappings. This
6975+ ;; should be a sufficient compromise, but it does mean that the superclass arity
6976+ ;; implementations are never overridden.
69676977(defn ^:private proxy-base-methods
69686978 [base]
69696979 (->> (inspect/getmembers base inspect/isroutine)
71207130 (multi-arity
71217131 ([] ...)
71227132 ([arg1] ...)
7123- ([arg1 & others] ...))"
7133+ ([arg1 & others] ...))
7134+
7135+ .. warning::
7136+
7137+ The ``proxy`` macro does not verify that the provided override implementations
7138+ arities match those of the method being overridden."
71247139 [class-and-interfaces args & fs]
71257140 (let [formatted-single (fn [method-name [arg-vec & body]]
71267141 [(munge method-name)
You can’t perform that action at this time.
0 commit comments