This protocol has some behaviour callbacks, one of them is `empty/0`. So
I cannot do MyProtocol.impl_for(term) because in that callback there is
no term (I am returning a term though).
https://github.com/eksperimental/buildable/blob/a2aa7658e58820472f56e7b1b7e3b3e2293c7950/lib/buildable/delegation.ex#L14

So what are my options for delegating to MyProtocol.MyImplementation ?


On Thu, 14 Jan 2021 15:32:47 +0100
José Valim <jose.va...@dashbit.co> wrote:

> The protocols are already optimized to dispatch as efficiently as
> possible. How can you be sure that, by doing your own protocol
> dispatch, you won't be doing that protocols do but slower?
> 
> In any case, impl_for returns the impl for a given data.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/6000f7bd.1c69fb81.6dc1c.71a0SMTPIN_ADDED_MISSING%40gmr-mx.google.com.

Reply via email to