Since the discussion steered towards "tuple modules", I am going to use the opportunity to ask.<div><br></div><div>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)"?</div>
<div><div><br></div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b><span style="border-collapse:separate;font-family:arial;font-weight:normal"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div>
<div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Lead Developer</span></div></span></div></span></b></span><br>
<br><br><div class="gmail_quote">2012/1/24 Björn Gustavsson <span dir="ltr"><<a href="mailto:bgustavsson@gmail.com">bgustavsson@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2012/1/24 Yurii Rashkovskii <<a href="mailto:yrashk@gmail.com">yrashk@gmail.com</a>>:<br>
<div class="im">> Björn,<br>
><br>
> Is there any way tuple module calls can be separated from parametrized<br>
> modules and subsequently documented and become part of standard<br>
> Erlang?<br>
><br>
<br>
</div>Perhaps.<br>
<br>
The problem with the current implementation of "tuple modules"<br>
is that the M in apply(M, F, A) and M:F(...) has a strange type, i.e. M can<br>
be either an atom or a tuple. Unless we implement parameterized modules,<br>
we want M to be only an atom. (There is a run-time cost in the<br>
implementation of apply/3 to allow parameterized modules/"tuple modules",<br>
and parameterized modules prevented an optimization I wanted to do in the<br>
compiler for R15B.)<br>
<br>
We might consider an alternative implementation of "tuple modules"<br>
that does not use apply(M, F, A) or M:F(...), using either new BIFs or new<br>
syntax. (Example: tuple_module_apply(M, F, A) could behave as apply/3<br>
currently behaves, or alternatively only allow M to be a tuple. This is not<br>
a serious suggestion, just an example to make it clear what I mean.)<br>
<br>
I suggest that you write an EEP.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Björn Gustavsson, Erlang/OTP, Ericsson AB<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>