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 69156915
69166916(def ^:private proxy-cache (atom {}))
69176917
6918+ ;; One consequence of adhering so closely to the Clojure proxy model is that this
6919+ ;; style of dispatch method doesn't align well with the Basilisp style of defining
6920+ ;; multi-arity methods (which involves creating the "main" entrypoint method which
6921+ ;; dispatches to private implementations for all of the defined arities).
6922+ ;;
6923+ ;; Fortunately, since the public interface of even multi-arity methods is a single
6924+ ;; public method, when callers provide a multi-arity override for such methods,
6925+ ;; only the public entrypoint method is overridden in the proxy mappings. This
6926+ ;; should be a sufficient compromise, but it does mean that the superclass arity
6927+ ;; implementations are never overridden.
69186928(defn ^:private proxy-base-methods
69196929 [base]
69206930 (->> (inspect/getmembers base inspect/isroutine)
70717081 (multi-arity
70727082 ([] ...)
70737083 ([arg1] ...)
7074- ([arg1 & others] ...))"
7084+ ([arg1 & others] ...))
7085+
7086+ .. warning::
7087+
7088+ The ``proxy`` macro does not verify that the provided override implementations
7089+ arities match those of the method being overridden."
70757090 [class-and-interfaces args & fs]
70767091 (let [formatted-single (fn [method-name [arg-vec & body]]
70777092 [(munge method-name)
You can’t perform that action at this time.
0 commit comments