Skip to content

Commit e9c3068

Browse files
committed
Documentation
1 parent 487b0b1 commit e9c3068

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
@@ -6915,6 +6915,16 @@
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)
@@ -7071,7 +7081,12 @@
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)

0 commit comments

Comments
 (0)