[erlang-questions] Why do we need modules at all?

Vlad Dumitrescu vladdu55@REDACTED
Wed May 25 11:19:34 CEST 2011


Hi,

On Wed, May 25, 2011 at 11:09, Joe Armstrong <erlang@REDACTED> wrote:

> On Wed, May 25, 2011 at 6:29 AM, Richard O'Keefe <ok@REDACTED>wrote:
>
>> On 24/05/2011, at 8:06 PM, Joe Armstrong wrote:
>>
>> > Why do we need modules at all?
>>
>> To hide data types,
>> and to provide short names (we can import a function
>> and not have to keep on repeating a long long name for it).
>>
>> I note, without recommendation either way,
>> the existence of
>>          local
>>           <declarations>
>>        in
>>           <declarations>
>>        end
>>  in Standard ML, where the second lot of declarations
>> defines things visible outside but the first lot
>> defines things visible only inside this form.
>>
>> How about
>
> public
>     Functions etc.
> private
>     Functions etc.
> end.
>
> Functions etc is just a regular sequence of function defs macros, records
> etc.
>

Where would this declaration be located?
This would in effect become a module definition, if I understand correctly?
Will it point out functions from the "sea of functions" out there and group
them together?
What happens if some other such declaration says that my private functions
are public?

I think I need to think more about this. I would start by trying to describe
a user that sits down and wants to write a program. What would he need to
do? What support is needed from the tools?


> The use of the words public and private would attract hoards of programmers
> to our humble little
> language...
>
:-)

/Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110525/3c858aca/attachment.htm>


More information about the erlang-questions mailing list