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 6858
6858
6859
6859
(def ^:private proxy-cache (atom {}))
6860
6860
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.
6861
6871
(defn ^:private proxy-base-methods
6862
6872
[base]
6863
6873
(->> (inspect/getmembers base inspect/isroutine)
7014
7024
(multi-arity
7015
7025
([] ...)
7016
7026
([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."
7018
7033
[class-and-interfaces args & fs]
7019
7034
(let [formatted-single (fn [method-name [arg-vec & body]]
7020
7035
[(munge method-name)
You can’t perform that action at this time.
0 commit comments