From 490b7e3fa22f95897a07796920e2756415c9acba Mon Sep 17 00:00:00 2001 From: Alex Miller Date: Tue, 3 Dec 2024 16:21:12 -0600 Subject: [PATCH] protocols - add primitive type hint note --- content/reference/protocols.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/content/reference/protocols.adoc b/content/reference/protocols.adoc index 1ea4e7a5..33695220 100644 --- a/content/reference/protocols.adoc +++ b/content/reference/protocols.adoc @@ -51,6 +51,7 @@ A protocol is a named set of named methods and their signatures, defined using h ** all are namespace-qualified by the namespace enclosing the definition * The resulting functions dispatch on the type of their first argument, and thus must have at least one argument * defprotocol is dynamic, and does not require AOT compilation +* Note: primitive type hints are not supported on protocol functions https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defprotocol[defprotocol] will automatically generate a corresponding interface, with the same name as the protocol, e.g. given a protocol my.ns/Protocol, an interface my.ns.Protocol. The interface will have methods corresponding to the protocol functions, and the protocol will automatically work with instances of the interface.