Skip to content

Instantly share code, notes, and snippets.

@dmitriid
Last active Aug 29, 2015
Embed
What would you like to do?
%% более читабельно
resolve_family({_,_,_,_}, auto) -> inet;
resolve_family({_,_,_,_,_,_,_,_}, auto) -> inet6;
resolve_family(IP, auto) -> throw({error, {strange_family, IP}});
resolve_family(_, F) -> F.
%% менее читабельно
resolve_family({_,_,_,_}, auto) -> inet;
resolve_family({_,_,_,_,_,_,_,_}, auto) -> inet6;
resolve_family(IP, auto) -> throw({error, {strange_family, IP}});
resolve_family(_, F) -> F.
%% «раздрай»
resolve_family({_,_,_,_}, auto) -> inet;
resolve_family({_,_,_,_,_,_,_,_}, auto) -> inet6;
resolve_family(IP, auto) -> throw({error, {strange_family, IP}});
resolve_family(_, F) -> F.
%% черезполосица
resolve_family({_,_,_,_}, auto) ->
inet;
resolve_family({_,_,_,_,_,_,_,_}, auto) ->
inet6;
resolve_family(IP, auto) ->
throw({error, {strange_family, IP}});
resolve_family(_, F) ->
F.
%% многострочек
resolve_family({_,_,_,_}, auto) ->
inet;
resolve_family({_,_,_,_,_,_,_,_}, auto) ->
inet6;
resolve_family(IP, auto) ->
throw({error, {strange_family, IP}});
resolve_family(_, F) ->
F.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment