Exactly the "regardless" was my point, the black box does not solve
anything more. "the 'use Protocol' doesn't help for anything compared
to "defprotocol", but 'defmodule' and 'defdispatch' does. I understand
your point and I don't agree (the same about record modules) : black
box is never good, the force of Elixir is that it as the flexibility
(with macros and syntaxic sugar) and the simplicity : in the end we
have modules to manage functions to manage immutable data,
light-linked-autogc-processes to run them and message passing to
synchronise.
The thing that Elixir allows macros gives responsability to the
developer, he could do some things very nasty but it is fine because
it is just a powerful tool. So, thanks to macros, there are many many
cases where you can put somthing in the wrong place in Elixir (many
more than defprotocol/defstruct), hiding things does not help to avoid
that, but understand things does help.
I would like to see protocol as a useful macro, part of the standard
library, that defines dispatch functions for me (and also that
optimizes dispatch for me, which add constraints to my module). The
blackbox thing makes "protocols" an Elixir specific paradigm for
polymorphism.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elixir-lang-core" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/elixir-lang-core/_SYGvgPp8Mo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to