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 6964
6964
6965
6965
(def ^:private proxy-cache (atom {}))
6966
6966
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.
6967
6977
(defn ^:private proxy-base-methods
6968
6978
[base]
6969
6979
(->> (inspect/getmembers base inspect/isroutine)
7120
7130
(multi-arity
7121
7131
([] ...)
7122
7132
([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."
7124
7139
[class-and-interfaces args & fs]
7125
7140
(let [formatted-single (fn [method-name [arg-vec & body]]
7126
7141
[(munge method-name)
You can’t perform that action at this time.
0 commit comments