[erlang-questions] towards a unified dict api

José Valim <>
Fri Jan 13 15:10:16 CET 2012


>
> There seems to be a lot of confusion going on here between *interface*
> (API) and *dispatch* (redirecting the API calls to the actual
> implementation depending on the data structure). I have only suggested a
> unified API; not a generic dispatch mechanism.
>

If the main purpose is an unified API, agreed. Thanks for clearing it up.

"Tuple modules" (please call them Parameterized modules or Abstract modules
> - the implementation-as-tuples is a temporary hack, and you should treat
> them as opaque objects just like funs).
>

I thought it was the opposite. Parameterized modules were the temporary
hack and the implementation-as-tuples/"tuple modules" were here to stay.


> That said, I think Clojure's protocols (which are a way of dynamically
> getting the same effect that you get with Haskell's type classes) are a
> neat idea that would probably work well with Erlang. But that's a different
> story.


Agreed as well. Regardless, protocols should be possible to implement in
Erlang via parse transforms. I have implemented it for a language of top of
the Erlang VM I am working on, but it is not officially released yet.
Hoping to talk more about it on Erlang Factory Lite in Kraków this march.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120113/5aba1959/attachment.html>


More information about the erlang-questions mailing list