Skip to content

Commit 368536f

Browse files
committed
Documentation
1 parent 75ebc77 commit 368536f

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
@@ -6964,6 +6964,16 @@
69646964

69656965
(def ^:private proxy-cache (atom {}))
69666966

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.
69676977
(defn ^:private proxy-base-methods
69686978
[base]
69696979
(->> (inspect/getmembers base inspect/isroutine)
@@ -7120,7 +7130,12 @@
71207130
(multi-arity
71217131
([] ...)
71227132
([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."
71247139
[class-and-interfaces args & fs]
71257140
(let [formatted-single (fn [method-name [arg-vec & body]]
71267141
[(munge method-name)

0 commit comments

Comments
 (0)