[erlang-questions] suggestion: shorthand functions

Ulf Wiger ulf@REDACTED
Fri Jan 11 12:42:53 CET 2013


Yes, this seems a bit harder to emulate in Erlang than my 
modest addition. :)

Note also that my primary aim is erlang for scripting, when
it's not always practical to assume the presence of 3rd 
party libraries that can be imported.

Also, again, I think that many of the functions most used in
scripts have the wrong semantics, using the {ok,Value} |
{error, Reason} approach.

BR,
Ulf W

On 11 Jan 2013, at 11:58, Jesper Louis Andersen wrote:

> 
> On Jan 11, 2013, at 10:12 AM, Ulf Wiger <ulf@REDACTED> wrote:
> 
>> Comments?
> 
> In the Standard ML module system, in particular with the .MLB file extension you get module-level import renaming:
> 
> local
>  $(OTP_LIB)/R15B % Grab *that* version of the Erlang OTP library
> in
>  module file = f
>  module filename = fn
>  module lists = l
> end
> % From here on out in our build specification, the modules f, fn and l are specified.
> your_module.erl
> 
> Note that this also solves module clashes:
> 
> local
>  file1.erl
> in
>  module file = f1
> end
> local
>  file2.erl
> in
>  module file = f2
> end
>> 
> Do note, however, that Standard ML did *not* make the--unfortunately ubiquitous--mistake of conflating a filename with a module name. So it may be hard to pull off in Erlang-land :/ 
> 
> Jesper Louis Andersen
>  Erlang Solutions Ltd., Copenhagen
> 
> 
> 

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com






More information about the erlang-questions mailing list