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

Tim Carpenter amphibian.ltd@REDACTED
Tue May 24 20:53:13 CEST 2011


The module from a collection of functions is basically along the lines I was thinking, but with the ability to expose to the users of that module simpler, unchanging or changing names depending on the way the module is used.

Sent from my iPhone

On 24 May 2011, at 19:33, Anthony Molinaro <anthonym@REDACTED> wrote:

> I'm wondering if a wiki, and an interface to construct a module (similar to
> those available for javascript libs like YUI/JQuery), wouldn't get you most
> of what you want.
> 
> So I imagine being able to share individual functions from your own
> misc lib, and then constructing misc libs with the set of functions
> you want, maybe when the addition of a module name.
> 
> This means you can still use the module name as a method of encapsulation
> but you can construct a module from a collection of functions.
> 
> You might even make it such that you can start to define modules in a
> local file via a description language or set of compiler directives as
> well as providing a web interface for constructing these modules.
> 
> So maybe you could do something like
> 
> -module(lists2).
> 
> -remote("http://erlfshare.com/?author=joe&func=remove_duplicates",
>        dedup/2).
> -remote("http://erlfshare.com/?author=joe&func=list2frequency_distribution",
>        freq/1).
> 
> And that would be the definition of the lists2 module in your codebase,
> it could pull the functions from the shared repo at compile time.  If
> you want to be safe you could version everything and pull in particular
> versions or hide the url construction, and instead have a proplist you
> set values in.
> 
> At the very least this allows you to share functions and work with
> pre-existing code.
> 
> Just a thought,
> 
> -Anthony
> 
> On Tue, May 24, 2011 at 08:16:20PM +0200, Joe Armstrong wrote:
>> On Tue, May 24, 2011 at 6:54 PM, Tom Murphy <amindfv@REDACTED> wrote:
>> 
>>> On 5/24/11, Parnell Springmeyer <ixmatus@REDACTED> wrote:
>>>> In practice though, I would really hate maintaining the metadata for
>>>> every function I've wrote! I much rather group common functions into a
>>>> module and then annotate the module with metadata.
>>> 
>>> Ideally, it wouldn't just be just you maintaining the metadata - if
>>> the functions were in the centralized DB, others could suggest or make
>>> changes, wikipedia-style.
>>> 
>> 
>> This did occur to me - the wikipedia allows large numbers of people
>> to make small contributions. Think of what I want as a wiki where each
>> entry is a single erlang function.
>> 
>> 
>> 
>> 
>>> 
>>> Tom
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>> 
> 
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
> 
> 
> -- 
> ------------------------------------------------------------------------
> Anthony Molinaro                           <anthonym@REDACTED>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list