[erlang-questions] Request feedback on example project

Richard A. O'Keefe ok@REDACTED
Thu Feb 4 21:32:36 CET 2016



On 5/02/16 1:29 am, Nathaniel Waisbrot wrote:
>
> The new maps are self-documenting and they provide sane defaults so 
> that if I want a vanilla supervisor I can just say `#{id => 
> cool_super, start => {M, F, A}, type => supervisor}`.  Not only do I 
> avoid dumb bugs, but it's also clear that this is a vanilla supervisor 
> and not something more interesting.

I fail to see why something that accepts that could not also accept
   [{id,cool_super}, {start,{M,F,A}}, {type,supervisor}]
with the same meaning and the same defaults.  In fact the
function maps:from_list/1 should make this trivial.

as_map(Map)
   when is_map(Map) ->
     Map;
as_map(List)
   when is_list(List) ->
     maps:from_list(List).

Maps _as such_ don't provide defaults, sane or otherwise.

There is a layout compromise that would give me the separation I need
to read the lines and Nathaniel Walsbrot the continuity he wants to
avoid a confusion that I've never personally experienced.

%% big comment
%% big comment
%
- spec ....
%
function(...) ->





More information about the erlang-questions mailing list