[erlang-questions] OTP-9649 and further changes

José Valim <>
Wed Jan 25 15:39:13 CET 2012


Since the discussion steered towards "tuple modules", I am going to use the
opportunity to ask.

The fact that part of the standard library, like the dict module, receives
the dict as last argument and the dict itself is a "tuple module" is an
accident or a design decision? Does anyone actually write "Dict:find(Key)"
instead of "dict:find(key, Dict)"?

*
José Valim
www.plataformatec.com.br
Founder and Lead Developer
*


2012/1/24 Björn Gustavsson <>

> 2012/1/24 Yurii Rashkovskii <>:
> > Björn,
> >
> > Is there any way tuple module calls can be separated from parametrized
> > modules and subsequently documented and become part of standard
> > Erlang?
> >
>
> Perhaps.
>
> The problem with the current implementation of "tuple modules"
> is that the M in apply(M, F, A) and M:F(...) has a strange type, i.e. M can
> be either an atom or a tuple. Unless we implement parameterized modules,
> we want M to be only an atom. (There is a run-time cost in the
> implementation of apply/3 to allow parameterized modules/"tuple modules",
> and parameterized modules prevented an optimization I wanted to do in the
> compiler for R15B.)
>
> We might consider an alternative implementation of "tuple modules"
> that does not use apply(M, F, A) or M:F(...), using either new BIFs or new
> syntax. (Example: tuple_module_apply(M, F, A) could behave as apply/3
> currently behaves, or alternatively only allow M to be a tuple. This is not
> a serious suggestion, just an example to make it clear what I mean.)
>
> I suggest that you write an EEP.
>
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120125/17d4e490/attachment.html>


More information about the erlang-questions mailing list