Skip to content

Commit 18ba940

Browse files
committed
Documentation
1 parent cd43c2f commit 18ba940

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
@@ -6824,6 +6824,16 @@
68246824

68256825
(def ^:private proxy-cache (atom {}))
68266826

6827+
;; One consequence of adhering so closely to the Clojure proxy model is that this
6828+
;; style of dispatch method doesn't align well with the Basilisp style of defining
6829+
;; multi-arity methods (which involves creating the "main" entrypoint method which
6830+
;; dispatches to private implementations for all of the defined arities).
6831+
;;
6832+
;; Fortunately, since the public interface of even multi-arity methods is a single
6833+
;; public method, when callers provide a multi-arity override for such methods,
6834+
;; only the public entrypoint method is overridden in the proxy mappings. This
6835+
;; should be a sufficient compromise, but it does mean that the superclass arity
6836+
;; implementations are never overridden.
68276837
(defn ^:private proxy-base-methods
68286838
[base]
68296839
(->> (inspect/getmembers base inspect/isroutine)
@@ -6980,7 +6990,12 @@
69806990
(multi-arity
69816991
([] ...)
69826992
([arg1] ...)
6983-
([arg1 & others] ...))"
6993+
([arg1 & others] ...))
6994+
6995+
.. warning::
6996+
6997+
The ``proxy`` macro does not verify that the provided override implementations
6998+
arities match those of the method being overridden."
69846999
[class-and-interfaces args & fs]
69857000
(let [formatted-single (fn [method-name [arg-vec & body]]
69867001
[(munge method-name)

0 commit comments

Comments
 (0)