Skip to content

Instantly share code, notes, and snippets.

@mietek
Created October 8, 2010 14:54
Show Gist options
  • Save mietek/616917 to your computer and use it in GitHub Desktop.
Save mietek/616917 to your computer and use it in GitHub Desktop.
-module(or_or_or).
-compile(export_all).
f1(X) ->
if
length(X) =:= 1; size(X) =:= 1 ->
okay;
true ->
nope
end.
f2(X) ->
if
length(X) =:= 1 orelse size(X) =:= 1 ->
okay;
true ->
nope
end.
test() ->
io:format("f1([x]) = ~p~n", [f1([x])]),
io:format("f1({x}) = ~p~n", [f1({x})]),
io:format("~n", []),
io:format("f2([x]) = ~p~n", [f2([x])]),
io:format("f2({x}) = ~p~n", [f2({x})]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment