[erlang-questions] Reassigning variables
Vance Shipley
vances@REDACTED
Tue Mar 17 22:42:58 CET 2009
On Tue, Mar 17, 2009 at 02:19:48PM -0700, Matthew Dempsky wrote:
} Similarly, Erlang doesn't support 'return'
Doesn't it?
} if requested ad size is bad:
} return {skip, bad_size}
} if the game has ads disabled:
} return {skip, disabled}
} if the game is filtering a domain:
} return {skip, domain_filtered}
} return choose_ad()
try begin
case requested_ad_size(Size) of
bad ->
throw(bad_size);
_ ->
ok
end,
case has_ads() of
true ->
throw(disabled);
false ->
ok
end,
case is_filtering() of
true ->
throw(domain_filtered);
false ->
ok
end
end of
ok ->
yahoo
catch
Problem ->
Problem
end
--
-Vance
More information about the erlang-questions
mailing list