[erlang-questions] (Non)Parametrized modules, inheritance, and R15B02 issues?

Yurii Rashkovskii yrashk@REDACTED
Fri Oct 12 19:35:26 CEST 2012


>From what I learned earlier this year, tuple modules have a bleak future as 
well:

===

[1] > But I was wondering if there's any word out about the fate of tuple
> modules? The ones like {erlang}:element(1). Are they expected to be
> kept around? (I certainly hope they are :)
>

No, we don't expect to keep them.

As pointed out by others, "tuple modules" is just an implementation
detail of parameterized modules (which is an experimental feature).

We have not reached a decision yet, but in the future we expect
we will do one of two things:

* Remove parameterized modules completely from the compiler
and run-time system.

OR

* Implement parameterized modules properly by creating a new
data type, both to allow better type checking by Dialyzer, and
to possibly improve performance.

/Björn
====

On Friday, October 12, 2012 1:04:52 AM UTC-7, Gleb Peregud wrote:
>
> I believe that someone from OTP team mentioned that the parametrized 
> modules are to be deleted, but tuple modules will stay. Essentially 
> this will mean that instead of writing: 
>
> -module(person, [FirstName, LastName]). 
> -compile(export_all). 
> first_name() -> 
>   FirstName. 
>
> You will have to write: 
>
> -module(person). 
> -record(person, {first_name, last_name}). 
> -compile(export_all). 
> new(FirstName, LastName) -> 
>   #person{first_name = FirstName, last_name = LastName}. 
> first_name(Person) -> 
>   Perosn#person.first_name. 
>
> but you will still be able to do: 
>
>    Person = person:new("Joe", "Armstrong"). 
>    Person:first_name(). 
>    "Joe" 
>    case Person:save() of 
>        {ok, SavedPerson} -> % do something ... 
>        {error, ValidationErrors} -> % do something else ... 
>    end. 
>
> So from point of view of readability there will be no change, 
> althought the amount of code in the model module (person.erl) will 
> slightly increase. 
>
> Please correct me if I am wrong. 
>
> Cheers, 
> Gleb 
> _______________________________________________ 
> erlang-questions mailing list 
> erlang-q...@REDACTED <javascript:> 
> http://erlang.org/mailman/listinfo/erlang-questions 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121012/2a16c6dd/attachment.htm>


More information about the erlang-questions mailing list