September 2010
1 post
1 tag
To avoid the verbose case statements in Erlang, I sometimes use this function:
ifc(true, True, _) -> True;
ifc(false, _, False) -> False;
So instead of writing this:
case proplists:is_defined(empty, Options) of
true -> [];
false -> [some_default]
end
one can write this:
ifc(proplists:is_defined(empty, Options), [], [some_default])
The idea was to mimic the...