Define a Protocol
A Protocol is a way to dispatch to a particular implementation of a function based on the type of the parameter.
The macros defprotocol
and defimpl
are used to define Protocols and Protocol implementations for different types in the following example.
Documentation: Protocols