30 points · by rdtsc · 15y ago · 17 comments
-module(opine).
-export([opine/0]).
-import(io).
-import(random).
opine() ->
io:fwrite("I "),
X = random:uniform(),
if
X > 0.2 ->
io:fwrite("love");
true ->
io:fwrite("hate")
end,
io:fwrite(" the new website.\n"). -module(opine).
-export([opine/0]).
opine() ->
S = case random:uniform() > 0.2 of
true -> "love";
false -> "hate"
end,
io:format("I ~s the new website.~n", [S]). -module(opine).
-export([opine/0]).
opine() -> io:format(gen_opine(random:uniform())).
gen_opine(R) when R > 0.2 -> "I love the new website.~n";
gen_opine(_) -> "I hate the new website.~n". -module(opine).
-export([opine/0]).
opine() ->
io:format("I ~s the new website.~n",[gen_opine(random:uniform())]).
gen_opine(R) when R > 0.2 -> love;
gen_opine(_) -> hate.Citing a simple mailing list demonstration here: http://www.erlang.org/%3C/div%3E%3Cdiv%3E%3Ch1%20style=%22fo...
http://www.erlang.org/erldoc?q=mensia&x=0&y=0
I still prefer erldocs, as the author I am bias though :)
Now I can't wait for them to update the online man pages. Something like redis.io documentation would be ideal. A console right there, shows the complexity of functions. I'd be so excited...
Wonder what logic they followed to design the new site.