Skip to content

Commit dde1107

Browse files
committed
Documentation
1 parent 276c83a commit dde1107

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/basilisp/core.lpy

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6858,6 +6858,16 @@
68586858

68596859
(def ^:private proxy-cache (atom {}))
68606860

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.
68616871
(defn ^:private proxy-base-methods
68626872
[base]
68636873
(->> (inspect/getmembers base inspect/isroutine)
@@ -7014,7 +7024,12 @@
70147024
(multi-arity
70157025
([] ...)
70167026
([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."
70187033
[class-and-interfaces args & fs]
70197034
(let [formatted-single (fn [method-name [arg-vec & body]]
70207035
[(munge method-name)

0 commit comments

Comments
 (0)