Skip to content

Commit

Permalink
protocols - add primitive type hint note
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Dec 3, 2024
1 parent 310cac1 commit 490b7e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions content/reference/protocols.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 490b7e3

Please sign in to comment.