[erlang-questions] Proposal to remove tuple dispatches from Erlang

Fred Hebert <>
Fri Apr 14 15:00:17 CEST 2017


On 04/14, José Valim wrote:
>This behaviour is considered by most in the community to be undesired 
>and confusing, as it obfuscates the meaning of the code and adds 
>indirection.
>
>Please let me know if there are other options available,
>
>I will be glad to send patches and implement the required parse-transforms
>if this is accepted by the OTP team.
>

One thing to consider is that this code is a remnant of parametrized 
modules, which have been removed back in 2012. See https://web-beta.archive.org/web/20121019180935/http://www.erlang.org/news/35


> To allow for source code compatibility, the board decides to only
> remove the syntactic support for parameterized modules. This means:
> 
> * Apply with tuple modules will be retained, supported and properly documented.
> 
> [...]
> 
> * The parser will accept the syntax for implementation of
>   parameterized modules [...]
> 
> * A parse_transform handling source code implementing a parameterized
>   module will be published in the public domain, free to use and
>   include in any package needing it. It will however not be part of OTP.
>   As it uses supported and documented functionality, it will however
>   be expected to work for forthcoming releases as well, or at least
>   to be possible to adopt to forthcoming releases.

This is to say the OTP team made a commitment to supporting tuple calls 
as a way to remove parametrized modules and keep the code working.

Removing tuple calls must at the very least ensure a seamless transition 
to keep working with the parametrized module parse transforms, and 
moreover have the guarantee that it will "be expected to work for 
forthcoming releases" because it "uses supported and documented 
functionality".

Regards,
Fred.


More information about the erlang-questions mailing list