[erlang-questions] Hungarian notation for Erlang / ETL

Zvi exta7@REDACTED
Sun Oct 5 11:58:34 CEST 2008


Nick Gerakines blogging about need for "Standard Collection behaviour" in
Erlang

http://blog.socklabs.com/2008/10/erlang_woes/


Zvi


Zvi wrote:
> 
> 1. I also hate Hungarian notation and doesn't use it even in C++ (except
> m_ prefix), but I still need a solution for current version of Elrang
> (does it mean that I need always use Dyalizer?).
> 
> 2. I wasn't talking about implementing object using Erlang processes. I
> talking about much simpler and functional solution, like providing
> behaviour, like:
> 
> -module(collection).
> -export([behaviour_info/1]).
> 
> behaviour_info(callbacks) ->
>     [{new,0},
>      {length,1},
>      {to_string,1},
>      {from_string,1},
>      {map,2},
>      {foldl,2},
>      {foldr,2},
>      {sort,1}, 
>      %% etc... 
>    ];
> behaviour_info(_Other) ->
>     undefined.
> 
> then each ADT will implement this bahaviour, like:
> 
> -module(queue).
> -behaviour(collection).
> 
> %% ...
> 
> -module(set).
> -behaviour(collection).
> 
> %% ...
> 
> -module(stack).
> -behaviour(collection).
> 
> %% ...
> 
> 
> etc.
> 
> Zvi
> 
> 
> David Holz wrote:
>> 
>> 
>> From: exta7@REDACTED
>>> Is there some kind of Hungarian notation for Erlang? i.e. prefix or
>>> postfix
>>> naming convention.
>> 
>> Hungarian notation is the absolute wrong solution to type confusion (or
>> any other problem).  The new type annotations will eventually provide
>> optional type information available to both the compiler and IDEs for
>> keeping things straight.  It won't be long before it's an official part
>> of the release; the annotation handling is in there already, just not
>> documented.
>> 
>> I would, though, also like to see some sort of actual OO-ish interface to
>> a block of data that can dispatch to the proper behavior for that
>> specific data term.  Java's collections and IO streams, while verbose,
>> are incredibly usable implementations of that idea at their core.  With
>> Erlang, however, it might mean that your data item is held by its own
>> process, with a well-defined messaging interface, and might want some
>> sort of automatic deferring to a parent process/module for unhandled
>> calls or messages in the receive loop.
>> 
>> _________________________________________________________________
>> Share life as it happens with the new Windows Live.
>> http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Hungarian-notation-for-Erlang---ETL-tp14701912p19822958.html
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list